Search in sources :

Example 1 with ItemEnderBackpack

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;
}
Also used : ItemStack(net.minecraft.item.ItemStack) ItemEnderBackpack(net.mcft.copy.betterstorage.item.ItemEnderBackpack) EntityItem(net.minecraft.entity.item.EntityItem) SubscribeEvent(cpw.mods.fml.common.eventhandler.SubscribeEvent)

Example 2 with ItemEnderBackpack

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();
}
Also used : ItemBucketSlime(net.mcft.copy.betterstorage.item.ItemBucketSlime) ItemCardboardSword(net.mcft.copy.betterstorage.item.cardboard.ItemCardboardSword) ItemCardboardSheet(net.mcft.copy.betterstorage.item.cardboard.ItemCardboardSheet) ItemBackpack(net.mcft.copy.betterstorage.item.ItemBackpack) ItemCardboardAxe(net.mcft.copy.betterstorage.item.cardboard.ItemCardboardAxe) ItemMasterKey(net.mcft.copy.betterstorage.item.locking.ItemMasterKey) ItemPresentBook(net.mcft.copy.betterstorage.item.ItemPresentBook) ItemKeyring(net.mcft.copy.betterstorage.item.locking.ItemKeyring) ItemKey(net.mcft.copy.betterstorage.item.locking.ItemKey) ItemLock(net.mcft.copy.betterstorage.item.locking.ItemLock) ItemCardboardPickaxe(net.mcft.copy.betterstorage.item.cardboard.ItemCardboardPickaxe) ItemEnderBackpack(net.mcft.copy.betterstorage.item.ItemEnderBackpack) ItemCardboardShovel(net.mcft.copy.betterstorage.item.cardboard.ItemCardboardShovel) ItemCardboardHoe(net.mcft.copy.betterstorage.item.cardboard.ItemCardboardHoe) ItemDrinkingHelmet(net.mcft.copy.betterstorage.item.ItemDrinkingHelmet)

Aggregations

ItemEnderBackpack (net.mcft.copy.betterstorage.item.ItemEnderBackpack)2 SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)1 ItemBackpack (net.mcft.copy.betterstorage.item.ItemBackpack)1 ItemBucketSlime (net.mcft.copy.betterstorage.item.ItemBucketSlime)1 ItemDrinkingHelmet (net.mcft.copy.betterstorage.item.ItemDrinkingHelmet)1 ItemPresentBook (net.mcft.copy.betterstorage.item.ItemPresentBook)1 ItemCardboardAxe (net.mcft.copy.betterstorage.item.cardboard.ItemCardboardAxe)1 ItemCardboardHoe (net.mcft.copy.betterstorage.item.cardboard.ItemCardboardHoe)1 ItemCardboardPickaxe (net.mcft.copy.betterstorage.item.cardboard.ItemCardboardPickaxe)1 ItemCardboardSheet (net.mcft.copy.betterstorage.item.cardboard.ItemCardboardSheet)1 ItemCardboardShovel (net.mcft.copy.betterstorage.item.cardboard.ItemCardboardShovel)1 ItemCardboardSword (net.mcft.copy.betterstorage.item.cardboard.ItemCardboardSword)1 ItemKey (net.mcft.copy.betterstorage.item.locking.ItemKey)1 ItemKeyring (net.mcft.copy.betterstorage.item.locking.ItemKeyring)1 ItemLock (net.mcft.copy.betterstorage.item.locking.ItemLock)1 ItemMasterKey (net.mcft.copy.betterstorage.item.locking.ItemMasterKey)1 EntityItem (net.minecraft.entity.item.EntityItem)1 ItemStack (net.minecraft.item.ItemStack)1