use of net.mcft.copy.betterstorage.item.ItemEnderBackpack in project BetterStorage by copygirl.
the class BackpackHandler method onEntityJoinWorldEvent.
@SubscribeEvent
public void onEntityJoinWorldEvent(EntityJoinWorldEvent event) {
if (event.world.isRemote)
return;
if (!(event.entity instanceof EntityItem))
return;
EntityItem entity = (EntityItem) event.entity;
ItemStack stack = entity.getDataWatcher().getWatchableObjectItemStack(10);
if ((stack == null) || !(stack.getItem() instanceof ItemEnderBackpack))
return;
event.setCanceled(true);
for (int i = 0; i < 64; i++) if (TileEnderBackpack.teleportRandomly(entity.worldObj, entity.posX, entity.posY, entity.posZ, (i > 48), stack))
break;
}
use of net.mcft.copy.betterstorage.item.ItemEnderBackpack in project BetterStorage by copygirl.
the class BetterStorageItems method initialize.
public static void initialize() {
key = MiscUtils.conditionalNew(ItemKey.class, GlobalConfig.keyEnabled);
lock = MiscUtils.conditionalNew(ItemLock.class, GlobalConfig.lockEnabled);
keyring = MiscUtils.conditionalNew(ItemKeyring.class, GlobalConfig.keyringEnabled);
cardboardSheet = MiscUtils.conditionalNew(ItemCardboardSheet.class, GlobalConfig.cardboardSheetEnabled);
masterKey = MiscUtils.conditionalNew(ItemMasterKey.class, GlobalConfig.masterKeyEnabled);
drinkingHelmet = MiscUtils.conditionalNew(ItemDrinkingHelmet.class, GlobalConfig.drinkingHelmetEnabled);
slimeBucket = MiscUtils.conditionalNew(ItemBucketSlime.class, GlobalConfig.slimeBucketEnabled);
presentBook = new ItemPresentBook();
itemBackpack = MiscUtils.conditionalNew(ItemBackpack.class, GlobalConfig.backpackEnabled);
itemEnderBackpack = MiscUtils.conditionalNew(ItemEnderBackpack.class, GlobalConfig.enderBackpackEnabled);
cardboardHelmet = conditionalNewArmor(GlobalConfig.cardboardHelmetEnabled, 0);
cardboardChestplate = conditionalNewArmor(GlobalConfig.cardboardChestplateEnabled, 1);
cardboardLeggings = conditionalNewArmor(GlobalConfig.cardboardLeggingsEnabled, 2);
cardboardBoots = conditionalNewArmor(GlobalConfig.cardboardBootsEnabled, 3);
cardboardSword = MiscUtils.conditionalNew(ItemCardboardSword.class, GlobalConfig.cardboardSwordEnabled);
cardboardPickaxe = MiscUtils.conditionalNew(ItemCardboardPickaxe.class, GlobalConfig.cardboardPickaxeEnabled);
cardboardShovel = MiscUtils.conditionalNew(ItemCardboardShovel.class, GlobalConfig.cardboardShovelEnabled);
cardboardAxe = MiscUtils.conditionalNew(ItemCardboardAxe.class, GlobalConfig.cardboardAxeEnabled);
cardboardHoe = MiscUtils.conditionalNew(ItemCardboardHoe.class, GlobalConfig.cardboardHoeEnabled);
anyCardboardItemsEnabled = ((BetterStorageItems.cardboardHelmet != null) || (BetterStorageItems.cardboardChestplate != null) || (BetterStorageItems.cardboardLeggings != null) || (BetterStorageItems.cardboardBoots != null) || (BetterStorageItems.cardboardSword != null) || (BetterStorageItems.cardboardPickaxe != null) || (BetterStorageItems.cardboardAxe != null) || (BetterStorageItems.cardboardShovel != null) || (BetterStorageItems.cardboardHoe != null));
if (cardboardSheet != null)
OreDictionary.registerOre("sheetCardboard", cardboardSheet);
Addon.initializeItemsAll();
}
Aggregations