Search in sources :

Example 1 with ItemDrill

use of blusunrize.immersiveengineering.common.items.ItemDrill in project ImmersiveEngineering by BluSunrize.

the class EventHandler method digSpeedEvent.

@SubscribeEvent()
public void digSpeedEvent(PlayerEvent.BreakSpeed event) {
    ItemStack current = event.getEntityPlayer().getHeldItem(EnumHand.MAIN_HAND);
    // Stop the combustion drill from working underwater
    if (!current.isEmpty() && current.getItem().equals(IEContent.itemDrill) && current.getItemDamage() == 0 && event.getEntityPlayer().isInsideOfMaterial(Material.WATER))
        if (((ItemDrill) IEContent.itemDrill).getUpgrades(current).getBoolean("waterproof"))
            event.setNewSpeed(event.getOriginalSpeed() * 5);
        else
            event.setCanceled(true);
    if (event.getState().getBlock() == IEContent.blockMetalDecoration2 && IEContent.blockMetalDecoration2.getMetaFromState(event.getState()) == BlockTypes_MetalDecoration2.RAZOR_WIRE.getMeta())
        if (!OreDictionary.itemMatches(new ItemStack(IEContent.itemTool, 1, 1), current, false)) {
            event.setCanceled(true);
            TileEntityRazorWire.applyDamage(event.getEntityLiving());
        }
    TileEntity te = event.getEntityPlayer().getEntityWorld().getTileEntity(event.getPos());
    if (te instanceof IEntityProof && !((IEntityProof) te).canEntityDestroy(event.getEntityPlayer()))
        event.setCanceled(true);
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) IEntityProof(blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IEntityProof) ItemStack(net.minecraft.item.ItemStack) ItemDrill(blusunrize.immersiveengineering.common.items.ItemDrill) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Example 2 with ItemDrill

use of blusunrize.immersiveengineering.common.items.ItemDrill in project ImmersiveEngineering by BluSunrize.

the class IEAchievements method init.

