Huge genericisation of item/block related stuff
parent
8a1b96eb49
commit
3b8b08b308
|
@ -1,103 +0,0 @@
|
|||
|
||||
package steamcraft.client.renderers.entity;
|
||||
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import steamcraft.common.entities.EntityGrapplingHook;
|
||||
import steamcraft.common.lib.ModInfo;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderGrapplingHook extends Render
|
||||
{
|
||||
private static final ResourceLocation bulletTex = new ResourceLocation(ModInfo.PREFIX + "textures/projectiles/musketball.png");
|
||||
|
||||
public void renderBullet(EntityGrapplingHook entity, double dx, double dy, double dz, float frotY, float frotP)
|
||||
{
|
||||
this.bindEntityTexture(entity);
|
||||
|
||||
if ((entity.prevRotationYaw == 0.0F) && (entity.prevRotationPitch == 0.0F))
|
||||
return;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) dx, (float) dy, (float) dz);
|
||||
GL11.glRotatef((entity.prevRotationYaw + ((entity.rotationYaw - entity.prevRotationYaw) * frotP)) - 90F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(entity.prevRotationPitch + ((entity.rotationPitch - entity.prevRotationPitch) * frotP), 0.0F, 0.0F, 1.0F);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
int i = 0;
|
||||
float f2 = 0.0F;
|
||||
float f3 = 0.5F;
|
||||
float f4 = (0 + (i * 10)) / 32F;
|
||||
float f5 = (5 + (i * 10)) / 32F;
|
||||
float f6 = 0.0F;
|
||||
float f7 = 0.15625F;
|
||||
float f8 = (5 + (i * 10)) / 32F;
|
||||
float f9 = (10 + (i * 10)) / 32F;
|
||||
float f10 = 0.3F;
|
||||
GL11.glEnable(32826 /* GL_RESCALE_NORMAL_EXT */);
|
||||
float f11 = 1.0F - frotP;
|
||||
|
||||
if (f11 > 0.0F)
|
||||
{
|
||||
float f12 = -MathHelper.sin(f11 * 3F) * f11;
|
||||
GL11.glRotatef(f12, 0.0F, 0.0F, 1.0F);
|
||||
}
|
||||
|
||||
GL11.glRotatef(45F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glScalef(f10, f10, f10);
|
||||
GL11.glTranslatef(-4F, 0.0F, 0.0F);
|
||||
GL11.glNormal3f(f10, 0.0F, 0.0F);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV(-7D, -2D, -2D, f6, f8);
|
||||
tessellator.addVertexWithUV(-7D, -2D, 2D, f7, f8);
|
||||
tessellator.addVertexWithUV(-7D, 2D, 2D, f7, f9);
|
||||
tessellator.addVertexWithUV(-7D, 2D, -2D, f6, f9);
|
||||
tessellator.draw();
|
||||
GL11.glNormal3f(-f10, 0.0F, 0.0F);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV(-7D, 2D, -2D, f6, f8);
|
||||
tessellator.addVertexWithUV(-7D, 2D, 2D, f7, f8);
|
||||
tessellator.addVertexWithUV(-7D, -2D, 2D, f7, f9);
|
||||
tessellator.addVertexWithUV(-7D, -2D, -2D, f6, f9);
|
||||
tessellator.draw();
|
||||
|
||||
for (int j = 0; j < 4; j++)
|
||||
{
|
||||
GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glNormal3f(0.0F, 0.0F, f10);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV(-8D, -2D, 0.0D, f2, f4);
|
||||
tessellator.addVertexWithUV(8D, -2D, 0.0D, f3, f4);
|
||||
tessellator.addVertexWithUV(8D, 2D, 0.0D, f3, f5);
|
||||
tessellator.addVertexWithUV(-8D, 2D, 0.0D, f2, f5);
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
GL11.glDisable(32826 /* GL_RESCALE_NORMAL_EXT */);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
protected ResourceLocation getBulletTexture(EntityGrapplingHook bullet)
|
||||
{
|
||||
return bulletTex;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity entity)
|
||||
{
|
||||
return this.getBulletTexture((EntityGrapplingHook) entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRender(Entity entity, double dx, double dy, double dz, float frotY, float frotP)
|
||||
{
|
||||
this.renderBullet((EntityGrapplingHook) entity, dx, dy, dz, frotY, frotP);
|
||||
}
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
|
||||
package steamcraft.common.blocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import steamcraft.common.Steamcraft;
|
||||
import steamcraft.common.lib.ModInfo;
|
||||
|
||||
/**
|
||||
* @author Surseance
|
||||
*
|
||||
*/
|
||||
public class BaseBlock extends Block
|
||||
{
|
||||
|
||||
public BaseBlock(Material mat)
|
||||
{
|
||||
super(mat);
|
||||
this.setCreativeTab(Steamcraft.tabSC2);
|
||||
this.setHardness(1F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister ir)
|
||||
{
|
||||
this.blockIcon = ir.registerIcon(ModInfo.PREFIX + this.getUnlocalizedName().substring(5));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the block's texture. Args: side, meta
|
||||
*/
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int p_149691_1_, int p_149691_2_)
|
||||
{
|
||||
return this.blockIcon;
|
||||
}
|
||||
}
|
|
@ -8,6 +8,8 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import boilerplate.common.baseclasses.blocks.BaseBlock;
|
||||
import steamcraft.common.Steamcraft;
|
||||
import steamcraft.common.entities.EntityFallingBoulder;
|
||||
|
||||
public class BlockBoulder extends BaseBlock
|
||||
|
@ -16,7 +18,7 @@ public class BlockBoulder extends BaseBlock
|
|||
|
||||
public BlockBoulder()
|
||||
{
|
||||
super(Material.rock);
|
||||
super(Material.rock, Steamcraft.instance);
|
||||
this.setHarvestLevel("pickaxe", 2);
|
||||
this.setHardness(2F);
|
||||
this.setResistance(20F);
|
||||
|
|
|
@ -7,13 +7,15 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import boilerplate.common.baseclasses.blocks.BaseBlock;
|
||||
import steamcraft.common.Steamcraft;
|
||||
import steamcraft.common.init.InitItems;
|
||||
|
||||
public class BlockBrassLeaves extends BaseBlock
|
||||
{
|
||||
public BlockBrassLeaves(Material mat)
|
||||
{
|
||||
super(mat);
|
||||
super(mat, Steamcraft.instance);
|
||||
this.setHarvestLevel("pickaxe", 2);
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,9 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import boilerplate.common.baseclasses.blocks.BaseBlock;
|
||||
import steamcraft.client.lib.RenderIDs;
|
||||
import steamcraft.common.Steamcraft;
|
||||
import steamcraft.common.lib.ModInfo;
|
||||
|
||||
/**
|
||||
|
@ -31,7 +33,7 @@ public class BlockCastIronRailing extends BaseBlock
|
|||
{
|
||||
public BlockCastIronRailing(Material mat)
|
||||
{
|
||||
super(mat);
|
||||
super(mat, Steamcraft.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
|
||||
package steamcraft.common.blocks;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
public class BlockCompressedStone extends BaseBlock
|
||||
{
|
||||
|
||||
public BlockCompressedStone(Material mat)
|
||||
{
|
||||
super(mat);
|
||||
this.setBlockName("blockCompressedStone");
|
||||
this.setHardness(2.2F);
|
||||
this.setResistance(15.0F);
|
||||
}
|
||||
|
||||
}
|
|
@ -6,13 +6,15 @@ import net.minecraft.entity.Entity;
|
|||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import boilerplate.common.baseclasses.blocks.BaseBlock;
|
||||
import steamcraft.common.Steamcraft;
|
||||
|
||||
public class BlockCongealedSlime extends BaseBlock
|
||||
{
|
||||
|
||||
public BlockCongealedSlime(Material mat)
|
||||
{
|
||||
super(mat);
|
||||
|
||||
super(mat, Steamcraft.instance);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
|
||||
package steamcraft.common.blocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import steamcraft.common.Steamcraft;
|
||||
import steamcraft.common.lib.ModInfo;
|
||||
|
||||
/**
|
||||
* @author warlordjones
|
||||
*
|
||||
*/
|
||||
public class BlockCustomSlab extends BlockSlab
|
||||
{
|
||||
String type;
|
||||
Block block;
|
||||
|
||||
public BlockCustomSlab(String type, Block block, Material mat)
|
||||
{
|
||||
super(false, mat);
|
||||
this.type = type;
|
||||
this.block = block;
|
||||
this.setCreativeTab(Steamcraft.tabSC2);
|
||||
this.useNeighborBrightness = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String func_150002_b(int p_150002_1_)
|
||||
{
|
||||
return ModInfo.PREFIX + this.type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta)
|
||||
{
|
||||
return this.block.getIcon(side, meta);
|
||||
}
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
|
||||
package steamcraft.common.blocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockStairs;
|
||||
|
||||
import steamcraft.common.Steamcraft;
|
||||
|
||||
/**
|
||||
* @author warlordjones
|
||||
*
|
||||
*/
|
||||
public class BlockCustomStairs extends BlockStairs
|
||||
{
|
||||
public BlockCustomStairs(Block block)
|
||||
{
|
||||
super(block, 0);
|
||||
this.setCreativeTab(Steamcraft.tabSC2);
|
||||
this.useNeighborBrightness = true;
|
||||
}
|
||||
|
||||
public BlockCustomStairs(Block block, int metadata)
|
||||
{
|
||||
super(block, metadata);
|
||||
this.setCreativeTab(Steamcraft.tabSC2);
|
||||
this.useNeighborBrightness = true;
|
||||
}
|
||||
}
|
|
@ -1,49 +0,0 @@
|
|||
|
||||
package steamcraft.common.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockWall;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import steamcraft.common.Steamcraft;
|
||||
|
||||
/**
|
||||
* @author warlordjones
|
||||
*
|
||||
*/
|
||||
public class BlockCustomWall extends BlockWall
|
||||
{
|
||||
Block block;
|
||||
int metadata;
|
||||
|
||||
public BlockCustomWall(Block block, int meta)
|
||||
{
|
||||
super(block);
|
||||
this.block = block;
|
||||
this.metadata = meta;
|
||||
this.setCreativeTab(Steamcraft.tabSC2);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta)
|
||||
{
|
||||
return this.block.getIcon(0, this.metadata);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list)
|
||||
{
|
||||
list.add(new ItemStack(item, 1, 0));
|
||||
}
|
||||
}
|
|
@ -19,6 +19,8 @@ import net.minecraft.world.World;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import boilerplate.common.baseclasses.blocks.BaseBlock;
|
||||
import steamcraft.common.Steamcraft;
|
||||
import steamcraft.common.lib.ModInfo;
|
||||
|
||||
public class BlockDynamite extends BaseBlock
|
||||
|
@ -28,7 +30,7 @@ public class BlockDynamite extends BaseBlock
|
|||
|
||||
public BlockDynamite()
|
||||
{
|
||||
super(Material.tnt);
|
||||
super(Material.tnt, Steamcraft.instance);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,6 +8,8 @@ import net.minecraft.util.AxisAlignedBB;
|
|||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldType;
|
||||
|
||||
import boilerplate.common.baseclasses.blocks.BaseBlock;
|
||||
import steamcraft.common.Steamcraft;
|
||||
import steamcraft.common.config.ConfigGeneral;
|
||||
import steamcraft.common.worldgen.dimension.util.TeleporterDeeps;
|
||||
|
||||
|
@ -15,7 +17,7 @@ public class BlockFissurePortal extends BaseBlock
|
|||
{
|
||||
public BlockFissurePortal(Material mat)
|
||||
{
|
||||
super(mat);
|
||||
super(mat, Steamcraft.instance);
|
||||
this.setBlockUnbreakable();
|
||||
this.setLightLevel(1F);
|
||||
}
|
||||
|
|
|
@ -9,13 +9,15 @@ import net.minecraft.world.World;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import boilerplate.common.baseclasses.blocks.BaseBlock;
|
||||
import steamcraft.common.Steamcraft;
|
||||
import steamcraft.common.entities.living.EntityGrub;
|
||||
|
||||
public class BlockInfestedDirt extends BaseBlock
|
||||
{
|
||||
public BlockInfestedDirt(Material mat)
|
||||
{
|
||||
super(mat);
|
||||
super(mat, Steamcraft.instance);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -14,11 +14,14 @@ import net.minecraft.world.World;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import boilerplate.common.baseclasses.blocks.BaseBlock;
|
||||
import steamcraft.common.Steamcraft;
|
||||
|
||||
public class BlockLeafPile extends BaseBlock
|
||||
{
|
||||
public BlockLeafPile()
|
||||
{
|
||||
super(Material.leaves);
|
||||
super(Material.leaves, Steamcraft.instance);
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F);
|
||||
this.setTickRandomly(true);
|
||||
this.func_150154_b(0);
|
||||
|
|
|
@ -6,13 +6,15 @@ import net.minecraft.entity.Entity;
|
|||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import boilerplate.common.baseclasses.blocks.BaseBlock;
|
||||
import steamcraft.common.Steamcraft;
|
||||
|
||||
public class BlockMud extends BaseBlock
|
||||
{
|
||||
|
||||
public BlockMud(Material mat)
|
||||
{
|
||||
super(mat);
|
||||
// TODO Auto-generated constructor stub
|
||||
super(mat, Steamcraft.instance);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,7 +9,9 @@ import net.minecraft.world.World;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import boilerplate.common.baseclasses.blocks.BaseBlock;
|
||||
import steamcraft.client.lib.RenderIDs;
|
||||
import steamcraft.common.Steamcraft;
|
||||
import steamcraft.common.entities.living.EntityGhostSpider;
|
||||
import steamcraft.common.entities.living.EntityGiantSpider;
|
||||
|
||||
|
@ -18,7 +20,7 @@ public class BlockSpiderEgg extends BaseBlock
|
|||
|
||||
public BlockSpiderEgg(Material mat)
|
||||
{
|
||||
super(mat);
|
||||
super(mat, Steamcraft.instance);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
|
|
|
@ -11,11 +11,14 @@ import net.minecraft.world.World;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import boilerplate.common.baseclasses.blocks.BaseBlock;
|
||||
import steamcraft.common.Steamcraft;
|
||||
|
||||
public class BlockThin extends BaseBlock
|
||||
{
|
||||
public BlockThin(Material mat)
|
||||
{
|
||||
super(mat);
|
||||
super(mat, Steamcraft.instance);
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F);
|
||||
// this.setLightOpacity(255);
|
||||
}
|
||||
|
|
|
@ -9,11 +9,14 @@ import net.minecraft.init.Items;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import boilerplate.common.baseclasses.blocks.BaseBlock;
|
||||
import steamcraft.common.Steamcraft;
|
||||
|
||||
public class BlockTintedRock extends BaseBlock
|
||||
{
|
||||
public BlockTintedRock(Material mat)
|
||||
{
|
||||
super(mat);
|
||||
super(mat, Steamcraft.instance);
|
||||
this.setHarvestLevel("pickaxe", 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,9 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import boilerplate.client.utils.EffectUtils;
|
||||
import boilerplate.common.baseclasses.blocks.BaseBlock;
|
||||
import brassutils.api.IEngravable;
|
||||
import steamcraft.common.Steamcraft;
|
||||
import steamcraft.common.init.InitBlocks;
|
||||
|
||||
/**
|
||||
|
@ -27,7 +29,7 @@ public class BlockUranium extends BaseBlock implements IEngravable
|
|||
{
|
||||
public BlockUranium(Material mat)
|
||||
{
|
||||
super(mat);
|
||||
super(mat, Steamcraft.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -16,7 +16,7 @@ import net.minecraftforge.fluids.FluidStack;
|
|||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
|
||||
import boilerplate.common.baseclasses.items.BaseItemBlockWithMetadata;
|
||||
import boilerplate.common.baseclasses.items.BaseMetadataItemBlock;
|
||||
import boilerplate.common.utils.helpers.IMCHelper;
|
||||
import boilerplate.common.utils.helpers.OreDictHelper;
|
||||
import steamcraft.common.init.InitBiomes;
|
||||
|
@ -292,7 +292,7 @@ public class CompatabilityLayer
|
|||
}
|
||||
if (Loader.isModLoaded("BrassUtils"))
|
||||
{
|
||||
InitBlocks.registerBlock(InitBlocks.blockEngraved, BaseItemBlockWithMetadata.class, "BlockEngravedSolid", 10);
|
||||
InitBlocks.registerBlock(InitBlocks.blockEngraved, BaseMetadataItemBlock.class, "BlockEngravedSolid", 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ public class ItemSteamChisel extends BaseSteamItem implements IChiselItem
|
|||
|
||||
public ItemSteamChisel()
|
||||
{
|
||||
super(32000);
|
||||
super(32000, Steamcraft.instance);
|
||||
this.setCreativeTab(Steamcraft.tabSC2);
|
||||
this.setUnlocalizedName("itemChiselSteam");
|
||||
this.setFull3D();
|
||||
|
|
|
@ -1,200 +0,0 @@
|
|||
|
||||
package steamcraft.common.entities;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.item.EntityMinecart;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import steamcraft.common.init.InitBlocks;
|
||||
|
||||
public class EntityBoilerMinecart extends EntityMinecart
|
||||
{
|
||||
private int fuel;
|
||||
public double pushX;
|
||||
public double pushZ;
|
||||
|
||||
public EntityBoilerMinecart(World p_i1718_1_)
|
||||
{
|
||||
super(p_i1718_1_);
|
||||
}
|
||||
|
||||
public EntityBoilerMinecart(World p_i1719_1_, double p_i1719_2_, double p_i1719_4_, double p_i1719_6_)
|
||||
{
|
||||
super(p_i1719_1_, p_i1719_2_, p_i1719_4_, p_i1719_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void entityInit()
|
||||
{
|
||||
super.entityInit();
|
||||
this.dataWatcher.addObject(16, (byte) 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to update the entity's position/logic.
|
||||
*/
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
super.onUpdate();
|
||||
|
||||
if (this.fuel > 0)
|
||||
{
|
||||
--this.fuel;
|
||||
}
|
||||
|
||||
if (this.fuel <= 0)
|
||||
{
|
||||
this.pushX = this.pushZ = 0.0D;
|
||||
}
|
||||
|
||||
this.setMinecartPowered(this.fuel > 0);
|
||||
|
||||
if (this.isMinecartPowered() && (this.rand.nextInt(4) == 0))
|
||||
{
|
||||
this.worldObj.spawnParticle("largesmoke", this.posX, this.posY + 0.8D, this.posZ, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void killMinecart(DamageSource p_94095_1_)
|
||||
{
|
||||
super.killMinecart(p_94095_1_);
|
||||
|
||||
if (!p_94095_1_.isExplosion())
|
||||
{
|
||||
this.entityDropItem(new ItemStack(Blocks.furnace, 1), 0.0F);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void func_145821_a(int p_145821_1_, int p_145821_2_, int p_145821_3_, double p_145821_4_, double p_145821_6_, Block p_145821_8_,
|
||||
int p_145821_9_)
|
||||
{
|
||||
super.func_145821_a(p_145821_1_, p_145821_2_, p_145821_3_, p_145821_4_, p_145821_6_, p_145821_8_, p_145821_9_);
|
||||
double d2 = (this.pushX * this.pushX) + (this.pushZ * this.pushZ);
|
||||
|
||||
if ((d2 > 1.0E-4D) && (((this.motionX * this.motionX) + (this.motionZ * this.motionZ)) > 0.001D))
|
||||
{
|
||||
d2 = MathHelper.sqrt_double(d2);
|
||||
this.pushX /= d2;
|
||||
this.pushZ /= d2;
|
||||
|
||||
if (((this.pushX * this.motionX) + (this.pushZ * this.motionZ)) < 0.0D)
|
||||
{
|
||||
this.pushX = 0.0D;
|
||||
this.pushZ = 0.0D;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.pushX = this.motionX;
|
||||
this.pushZ = this.motionZ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyDrag()
|
||||
{
|
||||
double d0 = (this.pushX * this.pushX) + (this.pushZ * this.pushZ);
|
||||
|
||||
if (d0 > 1.0E-4D)
|
||||
{
|
||||
d0 = MathHelper.sqrt_double(d0);
|
||||
this.pushX /= d0;
|
||||
this.pushZ /= d0;
|
||||
double d1 = 0.05D;
|
||||
this.motionX *= 0.800000011920929D;
|
||||
this.motionY *= 0.0D;
|
||||
this.motionZ *= 0.800000011920929D;
|
||||
this.motionX += this.pushX * d1;
|
||||
this.motionZ += this.pushZ * d1;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.motionX *= 0.9800000190734863D;
|
||||
this.motionY *= 0.0D;
|
||||
this.motionZ *= 0.9800000190734863D;
|
||||
}
|
||||
|
||||
super.applyDrag();
|
||||
}
|
||||
|
||||
/**
|
||||
* First layer of player interaction
|
||||
*/
|
||||
@Override
|
||||
public boolean interactFirst(EntityPlayer p_130002_1_)
|
||||
{
|
||||
// TODO Open GUI
|
||||
|
||||
this.pushX = this.posX - p_130002_1_.posX;
|
||||
this.pushZ = this.posZ - p_130002_1_.posZ;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||
*/
|
||||
@Override
|
||||
protected void writeEntityToNBT(NBTTagCompound tag)
|
||||
{
|
||||
super.writeEntityToNBT(tag);
|
||||
tag.setDouble("PushX", this.pushX);
|
||||
tag.setDouble("PushZ", this.pushZ);
|
||||
tag.setShort("Fuel", (short) this.fuel);
|
||||
}
|
||||
|
||||
/**
|
||||
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||
*/
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound tag)
|
||||
{
|
||||
super.readEntityFromNBT(tag);
|
||||
this.pushX = tag.getDouble("PushX");
|
||||
this.pushZ = tag.getDouble("PushZ");
|
||||
this.fuel = tag.getShort("Fuel");
|
||||
}
|
||||
|
||||
protected boolean isMinecartPowered()
|
||||
{
|
||||
return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0;
|
||||
}
|
||||
|
||||
protected void setMinecartPowered(boolean powered)
|
||||
{
|
||||
if (powered)
|
||||
{
|
||||
this.dataWatcher.updateObject(16, (byte) (this.dataWatcher.getWatchableObjectByte(16) | 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.dataWatcher.updateObject(16, (byte) (this.dataWatcher.getWatchableObjectByte(16) & -2));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block func_145817_o()
|
||||
{
|
||||
return InitBlocks.blockSteamBoiler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDefaultDisplayTileData()
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinecartType()
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
}
|
|
@ -1,475 +0,0 @@
|
|||
|
||||
package steamcraft.common.entities;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import steamcraft.common.init.InitItems;
|
||||
import steamcraft.common.items.ItemGrappleGun;
|
||||
|
||||
public class EntityGrapplingHook extends Entity
|
||||
{
|
||||
private int xTile;
|
||||
private int yTile;
|
||||
private int zTile;
|
||||
private Block block;
|
||||
private boolean inGround;
|
||||
public EntityPlayer player;
|
||||
private int ticksInGround;
|
||||
private int ticksInAir;
|
||||
public Entity caughtEntity;
|
||||
private double posX;
|
||||
private double posY;
|
||||
private double posZ;
|
||||
private double hookYaw;
|
||||
private double hookPitch;
|
||||
private int rotationIncrements;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private double clientMotionX;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private double clientMotionY;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private double clientMotionZ;
|
||||
private ItemGrappleGun gun;
|
||||
|
||||
public EntityGrapplingHook(World world)
|
||||
{
|
||||
super(world);
|
||||
this.xTile = -1;
|
||||
this.yTile = -1;
|
||||
this.zTile = -1;
|
||||
this.setSize(0.25F, 0.25F);
|
||||
this.ignoreFrustumCheck = true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EntityGrapplingHook(World world, double x, double y, double z, EntityPlayer player)
|
||||
{
|
||||
this(world);
|
||||
this.setPosition(x, y, z);
|
||||
this.ignoreFrustumCheck = true;
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
public EntityGrapplingHook(World world, EntityPlayer player, ItemGrappleGun gun)
|
||||
{
|
||||
super(world);
|
||||
this.gun = gun;
|
||||
this.xTile = -1;
|
||||
this.yTile = -1;
|
||||
this.zTile = -1;
|
||||
this.ignoreFrustumCheck = true;
|
||||
this.player = player;
|
||||
gun.hook = this;
|
||||
this.setSize(0.25F, 0.25F);
|
||||
this.setLocationAndAngles(player.posX, (player.posY + 1.62D) - player.yOffset, player.posZ, player.rotationYaw, player.rotationPitch);
|
||||
this.posX -= MathHelper.cos((this.rotationYaw / 180.0F) * (float) Math.PI) * 0.16F;
|
||||
this.posY -= 0.10000000149011612D;
|
||||
this.posZ -= MathHelper.sin((this.rotationYaw / 180.0F) * (float) Math.PI) * 0.16F;
|
||||
this.setPosition(this.posX, this.posY, this.posZ);
|
||||
this.yOffset = 0.0F;
|
||||
float f = 0.4F;
|
||||
this.motionX = -MathHelper.sin((this.rotationYaw / 180.0F) * (float) Math.PI)
|
||||
* MathHelper.cos((this.rotationPitch / 180.0F) * (float) Math.PI) * f;
|
||||
this.motionZ = MathHelper.cos((this.rotationYaw / 180.0F) * (float) Math.PI) * MathHelper.cos((this.rotationPitch / 180.0F) * (float) Math.PI)
|
||||
* f;
|
||||
this.motionY = -MathHelper.sin((this.rotationPitch / 180.0F) * (float) Math.PI) * f;
|
||||
this.func_146035_c(this.motionX, this.motionY, this.motionZ, 1.5F, 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void entityInit()
|
||||
{
|
||||
}
|
||||
|
||||
// On Cast
|
||||
public void func_146035_c(double p_146035_1_, double p_146035_3_, double p_146035_5_, float p_146035_7_, float p_146035_8_)
|
||||
{
|
||||
float f2 = MathHelper.sqrt_double((p_146035_1_ * p_146035_1_) + (p_146035_3_ * p_146035_3_) + (p_146035_5_ * p_146035_5_));
|
||||
p_146035_1_ /= f2;
|
||||
p_146035_3_ /= f2;
|
||||
p_146035_5_ /= f2;
|
||||
p_146035_1_ += this.rand.nextGaussian() * 0.007499999832361937D * p_146035_8_;
|
||||
p_146035_3_ += this.rand.nextGaussian() * 0.007499999832361937D * p_146035_8_;
|
||||
p_146035_5_ += this.rand.nextGaussian() * 0.007499999832361937D * p_146035_8_;
|
||||
p_146035_1_ *= p_146035_7_;
|
||||
p_146035_3_ *= p_146035_7_;
|
||||
p_146035_5_ *= p_146035_7_;
|
||||
this.motionX = p_146035_1_;
|
||||
this.motionY = p_146035_3_;
|
||||
this.motionZ = p_146035_5_;
|
||||
float f3 = MathHelper.sqrt_double((p_146035_1_ * p_146035_1_) + (p_146035_5_ * p_146035_5_));
|
||||
this.prevRotationYaw = this.rotationYaw = (float) ((Math.atan2(p_146035_1_, p_146035_5_) * 180.0D) / Math.PI);
|
||||
this.prevRotationPitch = this.rotationPitch = (float) ((Math.atan2(p_146035_3_, f3) * 180.0D) / Math.PI);
|
||||
this.ticksInGround = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the entity is in range to render by using the past in distance
|
||||
* and comparing it to its average edge length * 64 * renderDistanceWeight
|
||||
* Args: distance
|
||||
*/
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isInRangeToRenderDist(double distance)
|
||||
{
|
||||
double d1 = this.boundingBox.getAverageEdgeLength() * 4.0D;
|
||||
d1 *= 64.0D;
|
||||
return distance < (d1 * d1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the position and rotation. Only difference from the other one is no
|
||||
* bounding on the rotation. Args: posX, posY, posZ, yaw, pitch
|
||||
*/
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setPositionAndRotation2(double p_70056_1_, double p_70056_3_, double p_70056_5_, float p_70056_7_, float p_70056_8_, int p_70056_9_)
|
||||
{
|
||||
this.posX = p_70056_1_;
|
||||
this.posY = p_70056_3_;
|
||||
this.posZ = p_70056_5_;
|
||||
this.hookYaw = p_70056_7_;
|
||||
this.hookPitch = p_70056_8_;
|
||||
this.rotationIncrements = p_70056_9_;
|
||||
this.motionX = this.clientMotionX;
|
||||
this.motionY = this.clientMotionY;
|
||||
this.motionZ = this.clientMotionZ;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the velocity to the args. Args: x, y, z
|
||||
*/
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setVelocity(double p_70016_1_, double p_70016_3_, double p_70016_5_)
|
||||
{
|
||||
this.clientMotionX = this.motionX = p_70016_1_;
|
||||
this.clientMotionY = this.motionY = p_70016_3_;
|
||||
this.clientMotionZ = this.motionZ = p_70016_5_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to update the entity's position/logic.
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
if (this.rotationIncrements > 0)
|
||||
{
|
||||
double d7 = this.posX + ((this.posX - this.posX) / this.rotationIncrements);
|
||||
double d8 = this.posY + ((this.posY - this.posY) / this.rotationIncrements);
|
||||
double d9 = this.posZ + ((this.posZ - this.posZ) / this.rotationIncrements);
|
||||
double d1 = MathHelper.wrapAngleTo180_double(this.hookYaw - this.rotationYaw);
|
||||
this.rotationYaw = (float) (this.rotationYaw + (d1 / this.rotationIncrements));
|
||||
this.rotationPitch = (float) (this.rotationPitch + ((this.hookPitch - this.rotationPitch) / this.rotationIncrements));
|
||||
--this.rotationIncrements;
|
||||
this.setPosition(d7, d8, d9);
|
||||
this.setRotation(this.rotationYaw, this.rotationPitch);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!this.worldObj.isRemote && (this.player != null))
|
||||
{
|
||||
ItemStack itemstack = this.player.getCurrentEquippedItem();
|
||||
|
||||
if (!this.player.isEntityAlive() || (itemstack == null) || (itemstack.getItem() != InitItems.itemGrappleGun)
|
||||
|| (this.getDistanceSqToEntity(this.player) > 1024.0D))
|
||||
{
|
||||
this.setDead();
|
||||
this.gun.hook = null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.caughtEntity != null)
|
||||
{
|
||||
if (!this.caughtEntity.isDead)
|
||||
{
|
||||
this.posX = this.caughtEntity.posX;
|
||||
this.posY = this.caughtEntity.boundingBox.minY + (this.caughtEntity.height * 0.8D);
|
||||
this.posZ = this.caughtEntity.posZ;
|
||||
return;
|
||||
}
|
||||
|
||||
this.caughtEntity = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.inGround)
|
||||
{
|
||||
if (this.worldObj.getBlock(this.xTile, this.yTile, this.zTile) == this.block)
|
||||
{
|
||||
++this.ticksInGround;
|
||||
|
||||
if (this.ticksInGround == 1200)
|
||||
{
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
this.inGround = false;
|
||||
this.motionX *= this.rand.nextFloat() * 0.2F;
|
||||
this.motionY *= this.rand.nextFloat() * 0.2F;
|
||||
this.motionZ *= this.rand.nextFloat() * 0.2F;
|
||||
this.ticksInGround = 0;
|
||||
this.ticksInAir = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
++this.ticksInAir;
|
||||
}
|
||||
|
||||
Vec3 vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
|
||||
Vec3 vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||
MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec31, vec3);
|
||||
vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
|
||||
vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||
|
||||
if (movingobjectposition != null)
|
||||
{
|
||||
vec3 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord,
|
||||
movingobjectposition.hitVec.zCoord);
|
||||
}
|
||||
|
||||
Entity entity = null;
|
||||
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this,
|
||||
this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
|
||||
double d0 = 0.0D;
|
||||
double d2;
|
||||
|
||||
for (Object obj : list)
|
||||
{
|
||||
Entity entity1 = (Entity) obj;
|
||||
|
||||
if (entity1.canBeCollidedWith() && ((entity1 != this.player) || (this.ticksInAir >= 5)))
|
||||
{
|
||||
float f = 0.3F;
|
||||
AxisAlignedBB axisalignedbb = entity1.boundingBox.expand(f, f, f);
|
||||
MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec31, vec3);
|
||||
|
||||
if (movingobjectposition1 != null)
|
||||
{
|
||||
d2 = vec31.distanceTo(movingobjectposition1.hitVec);
|
||||
|
||||
if ((d2 < d0) || (d0 == 0.0D))
|
||||
{
|
||||
entity = entity1;
|
||||
d0 = d2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (entity != null)
|
||||
{
|
||||
movingobjectposition = new MovingObjectPosition(entity);
|
||||
}
|
||||
|
||||
if (movingobjectposition != null)
|
||||
{
|
||||
if (movingobjectposition.entityHit != null)
|
||||
{
|
||||
if (movingobjectposition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.player), 0.0F))
|
||||
{
|
||||
this.caughtEntity = movingobjectposition.entityHit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.inGround = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.inGround)
|
||||
{
|
||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
float f5 = MathHelper.sqrt_double((this.motionX * this.motionX) + (this.motionZ * this.motionZ));
|
||||
this.rotationYaw = (float) ((Math.atan2(this.motionX, this.motionZ) * 180.0D) / Math.PI);
|
||||
|
||||
for (this.rotationPitch = (float) ((Math.atan2(this.motionY, f5) * 180.0D) / Math.PI); (this.rotationPitch
|
||||
- this.prevRotationPitch) < -180.0F; this.prevRotationPitch -= 360.0F)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
while ((this.rotationPitch - this.prevRotationPitch) >= 180.0F)
|
||||
{
|
||||
this.prevRotationPitch += 360.0F;
|
||||
}
|
||||
|
||||
while ((this.rotationYaw - this.prevRotationYaw) < -180.0F)
|
||||
{
|
||||
this.prevRotationYaw -= 360.0F;
|
||||
}
|
||||
|
||||
while ((this.rotationYaw - this.prevRotationYaw) >= 180.0F)
|
||||
{
|
||||
this.prevRotationYaw += 360.0F;
|
||||
}
|
||||
|
||||
this.rotationPitch = this.prevRotationPitch + ((this.rotationPitch - this.prevRotationPitch) * 0.2F);
|
||||
this.rotationYaw = this.prevRotationYaw + ((this.rotationYaw - this.prevRotationYaw) * 0.2F);
|
||||
float f6 = 0.92F;
|
||||
|
||||
if (this.onGround || this.isCollidedHorizontally)
|
||||
{
|
||||
f6 = 0.5F;
|
||||
}
|
||||
|
||||
byte b0 = 5;
|
||||
double d10 = 0.0D;
|
||||
|
||||
for (int j = 0; j < b0; ++j)
|
||||
{
|
||||
double d3 = ((this.boundingBox.minY + (((this.boundingBox.maxY - this.boundingBox.minY) * (j + 0)) / b0)) - 0.125D) + 0.125D;
|
||||
double d4 = ((this.boundingBox.minY + (((this.boundingBox.maxY - this.boundingBox.minY) * (j + 1)) / b0)) - 0.125D) + 0.125D;
|
||||
AxisAlignedBB axisalignedbb1 = AxisAlignedBB.getBoundingBox(this.boundingBox.minX, d3, this.boundingBox.minZ,
|
||||
this.boundingBox.maxX, d4, this.boundingBox.maxZ);
|
||||
|
||||
if (this.worldObj.isAABBInMaterial(axisalignedbb1, Material.water))
|
||||
{
|
||||
d10 += 1.0D / b0;
|
||||
}
|
||||
}
|
||||
|
||||
d2 = (d10 * 2.0D) - 1.0D;
|
||||
this.motionY += 0.03999999910593033D * d2;
|
||||
|
||||
if (d10 > 0.0D)
|
||||
{
|
||||
f6 = (float) (f6 * 0.9D);
|
||||
this.motionY *= 0.8D;
|
||||
}
|
||||
|
||||
this.motionX *= f6;
|
||||
this.motionY *= f6;
|
||||
this.motionZ *= f6;
|
||||
this.setPosition(this.posX, this.posY, this.posZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||
*/
|
||||
@Override
|
||||
public void writeEntityToNBT(NBTTagCompound comp)
|
||||
{
|
||||
comp.setShort("xTile", (short) this.xTile);
|
||||
comp.setShort("yTile", (short) this.yTile);
|
||||
comp.setShort("zTile", (short) this.zTile);
|
||||
comp.setByte("inTile", (byte) Block.getIdFromBlock(this.block));
|
||||
comp.setByte("inGround", (byte) (this.inGround ? 1 : 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||
*/
|
||||
@Override
|
||||
public void readEntityFromNBT(NBTTagCompound p_70037_1_)
|
||||
{
|
||||
this.xTile = p_70037_1_.getShort("xTile");
|
||||
this.yTile = p_70037_1_.getShort("yTile");
|
||||
this.zTile = p_70037_1_.getShort("zTile");
|
||||
this.block = Block.getBlockById(p_70037_1_.getByte("inTile") & 255);
|
||||
this.inGround = p_70037_1_.getByte("inGround") == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getShadowSize()
|
||||
{
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
// Retract Hook and Calculate Damage
|
||||
public int func_146034_e()
|
||||
{
|
||||
if (this.worldObj.isRemote)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
byte damageTaken = 0;
|
||||
|
||||
if (this.caughtEntity != null)
|
||||
{
|
||||
if (this.caughtEntity.height < this.player.height)
|
||||
{
|
||||
double d0 = this.player.posX - this.posX;
|
||||
double d2 = this.player.posY - this.posY;
|
||||
double d4 = this.player.posZ - this.posZ;
|
||||
double d6 = MathHelper.sqrt_double((d0 * d0) + (d2 * d2) + (d4 * d4));
|
||||
double d8 = 0.3D;
|
||||
this.caughtEntity.motionX += d0 * d8;
|
||||
this.caughtEntity.motionY += (d2 * d8) + (MathHelper.sqrt_double(d6) * 0.08D);
|
||||
this.caughtEntity.motionZ += d4 * d8;
|
||||
damageTaken = 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
double d0 = this.player.posX - this.posX;
|
||||
double d2 = this.player.posY - this.posY;
|
||||
double d4 = this.player.posZ - this.posZ;
|
||||
double d6 = MathHelper.sqrt_double((d0 * d0) + (d2 * d2) + (d4 * d4));
|
||||
double d8 = 0.3D;
|
||||
this.player.motionX += -(d0 * d8);
|
||||
this.player.motionY += -((d2 * d8) + (MathHelper.sqrt_double(d6) * 0.08D));
|
||||
this.player.motionZ += -(d4 * d8);
|
||||
damageTaken = 3;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* double d1 = this.player.posX - this.posX; double d3 =
|
||||
* this.player.posY - this.posY; double d5 = this.player.posZ -
|
||||
* this.posZ; double d7 = (double)MathHelper.sqrt_double(d1 * d1 +
|
||||
* d3 * d3 + d5 * d5); double d9 = 0.1D; player.motionX = -(d1 *
|
||||
* d9); player.motionY = -(d3 * d9 +
|
||||
* (double)MathHelper.sqrt_double(d7) * 0.08D); player.motionZ =
|
||||
* -(d5 * d9); b0 = 1;
|
||||
*/
|
||||
|
||||
if (this.inGround)
|
||||
{
|
||||
damageTaken = 2;
|
||||
}
|
||||
|
||||
this.setDead();
|
||||
this.gun.hook = null;
|
||||
return damageTaken;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Will get destroyed next tick.
|
||||
*/
|
||||
@Override
|
||||
public void setDead()
|
||||
{
|
||||
super.setDead();
|
||||
|
||||
if (this.player != null)
|
||||
{
|
||||
this.gun.hook = null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -13,17 +13,20 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
|||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
|
||||
import boilerplate.common.baseclasses.blocks.BaseBlock;
|
||||
import boilerplate.common.baseclasses.blocks.BlockCustomDoubleSlab;
|
||||
import boilerplate.common.baseclasses.blocks.BlockCustomFence;
|
||||
import boilerplate.common.baseclasses.blocks.BlockCustomLeaves;
|
||||
import boilerplate.common.baseclasses.blocks.BlockCustomLog;
|
||||
import boilerplate.common.baseclasses.items.BaseItemBlockWithMetadata;
|
||||
import boilerplate.common.baseclasses.blocks.BlockCustomSlab;
|
||||
import boilerplate.common.baseclasses.blocks.BlockCustomStairs;
|
||||
import boilerplate.common.baseclasses.blocks.BlockCustomWall;
|
||||
import boilerplate.common.baseclasses.items.BaseMetadataItemBlock;
|
||||
import boilerplate.common.compathandler.FMPCompatHandler;
|
||||
import boilerplate.common.utils.helpers.RegistryHelper;
|
||||
import org.apache.commons.lang3.text.WordUtils;
|
||||
import steamcraft.client.renderers.tile.TileHatchRenderer.TileHatch;
|
||||
import steamcraft.common.Steamcraft;
|
||||
import steamcraft.common.blocks.BaseBlock;
|
||||
import steamcraft.common.blocks.BlockBoulder;
|
||||
import steamcraft.common.blocks.BlockBrassLeaves;
|
||||
import steamcraft.common.blocks.BlockBrassLog;
|
||||
|
@ -31,12 +34,8 @@ import steamcraft.common.blocks.BlockCastIronFence;
|
|||
import steamcraft.common.blocks.BlockCastIronGate;
|
||||
import steamcraft.common.blocks.BlockCastIronLamp;
|
||||
import steamcraft.common.blocks.BlockCastIronRailing;
|
||||
import steamcraft.common.blocks.BlockCompressedStone;
|
||||
import steamcraft.common.blocks.BlockCongealedSlime;
|
||||
import steamcraft.common.blocks.BlockCustomMushroom;
|
||||
import steamcraft.common.blocks.BlockCustomSlab;
|
||||
import steamcraft.common.blocks.BlockCustomStairs;
|
||||
import steamcraft.common.blocks.BlockCustomWall;
|
||||
import steamcraft.common.blocks.BlockDynamite;
|
||||
import steamcraft.common.blocks.BlockFissurePortal;
|
||||
import steamcraft.common.blocks.BlockHatch;
|
||||
|
@ -270,10 +269,10 @@ public class InitBlocks
|
|||
registerBlock(blockCastIronRailing, "BlockCastIronRailing");
|
||||
|
||||
blockStonebrickWall = new BlockStonebrickWall().setBlockName("blockStonebrickWall");
|
||||
registerBlock(blockStonebrickWall, BaseItemBlockWithMetadata.class, "BlockStonebrickWall", 0);
|
||||
blockStoneslabWall = new BlockCustomWall(Blocks.stone_slab, 0).setBlockName("blockStoneslabWall");
|
||||
registerBlock(blockStonebrickWall, BaseMetadataItemBlock.class, "BlockStonebrickWall", 0);
|
||||
blockStoneslabWall = new BlockCustomWall(Blocks.stone_slab, 0, Steamcraft.instance).setBlockName("blockStoneslabWall");
|
||||
registerBlock(blockStoneslabWall, "BlockStoneslabWall");
|
||||
blockBrickWall = new BlockCustomWall(Blocks.brick_block, 0).setBlockName("blockBrickWall");
|
||||
blockBrickWall = new BlockCustomWall(Blocks.brick_block, 0, Steamcraft.instance).setBlockName("blockBrickWall");
|
||||
registerBlock(blockBrickWall, "BlockBrickWall");
|
||||
}
|
||||
|
||||
|
@ -382,81 +381,84 @@ public class InitBlocks
|
|||
blockSlate = new BlockSlate().setBlockName("blockSlate");
|
||||
blockLightSlate = new BlockLightSlate().setBlockName("blockLightSlate");
|
||||
|
||||
blockRawBlueSlateStairs = new BlockCustomStairs(blockSlate, 0).setBlockName("blockRawBlueSlateStairs");
|
||||
blockRawBlueSlateStairs = new BlockCustomStairs(blockSlate, 0, Steamcraft.instance).setBlockName("blockRawBlueSlateStairs");
|
||||
registerBlock(blockRawBlueSlateStairs, "BlockRawBlueSlateStairs");
|
||||
blockRawBlackSlateStairs = new BlockCustomStairs(blockSlate, 1).setBlockName("blockRawBlackSlateStairs");
|
||||
blockRawBlackSlateStairs = new BlockCustomStairs(blockSlate, 1, Steamcraft.instance).setBlockName("blockRawBlackSlateStairs");
|
||||
registerBlock(blockRawBlackSlateStairs, "BlockRawBlackSlateStairs");
|
||||
blockRawRedSlateStairs = new BlockCustomStairs(blockSlate, 2).setBlockName("blockRawRedSlateStairs");
|
||||
blockRawRedSlateStairs = new BlockCustomStairs(blockSlate, 2, Steamcraft.instance).setBlockName("blockRawRedSlateStairs");
|
||||
registerBlock(blockRawRedSlateStairs, "BlockRawRedSlateStairs");
|
||||
blockCobbleBlueSlateStairs = new BlockCustomStairs(blockSlate, 3).setBlockName("blockCobbleBlueSlateStairs");
|
||||
blockCobbleBlueSlateStairs = new BlockCustomStairs(blockSlate, 3, Steamcraft.instance).setBlockName("blockCobbleBlueSlateStairs");
|
||||
registerBlock(blockCobbleBlueSlateStairs, "BlockCobbleBlueSlateStairs");
|
||||
blockCobbleBlackSlateStairs = new BlockCustomStairs(blockSlate, 4).setBlockName("blockCobbleBlackSlateStairs");
|
||||
blockCobbleBlackSlateStairs = new BlockCustomStairs(blockSlate, 4, Steamcraft.instance).setBlockName("blockCobbleBlackSlateStairs");
|
||||
registerBlock(blockCobbleBlackSlateStairs, "BlockCobbleBlackSlateStairs");
|
||||
blockCobbleRedSlateStairs = new BlockCustomStairs(blockSlate, 5).setBlockName("blockCobbleRedSlateStairs");
|
||||
blockCobbleRedSlateStairs = new BlockCustomStairs(blockSlate, 5, Steamcraft.instance).setBlockName("blockCobbleRedSlateStairs");
|
||||
registerBlock(blockCobbleRedSlateStairs, "BlockCobbleRedSlateStairs");
|
||||
blockBrickBlueSlateStairs = new BlockCustomStairs(blockSlate, 6).setBlockName("blockBrickBlueSlateStairs");
|
||||
blockBrickBlueSlateStairs = new BlockCustomStairs(blockSlate, 6, Steamcraft.instance).setBlockName("blockBrickBlueSlateStairs");
|
||||
registerBlock(blockBrickBlueSlateStairs, "BlockBrickBlueSlateStairs");
|
||||
blockBrickBlackSlateStairs = new BlockCustomStairs(blockSlate, 7).setBlockName("blockBrickBlackSlateStairs");
|
||||
blockBrickBlackSlateStairs = new BlockCustomStairs(blockSlate, 7, Steamcraft.instance).setBlockName("blockBrickBlackSlateStairs");
|
||||
registerBlock(blockBrickBlackSlateStairs, "BlockBrickBlackSlateStairs");
|
||||
blockBrickRedSlateStairs = new BlockCustomStairs(blockSlate, 8).setBlockName("blockBrickRedSlateStairs");
|
||||
blockBrickRedSlateStairs = new BlockCustomStairs(blockSlate, 8, Steamcraft.instance).setBlockName("blockBrickRedSlateStairs");
|
||||
registerBlock(blockBrickRedSlateStairs, "BlockBrickRedSlateStairs");
|
||||
|
||||
blockRawLightBlueSlateStairs = new BlockCustomStairs(blockLightSlate, 0).setBlockName("blockRawLightBlueSlateStairs");
|
||||
blockRawLightBlueSlateStairs = new BlockCustomStairs(blockLightSlate, 0, Steamcraft.instance).setBlockName("blockRawLightBlueSlateStairs");
|
||||
registerBlock(blockRawLightBlueSlateStairs, "BlockRawLightBlueSlateStairs");
|
||||
blockRawGreySlateStairs = new BlockCustomStairs(blockLightSlate, 1).setBlockName("blockRawGreySlateStairs");
|
||||
blockRawGreySlateStairs = new BlockCustomStairs(blockLightSlate, 1, Steamcraft.instance).setBlockName("blockRawGreySlateStairs");
|
||||
registerBlock(blockRawGreySlateStairs, "BlockRawGreySlateStairs");
|
||||
blockRawLightRedSlateStairs = new BlockCustomStairs(blockLightSlate, 2).setBlockName("blockRawLightRedSlateStairs");
|
||||
blockRawLightRedSlateStairs = new BlockCustomStairs(blockLightSlate, 2, Steamcraft.instance).setBlockName("blockRawLightRedSlateStairs");
|
||||
registerBlock(blockRawLightRedSlateStairs, "BlockRawLightRedSlateStairs");
|
||||
blockCobbleLightBlueSlateStairs = new BlockCustomStairs(blockLightSlate, 3).setBlockName("blockCobbleLightBlueSlateStairs");
|
||||
blockCobbleLightBlueSlateStairs = new BlockCustomStairs(blockLightSlate, 3, Steamcraft.instance)
|
||||
.setBlockName("blockCobbleLightBlueSlateStairs");
|
||||
registerBlock(blockCobbleLightBlueSlateStairs, "BlockCobbleLightBlueSlateStairs");
|
||||
blockCobbleGreySlateStairs = new BlockCustomStairs(blockLightSlate, 4).setBlockName("blockCobbleGreySlateStairs");
|
||||
blockCobbleGreySlateStairs = new BlockCustomStairs(blockLightSlate, 4, Steamcraft.instance).setBlockName("blockCobbleGreySlateStairs");
|
||||
registerBlock(blockCobbleGreySlateStairs, "BlockCobbleGreySlateStairs");
|
||||
blockCobbleLightRedSlateStairs = new BlockCustomStairs(blockLightSlate, 5).setBlockName("blockCobbleLightRedSlateStairs");
|
||||
blockCobbleLightRedSlateStairs = new BlockCustomStairs(blockLightSlate, 5, Steamcraft.instance)
|
||||
.setBlockName("blockCobbleLightRedSlateStairs");
|
||||
registerBlock(blockCobbleLightRedSlateStairs, "BlockCobbleLightRedSlateStairs");
|
||||
blockBrickLightBlueSlateStairs = new BlockCustomStairs(blockLightSlate, 6).setBlockName("blockBrickLightBlueSlateStairs");
|
||||
blockBrickLightBlueSlateStairs = new BlockCustomStairs(blockLightSlate, 6, Steamcraft.instance)
|
||||
.setBlockName("blockBrickLightBlueSlateStairs");
|
||||
registerBlock(blockBrickLightBlueSlateStairs, "BlockBrickLightBlueSlateStairs");
|
||||
blockBrickGreySlateStairs = new BlockCustomStairs(blockLightSlate, 7).setBlockName("blockBrickGreySlateStairs");
|
||||
blockBrickGreySlateStairs = new BlockCustomStairs(blockLightSlate, 7, Steamcraft.instance).setBlockName("blockBrickGreySlateStairs");
|
||||
registerBlock(blockBrickGreySlateStairs, "BlockBrickGreySlateStairs");
|
||||
blockBrickLightRedSlateStairs = new BlockCustomStairs(blockLightSlate, 8).setBlockName("blockBrickLightRedSlateStairs");
|
||||
blockBrickLightRedSlateStairs = new BlockCustomStairs(blockLightSlate, 8, Steamcraft.instance).setBlockName("blockBrickLightRedSlateStairs");
|
||||
registerBlock(blockBrickLightRedSlateStairs, "BlockBrickLightRedSlateStairs");
|
||||
|
||||
registerBlock(blockCustomOre, BaseItemBlockWithMetadata.class, "BlockSteamcraftOre", 7);
|
||||
registerBlock(blockSlate, BaseItemBlockWithMetadata.class, "BlockSlate", 9);
|
||||
registerBlock(blockLightSlate, BaseItemBlockWithMetadata.class, "BlockLightSlate", 9);
|
||||
registerBlock(blockCustomOre, BaseMetadataItemBlock.class, "BlockSteamcraftOre", 7);
|
||||
registerBlock(blockSlate, BaseMetadataItemBlock.class, "BlockSlate", 9);
|
||||
registerBlock(blockLightSlate, BaseMetadataItemBlock.class, "BlockLightSlate", 9);
|
||||
|
||||
// TODO Move this
|
||||
// Metals
|
||||
blockMetal = new BlockMetal().setBlockName("blockMetal");
|
||||
registerBlock(blockMetal, BaseItemBlockWithMetadata.class, "BlockMetal", 8);
|
||||
registerBlock(blockMetal, BaseMetadataItemBlock.class, "BlockMetal", 8);
|
||||
blockRustyMetal = new BlockRustyMetal().setBlockName("blockRustyMetal");
|
||||
registerBlock(blockRustyMetal, BaseItemBlockWithMetadata.class, "BlockRustyMetal", 8);
|
||||
registerBlock(blockRustyMetal, BaseMetadataItemBlock.class, "BlockRustyMetal", 8);
|
||||
blockMossyMetal = new BlockMossyMetal().setBlockName("blockMossyMetal");
|
||||
registerBlock(blockMossyMetal, BaseItemBlockWithMetadata.class, "BlockMossyMetal", 8);
|
||||
registerBlock(blockMossyMetal, BaseMetadataItemBlock.class, "BlockMossyMetal", 8);
|
||||
|
||||
blockMetalPlate = new BlockPlating(blockMetal).setBlockName("blockMetalPlate");
|
||||
registerBlock(blockMetalPlate, BaseItemBlockWithMetadata.class, "BlockMetalPlating", 8);
|
||||
registerBlock(blockMetalPlate, BaseMetadataItemBlock.class, "BlockMetalPlating", 8);
|
||||
blockRustyMetalPlate = new BlockPlating(blockRustyMetal).setBlockName("blockRustyMetalPlate");
|
||||
registerBlock(blockRustyMetalPlate, BaseItemBlockWithMetadata.class, "BlockRustyMetalPlating", 8);
|
||||
registerBlock(blockRustyMetalPlate, BaseMetadataItemBlock.class, "BlockRustyMetalPlating", 8);
|
||||
blockMossyMetalPlate = new BlockPlating(blockMossyMetal).setBlockName("blockMossyMetalPlate");
|
||||
registerBlock(blockMossyMetalPlate, BaseItemBlockWithMetadata.class, "BlockMossyMetalPlating", 8);
|
||||
registerBlock(blockMossyMetalPlate, BaseMetadataItemBlock.class, "BlockMossyMetalPlating", 8);
|
||||
|
||||
blockMetalLattice = new BlockMetalLattice("").setBlockName("blockMetalLattice");
|
||||
registerBlock(blockMetalLattice, BaseItemBlockWithMetadata.class, "BlockMetalLattice", 16);
|
||||
registerBlock(blockMetalLattice, BaseMetadataItemBlock.class, "BlockMetalLattice", 16);
|
||||
blockRustyMetalLattice = new BlockMetalLattice("Rusty").setBlockName("blockRustyMetalLattice");
|
||||
registerBlock(blockRustyMetalLattice, BaseItemBlockWithMetadata.class, "BlockRustyMetalLattice", 16);
|
||||
registerBlock(blockRustyMetalLattice, BaseMetadataItemBlock.class, "BlockRustyMetalLattice", 16);
|
||||
blockMossyMetalLattice = new BlockMetalLattice("Mossy").setBlockName("blockMossyMetalLattice");
|
||||
registerBlock(blockMossyMetalLattice, BaseItemBlockWithMetadata.class, "BlockMossyMetalLattice", 16);
|
||||
registerBlock(blockMossyMetalLattice, BaseMetadataItemBlock.class, "BlockMossyMetalLattice", 16);
|
||||
|
||||
blockVanillaLattice = new BlockVanillaLattice().setBlockName("blockVanillaLattice");
|
||||
registerBlock(blockVanillaLattice, BaseItemBlockWithMetadata.class, "BlockVanillaLattice", 4);
|
||||
registerBlock(blockVanillaLattice, BaseMetadataItemBlock.class, "BlockVanillaLattice", 4);
|
||||
|
||||
blockVanillaScaffold = new BlockScaffold(new String[] { "Oak", "Spruce", "Birch", "Jungle", "Acacia", "DarkOak", /* TODO */"ThinOak",
|
||||
"ThinSpruce", "ThinBirch", "ThinJungle", "ThinAcacia", "ThinDarkOak" }).setBlockName("blockVanillaScaffold");
|
||||
registerBlock(blockVanillaScaffold, BaseItemBlockWithMetadata.class, "BlockVanillaScaffold", 12);
|
||||
registerBlock(blockVanillaScaffold, BaseMetadataItemBlock.class, "BlockVanillaScaffold", 12);
|
||||
|
||||
blockModScaffold = new BlockScaffold(new String[] { "Redwood", "Mangrove", "Willow", "Petrified", "Polished", "ThinRedwood", "ThinMangrove",
|
||||
"ThinWillow", "ThinPetrified", "ThinPolished" }).setBlockName("blockModScaffold");
|
||||
registerBlock(blockModScaffold, BaseItemBlockWithMetadata.class, "BlockModScaffold", 10);
|
||||
registerBlock(blockModScaffold, BaseMetadataItemBlock.class, "BlockModScaffold", 10);
|
||||
|
||||
blockUranium = new BlockUranium(Material.iron).setBlockName("blockUranium");
|
||||
registerBlock(blockUranium, "BlockUranium");
|
||||
|
@ -473,7 +475,7 @@ public class InitBlocks
|
|||
blockHatch = new BlockHatch().setBlockName("blockHatch");
|
||||
RegistryHelper.registerContainerBlock(blockHatch, TileHatch.class, "BlockHatch");
|
||||
|
||||
blockFlesh = new BaseBlock(Material.gourd).setBlockName("blockFlesh").setCreativeTab(Steamcraft.tabSC2);
|
||||
blockFlesh = new BaseBlock(Material.gourd, Steamcraft.instance).setBlockName("blockFlesh").setCreativeTab(Steamcraft.tabSC2);
|
||||
registerBlock(blockFlesh, "BlockFlesh");
|
||||
|
||||
blockCongealedSlime = new BlockCongealedSlime(Material.gourd).setBlockName("blockCongealedSlime").setCreativeTab(Steamcraft.tabSC2);
|
||||
|
@ -521,7 +523,8 @@ public class InitBlocks
|
|||
blockFissurePortal = new BlockFissurePortal(Material.rock).setBlockName("blockFissurePortal");
|
||||
registerBlock(blockFissurePortal, "BlockFissurePortal");
|
||||
|
||||
blockCompressedStone = new BlockCompressedStone(Material.rock);
|
||||
blockCompressedStone = new BaseBlock(Material.rock, Steamcraft.instance).setBlockName("blockCompressedStone").setHardness(2.2F)
|
||||
.setResistance(15.0F);
|
||||
registerBlock(blockCompressedStone, "BlockCompressedStone");
|
||||
|
||||
blockInfestedGrass = new BlockInfestedGrass(Material.grass).setBlockName("blockInfestedGrass");
|
||||
|
@ -540,7 +543,7 @@ public class InitBlocks
|
|||
registerBlock(blockMoss, "BlockMoss");
|
||||
|
||||
blockPolishedPlanks = new BlockPolishedPlanks().setBlockName("blockPolishedPlanks");
|
||||
registerBlock(blockPolishedPlanks, BaseItemBlockWithMetadata.class, "BlockPolishedPlanks", 3);
|
||||
registerBlock(blockPolishedPlanks, BaseMetadataItemBlock.class, "BlockPolishedPlanks", 3);
|
||||
|
||||
blockRedwoodLog = new BlockCustomLog("Redwood", Steamcraft.instance).setBlockName("blockRedwoodLog");
|
||||
registerBlock(blockRedwoodLog, "BlockRedwoodLog");
|
||||
|
@ -548,7 +551,7 @@ public class InitBlocks
|
|||
blockRedwoodLeaves = new BlockCustomLeaves("Redwood", Steamcraft.instance).setBlockName("blockRedwoodLeaves");
|
||||
registerBlock(blockRedwoodLeaves, "BlockRedwoodLeaves");
|
||||
|
||||
blockRedwoodPlanks = new BaseBlock(Material.wood).setBlockName("blockRedwoodPlanks");
|
||||
blockRedwoodPlanks = new BaseBlock(Material.wood, Steamcraft.instance).setBlockName("blockRedwoodPlanks");
|
||||
registerBlock(blockRedwoodPlanks, "BlockRedwoodPlanks");
|
||||
|
||||
blockMangroveLog = new BlockCustomLog("Mangrove", Steamcraft.instance).setBlockName("blockMangroveLog");
|
||||
|
@ -557,7 +560,7 @@ public class InitBlocks
|
|||
blockMangroveLeaves = new BlockCustomLeaves("Mangrove", Steamcraft.instance).setBlockName("blockMangroveLeaves");
|
||||
registerBlock(blockMangroveLeaves, "BlockMangroveLeaves");
|
||||
|
||||
blockMangrovePlanks = new BaseBlock(Material.wood).setBlockName("blockMangrovePlanks");
|
||||
blockMangrovePlanks = new BaseBlock(Material.wood, Steamcraft.instance).setBlockName("blockMangrovePlanks");
|
||||
registerBlock(blockMangrovePlanks, "BlockMangrovePlanks");
|
||||
|
||||
blockWillowLog = new BlockCustomLog("Willow", Steamcraft.instance).setBlockName("blockWillowLog");
|
||||
|
@ -566,7 +569,7 @@ public class InitBlocks
|
|||
blockWillowLeaves = new BlockCustomLeaves("Willow", Steamcraft.instance).setBlockName("blockWillowLeaves");
|
||||
registerBlock(blockWillowLeaves, "BlockWillowLeaves");
|
||||
|
||||
blockWillowPlanks = new BaseBlock(Material.wood).setBlockName("blockWillowPlanks");
|
||||
blockWillowPlanks = new BaseBlock(Material.wood, Steamcraft.instance).setBlockName("blockWillowPlanks");
|
||||
registerBlock(blockWillowPlanks, "BlockWillowPlanks");
|
||||
|
||||
blockPetrifiedLog = new BlockCustomLog("Petrified", Steamcraft.instance).setBlockName("blockPetrifiedLog");
|
||||
|
@ -575,7 +578,7 @@ public class InitBlocks
|
|||
blockDeadLeaves = new BlockCustomLeaves("Dead", Steamcraft.instance).setBlockName("blockDeadLeaves");
|
||||
registerBlock(blockDeadLeaves, "BlockDeadLeaves");
|
||||
|
||||
blockPetrifiedPlanks = new BaseBlock(Material.wood).setBlockName("blockPetrifiedPlanks");
|
||||
blockPetrifiedPlanks = new BaseBlock(Material.wood, Steamcraft.instance).setBlockName("blockPetrifiedPlanks");
|
||||
registerBlock(blockPetrifiedPlanks, "BlockPetrifiedPlanks");
|
||||
|
||||
blockRedwoodFence = new BlockCustomFence("blockRedwoodPlanks", Material.wood, Steamcraft.instance).setBlockName("blockRedwoodFence");
|
||||
|
@ -590,28 +593,32 @@ public class InitBlocks
|
|||
blockPetrifiedFence = new BlockCustomFence("blockPetrifiedPlanks", Material.wood, Steamcraft.instance).setBlockName("blockPetrifiedFence");
|
||||
registerBlock(blockPetrifiedFence, "blockPetrifiedFence");
|
||||
|
||||
blockRedwoodStairs = new BlockCustomStairs(blockRedwoodPlanks).setBlockName("blockRedwoodStairs");
|
||||
blockRedwoodStairs = new BlockCustomStairs(blockRedwoodPlanks, Steamcraft.instance).setBlockName("blockRedwoodStairs");
|
||||
registerBlock(blockRedwoodStairs, "BlockRedwoodStairs");
|
||||
|
||||
blockMangroveStairs = new BlockCustomStairs(blockMangrovePlanks).setBlockName("blockMangroveStairs");
|
||||
blockMangroveStairs = new BlockCustomStairs(blockMangrovePlanks, Steamcraft.instance).setBlockName("blockMangroveStairs");
|
||||
registerBlock(blockMangroveStairs, "blockMangroveStairs");
|
||||
|
||||
blockWillowStairs = new BlockCustomStairs(blockWillowPlanks).setBlockName("blockWillowStairs");
|
||||
blockWillowStairs = new BlockCustomStairs(blockWillowPlanks, Steamcraft.instance).setBlockName("blockWillowStairs");
|
||||
registerBlock(blockWillowStairs, "blockWillowStairs");
|
||||
|
||||
blockPetrifiedStairs = new BlockCustomStairs(blockPetrifiedPlanks).setBlockName("blockPetrifiedStairs");
|
||||
blockPetrifiedStairs = new BlockCustomStairs(blockPetrifiedPlanks, Steamcraft.instance).setBlockName("blockPetrifiedStairs");
|
||||
registerBlock(blockPetrifiedStairs, "blockPetrifiedStairs");
|
||||
|
||||
blockRedwoodSlab = new BlockCustomSlab("blockRedwoodPlanks", blockRedwoodPlanks, Material.wood).setBlockName("blockRedwoodSlab");
|
||||
blockRedwoodSlab = new BlockCustomSlab("blockRedwoodPlanks", blockRedwoodPlanks, Material.wood, Steamcraft.instance)
|
||||
.setBlockName("blockRedwoodSlab");
|
||||
registerBlock(blockRedwoodSlab, "BlockRedwoodSlab");
|
||||
|
||||
blockMangroveSlab = new BlockCustomSlab("blockMangrovePlanks", blockMangrovePlanks, Material.wood).setBlockName("blockMangroveSlab");
|
||||
blockMangroveSlab = new BlockCustomSlab("blockMangrovePlanks", blockMangrovePlanks, Material.wood, Steamcraft.instance)
|
||||
.setBlockName("blockMangroveSlab");
|
||||
registerBlock(blockMangroveSlab, "blockMangroveSlab");
|
||||
|
||||
blockWillowSlab = new BlockCustomSlab("blockWillowPlanks", blockWillowPlanks, Material.wood).setBlockName("blockWillowSlab");
|
||||
blockWillowSlab = new BlockCustomSlab("blockWillowPlanks", blockWillowPlanks, Material.wood, Steamcraft.instance)
|
||||
.setBlockName("blockWillowSlab");
|
||||
registerBlock(blockWillowSlab, "blockWillowSlab");
|
||||
|
||||
blockPetrifiedSlab = new BlockCustomSlab("blockPetrifiedPlanks", blockPetrifiedPlanks, Material.wood).setBlockName("blockPetrifiedSlab");
|
||||
blockPetrifiedSlab = new BlockCustomSlab("blockPetrifiedPlanks", blockPetrifiedPlanks, Material.wood, Steamcraft.instance)
|
||||
.setBlockName("blockPetrifiedSlab");
|
||||
registerBlock(blockPetrifiedSlab, "blockPetrifiedSlab");
|
||||
|
||||
blockRedwoodDoubleSlab = new BlockCustomDoubleSlab("blockRedwoodPlanks", blockRedwoodPlanks, Material.wood, blockRedwoodSlab,
|
||||
|
|
|
@ -14,42 +14,29 @@ import net.minecraftforge.fluids.FluidContainerRegistry;
|
|||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import boilerplate.common.baseclasses.items.BaseItem;
|
||||
import boilerplate.common.baseclasses.items.BaseMetadataItem;
|
||||
import boilerplate.common.utils.handlers.BucketHandler;
|
||||
import boilerplate.common.utils.helpers.RegistryHelper;
|
||||
import steamcraft.common.Steamcraft;
|
||||
import steamcraft.common.items.BaseItem;
|
||||
import steamcraft.common.items.ItemCanister;
|
||||
import steamcraft.common.items.ItemCoin;
|
||||
import steamcraft.common.items.ItemCustomBucket;
|
||||
import steamcraft.common.items.ItemCustomFood;
|
||||
import steamcraft.common.items.ItemDimensionalPocket;
|
||||
import steamcraft.common.items.ItemFieldManipulator;
|
||||
import steamcraft.common.items.ItemFirearm;
|
||||
import steamcraft.common.items.ItemGrappleGun;
|
||||
import steamcraft.common.items.ItemGunPart;
|
||||
import steamcraft.common.items.ItemHandbook;
|
||||
import steamcraft.common.items.ItemIngot;
|
||||
import steamcraft.common.items.ItemLoreBook;
|
||||
import steamcraft.common.items.ItemMachinePart;
|
||||
import steamcraft.common.items.ItemMatch;
|
||||
import steamcraft.common.items.ItemMobBottle;
|
||||
import steamcraft.common.items.ItemMonsterSpawner;
|
||||
import steamcraft.common.items.ItemNugget;
|
||||
import steamcraft.common.items.ItemNuggetIron;
|
||||
import steamcraft.common.items.ItemParts;
|
||||
import steamcraft.common.items.ItemPowder;
|
||||
import steamcraft.common.items.ItemResource;
|
||||
import steamcraft.common.items.ItemRocket;
|
||||
import steamcraft.common.items.ItemRocketLauncher;
|
||||
import steamcraft.common.items.ItemSheet;
|
||||
import steamcraft.common.items.ItemSpanner;
|
||||
import steamcraft.common.items.ItemSplashLightningBottle;
|
||||
import steamcraft.common.items.ItemTeaSeed;
|
||||
import steamcraft.common.items.ItemTeacup;
|
||||
import steamcraft.common.items.ItemTeapot;
|
||||
import steamcraft.common.items.ItemTimeClock;
|
||||
import steamcraft.common.items.ItemVanillaPowder;
|
||||
import steamcraft.common.items.ItemVanillaSheet;
|
||||
import steamcraft.common.items.ItemWatch;
|
||||
import steamcraft.common.items.ItemWithCraftingDurability;
|
||||
import steamcraft.common.items.armor.ItemBrassArmor;
|
||||
|
@ -59,7 +46,6 @@ import steamcraft.common.items.armor.ItemDivingHelmet;
|
|||
import steamcraft.common.items.armor.ItemMonocle;
|
||||
import steamcraft.common.items.armor.ItemNormalArmor;
|
||||
import steamcraft.common.items.armor.ItemSteamJetpack;
|
||||
import steamcraft.common.items.compat.ItemSteamcraftCluster;
|
||||
import steamcraft.common.items.compat.ItemThaumicMonocle;
|
||||
import steamcraft.common.items.electric.ElectricItem;
|
||||
import steamcraft.common.items.electric.ItemRayGun;
|
||||
|
@ -92,6 +78,7 @@ import steamcraft.common.items.tools.steam.ItemSteamPickaxe;
|
|||
import steamcraft.common.items.tools.steam.ItemSteamShovel;
|
||||
import steamcraft.common.items.tools.steam.ItemSteamSword;
|
||||
import steamcraft.common.items.vanity.ItemTopHat;
|
||||
import steamcraft.common.lib.LibInfo;
|
||||
import steamcraft.common.lib.ModInfo;
|
||||
|
||||
/**
|
||||
|
@ -240,9 +227,9 @@ public class InitItems
|
|||
private static void initializeGuns()
|
||||
{
|
||||
// Ammo
|
||||
itemMusketBall = new BaseItem().setUnlocalizedName("itemMusketBall");
|
||||
itemRifleBullet = new BaseItem().setUnlocalizedName("itemRifleBullet");
|
||||
itemPercussionCap = new BaseItem().setUnlocalizedName("itemPercussionCap");
|
||||
itemMusketBall = new BaseItem(Steamcraft.instance).setUnlocalizedName("itemMusketBall");
|
||||
itemRifleBullet = new BaseItem(Steamcraft.instance).setUnlocalizedName("itemRifleBullet");
|
||||
itemPercussionCap = new BaseItem(Steamcraft.instance).setUnlocalizedName("itemPercussionCap");
|
||||
|
||||
registerItem(itemMusketBall, "ItemMusketBall");
|
||||
registerItem(itemRifleBullet, "ItemRifleBullet");
|
||||
|
@ -283,9 +270,9 @@ public class InitItems
|
|||
|
||||
registerItem(itemRayGun, "ItemRayGun");
|
||||
registerItem(itemShrinkray, "ItemShrinkray");
|
||||
// registerItem(itemLightningGun, "ItemLightningGun");
|
||||
|
||||
itemRocket = new ItemRocket().setUnlocalizedName("itemClockworkRocket").setCreativeTab(Steamcraft.tabSC2);
|
||||
itemRocket = new BaseMetadataItem(Steamcraft.instance, new String[] { "HE", "HEAT", "AP" }).setUnlocalizedName("itemClockworkRocket")
|
||||
.setCreativeTab(Steamcraft.tabSC2);
|
||||
itemClockworkRocketLauncher = new ItemRocketLauncher(50, itemRocket, "steamcraft:rocket", "steamcraft:reload");
|
||||
|
||||
registerItem(itemRocket, "ItemRocket");
|
||||
|
@ -294,13 +281,14 @@ public class InitItems
|
|||
|
||||
private static void initializeMetals()
|
||||
{
|
||||
itemIngot = new ItemIngot().setUnlocalizedName("itemIngot");
|
||||
itemNugget = new ItemNugget().setUnlocalizedName("itemNugget");
|
||||
itemIngot = new BaseMetadataItem(Steamcraft.instance, "metals/", "Ingot", LibInfo.metals).setUnlocalizedName("itemIngot");
|
||||
itemNugget = new BaseMetadataItem(Steamcraft.instance, "metals/", "Nugget", LibInfo.metals).setUnlocalizedName("itemNugget");
|
||||
itemNuggetIron = new ItemNuggetIron().setUnlocalizedName("itemNuggetIron");
|
||||
itemSheet = new ItemSheet().setUnlocalizedName("itemSheet");
|
||||
itemPowder = new ItemPowder().setUnlocalizedName("itemPowder");
|
||||
itemVanillaPowder = new ItemVanillaPowder().setUnlocalizedName("itemVanillaPowder");
|
||||
itemVanillaSheet = new ItemVanillaSheet().setUnlocalizedName("itemVanillaSheet");
|
||||
itemSheet = new BaseMetadataItem(Steamcraft.instance, "metals/", "Sheet", LibInfo.metals).setUnlocalizedName("itemSheet");
|
||||
itemPowder = new BaseMetadataItem(Steamcraft.instance, "metals/", "Ingot", LibInfo.metals).setUnlocalizedName("itemPowder");
|
||||
itemVanillaPowder = new BaseMetadataItem(Steamcraft.instance, "metals/", "Powder", LibInfo.metalsV)
|
||||
.setUnlocalizedName("itemVanillaPowder");
|
||||
itemVanillaSheet = new BaseMetadataItem(Steamcraft.instance, "metals/", "Sheet", LibInfo.metalsV).setUnlocalizedName("itemVanillaSheet");
|
||||
|
||||
registerItem(itemIngot, "ItemIngot");
|
||||
registerItem(itemNugget, "ItemMetalNugget");
|
||||
|
@ -310,10 +298,12 @@ public class InitItems
|
|||
registerItem(itemVanillaPowder, "ItemVanillaMetalPowder");
|
||||
registerItem(itemVanillaSheet, "ItemVanillaMetalSheet");
|
||||
|
||||
itemMachinePart = new ItemMachinePart().setUnlocalizedName("itemMachinePart");
|
||||
itemGunPart = new ItemGunPart().setUnlocalizedName("itemGunPart");
|
||||
itemIronParts = ((ItemParts) new ItemParts().setUnlocalizedName("itemPartsIron")).setMaterial("Iron");
|
||||
itemSteelParts = ((ItemParts) new ItemParts().setUnlocalizedName("itemPartsSteel")).setMaterial("Steel");
|
||||
itemMachinePart = new BaseMetadataItem(Steamcraft.instance, new String[] { "CastIronRod", "ClockworkMechanism", "Grating", "Magnet",
|
||||
"Generator", "Fan", "WireCoil", "Speaker", "InsulatedSheet", "Capacitor" }).setUnlocalizedName("itemMachinePart");
|
||||
itemGunPart = new BaseMetadataItem(Steamcraft.instance, new String[] { "Stock", "MusketBarrel", "RifleBarrel", "Lock", "BrassGunFrame",
|
||||
"GreenFocus", "BlueFocus", "PowerCore", "OverchargedPowerCore", "PistolBarrel", "ShortStock" }).setUnlocalizedName("itemGunPart");
|
||||
itemIronParts = new BaseMetadataItem(Steamcraft.instance, "parts/", "Iron", LibInfo.parts).setUnlocalizedName("itemPartsIron");
|
||||
itemSteelParts = new BaseMetadataItem(Steamcraft.instance, "parts/", "Steel", LibInfo.parts).setUnlocalizedName("itemPartsSteel");
|
||||
|
||||
registerItem(itemMachinePart, "ItemMachinePart");
|
||||
registerItem(itemGunPart, "ItemGunPart");
|
||||
|
@ -326,7 +316,8 @@ public class InitItems
|
|||
/**
|
||||
* Registration of these are handled in @link={CompatibilityLayer.class}
|
||||
*/
|
||||
itemSteamcraftCluster = new ItemSteamcraftCluster().setUnlocalizedName("itemSteamcraftCluster");
|
||||
itemSteamcraftCluster = new BaseMetadataItem(Steamcraft.instance, "Cluster", new String[] { "Zinc", "Aluminum" })
|
||||
.setUnlocalizedName("itemSteamcraftCluster");
|
||||
|
||||
itemThaumicMonocle = new ItemThaumicMonocle().setUnlocalizedName("itemThaumicMonocle");
|
||||
}
|
||||
|
@ -355,7 +346,8 @@ public class InitItems
|
|||
registerItem(itemElectricJarHuge, "ItemElectricJarHuge");
|
||||
|
||||
// Others
|
||||
itemResource = new ItemResource().setUnlocalizedName("itemResource");
|
||||
itemResource = new BaseMetadataItem(Steamcraft.instance, new String[] { "Sulphur", "Phosphorus", "SulphuricAcid", "Uranium", "Pellet" })
|
||||
.setUnlocalizedName("itemResource");
|
||||
registerItem(itemResource, "ItemResource");
|
||||
|
||||
itemWatch = new ItemWatch().setUnlocalizedName("itemWatch");
|
||||
|
@ -446,10 +438,10 @@ public class InitItems
|
|||
itemAutofeeder = new ItemAutofeeder().setUnlocalizedName("itemAutofeeder");
|
||||
registerItem(itemAutofeeder, "ItemAutofeeder");
|
||||
|
||||
itemTeaLeaf = new BaseItem().setUnlocalizedName("itemTeaLeaves");
|
||||
itemTeaLeaf = new BaseItem(Steamcraft.instance).setUnlocalizedName("itemTeaLeaves");
|
||||
registerItem(itemTeaLeaf, "ItemTeaLeaf");
|
||||
|
||||
itemSlimeRubber = new BaseItem().setUnlocalizedName("itemSlimeRubber");
|
||||
itemSlimeRubber = new BaseItem(Steamcraft.instance).setUnlocalizedName("itemSlimeRubber");
|
||||
registerItem(itemSlimeRubber, "ItemSlimeRubber");
|
||||
|
||||
itemTeapot = new ItemTeapot().setUnlocalizedName("itemTeapot");
|
||||
|
@ -458,13 +450,14 @@ public class InitItems
|
|||
registerItem(itemTeapot, "ItemTeapot");
|
||||
registerItem(itemTeacup, "ItemTeacup");
|
||||
|
||||
itemGrappleGun = new ItemGrappleGun().setUnlocalizedName("itemGrappleGun");
|
||||
// itemGrappleGun = new
|
||||
// ItemGrappleGun().setUnlocalizedName("itemGrappleGun");
|
||||
// registerItem(itemGrappleGun, "ItemGrappleGun");
|
||||
|
||||
itemHandbook = new ItemHandbook().setUnlocalizedName("itemHandbook");
|
||||
registerItem(itemHandbook, "ItemHandbook");
|
||||
|
||||
itemSpyglass = new BaseItem().setUnlocalizedName("itemSpyglass").setFull3D();
|
||||
itemSpyglass = new BaseItem(Steamcraft.instance).setUnlocalizedName("itemSpyglass").setFull3D();
|
||||
registerItem(itemSpyglass, "ItemSpyglass");
|
||||
|
||||
// TODO Add a version system to allow updates. Check version on right
|
||||
|
@ -514,7 +507,7 @@ public class InitItems
|
|||
BucketHandler.getInstance().bucketMap.put(InitBlocks.blockMoltenBrass, itemMoltenBrassBucket);
|
||||
MinecraftForge.EVENT_BUS.register(BucketHandler.getInstance());
|
||||
|
||||
itemWhalebone = new BaseItem().setUnlocalizedName("itemWhalebone");
|
||||
itemWhalebone = new BaseItem(Steamcraft.instance).setUnlocalizedName("itemWhalebone");
|
||||
registerItem(itemWhalebone, "ItemWhalebone");
|
||||
|
||||
itemWhaleMeat = new ItemCustomFood(3, 0.4F, false).setUnlocalizedName("itemWhaleMeat");
|
||||
|
@ -523,36 +516,31 @@ public class InitItems
|
|||
itemCookedWhaleMeat = new ItemCustomFood(6, 0.8F, true).setUnlocalizedName("itemCookedWhaleMeat");
|
||||
registerItem(itemCookedWhaleMeat, "ItemCookedWhaleMeat");
|
||||
|
||||
itemWhaleBlubber = new BaseItem().setUnlocalizedName("itemWhaleBlubber");
|
||||
itemWhaleBlubber = new BaseItem(Steamcraft.instance).setUnlocalizedName("itemWhaleBlubber");
|
||||
registerItem(itemWhaleBlubber, "ItemWhaleBlubber");
|
||||
|
||||
itemCoin = new ItemCoin().setUnlocalizedName("itemCoin");
|
||||
itemCoin = new BaseMetadataItem(Steamcraft.instance, "Coin", new String[] { "Farthing", "Halfpenny", "Penny", "Tuppence", "Groat",
|
||||
"Thripenny", "Sixpence", "Shilling", "Florin", "HalfCrown", "Crown", "HalfSovereign", "Sovereign" }).setUnlocalizedName("itemCoin");
|
||||
registerItem(itemCoin, "ItemCoin");
|
||||
|
||||
// Also known as a pokkit by some wierdo called Longeye ;)
|
||||
itemDimPocket = new ItemDimensionalPocket().setUnlocalizedName("itemDimPocket");
|
||||
// TODO registerItem(itemDimPocket, "ItemDimPocket");
|
||||
|
||||
itemRedwoodStick = new BaseItem().setUnlocalizedName("itemRedwoodStick");
|
||||
itemRedwoodStick = new BaseItem(Steamcraft.instance).setUnlocalizedName("itemRedwoodStick");
|
||||
registerItem(itemRedwoodStick, "ItemRedwoodStick");
|
||||
itemMangroveStick = new BaseItem().setUnlocalizedName("itemMangroveStick");
|
||||
itemMangroveStick = new BaseItem(Steamcraft.instance).setUnlocalizedName("itemMangroveStick");
|
||||
registerItem(itemMangroveStick, "ItemMangroveStick");
|
||||
itemWillowStick = new BaseItem().setUnlocalizedName("itemWillowStick");
|
||||
itemWillowStick = new BaseItem(Steamcraft.instance).setUnlocalizedName("itemWillowStick");
|
||||
registerItem(itemWillowStick, "ItemWillowStick");
|
||||
itemPetrifiedStick = new BaseItem().setUnlocalizedName("itemPetrifiedStick");
|
||||
itemPetrifiedStick = new BaseItem(Steamcraft.instance).setUnlocalizedName("itemPetrifiedStick");
|
||||
registerItem(itemPetrifiedStick, "ItemPetrifiedStick");
|
||||
|
||||
itemEmptyMobBottle = new BaseItem().setUnlocalizedName("itemEmptyMobBottle");
|
||||
// registerItem(itemEmptyMobBottle, "ItemEmptyMobBottle");
|
||||
itemMobBottle = new ItemMobBottle().setUnlocalizedName("itemMobBottle");
|
||||
// registerItem(itemMobBottle, "ItemMobBottle");
|
||||
}
|
||||
|
||||
private static void initializeTools()
|
||||
{
|
||||
// Drills
|
||||
drillCore = new BaseItem().setUnlocalizedName("itemDrillCore");
|
||||
drillBase = new BaseItem().setUnlocalizedName("itemDrillBase");
|
||||
drillCore = new BaseItem(Steamcraft.instance).setUnlocalizedName("itemDrillCore");
|
||||
drillBase = new BaseItem(Steamcraft.instance).setUnlocalizedName("itemDrillBase");
|
||||
|
||||
drillWood = new ItemElectricDrill(InitMaterials.DRILL_WOOD, 40, 80).setUnlocalizedName("itemDrillWood");
|
||||
drillStone = new ItemElectricDrill(InitMaterials.DRILL_STONE, 80, 80).setUnlocalizedName("itemDrillStone");
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
|
||||
package steamcraft.common.items;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import boilerplate.common.baseclasses.items.RootItem;
|
||||
import steamcraft.common.Steamcraft;
|
||||
import steamcraft.common.lib.ModInfo;
|
||||
|
||||
/**
|
||||
* @author warlordjones
|
||||
*
|
||||
*/
|
||||
public class BaseItem extends RootItem
|
||||
{
|
||||
public BaseItem()
|
||||
{
|
||||
super();
|
||||
this.setCreativeTab(Steamcraft.tabSC2);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister par1IconRegister)
|
||||
{
|
||||
this.itemIcon = par1IconRegister.registerIcon(ModInfo.PREFIX + this.getUnlocalizedName().substring(5));
|
||||
}
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
|
||||
package steamcraft.common.items;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* @author warlordjones
|
||||
*
|
||||
*/
|
||||
public class BaseItemWithMetadata extends BaseItem
|
||||
{
|
||||
public BaseItemWithMetadata()
|
||||
{
|
||||
super();
|
||||
this.setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack is)
|
||||
{
|
||||
return super.getUnlocalizedName() + "." + is.getItemDamage();
|
||||
}
|
||||
|
||||
}
|
|
@ -18,6 +18,8 @@ import net.minecraftforge.fluids.FluidRegistry;
|
|||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.IFluidContainerItem;
|
||||
|
||||
import boilerplate.common.baseclasses.items.BaseItem;
|
||||
import steamcraft.common.Steamcraft;
|
||||
import steamcraft.common.init.InitItems;
|
||||
import steamcraft.common.lib.ModInfo;
|
||||
|
||||
|
@ -34,7 +36,7 @@ public class ItemCanister extends BaseItem implements IFluidContainerItem
|
|||
|
||||
public ItemCanister(int maxSteam, int maxSteamRate)
|
||||
{
|
||||
super();
|
||||
super(Steamcraft.instance);
|
||||
this.maxSteam = maxSteam;
|
||||
this.maxSteamRate = maxSteamRate;
|
||||
this.setMaxStackSize(1);
|
||||
|
|
|
@ -1,61 +0,0 @@
|
|||
|
||||
package steamcraft.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import steamcraft.common.init.InitItems;
|
||||
import steamcraft.common.lib.ModInfo;
|
||||
|
||||
/**
|
||||
* @author warlordjones
|
||||
*
|
||||
*/
|
||||
public class ItemCoin extends BaseItemWithMetadata
|
||||
{
|
||||
IIcon[] itemIcon = new IIcon[13];
|
||||
|
||||
@SuppressWarnings("all")
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list)
|
||||
{
|
||||
for (int var4 = 0; var4 < 13; ++var4)
|
||||
list.add(new ItemStack(InitItems.itemCoin, 1, var4));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir)
|
||||
{
|
||||
this.itemIcon[0] = ir.registerIcon(ModInfo.PREFIX + "itemCoinFarthing");
|
||||
this.itemIcon[1] = ir.registerIcon(ModInfo.PREFIX + "itemCoinHalfpenny");
|
||||
this.itemIcon[2] = ir.registerIcon(ModInfo.PREFIX + "itemCoinPenny");
|
||||
this.itemIcon[3] = ir.registerIcon(ModInfo.PREFIX + "itemCoinTuppence");
|
||||
this.itemIcon[4] = ir.registerIcon(ModInfo.PREFIX + "itemCoinGroat");
|
||||
this.itemIcon[5] = ir.registerIcon(ModInfo.PREFIX + "itemCoinThripenny");
|
||||
this.itemIcon[6] = ir.registerIcon(ModInfo.PREFIX + "itemCoinSixpence");
|
||||
this.itemIcon[7] = ir.registerIcon(ModInfo.PREFIX + "itemCoinShilling");
|
||||
this.itemIcon[8] = ir.registerIcon(ModInfo.PREFIX + "itemCoinFlorin");
|
||||
this.itemIcon[9] = ir.registerIcon(ModInfo.PREFIX + "itemCoinHalfCrown");
|
||||
this.itemIcon[10] = ir.registerIcon(ModInfo.PREFIX + "itemCoinCrown");
|
||||
this.itemIcon[11] = ir.registerIcon(ModInfo.PREFIX + "itemCoinHalfSovereign");
|
||||
this.itemIcon[12] = ir.registerIcon(ModInfo.PREFIX + "itemCoinSovereign");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int itemDamage)
|
||||
{
|
||||
return this.itemIcon[itemDamage];
|
||||
}
|
||||
|
||||
}
|
|
@ -7,6 +7,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import boilerplate.common.baseclasses.items.BaseItem;
|
||||
import steamcraft.common.Steamcraft;
|
||||
|
||||
public class ItemCustomFood extends BaseItem
|
||||
|
@ -37,6 +38,7 @@ public class ItemCustomFood extends BaseItem
|
|||
|
||||
public ItemCustomFood(int healAmount, float satModifier, boolean wolfMeat)
|
||||
{
|
||||
super(Steamcraft.instance);
|
||||
this.itemUseDuration = 32;
|
||||
this.healAmount = healAmount;
|
||||
this.isWolfsFavoriteMeat = wolfMeat;
|
||||
|
|
|
@ -6,6 +6,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.world.World;
|
||||
|
||||
import boilerplate.api.IOpenableGUI;
|
||||
import boilerplate.common.baseclasses.items.BaseItem;
|
||||
import steamcraft.client.gui.GuiPocket;
|
||||
import steamcraft.client.lib.GuiIDs;
|
||||
import steamcraft.common.Steamcraft;
|
||||
|
@ -15,7 +16,7 @@ public class ItemDimensionalPocket extends BaseItem implements IOpenableGUI
|
|||
{
|
||||
public ItemDimensionalPocket()
|
||||
{
|
||||
super();
|
||||
super(Steamcraft.instance);
|
||||
this.setMaxStackSize(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -5,10 +5,17 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import boilerplate.common.baseclasses.items.BaseItem;
|
||||
import steamcraft.common.Steamcraft;
|
||||
import steamcraft.common.entities.projectile.EntityFieldManipulator;
|
||||
|
||||
public class ItemFieldManipulator extends BaseItem
|
||||
{
|
||||
public ItemFieldManipulator()
|
||||
{
|
||||
super(Steamcraft.instance);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called whenever this item is equipped and the right mouse button is
|
||||
* pressed. Args: itemStack, world, entityPlayer
|
||||
|
|
|
@ -26,7 +26,7 @@ public class ItemFirearm extends BaseFirearm
|
|||
{
|
||||
public ItemFirearm(int damage, int reloadTime, Item ammo, Item ammo2, String fireSound, String reloadSound)
|
||||
{
|
||||
super(damage, reloadTime, ammo, ammo2, fireSound, reloadSound);
|
||||
super(damage, reloadTime, ammo, ammo2, fireSound, reloadSound, Steamcraft.instance);
|
||||
this.setCreativeTab(Steamcraft.tabSC2);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
|
||||
package steamcraft.common.items;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import steamcraft.common.entities.EntityGrapplingHook;
|
||||
|
||||
public class ItemGrappleGun extends BaseItem
|
||||
{
|
||||
public EntityGrapplingHook hook;
|
||||
|
||||
public ItemGrappleGun()
|
||||
{
|
||||
this.hook = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called whenever this item is equipped and the right mouse button is
|
||||
* pressed. Args: itemStack, world, entityPlayer
|
||||
*/
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
if (this.hook != null)
|
||||
{
|
||||
int i = this.hook.func_146034_e();
|
||||
stack.damageItem(i, player);
|
||||
player.swingItem();
|
||||
}
|
||||
else
|
||||
{
|
||||
world.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / ((itemRand.nextFloat() * 0.4F) + 0.8F));
|
||||
|
||||
if (!world.isRemote)
|
||||
{
|
||||
world.spawnEntityInWorld(new EntityGrapplingHook(world, player, this));
|
||||
}
|
||||
|
||||
player.swingItem();
|
||||
}
|
||||
return stack;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,65 +0,0 @@
|
|||
|
||||
package steamcraft.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import steamcraft.common.init.InitItems;
|
||||
import steamcraft.common.lib.ModInfo;
|
||||
|
||||
/**
|
||||
* @author Surseance
|
||||
*
|
||||
*/
|
||||
public class ItemGunPart extends BaseItemWithMetadata
|
||||
{
|
||||
IIcon[] itemIcon = new IIcon[12];
|
||||
|
||||
public ItemGunPart()
|
||||
{
|
||||
super();
|
||||
this.setMaxStackSize(64);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir)
|
||||
{
|
||||
this.itemIcon[0] = ir.registerIcon(ModInfo.PREFIX + "itemStock");
|
||||
this.itemIcon[1] = ir.registerIcon(ModInfo.PREFIX + "itemMusketBarrel");
|
||||
this.itemIcon[2] = ir.registerIcon(ModInfo.PREFIX + "itemRifleBarrel");
|
||||
this.itemIcon[3] = ir.registerIcon(ModInfo.PREFIX + "itemLock");
|
||||
this.itemIcon[4] = ir.registerIcon(ModInfo.PREFIX + "itemBrassGunFrame");
|
||||
this.itemIcon[5] = ir.registerIcon(ModInfo.PREFIX + "itemCastIronGunFrame");
|
||||
this.itemIcon[6] = ir.registerIcon(ModInfo.PREFIX + "itemGreenFocus");
|
||||
this.itemIcon[7] = ir.registerIcon(ModInfo.PREFIX + "itemBlueFocus");
|
||||
this.itemIcon[8] = ir.registerIcon(ModInfo.PREFIX + "itemPowerCore");
|
||||
this.itemIcon[9] = ir.registerIcon(ModInfo.PREFIX + "itemOverchargedPowerCore");
|
||||
this.itemIcon[10] = ir.registerIcon(ModInfo.PREFIX + "itemPistolBarrel");
|
||||
this.itemIcon[11] = ir.registerIcon(ModInfo.PREFIX + "itemShortStock");
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List l)
|
||||
{
|
||||
for (int var4 = 0; var4 < this.itemIcon.length; ++var4)
|
||||
l.add(new ItemStack(InitItems.itemGunPart, 1, var4));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int itemDamage)
|
||||
{
|
||||
return this.itemIcon[itemDamage];
|
||||
}
|
||||
}
|
|
@ -7,6 +7,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.world.World;
|
||||
|
||||
import boilerplate.api.IOpenableGUI;
|
||||
import boilerplate.common.baseclasses.items.BaseItem;
|
||||
import steamcraft.client.gui.GuiHandbook;
|
||||
import steamcraft.client.lib.GuiIDs;
|
||||
import steamcraft.common.Steamcraft;
|
||||
|
@ -17,7 +18,7 @@ public class ItemHandbook extends BaseItem implements IOpenableGUI
|
|||
|
||||
public ItemHandbook()
|
||||
{
|
||||
super();
|
||||
super(Steamcraft.instance);
|
||||
this.setMaxStackSize(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,50 +0,0 @@
|
|||
|
||||
package steamcraft.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import steamcraft.common.init.InitItems;
|
||||
import steamcraft.common.lib.LibInfo;
|
||||
import steamcraft.common.lib.ModInfo;
|
||||
|
||||
/**
|
||||
* @author warlordjones
|
||||
*
|
||||
*/
|
||||
public class ItemIngot extends BaseItemWithMetadata
|
||||
{
|
||||
IIcon[] itemIcon = new IIcon[8];
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir)
|
||||
{
|
||||
for (int i = 0; i < this.itemIcon.length; i++)
|
||||
this.itemIcon[i] = ir.registerIcon(ModInfo.PREFIX + "metals/" + "itemIngot" + LibInfo.metals[i]);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List l)
|
||||
{
|
||||
for (int var4 = 0; var4 < 8; ++var4)
|
||||
l.add(new ItemStack(InitItems.itemIngot, 1, var4));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int itemDamage)
|
||||
{
|
||||
return this.itemIcon[itemDamage];
|
||||
}
|
||||
}
|
|
@ -20,6 +20,7 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import boilerplate.api.IOpenableGUI;
|
||||
import boilerplate.common.baseclasses.items.BaseItem;
|
||||
import steamcraft.client.lib.GuiIDs;
|
||||
import steamcraft.common.Steamcraft;
|
||||
import steamcraft.common.lib.ModInfo;
|
||||
|
@ -32,7 +33,7 @@ public class ItemLoreBook extends BaseItem implements IOpenableGUI
|
|||
|
||||
public ItemLoreBook(String author, String title, String[] pages)
|
||||
{
|
||||
super();
|
||||
super(Steamcraft.instance);
|
||||
this.setMaxStackSize(1);
|
||||
this.author = author;
|
||||
this.title = title;
|
||||
|
|
|
@ -1,63 +0,0 @@
|
|||
|
||||
package steamcraft.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import steamcraft.common.init.InitItems;
|
||||
import steamcraft.common.lib.ModInfo;
|
||||
|
||||
/**
|
||||
* @author warlordjones
|
||||
*
|
||||
*/
|
||||
public class ItemMachinePart extends BaseItemWithMetadata
|
||||
{
|
||||
IIcon[] itemIcon = new IIcon[10];
|
||||
|
||||
public ItemMachinePart()
|
||||
{
|
||||
super();
|
||||
this.setMaxStackSize(64);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir)
|
||||
{
|
||||
this.itemIcon[0] = ir.registerIcon(ModInfo.PREFIX + "itemCastIronRod");
|
||||
this.itemIcon[1] = ir.registerIcon(ModInfo.PREFIX + "itemClockworkMechanism");
|
||||
this.itemIcon[2] = ir.registerIcon(ModInfo.PREFIX + "itemGrating");
|
||||
this.itemIcon[3] = ir.registerIcon(ModInfo.PREFIX + "itemMagnet");
|
||||
this.itemIcon[4] = ir.registerIcon(ModInfo.PREFIX + "itemGenerator");
|
||||
this.itemIcon[5] = ir.registerIcon(ModInfo.PREFIX + "itemFan");
|
||||
this.itemIcon[6] = ir.registerIcon(ModInfo.PREFIX + "itemWireCoil");
|
||||
this.itemIcon[7] = ir.registerIcon(ModInfo.PREFIX + "itemSpeaker");
|
||||
this.itemIcon[8] = ir.registerIcon(ModInfo.PREFIX + "itemInsulatedSheet");
|
||||
this.itemIcon[9] = ir.registerIcon(ModInfo.PREFIX + "itemCapacitor");
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List l)
|
||||
{
|
||||
for (int var4 = 0; var4 < this.itemIcon.length; ++var4)
|
||||
l.add(new ItemStack(InitItems.itemMachinePart, 1, var4));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int itemDamage)
|
||||
{
|
||||
return this.itemIcon[itemDamage];
|
||||
}
|
||||
}
|
|
@ -6,12 +6,20 @@ import net.minecraft.init.Blocks;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import boilerplate.common.baseclasses.items.BaseItem;
|
||||
import steamcraft.common.Steamcraft;
|
||||
|
||||
/**
|
||||
* @author warlordjones
|
||||
*
|
||||
*/
|
||||
public class ItemMatch extends BaseItem
|
||||
{
|
||||
public ItemMatch()
|
||||
{
|
||||
super(Steamcraft.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7,
|
||||
float par8, float par9, float par10)
|
||||
|
|
|
@ -1,64 +0,0 @@
|
|||
|
||||
package steamcraft.common.items;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import steamcraft.common.entities.projectile.EntityMobBottle;
|
||||
|
||||
public class ItemMobBottle extends BaseItem
|
||||
{
|
||||
public ItemMobBottle()
|
||||
{
|
||||
this.setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerStoppedUsing(ItemStack stack, World world, EntityPlayer player, int useCount)
|
||||
{
|
||||
if (!stack.hasTagCompound())
|
||||
return;
|
||||
if (useCount > (this.getMaxItemUseDuration(stack) / 2))
|
||||
{
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
--stack.stackSize;
|
||||
}
|
||||
|
||||
world.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F);
|
||||
|
||||
if (!world.isRemote)
|
||||
{
|
||||
world.spawnEntityInWorld(new EntityMobBottle(world, player, stack.getTagCompound().getTag("storedCreature")));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxItemUseDuration(ItemStack p_77626_1_)
|
||||
{
|
||||
return 72000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumAction getItemUseAction(ItemStack p_77661_1_)
|
||||
{
|
||||
return EnumAction.bow;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
player.setItemInUse(stack, this.getMaxItemUseDuration(stack));
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onEaten(ItemStack stack, World p_77654_2_, EntityPlayer p_77654_3_)
|
||||
{
|
||||
return stack;
|
||||
}
|
||||
}
|
|
@ -1,19 +1,14 @@
|
|||
|
||||
package steamcraft.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.passive.EntitySheep;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import boilerplate.common.baseclasses.items.BaseMetadataItem;
|
||||
import steamcraft.common.Steamcraft;
|
||||
import steamcraft.common.entities.living.EntityAbandonedGolem;
|
||||
import steamcraft.common.entities.living.EntityBoar;
|
||||
import steamcraft.common.entities.living.EntityGhostSpider;
|
||||
|
@ -25,10 +20,14 @@ import steamcraft.common.entities.living.EntityShroomZombie;
|
|||
import steamcraft.common.entities.living.EntitySpiderQueen;
|
||||
import steamcraft.common.entities.living.EntityVampireBat;
|
||||
import steamcraft.common.entities.living.EntityWhale;
|
||||
import steamcraft.common.init.InitItems;
|
||||
|
||||
public class ItemMonsterSpawner extends BaseItemWithMetadata
|
||||
public class ItemMonsterSpawner extends BaseMetadataItem
|
||||
{
|
||||
public ItemMonsterSpawner()
|
||||
{
|
||||
super(Steamcraft.instance, "MonsterSpawner", new String[13]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
|
@ -84,13 +83,4 @@ public class ItemMonsterSpawner extends BaseItemWithMetadata
|
|||
}
|
||||
return stack;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List l)
|
||||
{
|
||||
for (int var4 = 0; var4 < 11; ++var4)
|
||||
l.add(new ItemStack(InitItems.itemMonsterSpawner, 1, var4));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,51 +0,0 @@
|
|||
|
||||
package steamcraft.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import steamcraft.common.init.InitItems;
|
||||
import steamcraft.common.lib.LibInfo;
|
||||
import steamcraft.common.lib.ModInfo;
|
||||
|
||||
/**
|
||||
* @author warlordjones
|
||||
*
|
||||
*/
|
||||
public class ItemNugget extends BaseItemWithMetadata
|
||||
{
|
||||
IIcon[] itemIcon = new IIcon[8];
|
||||
|
||||
@SuppressWarnings("all")
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list)
|
||||
{
|
||||
for (int var4 = 0; var4 < 8; ++var4)
|
||||
list.add(new ItemStack(InitItems.itemNugget, 1, var4));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir)
|
||||
{
|
||||
for (int i = 0; i < this.itemIcon.length; i++)
|
||||
this.itemIcon[i] = ir.registerIcon(ModInfo.PREFIX + "metals/" + "itemNugget" + LibInfo.metals[i]);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int itemDamage)
|
||||
{
|
||||
return this.itemIcon[itemDamage];
|
||||
}
|
||||
|
||||
}
|
|
@ -6,6 +6,8 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import boilerplate.common.baseclasses.items.BaseItem;
|
||||
import steamcraft.common.Steamcraft;
|
||||
import steamcraft.common.lib.ModInfo;
|
||||
|
||||
/**
|
||||
|
@ -16,7 +18,7 @@ public class ItemNuggetIron extends BaseItem
|
|||
{
|
||||
public ItemNuggetIron()
|
||||
{
|
||||
super();
|
||||
super(Steamcraft.instance);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
|
|
@ -1,76 +0,0 @@
|
|||
|
||||
package steamcraft.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import org.apache.commons.lang3.text.WordUtils;
|
||||
import steamcraft.common.lib.ModInfo;
|
||||
|
||||
/**
|
||||
* @author warlordjones
|
||||
*
|
||||
*/
|
||||
public class ItemParts extends BaseItemWithMetadata
|
||||
{
|
||||
public IIcon[] itemIcon = new IIcon[10];
|
||||
|
||||
private String material;
|
||||
|
||||
public ItemParts()
|
||||
{
|
||||
super();
|
||||
this.setMaxStackSize(64);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir)
|
||||
{
|
||||
this.itemIcon[0] = ir.registerIcon(ModInfo.PREFIX + "parts/" + "item" + this.getMaterial() + "Gear");
|
||||
this.itemIcon[1] = ir.registerIcon(ModInfo.PREFIX + "parts/" + "item" + this.getMaterial() + "Sprocket");
|
||||
this.itemIcon[2] = ir.registerIcon(ModInfo.PREFIX + "parts/" + "item" + this.getMaterial() + "Spring");
|
||||
this.itemIcon[3] = ir.registerIcon(ModInfo.PREFIX + "parts/" + "item" + this.getMaterial() + "Thread");
|
||||
this.itemIcon[4] = ir.registerIcon(ModInfo.PREFIX + "parts/" + "item" + this.getMaterial() + "Nut");
|
||||
this.itemIcon[5] = ir.registerIcon(ModInfo.PREFIX + "parts/" + "item" + this.getMaterial() + "Bolt");
|
||||
this.itemIcon[6] = ir.registerIcon(ModInfo.PREFIX + "parts/" + "item" + this.getMaterial() + "Washer");
|
||||
this.itemIcon[7] = ir.registerIcon(ModInfo.PREFIX + "parts/" + "item" + this.getMaterial() + "Bearing");
|
||||
this.itemIcon[8] = ir.registerIcon(ModInfo.PREFIX + "parts/" + "item" + this.getMaterial() + "Screw");
|
||||
this.itemIcon[9] = ir.registerIcon(ModInfo.PREFIX + "parts/" + "item" + this.getMaterial() + "Nail");
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "all" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List l)
|
||||
{
|
||||
for (int var4 = 0; var4 < this.itemIcon.length; ++var4)
|
||||
l.add(new ItemStack(this, 1, var4));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int itemDamage)
|
||||
{
|
||||
return this.itemIcon[itemDamage];
|
||||
}
|
||||
|
||||
public String getMaterial()
|
||||
{
|
||||
return WordUtils.capitalize(this.material);
|
||||
}
|
||||
|
||||
public Item setMaterial(String material)
|
||||
{
|
||||
this.material = material;
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
|
||||
package steamcraft.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import steamcraft.common.init.InitItems;
|
||||
import steamcraft.common.lib.LibInfo;
|
||||
import steamcraft.common.lib.ModInfo;
|
||||
|
||||
/**
|
||||
* @author warlordjones
|
||||
*
|
||||
*/
|
||||
public class ItemPowder extends BaseItemWithMetadata
|
||||
{
|
||||
IIcon[] itemIcon = new IIcon[8];
|
||||
|
||||
@SuppressWarnings("all")
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list)
|
||||
{
|
||||
for (int var4 = 0; var4 < 8; ++var4)
|
||||
list.add(new ItemStack(InitItems.itemPowder, 1, var4));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir)
|
||||
{
|
||||
for (int i = 0; i < this.itemIcon.length; i++)
|
||||
this.itemIcon[i] = ir.registerIcon(ModInfo.PREFIX + "metals/" + "itemPowder" + LibInfo.metals[i]);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int itemDamage)
|
||||
{
|
||||
return this.itemIcon[itemDamage];
|
||||
}
|
||||
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
|
||||
package steamcraft.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import steamcraft.common.init.InitItems;
|
||||
import steamcraft.common.lib.ModInfo;
|
||||
|
||||
/**
|
||||
* @author warlordjones
|
||||
*
|
||||
*/
|
||||
public class ItemResource extends BaseItemWithMetadata
|
||||
{
|
||||
IIcon[] itemIcon = new IIcon[5];
|
||||
|
||||
public ItemResource()
|
||||
{
|
||||
super();
|
||||
this.setMaxStackSize(64);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir)
|
||||
{
|
||||
this.itemIcon[0] = ir.registerIcon(ModInfo.PREFIX + "itemSulphur");
|
||||
this.itemIcon[1] = ir.registerIcon(ModInfo.PREFIX + "itemPhosphorus");
|
||||
this.itemIcon[2] = ir.registerIcon(ModInfo.PREFIX + "itemSulfuricAcid");
|
||||
this.itemIcon[3] = ir.registerIcon(ModInfo.PREFIX + "itemUranium");
|
||||
this.itemIcon[4] = ir.registerIcon(ModInfo.PREFIX + "itemPellet");
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List l)
|
||||
{
|
||||
for (int var4 = 0; var4 < this.itemIcon.length; ++var4)
|
||||
l.add(new ItemStack(InitItems.itemResource, 1, var4));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int itemDamage)
|
||||
{
|
||||
return this.itemIcon[itemDamage];
|
||||
}
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
|
||||
package steamcraft.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import steamcraft.common.init.InitItems;
|
||||
import steamcraft.common.lib.ModInfo;
|
||||
|
||||
/**
|
||||
* @author warlordjones
|
||||
*
|
||||
*/
|
||||
public class ItemRocket extends BaseItemWithMetadata
|
||||
{
|
||||
IIcon[] itemIcon = new IIcon[3];
|
||||
|
||||
@SuppressWarnings("all")
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list)
|
||||
{
|
||||
for (int var4 = 0; var4 < this.itemIcon.length; ++var4)
|
||||
list.add(new ItemStack(InitItems.itemRocket, 1, var4));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir)
|
||||
{
|
||||
for (int i = 0; i < this.itemIcon.length; i++)
|
||||
this.itemIcon[i] = ir.registerIcon(ModInfo.PREFIX + "itemRocket" + i);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int itemDamage)
|
||||
{
|
||||
return this.itemIcon[itemDamage];
|
||||
}
|
||||
|
||||
}
|
|
@ -25,7 +25,7 @@ public class ItemRocketLauncher extends BaseFirearm
|
|||
{
|
||||
public ItemRocketLauncher(int reloadTime, Item ammo, String fireSound, String reloadSound)
|
||||
{
|
||||
super(0, reloadTime, ammo, null, fireSound, reloadSound);
|
||||
super(0, reloadTime, ammo, null, fireSound, reloadSound, Steamcraft.instance);
|
||||
this.setCreativeTab(Steamcraft.tabSC2);
|
||||
this.setUnlocalizedName("itemClockworkRocketLauncher");
|
||||
}
|
||||
|
|
|
@ -1,50 +0,0 @@
|
|||
|
||||
package steamcraft.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import steamcraft.common.init.InitItems;
|
||||
import steamcraft.common.lib.LibInfo;
|
||||
import steamcraft.common.lib.ModInfo;
|
||||
|
||||
/**
|
||||
* @author warlordjones
|
||||
*
|
||||
*/
|
||||
public class ItemSheet extends BaseItemWithMetadata
|
||||
{
|
||||
IIcon[] itemIcon = new IIcon[8];
|
||||
|
||||
@SuppressWarnings("all")
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list)
|
||||
{
|
||||
for (int var4 = 0; var4 < 8; ++var4)
|
||||
list.add(new ItemStack(InitItems.itemSheet, 1, var4));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir)
|
||||
{
|
||||
for (int i = 0; i < this.itemIcon.length; i++)
|
||||
this.itemIcon[i] = ir.registerIcon(ModInfo.PREFIX + "metals/" + "itemSheet" + LibInfo.metals[i]);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int itemDamage)
|
||||
{
|
||||
return this.itemIcon[itemDamage];
|
||||
}
|
||||
}
|
|
@ -14,6 +14,7 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import boilerplate.api.IOpenableGUI;
|
||||
import boilerplate.common.baseclasses.items.BaseItem;
|
||||
import steamcraft.api.item.IUniversalWrench;
|
||||
import steamcraft.api.tile.ISpannerTile;
|
||||
import steamcraft.client.lib.GuiIDs;
|
||||
|
@ -28,7 +29,7 @@ public class ItemSpanner extends BaseItem implements IUniversalWrench
|
|||
{
|
||||
public ItemSpanner()
|
||||
{
|
||||
super();
|
||||
super(Steamcraft.instance);
|
||||
this.setCreativeTab(Steamcraft.tabSC2);
|
||||
}
|
||||
|
||||
|
|
|
@ -5,12 +5,15 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import boilerplate.common.baseclasses.items.BaseItem;
|
||||
import steamcraft.common.Steamcraft;
|
||||
import steamcraft.common.entities.projectile.EntitySplashLightningBottle;
|
||||
|
||||
public class ItemSplashLightningBottle extends BaseItem
|
||||
{
|
||||
public ItemSplashLightningBottle()
|
||||
{
|
||||
super(Steamcraft.instance);
|
||||
this.setMaxStackSize(3);
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,8 @@ import net.minecraftforge.common.EnumPlantType;
|
|||
import net.minecraftforge.common.IPlantable;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import boilerplate.common.baseclasses.items.BaseItem;
|
||||
import steamcraft.common.Steamcraft;
|
||||
import steamcraft.common.init.InitBlocks;
|
||||
|
||||
/**
|
||||
|
@ -21,7 +23,7 @@ public class ItemTeaSeed extends BaseItem implements IPlantable
|
|||
{
|
||||
public ItemTeaSeed()
|
||||
{
|
||||
super();
|
||||
super(Steamcraft.instance);
|
||||
this.setMaxStackSize(64);
|
||||
this.setUnlocalizedName("itemTeaSeed");
|
||||
}
|
||||
|
|
|
@ -16,17 +16,19 @@ import net.minecraft.world.World;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import boilerplate.common.baseclasses.items.BaseMetadataItem;
|
||||
import steamcraft.common.Steamcraft;
|
||||
import steamcraft.common.init.InitAchievements;
|
||||
import steamcraft.common.init.InitItems;
|
||||
import steamcraft.common.lib.ModInfo;
|
||||
|
||||
public class ItemTeacup extends BaseItemWithMetadata
|
||||
public class ItemTeacup extends BaseMetadataItem
|
||||
{
|
||||
IIcon[] itemIcon = new IIcon[2];
|
||||
|
||||
public ItemTeacup()
|
||||
{
|
||||
super();
|
||||
super(Steamcraft.instance, null);
|
||||
this.setMaxStackSize(1);
|
||||
this.setNoRepair();
|
||||
this.setFull3D();
|
||||
|
@ -61,7 +63,6 @@ public class ItemTeacup extends BaseItemWithMetadata
|
|||
public void getSubItems(Item item, CreativeTabs tab, List l)
|
||||
{
|
||||
l.add(new ItemStack(InitItems.itemTeacup, 1, 0));
|
||||
|
||||
l.add(new ItemStack(InitItems.itemTeacup, 1, 10));
|
||||
}
|
||||
|
||||
|
|
|
@ -13,16 +13,18 @@ import net.minecraft.world.World;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import boilerplate.common.baseclasses.items.BaseMetadataItem;
|
||||
import boilerplate.common.utils.ItemStackUtils;
|
||||
import steamcraft.common.Steamcraft;
|
||||
import steamcraft.common.init.InitItems;
|
||||
import steamcraft.common.lib.ModInfo;
|
||||
|
||||
public class ItemTeapot extends BaseItemWithMetadata
|
||||
public class ItemTeapot extends BaseMetadataItem
|
||||
{
|
||||
|
||||
public ItemTeapot()
|
||||
{
|
||||
super();
|
||||
super(Steamcraft.instance, null);
|
||||
this.setMaxStackSize(1);
|
||||
this.setNoRepair();
|
||||
this.setFull3D();
|
||||
|
@ -32,7 +34,7 @@ public class ItemTeapot extends BaseItemWithMetadata
|
|||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister icon)
|
||||
{
|
||||
this.itemIcon = icon.registerIcon(ModInfo.PREFIX + this.getUnlocalizedName().substring(5));
|
||||
this.itemIcon[0] = icon.registerIcon(ModInfo.PREFIX + this.getUnlocalizedName().substring(5));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -14,6 +14,7 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import boilerplate.client.ClientHelper;
|
||||
import boilerplate.common.baseclasses.items.BaseItem;
|
||||
import steamcraft.common.Steamcraft;
|
||||
import steamcraft.common.lib.ModInfo;
|
||||
|
||||
|
@ -27,8 +28,8 @@ public class ItemTimeClock extends BaseItem
|
|||
|
||||
public ItemTimeClock()
|
||||
{
|
||||
super(Steamcraft.instance);
|
||||
this.setMaxStackSize(1);
|
||||
this.setCreativeTab(Steamcraft.tabSC2);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,50 +0,0 @@
|
|||
|
||||
package steamcraft.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import steamcraft.common.init.InitItems;
|
||||
import steamcraft.common.lib.LibInfo;
|
||||
import steamcraft.common.lib.ModInfo;
|
||||
|
||||
/**
|
||||
* @author warlordjones For futureproofing
|
||||
*/
|
||||
public class ItemVanillaPowder extends BaseItemWithMetadata
|
||||
{
|
||||
IIcon[] itemIcon = new IIcon[2];
|
||||
|
||||
@SuppressWarnings("all")
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list)
|
||||
{
|
||||
for (int var4 = 0; var4 < 2; ++var4)
|
||||
list.add(new ItemStack(InitItems.itemVanillaPowder, 1, var4));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir)
|
||||
{
|
||||
for (int i = 0; i < this.itemIcon.length; i++)
|
||||
this.itemIcon[i] = ir.registerIcon(ModInfo.PREFIX + "metals/" + "itemPowder" + LibInfo.metalsV[i]);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int itemDamage)
|
||||
{
|
||||
return this.itemIcon[itemDamage];
|
||||
}
|
||||
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
|
||||
package steamcraft.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import steamcraft.common.init.InitItems;
|
||||
import steamcraft.common.lib.LibInfo;
|
||||
import steamcraft.common.lib.ModInfo;
|
||||
|
||||
/**
|
||||
* @author warlordjones
|
||||
*
|
||||
*/
|
||||
public class ItemVanillaSheet extends BaseItemWithMetadata
|
||||
{
|
||||
IIcon[] itemIcon = new IIcon[2];
|
||||
|
||||
@SuppressWarnings("all")
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list)
|
||||
{
|
||||
for (int var4 = 0; var4 < 2; ++var4)
|
||||
list.add(new ItemStack(InitItems.itemVanillaSheet, 1, var4));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir)
|
||||
{
|
||||
for (int i = 0; i < this.itemIcon.length; i++)
|
||||
this.itemIcon[i] = ir.registerIcon(ModInfo.PREFIX + "metals/" + "itemSheet" + LibInfo.metalsV[i]);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int itemDamage)
|
||||
{
|
||||
return this.itemIcon[itemDamage];
|
||||
}
|
||||
}
|
|
@ -10,6 +10,7 @@ import net.minecraft.util.ChatComponentText;
|
|||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import boilerplate.common.baseclasses.items.BaseItem;
|
||||
import steamcraft.common.Steamcraft;
|
||||
|
||||
/**
|
||||
|
@ -20,6 +21,7 @@ public class ItemWatch extends BaseItem
|
|||
{
|
||||
public ItemWatch()
|
||||
{
|
||||
super(Steamcraft.instance);
|
||||
this.setMaxStackSize(1);
|
||||
this.setCreativeTab(Steamcraft.tabSC2);
|
||||
}
|
||||
|
|
|
@ -12,6 +12,8 @@ import net.minecraft.world.World;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import boilerplate.common.baseclasses.items.BaseItem;
|
||||
import steamcraft.common.Steamcraft;
|
||||
import steamcraft.common.init.InitItems;
|
||||
import steamcraft.common.lib.LibInfo;
|
||||
|
||||
|
@ -25,6 +27,7 @@ public class ItemWithCraftingDurability extends BaseItem
|
|||
|
||||
public ItemWithCraftingDurability()
|
||||
{
|
||||
super(Steamcraft.instance);
|
||||
this.setMaxStackSize(1);
|
||||
this.setMaxDamage(ToolMaterial.IRON.getMaxUses());
|
||||
this.setNoRepair();
|
||||
|
|
|
@ -12,11 +12,17 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import boilerplate.client.ClientHelper;
|
||||
import boilerplate.common.baseclasses.items.RootItem;
|
||||
import boilerplate.common.baseclasses.items.BaseItem;
|
||||
import steamcraft.api.item.IDefensiveArmorModule;
|
||||
import steamcraft.common.Steamcraft;
|
||||
|
||||
public abstract class BaseDefensiveModule extends RootItem implements IDefensiveArmorModule
|
||||
public abstract class BaseDefensiveModule extends BaseItem implements IDefensiveArmorModule
|
||||
{
|
||||
public BaseDefensiveModule()
|
||||
{
|
||||
super(Steamcraft.instance);
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
|
|
|
@ -1,50 +0,0 @@
|
|||
|
||||
package steamcraft.common.items.compat;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import steamcraft.common.init.InitItems;
|
||||
import steamcraft.common.items.BaseItemWithMetadata;
|
||||
import steamcraft.common.lib.ModInfo;
|
||||
|
||||
/**
|
||||
* @author warlordjones
|
||||
*
|
||||
*/
|
||||
public class ItemSteamcraftCluster extends BaseItemWithMetadata
|
||||
{
|
||||
IIcon[] itemIcon = new IIcon[2];
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir)
|
||||
{
|
||||
this.itemIcon[0] = ir.registerIcon(ModInfo.PREFIX + "metals/" + "itemClusterAluminum");
|
||||
this.itemIcon[1] = ir.registerIcon(ModInfo.PREFIX + "metals/" + "itemClusterZinc");
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List l)
|
||||
{
|
||||
l.add(new ItemStack(InitItems.itemSteamcraftCluster, 1, 0));
|
||||
l.add(new ItemStack(InitItems.itemSteamcraftCluster, 1, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int itemDamage)
|
||||
{
|
||||
return this.itemIcon[itemDamage];
|
||||
}
|
||||
}
|
|
@ -10,7 +10,6 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import steamcraft.api.item.ModuleRegistry;
|
||||
import steamcraft.common.Steamcraft;
|
||||
import steamcraft.common.items.modules.BaseArmorModule;
|
||||
import steamcraft.common.lib.ModInfo;
|
||||
|
||||
|
@ -24,8 +23,6 @@ public class ItemThaumicMonocle extends BaseArmorModule
|
|||
{
|
||||
super();
|
||||
ModuleRegistry.registerModule(this);
|
||||
this.setMaxStackSize(1);
|
||||
this.setCreativeTab(Steamcraft.tabSC2);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -27,7 +27,7 @@ public class ElectricItem extends BaseElectricItem
|
|||
{
|
||||
public ElectricItem(int maxEnergy, int maxReceive, int maxSend)
|
||||
{
|
||||
super(maxEnergy, maxReceive, maxSend);
|
||||
super(maxEnergy, maxReceive, maxSend, Steamcraft.instance);
|
||||
this.setCreativeTab(Steamcraft.tabSC2);
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ import net.minecraft.world.World;
|
|||
import boilerplate.api.IEnergyItem;
|
||||
import boilerplate.common.baseclasses.items.tools.BaseTool;
|
||||
import steamcraft.common.Steamcraft;
|
||||
import steamcraft.common.lib.ModInfo;
|
||||
|
||||
public class ItemElectricTool extends BaseTool implements IEnergyItem
|
||||
{
|
||||
|
@ -23,7 +22,7 @@ public class ItemElectricTool extends BaseTool implements IEnergyItem
|
|||
|
||||
protected ItemElectricTool(float damage, ToolMaterial toolMat, int maxEnergy, int maxReceive)
|
||||
{
|
||||
super(damage, toolMat, ModInfo.PREFIX);
|
||||
super(damage, toolMat, Steamcraft.instance);
|
||||
this.setCreativeTab(Steamcraft.tabSC2);
|
||||
this.maxEnergy = maxEnergy * 1000;
|
||||
this.maxReceive = (short) maxReceive;
|
||||
|
|
|
@ -12,14 +12,16 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import boilerplate.client.ClientHelper;
|
||||
import boilerplate.common.baseclasses.items.RootItem;
|
||||
import boilerplate.common.baseclasses.items.BaseItem;
|
||||
import steamcraft.api.item.IArmorModule;
|
||||
import steamcraft.api.item.ModuleRegistry;
|
||||
import steamcraft.common.Steamcraft;
|
||||
|
||||
public abstract class BaseArmorModule extends RootItem implements IArmorModule
|
||||
public abstract class BaseArmorModule extends BaseItem implements IArmorModule
|
||||
{
|
||||
public BaseArmorModule()
|
||||
{
|
||||
super(Steamcraft.instance);
|
||||
ModuleRegistry.setModuleIncompatibilities(this);
|
||||
this.setMaxStackSize(1);
|
||||
}
|
||||
|
|
|
@ -11,14 +11,16 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import boilerplate.client.ClientHelper;
|
||||
import boilerplate.common.baseclasses.items.RootItem;
|
||||
import boilerplate.common.baseclasses.items.BaseItem;
|
||||
import steamcraft.api.item.IFistModule;
|
||||
import steamcraft.api.item.ModuleRegistry;
|
||||
import steamcraft.common.Steamcraft;
|
||||
|
||||
public abstract class BaseFistModule extends RootItem implements IFistModule
|
||||
public abstract class BaseFistModule extends BaseItem implements IFistModule
|
||||
{
|
||||
public BaseFistModule()
|
||||
{
|
||||
super(Steamcraft.instance);
|
||||
ModuleRegistry.setModuleIncompatibilities(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,14 +3,10 @@ package steamcraft.common.items.tools;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import boilerplate.common.baseclasses.items.tools.BaseTool;
|
||||
import steamcraft.api.item.IFistModule;
|
||||
import steamcraft.api.item.ModuleRegistry;
|
||||
|
@ -18,24 +14,16 @@ import steamcraft.common.Steamcraft;
|
|||
import steamcraft.common.init.InitItems;
|
||||
import steamcraft.common.items.ItemCanister;
|
||||
import steamcraft.common.items.electric.ElectricItem;
|
||||
import steamcraft.common.lib.ModInfo;
|
||||
|
||||
public class ItemBrassFist extends BaseTool
|
||||
{
|
||||
public ItemBrassFist(ToolMaterial mat)
|
||||
{
|
||||
super(mat.getDamageVsEntity(), mat, ModInfo.PREFIX);
|
||||
super(mat.getDamageVsEntity(), mat, Steamcraft.instance);
|
||||
this.setMaxStackSize(1);
|
||||
this.setCreativeTab(Steamcraft.tabSC2);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir)
|
||||
{
|
||||
this.itemIcon = ir.registerIcon(ModInfo.PREFIX + "tools/" + this.getUnlocalizedName().substring(5));
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean flag)
|
||||
|
|
|
@ -21,13 +21,12 @@ import steamcraft.common.Steamcraft;
|
|||
import steamcraft.common.init.InitItems;
|
||||
import steamcraft.common.init.InitMaterials;
|
||||
import steamcraft.common.items.ItemCanister;
|
||||
import steamcraft.common.lib.ModInfo;
|
||||
|
||||
public class ItemSteamTool extends BaseTool
|
||||
{
|
||||
public ItemSteamTool(float damage)
|
||||
{
|
||||
super(damage, InitMaterials.TOOL_STEAM, ModInfo.PREFIX);
|
||||
super(damage, InitMaterials.TOOL_STEAM, Steamcraft.instance);
|
||||
this.setCreativeTab(Steamcraft.tabSC2);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,10 +7,11 @@ import net.minecraft.util.ResourceLocation;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import boilerplate.common.baseclasses.items.BaseItem;
|
||||
import steamcraft.api.vanity.EnumVanityType;
|
||||
import steamcraft.api.vanity.IVanityItem;
|
||||
import steamcraft.client.renderers.models.ModelTopHat;
|
||||
import steamcraft.common.items.BaseItem;
|
||||
import steamcraft.common.Steamcraft;
|
||||
import steamcraft.common.lib.ModInfo;
|
||||
|
||||
/**
|
||||
|
@ -19,6 +20,11 @@ import steamcraft.common.lib.ModInfo;
|
|||
*/
|
||||
public class ItemTopHat extends BaseItem implements IVanityItem
|
||||
{
|
||||
public ItemTopHat()
|
||||
{
|
||||
super(Steamcraft.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ModelBase getVanityItemModel()
|
||||
|
|
|
@ -8,6 +8,7 @@ public class LibInfo
|
|||
{
|
||||
public static String[] metals = { "Aluminum", "Copper", "Tin", "Zinc", "Brass", "Bronze", "Steel", "CastIron" };
|
||||
public static String[] metalsV = { "Iron", "Gold" };
|
||||
public static String[] parts = { "Gear", "Sprocket", "Spring", "Thread", "Nut", "Bolt", "Washer", "Bearing", "Screw", "Nail" };
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -31,8 +31,6 @@ import steamcraft.common.config.Config;
|
|||
import steamcraft.common.config.ConfigGeneral;
|
||||
import steamcraft.common.init.InitAchievements;
|
||||
import steamcraft.common.init.InitItems;
|
||||
import steamcraft.common.items.ItemIngot;
|
||||
import steamcraft.common.items.ItemSheet;
|
||||
import steamcraft.common.items.armor.ItemBrassArmor;
|
||||
import steamcraft.common.items.armor.ItemClockworkWings;
|
||||
import steamcraft.common.items.armor.ItemSteamJetpack;
|
||||
|
@ -65,8 +63,6 @@ public class EventHandlerFML
|
|||
event.player.triggerAchievement(InitAchievements.turbineAchieve);
|
||||
else if (craftingBlock instanceof BlockLightningRod)
|
||||
event.player.triggerAchievement(InitAchievements.rodAchieve);
|
||||
else if (event.crafting.getItem() instanceof ItemSheet)
|
||||
event.player.triggerAchievement(InitAchievements.sheetAchieve);
|
||||
else if (event.crafting.getItem() instanceof ItemClockworkWings)
|
||||
event.player.triggerAchievement(InitAchievements.wingsAchieve);
|
||||
else if (event.crafting.getItem() instanceof ItemSteamJetpack)
|
||||
|
@ -75,13 +71,6 @@ public class EventHandlerFML
|
|||
event.player.triggerAchievement(InitAchievements.wingpackAchieve);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onItemSmelted(PlayerEvent.ItemSmeltedEvent event)
|
||||
{
|
||||
if (event.smelting.getItem() instanceof ItemIngot)
|
||||
event.player.triggerAchievement(InitAchievements.ingotAchieve);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event)
|
||||
{
|
||||
|
|
Before Width: | Height: | Size: 599 B After Width: | Height: | Size: 599 B |
Before Width: | Height: | Size: 593 B After Width: | Height: | Size: 593 B |
Before Width: | Height: | Size: 577 B After Width: | Height: | Size: 577 B |
Loading…
Reference in New Issue