public static void init() {
    openManual = new AchievementIE("openManual", 0, 1, new ItemStack(IEContent.itemTool, 1, 3), null);
    craftHammer = new AchievementIE("craftHammer", 3, 2, IEContent.itemTool, openManual).setNormalCrafting();
    connectWire = new AchievementIE("connectWire", 0, -1, IEContent.itemWireCoil, openManual);
    blastfurnace = new AchievementIE("blastfurnace", 2, 1, new ItemStack(IEContent.blockStoneDevice, 1, BlockTypes_StoneDevices.BLAST_FURNACE.getMeta()), craftHammer);
    makeSteel = new AchievementIE("makeSteel", 2, -1, new ItemStack(IEContent.itemMetal, 1, 8), blastfurnace);
    placeConveyor = new AchievementIE("placeConveyor", 1, 3, ConveyorHandler.getConveyorStack(ImmersiveEngineering.MODID + ":conveyor"), openManual).setPlacement(new ItemStack(IEContent.blockConveyor));
    placeWindmill = new AchievementIE("placeWindmill", -1, 3, new ItemStack(IEContent.blockWoodenDevice1, 1, BlockTypes_WoodenDevice1.WINDMILL.getMeta()), openManual).setPlacement(new ItemStack(IEContent.blockWoodenDevice1, 1, BlockTypes_WoodenDevice1.WINDMILL.getMeta()), new ItemStack(IEContent.blockWoodenDevice1, 1, BlockTypes_WoodenDevice1.WINDMILL_ADVANCED.getMeta()));
    craftHeater = new AchievementIE("craftHeater", -2, 4, new ItemStack(IEContent.blockMetalDevice1, 1, BlockTypes_MetalDevice1.FURNACE_HEATER.getMeta()), openManual).setNormalCrafting();
    craftPump = new AchievementIE("craftPump", 2, 4, new ItemStack(IEContent.blockMetalDevice0, 1, BlockTypes_MetalDevice0.FLUID_PUMP.getMeta()), openManual).setNormalCrafting();
    placeFloodlight = new AchievementIE("placeFloodlight", -1, 5, new ItemStack(IEContent.blockMetalDevice1, 1, BlockTypes_MetalDevice1.FLOODLIGHT.getMeta()), openManual).setPlacement();
    mbImprovedBlastFurnace = new AchievementIE("mbImprovedBlastFurnace", 6, -3, new ItemStack(IEContent.blockStoneDevice, 1, BlockTypes_StoneDevices.BLAST_FURNACE_ADVANCED.getMeta()), makeSteel).setSpecial();
    mbMetalPress = new AchievementIE("mbMetalPress", 6, -2, new ItemStack(IEContent.blockMetalMultiblock, 1, BlockTypes_MetalMultiblock.METAL_PRESS.getMeta()), makeSteel).setSpecial();
    mbCrusher = new AchievementIE("mbCrusher", 6, -1, new ItemStack(IEContent.blockMetalMultiblock, 1, BlockTypes_MetalMultiblock.CRUSHER.getMeta()), makeSteel).setSpecial();
    mbSilo = new AchievementIE("mbSilo", 7, -2, new ItemStack(IEContent.blockMetalMultiblock, 1, BlockTypes_MetalMultiblock.SILO.getMeta()), craftHammer).setSpecial();
    mbDieselGen = new AchievementIE("mbDieselGen", 6, 0, new ItemStack(IEContent.blockMetalMultiblock, 1, BlockTypes_MetalMultiblock.DIESEL_GENERATOR.getMeta()), craftHammer).setSpecial();
    mbExcavator = new AchievementIE("mbExcavator", 6, 1, new ItemStack(IEContent.blockMetalMultiblock, 1, BlockTypes_MetalMultiblock.EXCAVATOR.getMeta()), craftHammer).setSpecial();
    mbArcFurnace = new AchievementIE("mbArcFurnace", 6, 2, new ItemStack(IEContent.blockMetalMultiblock, 1, BlockTypes_MetalMultiblock.ARC_FURNACE.getMeta()), craftHammer).setSpecial();
    craftWorkbench = new AchievementIE("craftWorkbench", 2, -3, new ItemStack(IEContent.blockWoodenDevice0, 1, BlockTypes_WoodenDevice0.WORKBENCH.getMeta()), makeSteel).setNormalCrafting();
    craftRevolver = new AchievementIE("craftRevolver", 3, -6, IEContent.itemRevolver, craftWorkbench).setNormalCrafting();
    ItemStack[] upgrades = new ItemStack[20];
    upgrades[18] = new ItemStack(IEContent.itemToolUpgrades, 1, 5);
    upgrades[19] = new ItemStack(IEContent.itemToolUpgrades, 1, 6);
    ItemStack revolver = new ItemStack(IEContent.itemRevolver);
    ((ItemRevolver) IEContent.itemRevolver).setContainedItems(revolver, upgrades);
    ((ItemRevolver) IEContent.itemRevolver).recalculateUpgrades(revolver);
    upgradeRevolver = new AchievementIE("upgradeRevolver", 4, -6, revolver, craftRevolver);
    if (!BulletHandler.homingCartridges.isEmpty())
        craftWolfPack = new AchievementIE("craftWolfPack", 4, -7, BulletHandler.getBulletStack("wolfpack"), craftRevolver).setCheckNBT(true).setBlueprintCrafting().setSpecial();
    ItemStack drill = new ItemStack(IEContent.itemDrill);
    ((ItemDrill) IEContent.itemDrill).setHead(drill, new ItemStack(IEContent.itemDrillhead));
    craftDrill = new AchievementIE("craftDrill", 1, -6, drill, craftWorkbench).setNormalCrafting();
    upgrades = new ItemStack[4];
    upgrades[0] = new ItemStack(IEContent.itemDrillhead);
    upgrades[1] = new ItemStack(IEContent.itemToolUpgrades, 1, 0);
    upgrades[2] = new ItemStack(IEContent.itemToolUpgrades, 1, 1);
    upgrades[3] = new ItemStack(IEContent.itemToolUpgrades, 3, 2);
    ItemStack drill2 = drill.copy();
    ((ItemDrill) IEContent.itemDrill).setContainedItems(drill2, upgrades);
    ((ItemDrill) IEContent.itemDrill).recalculateUpgrades(drill2);
    upgradeDrill = new AchievementIE("upgradeDrill", 0, -6, drill2, craftDrill);
    craftSkyhook = new AchievementIE("craftSkyhook", 1, -5, IEContent.itemSkyhook, craftWorkbench).setNormalCrafting();
    ItemStack hook = new ItemStack(IEContent.itemSkyhook);
    hook.addEnchantment(Enchantments.UNBREAKING, 1);
    //skyhookPro = new AchievementIE("skyhookPro", 0, -5, hook, craftSkyhook);
    craftChemthrower = new AchievementIE("craftChemthrower", 3, -5, IEContent.itemChemthrower, craftWorkbench).setNormalCrafting();
    craftRailgun = new AchievementIE("craftRailgun", 1, -7, IEContent.itemRailgun, craftWorkbench).setNormalCrafting();
    secret_birthdayParty = new AchievementIE("secret_birthdayParty", -4, -1, new ItemStack(IEContent.itemFakeIcons, 1, 0), null).setSpecial();
    secret_luckOfTheDraw = new AchievementIE("secret_luckOfTheDraw", -4, 1, new ItemStack(IEContent.itemFakeIcons, 1, 1), null).setSpecial();
    ieAchievementPage = new AchievementPage(ImmersiveEngineering.MODNAME, AchievementIE.achievements.toArray(new Achievement[AchievementIE.achievements.size()]));
    AchievementPage.registerAchievementPage(ieAchievementPage);
    statDistanceSkyhook = new StatBase("stat.skyhookOneCm", new TextComponentTranslation("stat.skyhookOneCm", new Object[0]), StatBase.distanceStatType) {

        @Override
        public StatBase registerStat() {
            super.registerStat();
            StatList.BASIC_STATS.add(12, this);
            return this;
        }
    }.initIndependentStat().registerStat();
}
Also used : ItemRevolver(blusunrize.immersiveengineering.common.items.ItemRevolver) TextComponentTranslation(net.minecraft.util.text.TextComponentTranslation) AchievementPage(net.minecraftforge.common.AchievementPage) StatBase(net.minecraft.stats.StatBase) ItemStack(net.minecraft.item.ItemStack) ItemDrill(blusunrize.immersiveengineering.common.items.ItemDrill)

Example 3 with ItemDrill

use of blusunrize.immersiveengineering.common.items.ItemDrill in project ImmersiveEngineering by BluSunrize.

the class ClientUtils method handleBipedRotations.

public static void handleBipedRotations(ModelBiped model, Entity entity) {
    if (!Config.IEConfig.fancyItemHolding)
        return;
    if (entity instanceof EntityPlayer) {
        EntityPlayer player = (EntityPlayer) entity;
        for (EnumHand hand : EnumHand.values()) {
            ItemStack heldItem = player.getHeldItem(hand);
            if (!heldItem.isEmpty()) {
                boolean right = (hand == EnumHand.MAIN_HAND) == (player.getPrimaryHand() == EnumHandSide.RIGHT);
                if (heldItem.getItem() instanceof ItemRevolver) {
                    if (right) {
                        model.bipedRightArm.rotateAngleX = -1.39626f + model.bipedHead.rotateAngleX;
                        model.bipedRightArm.rotateAngleY = -.08726f + model.bipedHead.rotateAngleY;
                    } else {
                        model.bipedLeftArm.rotateAngleX = -1.39626f + model.bipedHead.rotateAngleX;
                        model.bipedLeftArm.rotateAngleY = .08726f + model.bipedHead.rotateAngleY;
                    }
                } else if (heldItem.getItem() instanceof ItemDrill || heldItem.getItem() instanceof ItemChemthrower) {
                    if (right) {
                        model.bipedLeftArm.rotateAngleX = -.87266f;
                        model.bipedLeftArm.rotateAngleY = .52360f;
                    } else {
                        model.bipedRightArm.rotateAngleX = -.87266f;
                        model.bipedRightArm.rotateAngleY = -0.52360f;
                    }
                } else if (heldItem.getItem() instanceof ItemRailgun) {
                    if (right)
                        model.bipedRightArm.rotateAngleX = -.87266f;
                    else
                        model.bipedLeftArm.rotateAngleX = -.87266f;
                }
            }
        }
    }
}
Also used : ItemRevolver(blusunrize.immersiveengineering.common.items.ItemRevolver) ItemRailgun(blusunrize.immersiveengineering.common.items.ItemRailgun) ItemChemthrower(blusunrize.immersiveengineering.common.items.ItemChemthrower) EntityPlayer(net.minecraft.entity.player.EntityPlayer) ItemStack(net.minecraft.item.ItemStack) ItemDrill(blusunrize.immersiveengineering.common.items.ItemDrill)

Aggregations

ItemDrill (blusunrize.immersiveengineering.common.items.ItemDrill)3 ItemStack (net.minecraft.item.ItemStack)3 ItemRevolver (blusunrize.immersiveengineering.common.items.ItemRevolver)2 IEntityProof (blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IEntityProof)1 ItemChemthrower (blusunrize.immersiveengineering.common.items.ItemChemthrower)1 ItemRailgun (blusunrize.immersiveengineering.common.items.ItemRailgun)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 StatBase (net.minecraft.stats.StatBase)1 TileEntity (net.minecraft.tileentity.TileEntity)1 TextComponentTranslation (net.minecraft.util.text.TextComponentTranslation)1 AchievementPage (net.minecraftforge.common.AchievementPage)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1