Broken potion launcher
@ -150,7 +150,6 @@ public abstract class InventoryBlock extends BlockContainer
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
String[] textureNames = getTextureNames();
|
||||
//System.out.println("TextureNames: :"+this.getClass().getSimpleName());
|
||||
this.icons = new Icon[textureNames.length];
|
||||
|
||||
for (int i = 0; i < this.icons.length; ++i)
|
||||
|
115
mods/tinker/golems/blocks/GolemCoreBlock.java
Normal file
@ -0,0 +1,115 @@
|
||||
package mods.tinker.golems.blocks;
|
||||
|
||||
import mods.tinker.common.InventoryBlock;
|
||||
import mods.tinker.golems.client.GolemCoreRender;
|
||||
import mods.tinker.golems.logic.GolemCoreLogic;
|
||||
import mods.tinker.tconstruct.TConstruct;
|
||||
import mods.tinker.tconstruct.library.TConstructRegistry;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class GolemCoreBlock extends InventoryBlock
|
||||
{
|
||||
public GolemCoreBlock(int id)
|
||||
{
|
||||
super(id, Material.rock);
|
||||
this.setCreativeTab(TConstructRegistry.blockTab);
|
||||
}
|
||||
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getRenderType()
|
||||
{
|
||||
return GolemCoreRender.model;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
GolemCoreLogic logic = (GolemCoreLogic)world.getBlockTileEntity(x, y, z);
|
||||
|
||||
if (!logic.isStackInSlot(0))
|
||||
{
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
stack = player.inventory.decrStackSize(player.inventory.currentItem, 1);
|
||||
logic.setInventorySlotContents(0, stack);
|
||||
}
|
||||
else
|
||||
{
|
||||
ItemStack stack = logic.decrStackSize(0, 1);
|
||||
if (stack != null)
|
||||
addItemToInventory(player, world, x, y, z, stack);
|
||||
}
|
||||
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void addItemToInventory (EntityPlayer player, World world, int x, int y, int z, ItemStack stack)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
EntityItem entityitem = new EntityItem(world, (double) x + 0.5D, (double) y + 0.9325D, (double) z + 0.5D, stack);
|
||||
world.spawnEntityInWorld(entityitem);
|
||||
entityitem.onCollideWithPlayer(player);
|
||||
}
|
||||
}
|
||||
|
||||
public int damageDropped(int meta)
|
||||
{
|
||||
return meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getBlockTextureFromSideAndMetadata(int side, int meta)
|
||||
{
|
||||
return icons[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldSideBeRendered (IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity (World world, int metadata)
|
||||
{
|
||||
return new GolemCoreLogic();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getGui (World world, int x, int y, int z, EntityPlayer entityplayer)
|
||||
{
|
||||
return null; //Not sure if gui block or not, probably not
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getModInstance ()
|
||||
{
|
||||
return TConstruct.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getTextureNames ()
|
||||
{
|
||||
return new String[] { "golemcore" };
|
||||
}
|
||||
}
|
1014
mods/tinker/golems/blocks/GolemHeadBlock.java
Normal file
147
mods/tinker/golems/blocks/GolemPedestalBlock.java
Normal file
@ -0,0 +1,147 @@
|
||||
package mods.tinker.golems.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import mods.tinker.common.InventoryBlock;
|
||||
import mods.tinker.golems.logic.GolemPedestalLogic;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class GolemPedestalBlock extends InventoryBlock
|
||||
{
|
||||
/*public static int texTop;
|
||||
public static int texTopp;
|
||||
public static int texSide;
|
||||
public static int texBottom;*/
|
||||
|
||||
public GolemPedestalBlock(int i)
|
||||
{
|
||||
super(i, Material.wood);
|
||||
/*texTop = ModLoader.addOverride("/terrain.png", "/GGE/pedestaltop.png");
|
||||
texTopp = ModLoader.addOverride("/terrain.png", "/GGE/pedestaltopp.png");
|
||||
texSide = ModLoader.addOverride("/terrain.png", "/GGE/pedestalside.png");
|
||||
texBottom = ModLoader.addOverride("/terrain.png", "/GGE/pedestalbottom.png");*/
|
||||
}
|
||||
|
||||
/*public int getBlockTextureFromSideAndMetadata(int i, int j)
|
||||
{
|
||||
if (i == 1)
|
||||
{
|
||||
return j == 0 ? texTop : texTopp;
|
||||
}
|
||||
if (i == 0)
|
||||
{
|
||||
return texBottom;
|
||||
}
|
||||
if (i == 2 || i == 4)
|
||||
{
|
||||
return texSide;
|
||||
}
|
||||
else
|
||||
{
|
||||
return texSide;
|
||||
}
|
||||
}*/
|
||||
|
||||
/*public int idDropped(int i, Random random, int j)
|
||||
{
|
||||
return super.idDropped(i, random, j);
|
||||
}*/
|
||||
|
||||
/*public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving)
|
||||
{
|
||||
super.onBlockPlacedBy(world, i, j, k, entityliving);
|
||||
ItemStack itemstack = ((EntityPlayer)entityliving).getCurrentEquippedItem();
|
||||
world.setBlockMetadata(i, j, k, itemstack.getItemDamage());
|
||||
}*/
|
||||
|
||||
public void onBlockRemoval(World world, int i, int j, int k)
|
||||
{
|
||||
Random random = new Random();
|
||||
GolemPedestalLogic tileentitygolempedestal = (GolemPedestalLogic)world.getBlockTileEntity(i, j, k);
|
||||
if (tileentitygolempedestal != null)
|
||||
{
|
||||
label0:
|
||||
for (int l = 0; l < tileentitygolempedestal.getSizeInventory(); l++)
|
||||
{
|
||||
ItemStack itemstack = tileentitygolempedestal.getStackInSlot(l);
|
||||
if (itemstack == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
float f = random.nextFloat() * 0.8F + 0.1F;
|
||||
float f1 = random.nextFloat() * 0.8F + 0.1F;
|
||||
float f2 = random.nextFloat() * 0.8F + 0.1F;
|
||||
do
|
||||
{
|
||||
if (itemstack.stackSize <= 0)
|
||||
{
|
||||
continue label0;
|
||||
}
|
||||
int i1 = random.nextInt(21) + 10;
|
||||
if (i1 > itemstack.stackSize)
|
||||
{
|
||||
i1 = itemstack.stackSize;
|
||||
}
|
||||
itemstack.stackSize -= i1;
|
||||
EntityItem entityitem = new EntityItem(world, (float)i + f, (float)j + f1, (float)k + f2, new ItemStack(itemstack.itemID, i1, itemstack.getItemDamage()));
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (float)random.nextGaussian() * f3;
|
||||
entityitem.motionY = (float)random.nextGaussian() * f3 + 0.2F;
|
||||
entityitem.motionZ = (float)random.nextGaussian() * f3;
|
||||
world.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
while (true);
|
||||
}
|
||||
}
|
||||
//super.onBlockRemoval(world, i, j, k);
|
||||
}
|
||||
|
||||
public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer)
|
||||
{
|
||||
/*ItemStack itemstack = entityplayer.getCurrentEquippedItem();
|
||||
if (world.isRemote)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (itemstack == null || itemstack != null && (itemstack.itemID >= 256 || itemstack.itemID == 0 || itemstack.itemID == Block.slowSand.blockID))
|
||||
{
|
||||
ModLoader.openGUI(entityplayer, new GuiGolemPedestal(entityplayer.inventory, world, i, j, k));
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}*/
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity (World world, int metadata)
|
||||
{
|
||||
return new GolemPedestalLogic();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getGui (World world, int x, int y, int z, EntityPlayer entityplayer)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getModInstance ()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getTextureNames ()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
117
mods/tinker/golems/client/GolemCoreRender.java
Normal file
@ -0,0 +1,117 @@
|
||||
package mods.tinker.golems.client;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.src.ModLoader;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
|
||||
public class GolemCoreRender implements ISimpleBlockRenderingHandler
|
||||
{
|
||||
public static int model = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer)
|
||||
{
|
||||
/*Tessellator tessellator = Tessellator.instance;
|
||||
double d = 0.1875D;
|
||||
World world = ModLoader.getMinecraftInstance().theWorld;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, -1F, 0.0F);
|
||||
renderblocks.renderBottomFace(block, -0.5D, -0.5D, -0.5D, block.getBlockTextureFromSide(0));
|
||||
renderblocks.renderBottomFace(block, -0.5D, 0.5D - d, -0.5D, block.getBlockTextureFromSide(0));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 1.0F, 0.0F);
|
||||
renderblocks.renderTopFace(block, -0.5D, -0.5D, -0.5D, block.getBlockTextureFromSide(1));
|
||||
renderblocks.renderTopFace(block, -0.5D, -1.5D + d, -0.5D, block.getBlockTextureFromSide(1));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(1.0F, 0.0F, 0.0F);
|
||||
renderblocks.renderEastFace(block, -0.5D, -0.5D, -0.5D, block.getBlockTextureFromSide(2));
|
||||
renderblocks.renderEastFace(block, -0.5D, -0.5D, 0.5D - d, block.getBlockTextureFromSide(2));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(-1F, 1.0F, 0.0F);
|
||||
renderblocks.renderWestFace(block, -0.5D, -0.5D, -0.5D, block.getBlockTextureFromSide(3));
|
||||
renderblocks.renderWestFace(block, -0.5D, -0.5D, -1.5D + d, block.getBlockTextureFromSide(3));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 1.0F, 1.0F);
|
||||
renderblocks.renderNorthFace(block, -0.5D, -0.5D, -0.5D, block.getBlockTextureFromSide(4));
|
||||
renderblocks.renderNorthFace(block, 0.5D - d, -0.5D, -0.5D, block.getBlockTextureFromSide(4));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 1.0F, -1F);
|
||||
renderblocks.renderSouthFace(block, -0.5D, -0.5D, -0.5D, block.getBlockTextureFromSide(5));
|
||||
renderblocks.renderSouthFace(block, -1.5D + d, -0.5D, -0.5D, block.getBlockTextureFromSide(5));
|
||||
tessellator.draw();*/
|
||||
renderInvBlock(renderer, block, metadata);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
|
||||
{
|
||||
renderer.setRenderBounds(0.0F, 0F, 0.0F, 1.0F, 0.1875F, 1.0F);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0.0F, 0.8125F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0.0F, 0.1875F, 0.0F, 0.1875F, 0.8125F, 0.1875F);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0.8175, 0.1875F, 0.0F, 1f, 0.8125F, 0.1875F);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0.0F, 0.1875F, 0.8175, 0.1875F, 0.8125F, 1f);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0.8175F, 0.1875F, 0.8175, 1f, 0.8125F, 1f);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory ()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId ()
|
||||
{
|
||||
return model;
|
||||
}
|
||||
|
||||
public static void renderInvBlock (RenderBlocks renderblocks, Block block, int meta)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, -1F, 0.0F);
|
||||
renderblocks.renderBottomFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(0, meta));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 1.0F, 0.0F);
|
||||
renderblocks.renderTopFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(1, meta));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 0.0F, -1F);
|
||||
renderblocks.renderEastFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(2, meta));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 0.0F, 1.0F);
|
||||
renderblocks.renderWestFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(3, meta));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(-1F, 0.0F, 0.0F);
|
||||
renderblocks.renderNorthFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(4, meta));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(1.0F, 0.0F, 0.0F);
|
||||
renderblocks.renderSouthFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(5, meta));
|
||||
tessellator.draw();
|
||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||
}
|
||||
}
|
64
mods/tinker/golems/client/GolemCoreSpecialRender.java
Normal file
@ -0,0 +1,64 @@
|
||||
package mods.tinker.golems.client;
|
||||
|
||||
import mods.tinker.common.fancyitem.FancyEntityItem;
|
||||
import mods.tinker.golems.logic.GolemCoreLogic;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
/* Special renderer, only used for drawing tools */
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GolemCoreSpecialRender extends TileEntitySpecialRenderer
|
||||
{
|
||||
@Override
|
||||
public void renderTileEntityAt (TileEntity logic, double var2, double var4, double var6, float var8)
|
||||
{
|
||||
this.render((GolemCoreLogic) logic, var2, var4, var6, var8);
|
||||
}
|
||||
|
||||
public void render (GolemCoreLogic logic, double posX, double posY, double posZ, float var8)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
float var10 = (float) (posX - 0.5F);
|
||||
float var11 = (float) (posY - 0.5F);
|
||||
float var12 = (float) (posZ - 0.5F);
|
||||
GL11.glTranslatef(var10, var11, var12);
|
||||
|
||||
ItemStack stack = logic.getStackInSlot(0);
|
||||
if (stack != null)
|
||||
renderItem(logic, stack);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
void renderItem(GolemCoreLogic logic, ItemStack stack)
|
||||
{
|
||||
FancyEntityItem entityitem = new FancyEntityItem(logic.worldObj, 0.0D, 0.0D, 0.0D, stack);
|
||||
entityitem.getEntityItem().stackSize = 1;
|
||||
entityitem.hoverStart = 0.0F;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(1F, 0.675F, 1.0F);
|
||||
//GL11.glRotatef(90F, 1, 0F, 0F);
|
||||
GL11.glScalef(1.4F, 1.4F, 1.4F);
|
||||
if (stack.getItem() instanceof ItemBlock)
|
||||
{
|
||||
GL11.glScalef(1.6F, 1.6F, 1.6F);
|
||||
GL11.glTranslatef(0F, 0.045F, 0.0f);
|
||||
}
|
||||
|
||||
RenderItem.renderInFrame = true;
|
||||
RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
|
||||
RenderItem.renderInFrame = false;
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
113
mods/tinker/golems/logic/GolemCoreLogic.java
Normal file
@ -0,0 +1,113 @@
|
||||
package mods.tinker.golems.logic;
|
||||
|
||||
import mods.tinker.common.InventoryLogic;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.INetworkManager;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.network.packet.Packet132TileEntityData;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class GolemCoreLogic extends InventoryLogic
|
||||
implements IInventory
|
||||
{
|
||||
|
||||
public GolemCoreLogic()
|
||||
{
|
||||
super(1);
|
||||
}
|
||||
|
||||
public ItemStack getKey()
|
||||
{
|
||||
return inventory[0];
|
||||
}
|
||||
|
||||
public void setKey(ItemStack itemstack)
|
||||
{
|
||||
inventory[0] = itemstack;
|
||||
onInventoryChanged();
|
||||
}
|
||||
|
||||
public void clear()
|
||||
{
|
||||
inventory[0] = null;
|
||||
}
|
||||
|
||||
public int getSizeInventory()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public ItemStack getStackInSlot(int slot)
|
||||
{
|
||||
return inventory[0];
|
||||
}
|
||||
|
||||
public int getInventoryStackLimit()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public boolean canInteractWith(EntityPlayer entityplayer)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void openChest() {}
|
||||
public void closeChest() {}
|
||||
|
||||
public boolean isUseableByPlayer(EntityPlayer entityplayer)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing (int i)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInvNameLocalized ()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStackValidForSlot (int i, ItemStack itemstack)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container getGuiContainer (InventoryPlayer inventoryplayer, World world, int x, int y, int z)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getDefaultName ()
|
||||
{
|
||||
return "golems.core";
|
||||
}
|
||||
|
||||
/* Packets */
|
||||
@Override
|
||||
public Packet getDescriptionPacket ()
|
||||
{
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
writeToNBT(tag);
|
||||
return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket (INetworkManager net, Packet132TileEntityData packet)
|
||||
{
|
||||
readFromNBT(packet.customParam1);
|
||||
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
358
mods/tinker/golems/logic/GolemPedestalLogic.java
Normal file
@ -0,0 +1,358 @@
|
||||
package mods.tinker.golems.logic;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.src.ModLoader;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class GolemPedestalLogic extends TileEntity
|
||||
implements IInventory
|
||||
{
|
||||
public ItemStack supply;
|
||||
public static int cost[] = null;
|
||||
public static int souls[] = null;
|
||||
|
||||
public GolemPedestalLogic()
|
||||
{
|
||||
supply = null;
|
||||
if (cost == null)
|
||||
{
|
||||
cost = new int[512];
|
||||
souls = new int[512];
|
||||
cost[Block.planks.blockID] = 0;
|
||||
cost[Block.wood.blockID] = 32;
|
||||
cost[Block.cloth.blockID] = 8;
|
||||
cost[Block.cobblestoneMossy.blockID] = 16;
|
||||
cost[Block.obsidian.blockID] = 8;
|
||||
cost[Block.pumpkin.blockID] = 8;
|
||||
cost[Block.netherrack.blockID] = 64;
|
||||
cost[Block.slowSand.blockID] = 1;
|
||||
cost[Block.glowStone.blockID] = 1;
|
||||
cost[Block.pumpkinLantern.blockID] = 8;
|
||||
cost[Block.blockDiamond.blockID] = 1;
|
||||
cost[Block.blockGold.blockID] = 1;
|
||||
cost[Block.blockSteel.blockID] = 1;
|
||||
cost[Block.blockLapis.blockID] = 1;
|
||||
cost[Block.jukebox.blockID] = 1;
|
||||
cost[Block.music.blockID] = 1;
|
||||
cost[Block.melon.blockID] = 8;
|
||||
cost[Block.torchRedstoneIdle.blockID] = 6;
|
||||
cost[Block.torchRedstoneActive.blockID] = cost[Block.torchRedstoneIdle.blockID];
|
||||
cost[Item.redstone.itemID] = 6;
|
||||
cost[Item.beefRaw.itemID] = 8;
|
||||
cost[Item.beefCooked.itemID] = cost[Item.beefRaw.itemID];
|
||||
cost[Item.porkRaw.itemID] = cost[Item.beefRaw.itemID];
|
||||
cost[Item.porkCooked.itemID] = cost[Item.beefRaw.itemID];
|
||||
cost[Item.enderPearl.itemID] = 1;
|
||||
cost[Item.eyeOfEnder.itemID] = 1;
|
||||
cost[Item.blazeRod.itemID] = 2;
|
||||
cost[Block.mushroomBrown.blockID] = 16;
|
||||
cost[Block.mushroomRed.blockID] = cost[Block.mushroomBrown.blockID];
|
||||
cost[Block.netherStalk.blockID] = 6;
|
||||
cost[Item.lightStoneDust.itemID] = 4;
|
||||
cost[Item.diamond.itemID] = 1;
|
||||
cost[Item.ingotIron.itemID] = 8;
|
||||
cost[Item.ingotGold.itemID] = 2;
|
||||
cost[Item.reed.itemID] = 8;
|
||||
cost[Item.sugar.itemID] = cost[Item.reed.itemID];
|
||||
cost[Item.bucketLava.itemID] = 1;
|
||||
cost[Item.cake.itemID] = 1;
|
||||
cost[Item.bucketMilk.itemID] = 1;
|
||||
cost[Item.wheat.itemID] = 32;
|
||||
cost[Item.bread.itemID] = 8;
|
||||
cost[Block.plantYellow.blockID] = 32;
|
||||
cost[Block.plantRed.blockID] = cost[Block.plantYellow.blockID];
|
||||
cost[Block.dragonEgg.blockID] = 1;
|
||||
cost[Block.tallGrass.blockID] = 64;
|
||||
cost[Block.sapling.blockID] = 64;
|
||||
cost[Item.ghastTear.itemID] = 8;
|
||||
cost[Item.goldNugget.itemID] = 18;
|
||||
cost[Item.spiderEye.itemID] = 16;
|
||||
cost[Item.fermentedSpiderEye.itemID] = 6;
|
||||
cost[Item.bowlSoup.itemID] = 0;
|
||||
cost[Item.fishRaw.itemID] = 1;
|
||||
cost[Item.fishCooked.itemID] = cost[Item.fishRaw.itemID];
|
||||
cost[Item.magmaCream.itemID] = 2;
|
||||
cost[Item.blazePowder.itemID] = 4;
|
||||
cost[Item.speckledMelon.itemID] = 1;
|
||||
cost[Item.paper.itemID] = 8;
|
||||
cost[Item.book.itemID] = 2;
|
||||
cost[Item.egg.itemID] = 4;
|
||||
cost[Item.slimeBall.itemID] = 2;
|
||||
cost[Item.saddle.itemID] = 1;
|
||||
cost[Item.feather.itemID] = 48;
|
||||
cost[Item.gunpowder.itemID] = 16;
|
||||
cost[Item.appleRed.itemID] = 8;
|
||||
cost[Item.appleGold.itemID] = 1;
|
||||
cost[Item.dyePowder.itemID] = 64;
|
||||
cost[Item.bone.itemID] = 2;
|
||||
cost[Item.rottenFlesh.itemID] = 48;
|
||||
cost[Item.cookie.itemID] = 16;
|
||||
cost[Item.melon.itemID] = 32;
|
||||
cost[Item.chickenCooked.itemID] = 8;
|
||||
cost[Item.chickenRaw.itemID] = cost[Item.chickenCooked.itemID];
|
||||
cost[Item.silk.itemID] = 64;
|
||||
cost[Block.cactus.blockID] = 32;
|
||||
souls[Block.planks.blockID] = 0;
|
||||
souls[Block.wood.blockID] = 1;
|
||||
souls[Block.cloth.blockID] = 1;
|
||||
souls[Block.cobblestoneMossy.blockID] = 1;
|
||||
souls[Block.obsidian.blockID] = 1;
|
||||
souls[Block.pumpkin.blockID] = 1;
|
||||
souls[Block.netherrack.blockID] = 1;
|
||||
souls[Block.slowSand.blockID] = 1;
|
||||
souls[Block.glowStone.blockID] = 2;
|
||||
souls[Block.pumpkinLantern.blockID] = 1;
|
||||
souls[Block.blockDiamond.blockID] = 27;
|
||||
souls[Block.blockGold.blockID] = 2;
|
||||
souls[Block.blockSteel.blockID] = 2;
|
||||
souls[Block.blockLapis.blockID] = 3;
|
||||
souls[Block.jukebox.blockID] = 3;
|
||||
souls[Block.music.blockID] = 1;
|
||||
souls[Block.melon.blockID] = 1;
|
||||
souls[Block.torchRedstoneIdle.blockID] = 1;
|
||||
souls[Block.torchRedstoneActive.blockID] = souls[Block.torchRedstoneIdle.blockID];
|
||||
souls[Item.redstone.itemID] = 1;
|
||||
souls[Item.beefRaw.itemID] = 1;
|
||||
souls[Item.beefCooked.itemID] = souls[Item.beefRaw.itemID];
|
||||
souls[Item.porkRaw.itemID] = souls[Item.beefRaw.itemID];
|
||||
souls[Item.porkCooked.itemID] = souls[Item.beefRaw.itemID];
|
||||
souls[Item.enderPearl.itemID] = 1;
|
||||
souls[Item.eyeOfEnder.itemID] = 2;
|
||||
souls[Item.blazeRod.itemID] = 2;
|
||||
souls[Block.mushroomBrown.blockID] = 1;
|
||||
souls[Block.mushroomRed.blockID] = souls[Block.mushroomBrown.blockID];
|
||||
souls[Block.netherStalk.blockID] = 1;
|
||||
souls[Item.lightStoneDust.itemID] = 1;
|
||||
souls[Item.diamond.itemID] = 3;
|
||||
souls[Item.ingotIron.itemID] = 1;
|
||||
souls[Item.ingotGold.itemID] = 1;
|
||||
souls[Item.reed.itemID] = 1;
|
||||
souls[Item.sugar.itemID] = souls[Item.reed.itemID];
|
||||
souls[Item.bucketLava.itemID] = 1;
|
||||
souls[Item.cake.itemID] = 1;
|
||||
souls[Item.bucketMilk.itemID] = 1;
|
||||
souls[Item.wheat.itemID] = 1;
|
||||
souls[Item.bread.itemID] = 1;
|
||||
souls[Block.plantYellow.blockID] = 1;
|
||||
souls[Block.plantRed.blockID] = souls[Block.plantYellow.blockID];
|
||||
souls[Block.dragonEgg.blockID] = 1;
|
||||
souls[Block.tallGrass.blockID] = 1;
|
||||
souls[Block.sapling.blockID] = 1;
|
||||
souls[Item.ghastTear.itemID] = 1;
|
||||
souls[Item.goldNugget.itemID] = 1;
|
||||
souls[Item.spiderEye.itemID] = 1;
|
||||
souls[Item.fermentedSpiderEye.itemID] = 1;
|
||||
souls[Item.bowlSoup.itemID] = 1;
|
||||
souls[Item.fishRaw.itemID] = 1;
|
||||
souls[Item.fishCooked.itemID] = souls[Item.fishRaw.itemID];
|
||||
souls[Item.magmaCream.itemID] = 1;
|
||||
souls[Item.blazePowder.itemID] = 1;
|
||||
souls[Item.speckledMelon.itemID] = 1;
|
||||
souls[Item.paper.itemID] = 1;
|
||||
souls[Item.book.itemID] = 1;
|
||||
souls[Item.egg.itemID] = 1;
|
||||
souls[Item.slimeBall.itemID] = 1;
|
||||
souls[Item.saddle.itemID] = 1;
|
||||
souls[Item.feather.itemID] = 1;
|
||||
souls[Item.gunpowder.itemID] = 1;
|
||||
souls[Item.appleRed.itemID] = 1;
|
||||
souls[Item.appleGold.itemID] = 3;
|
||||
souls[Item.dyePowder.itemID] = 1;
|
||||
souls[Item.bone.itemID] = 1;
|
||||
souls[Item.rottenFlesh.itemID] = 1;
|
||||
souls[Item.cookie.itemID] = 1;
|
||||
souls[Item.melon.itemID] = 1;
|
||||
souls[Item.chickenCooked.itemID] = 1;
|
||||
souls[Item.chickenRaw.itemID] = souls[Item.chickenCooked.itemID];
|
||||
souls[Item.silk.itemID] = 1;
|
||||
souls[Block.cactus.blockID] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
public int getSizeInventory()
|
||||
{
|
||||
return 9;
|
||||
}
|
||||
|
||||
public ItemStack getStackInSlot(int i)
|
||||
{
|
||||
if (supply != null && supply.getItem() == null)
|
||||
{
|
||||
supply = null;
|
||||
}
|
||||
return supply;
|
||||
}
|
||||
|
||||
public boolean subtractSoul(int i)
|
||||
{
|
||||
System.out.println("SUBTRACT WHY");
|
||||
if (supply == null || supply.itemID >= 512 || cost[supply.itemID] == 0)
|
||||
{
|
||||
worldObj.playSoundAtEntity(ModLoader.getMinecraftInstance().thePlayer, "mob.blaze.death", 1.0F, 0.5F);
|
||||
ModLoader.getMinecraftInstance().thePlayer.addChatMessage("I require more souls...");
|
||||
return false;
|
||||
}
|
||||
int j = cost[supply.itemID];
|
||||
int k = souls[supply.itemID];
|
||||
int l = (supply.stackSize / j) * k;
|
||||
System.out.println((new StringBuilder()).append("Subtracting amt").append(i).append(" s").append(k).append(" c").append(j).append(" ss").append(supply.stackSize).append(" id").append(supply.itemID).append(" sa").append(l).append(" calc").append(Math.ceil((double)i / (double)k)).toString());
|
||||
if (l < i)
|
||||
{
|
||||
worldObj.playSoundAtEntity(ModLoader.getMinecraftInstance().thePlayer, "mob.blaze.death", 1.0F, 0.5F);
|
||||
ModLoader.getMinecraftInstance().thePlayer.addChatMessage("I need more souls...");
|
||||
return false;
|
||||
}
|
||||
supply.stackSize -= Math.ceil((double)i / (double)k) * (double)j;
|
||||
if (supply.stackSize == 0)
|
||||
{
|
||||
supply = null;
|
||||
}
|
||||
else if (supply.stackSize < 0)
|
||||
{
|
||||
throw new UnsupportedOperationException((new StringBuilder()).append("If you are getting this error then your golems mod has derped, \nplease contact billythegoat101 on the minecraftforums with the error code: LERN YO MATHS [i").append(supply.itemID).append(",ss").append(supply.stackSize).append(",a").append(i).append("]").toString());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public ItemStack decrStackSize(int i, int j)
|
||||
{
|
||||
if (supply != null && supply.getItem() == null)
|
||||
{
|
||||
supply = null;
|
||||
}
|
||||
if (supply != null)
|
||||
{
|
||||
if (supply.stackSize <= j)
|
||||
{
|
||||
ItemStack itemstack = supply;
|
||||
supply = null;
|
||||
onInventoryChanged();
|
||||
return itemstack;
|
||||
}
|
||||
ItemStack itemstack1 = supply.splitStack(j);
|
||||
if (supply.stackSize == 0)
|
||||
{
|
||||
supply = null;
|
||||
}
|
||||
onInventoryChanged();
|
||||
return itemstack1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void setInventorySlotContents(int i, ItemStack itemstack)
|
||||
{
|
||||
supply = itemstack;
|
||||
if (itemstack != null && itemstack.stackSize > getInventoryStackLimit())
|
||||
{
|
||||
itemstack.stackSize = getInventoryStackLimit();
|
||||
}
|
||||
if (supply != null && supply.getItem() == null)
|
||||
{
|
||||
supply = null;
|
||||
}
|
||||
onInventoryChanged();
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound)
|
||||
{
|
||||
super.writeToNBT(nbttagcompound);
|
||||
if (supply == null)
|
||||
{
|
||||
supply = new ItemStack(0, 0, 0);
|
||||
}
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
if (supply != null)
|
||||
{
|
||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
nbttagcompound1.setByte("Slot", (byte)0);
|
||||
supply.writeToNBT(nbttagcompound1);
|
||||
nbttaglist.appendTag(nbttagcompound1);
|
||||
}
|
||||
nbttagcompound.setTag("Items", nbttaglist);
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound)
|
||||
{
|
||||
super.readFromNBT(nbttagcompound);
|
||||
supply = new ItemStack(0, 0, 0);
|
||||
NBTTagList nbttaglist = nbttagcompound.getTagList("Items");
|
||||
for (int i = 0; i < nbttaglist.tagCount(); i++)
|
||||
{
|
||||
NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbttaglist.tagAt(i);
|
||||
int j = nbttagcompound1.getByte("Slot") & 0xff;
|
||||
if (j >= 0 && j < 1)
|
||||
{
|
||||
supply = ItemStack.loadItemStackFromNBT(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
|
||||
if (supply != null && supply.getItem() == null)
|
||||
{
|
||||
supply = null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getInvName()
|
||||
{
|
||||
return "golempedestalinv";
|
||||
}
|
||||
|
||||
public int getInventoryStackLimit()
|
||||
{
|
||||
return 64;
|
||||
}
|
||||
|
||||
public boolean canInteractWith(EntityPlayer entityplayer)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void openChest()
|
||||
{
|
||||
}
|
||||
|
||||
public void closeChest()
|
||||
{
|
||||
}
|
||||
|
||||
public void clear()
|
||||
{
|
||||
supply = null;
|
||||
}
|
||||
|
||||
public boolean isUseableByPlayer(EntityPlayer entityplayer)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing (int i)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInvNameLocalized ()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStackValidForSlot (int i, ItemStack itemstack)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
}
|
@ -54,8 +54,10 @@ public class PHConstruct {
|
||||
enableTCactus = config.get("Difficulty Changes", "Enable mod cactus tools", true).getBoolean(true);
|
||||
enableTBone = config.get("Difficulty Changes", "Enable mod bone tools", true).getBoolean(true);
|
||||
|
||||
unstableCreeper = config.get("Mob Spawning", "Activate Nitro Creeper Spawns", true).getBoolean(true);
|
||||
redCreeper = config.get("Mob Spawning", "Activate Nitro Creeper Spawns", true).getBoolean(true);
|
||||
blueSlime = config.get("Mob Spawning", "Activate Blue Slime Spawns", true).getBoolean(true);
|
||||
redCreeperWeight = config.get("Mob Spawning", "Spawn Weight for Nitro Creeper", 7).getInt(7);
|
||||
blueSlimeWeight = config.get("Mob Spawning", "Spawn Weight for Blue Slime", 10).getInt(10);
|
||||
|
||||
woodCrafter = config.getBlock("Wood Tool Station", 1471).getInt(1471);
|
||||
heldItemBlock = config.getBlock("Held Item Block", 1472).getInt(1472);
|
||||
@ -69,6 +71,10 @@ public class PHConstruct {
|
||||
metalStill = config.getBlock("Liquid Metal Still", 1480).getInt(1480);
|
||||
//landmine = config.getBlock("Landmine", 1481).getInt(1481);
|
||||
|
||||
golemCore = config.getBlock("Golem Core", 1481).getInt(1481);
|
||||
golemHead = config.getBlock("Golem Head", 1482).getInt(1482);
|
||||
golemPedestal = config.getBlock("Golem Pedestal", 1483).getInt(1483);
|
||||
|
||||
manual = config.getItem("Patterns and Misc", "Tinker's Manual", 14018).getInt(14018);
|
||||
blankPattern = config.getItem("Patterns and Misc", "Blank Patterns", 14019).getInt(14019);
|
||||
materials = config.getItem("Patterns and Misc", "Materials", 14020).getInt(14020);
|
||||
@ -107,6 +113,8 @@ public class PHConstruct {
|
||||
mattock = config.getItem("Tools", "Mattock", 14060).getInt(14060);
|
||||
lumberaxe = config.getItem("Tools", "Lumber Axe", 14061).getInt(14061);
|
||||
longbow = config.getItem("Tools", "Longbow", 14062).getInt(14062);
|
||||
shortbow = config.getItem("Tools", "Shortbow", 14063).getInt(14063);
|
||||
potionLauncher = config.getItem("Tools", "Potion Launcher", 14064).getInt(14064);
|
||||
|
||||
buckets = config.getItem("Patterns and Misc", "Buckets", 14101).getInt(14101);
|
||||
uselessItem = config.getItem("Patterns and Misc", "Title Icon", 14102).getInt(14102);
|
||||
@ -159,6 +167,10 @@ public class PHConstruct {
|
||||
public static int oreSlag;
|
||||
public static int metalBlock;
|
||||
//public static int axle;
|
||||
|
||||
public static int golemCore;
|
||||
public static int golemHead;
|
||||
public static int golemPedestal;
|
||||
|
||||
//Traps
|
||||
//public static int landmine;
|
||||
@ -195,6 +207,8 @@ public class PHConstruct {
|
||||
public static int frypan;
|
||||
public static int battlesign;
|
||||
public static int longbow;
|
||||
public static int shortbow;
|
||||
public static int potionLauncher;
|
||||
|
||||
public static int mattock;
|
||||
public static int lumberaxe;
|
||||
@ -236,8 +250,10 @@ public class PHConstruct {
|
||||
public static int netherDensity;
|
||||
|
||||
//Mobs
|
||||
public static boolean unstableCreeper;
|
||||
public static boolean redCreeper;
|
||||
public static int redCreeperWeight;
|
||||
public static boolean blueSlime;
|
||||
public static int blueSlimeWeight;
|
||||
|
||||
//Difficulty modifiers
|
||||
public static boolean keepHunger;
|
||||
|
@ -25,7 +25,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
||||
* @author: mDiyo
|
||||
*/
|
||||
|
||||
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.2.12")
|
||||
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.2.15")
|
||||
@NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = mods.tinker.tconstruct.TPacketHandler.class)
|
||||
public class TConstruct
|
||||
{
|
||||
|
@ -7,14 +7,72 @@ import java.util.List;
|
||||
import mods.tinker.common.IPattern;
|
||||
import mods.tinker.common.RecipeRemover;
|
||||
import mods.tinker.common.fancyitem.FancyEntityItem;
|
||||
import mods.tinker.tconstruct.blocks.*;
|
||||
import mods.tinker.tconstruct.crafting.*;
|
||||
import mods.tinker.tconstruct.entity.*;
|
||||
import mods.tinker.tconstruct.items.*;
|
||||
import mods.tinker.tconstruct.library.*;
|
||||
import mods.tinker.tconstruct.logic.*;
|
||||
import mods.tinker.tconstruct.modifiers.*;
|
||||
import mods.tinker.tconstruct.tools.*;
|
||||
import mods.tinker.tconstruct.blocks.EquipBlock;
|
||||
import mods.tinker.tconstruct.blocks.LavaTankBlock;
|
||||
import mods.tinker.tconstruct.blocks.LiquidMetalFlowing;
|
||||
import mods.tinker.tconstruct.blocks.LiquidMetalStill;
|
||||
import mods.tinker.tconstruct.blocks.MetalOre;
|
||||
import mods.tinker.tconstruct.blocks.SearedBlock;
|
||||
import mods.tinker.tconstruct.blocks.SmelteryBlock;
|
||||
import mods.tinker.tconstruct.blocks.TConstructBlock;
|
||||
import mods.tinker.tconstruct.blocks.ToolStationBlock;
|
||||
import mods.tinker.tconstruct.crafting.LiquidCasting;
|
||||
import mods.tinker.tconstruct.crafting.PatternBuilder;
|
||||
import mods.tinker.tconstruct.crafting.Smeltery;
|
||||
import mods.tinker.tconstruct.crafting.ToolBuilder;
|
||||
import mods.tinker.tconstruct.entity.BlueSlime;
|
||||
import mods.tinker.tconstruct.entity.Crystal;
|
||||
import mods.tinker.tconstruct.entity.LaunchedPotion;
|
||||
import mods.tinker.tconstruct.entity.UnstableCreeper;
|
||||
import mods.tinker.tconstruct.items.CraftedSoilItemBlock;
|
||||
import mods.tinker.tconstruct.items.CraftingItem;
|
||||
import mods.tinker.tconstruct.items.FilledBucket;
|
||||
import mods.tinker.tconstruct.items.LavaTankItemBlock;
|
||||
import mods.tinker.tconstruct.items.LiquidItemBlock;
|
||||
import mods.tinker.tconstruct.items.MetalItemBlock;
|
||||
import mods.tinker.tconstruct.items.MetalOreItemBlock;
|
||||
import mods.tinker.tconstruct.items.MetalPattern;
|
||||
import mods.tinker.tconstruct.items.Pattern;
|
||||
import mods.tinker.tconstruct.items.PatternManual;
|
||||
import mods.tinker.tconstruct.items.SearedTableItemBlock;
|
||||
import mods.tinker.tconstruct.items.SmelteryItemBlock;
|
||||
import mods.tinker.tconstruct.items.StrangeFood;
|
||||
import mods.tinker.tconstruct.items.TitleIcon;
|
||||
import mods.tinker.tconstruct.items.ToolPart;
|
||||
import mods.tinker.tconstruct.items.ToolShard;
|
||||
import mods.tinker.tconstruct.items.ToolStationItemBlock;
|
||||
import mods.tinker.tconstruct.library.TConstructRegistry;
|
||||
import mods.tinker.tconstruct.library.ToolCore;
|
||||
import mods.tinker.tconstruct.logic.CastingTableLogic;
|
||||
import mods.tinker.tconstruct.logic.FaucetLogic;
|
||||
import mods.tinker.tconstruct.logic.FrypanLogic;
|
||||
import mods.tinker.tconstruct.logic.LavaTankLogic;
|
||||
import mods.tinker.tconstruct.logic.LiquidTextureLogic;
|
||||
import mods.tinker.tconstruct.logic.MultiServantLogic;
|
||||
import mods.tinker.tconstruct.logic.PartCrafterLogic;
|
||||
import mods.tinker.tconstruct.logic.PatternChestLogic;
|
||||
import mods.tinker.tconstruct.logic.PatternShaperLogic;
|
||||
import mods.tinker.tconstruct.logic.SmelteryDrainLogic;
|
||||
import mods.tinker.tconstruct.logic.SmelteryLogic;
|
||||
import mods.tinker.tconstruct.logic.ToolStationLogic;
|
||||
import mods.tinker.tconstruct.modifiers.ModBlaze;
|
||||
import mods.tinker.tconstruct.modifiers.ModBoolean;
|
||||
import mods.tinker.tconstruct.modifiers.ModDurability;
|
||||
import mods.tinker.tconstruct.modifiers.ModElectric;
|
||||
import mods.tinker.tconstruct.modifiers.ModInteger;
|
||||
import mods.tinker.tconstruct.modifiers.ModLapisBase;
|
||||
import mods.tinker.tconstruct.modifiers.ModLapisIncrease;
|
||||
import mods.tinker.tconstruct.modifiers.ModRedstone;
|
||||
import mods.tinker.tconstruct.modifiers.ModRepair;
|
||||
import mods.tinker.tconstruct.tools.Axe;
|
||||
import mods.tinker.tconstruct.tools.BattleSign;
|
||||
import mods.tinker.tconstruct.tools.Broadsword;
|
||||
import mods.tinker.tconstruct.tools.FryingPan;
|
||||
import mods.tinker.tconstruct.tools.Longsword;
|
||||
import mods.tinker.tconstruct.tools.Mattock;
|
||||
import mods.tinker.tconstruct.tools.Pickaxe;
|
||||
import mods.tinker.tconstruct.tools.PotionLauncher;
|
||||
import mods.tinker.tconstruct.tools.Rapier;
|
||||
import mods.tinker.tconstruct.tools.Shovel;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.MapColor;
|
||||
@ -69,6 +127,8 @@ public class TContent implements IFuelHandler
|
||||
|
||||
public static ToolCore mattock;
|
||||
public static ToolCore lumberaxe;
|
||||
|
||||
public static Item potionLauncher;
|
||||
|
||||
//Tool parts
|
||||
public static Item pickaxeHead;
|
||||
@ -108,6 +168,21 @@ public class TContent implements IFuelHandler
|
||||
|
||||
//Tool modifiers
|
||||
public static ModElectric modE;
|
||||
|
||||
//Golems
|
||||
public static Block glowSapling;
|
||||
public static Block glowLeaves;
|
||||
public static Block glowLog;
|
||||
|
||||
public static Block golemCore;
|
||||
public static Block golemPedestal;
|
||||
public static Block golemHead;
|
||||
|
||||
public static Item golemWand;
|
||||
public static Item golemRecharger;
|
||||
public static Item corestone;
|
||||
public static Item notebook;
|
||||
public static Item note;
|
||||
|
||||
public TContent()
|
||||
{
|
||||
@ -124,21 +199,23 @@ public class TContent implements IFuelHandler
|
||||
void createEntities ()
|
||||
{
|
||||
EntityRegistry.registerModEntity(FancyEntityItem.class, "Fancy Item", 0, TConstruct.instance, 32, 5, true);
|
||||
EntityRegistry.registerModEntity(CartEntity.class, "Small Wagon", 1, TConstruct.instance, 32, 5, true);
|
||||
EntityRegistry.registerModEntity(LaunchedPotion.class, "Launched Potion", 1, TConstruct.instance, 32, 3, true);
|
||||
//EntityRegistry.registerModEntity(CartEntity.class, "Small Wagon", 1, TConstruct.instance, 32, 5, true);
|
||||
//EntityRegistry.registerModEntity(Crystal.class, "Crystal", 2, TConstruct.instance, 32, 5, true);
|
||||
EntityRegistry.registerModEntity(Crystal.class, "Crystal", 2, TConstruct.instance, 32, 5, true);
|
||||
|
||||
EntityRegistry.registerModEntity(Skyla.class, "Skyla", 10, TConstruct.instance, 32, 5, true);
|
||||
//EntityRegistry.registerModEntity(Skyla.class, "Skyla", 10, TConstruct.instance, 32, 5, true);
|
||||
EntityRegistry.registerModEntity(UnstableCreeper.class, "UnstableCreeper", 11, TConstruct.instance, 64, 5, true);
|
||||
EntityRegistry.registerModEntity(BlueSlime.class, "EdibleSlime", 12, TConstruct.instance, 64, 5, true);
|
||||
EntityRegistry.registerModEntity(MetalSlime.class, "MetalSlime", 13, TConstruct.instance, 64, 5, true);
|
||||
//EntityRegistry.registerModEntity(MetalSlime.class, "MetalSlime", 13, TConstruct.instance, 64, 5, true);
|
||||
|
||||
BiomeGenBase[] overworldBiomes = new BiomeGenBase[] { BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.desert, BiomeGenBase.extremeHills, BiomeGenBase.forest, BiomeGenBase.taiga,
|
||||
BiomeGenBase.swampland, BiomeGenBase.river, BiomeGenBase.frozenOcean, BiomeGenBase.frozenRiver, BiomeGenBase.icePlains, BiomeGenBase.iceMountains, BiomeGenBase.beach,
|
||||
BiomeGenBase.desertHills, BiomeGenBase.forestHills, BiomeGenBase.taigaHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.jungle, BiomeGenBase.jungleHills };
|
||||
if (PHConstruct.unstableCreeper)
|
||||
EntityRegistry.addSpawn(UnstableCreeper.class, 7, 4, 6, EnumCreatureType.monster, overworldBiomes);
|
||||
if (PHConstruct.redCreeper)
|
||||
EntityRegistry.addSpawn(UnstableCreeper.class, PHConstruct.redCreeperWeight, 4, 6, EnumCreatureType.monster, overworldBiomes);
|
||||
if (PHConstruct.blueSlime)
|
||||
EntityRegistry.addSpawn(BlueSlime.class, 10, 4, 4, EnumCreatureType.monster, overworldBiomes);
|
||||
EntityRegistry.addSpawn(BlueSlime.class, PHConstruct.blueSlimeWeight, 4, 4, EnumCreatureType.monster, overworldBiomes);
|
||||
//EntityRegistry.addSpawn(MetalSlime.class, 1, 4, 4, EnumCreatureType.monster, overworldBiomes);
|
||||
}
|
||||
|
||||
@ -205,6 +282,18 @@ public class TContent implements IFuelHandler
|
||||
GameRegistry.registerBlock(liquidMetalFlowing, LiquidItemBlock.class, "metalFlow");
|
||||
GameRegistry.registerBlock(liquidMetalStill, LiquidItemBlock.class, "metalStill");
|
||||
GameRegistry.registerTileEntity(LiquidTextureLogic.class, "LiquidTexture");
|
||||
|
||||
//Golems
|
||||
/*golemCore = new GolemCoreBlock(PHConstruct.golemCore).setUnlocalizedName("golemcore");
|
||||
GameRegistry.registerBlock(golemCore, "Golem Core");
|
||||
GameRegistry.registerTileEntity(GolemCoreLogic.class, "TConstruct.GolemCore");
|
||||
|
||||
golemHead = new GolemHeadBlock(PHConstruct.golemHead).setUnlocalizedName("golemhead");
|
||||
GameRegistry.registerBlock(golemHead, "Golem Head");
|
||||
|
||||
golemPedestal = new GolemPedestalBlock(PHConstruct.golemPedestal).setUnlocalizedName("golempedestal");
|
||||
GameRegistry.registerBlock(golemPedestal, "Golem Pedestal");
|
||||
GameRegistry.registerTileEntity(GolemPedestalLogic.class, "TConstruct.GolemPedestal");*/
|
||||
}
|
||||
|
||||
void registerItems ()
|
||||
@ -243,6 +332,7 @@ public class TContent implements IFuelHandler
|
||||
//longbow = new RangedWeapon(PHConstruct.longbow);
|
||||
mattock = new Mattock(PHConstruct.mattock);
|
||||
//lumberaxe = new LumberAxe(PHConstruct.lumberaxe, lumberaxeTexture);
|
||||
potionLauncher = new PotionLauncher(PHConstruct.potionLauncher);
|
||||
|
||||
pickaxeHead = new ToolPart(PHConstruct.pickaxeHead, "PickaxeHead", "_pickaxe_head").setUnlocalizedName("tconstruct.PickaxeHead");
|
||||
shovelHead = new ToolPart(PHConstruct.shovelHead, "ShovelHead", "_shovel_head").setUnlocalizedName("tconstruct.ShovelHead");
|
||||
|
@ -365,7 +365,7 @@ public abstract class LiquidMetalBase extends Block
|
||||
}
|
||||
|
||||
/**
|
||||
* Can add to the passed in vector for a movement vector to be applied to the entity. Args: x, y, z, entity, vec3d
|
||||
* Can add to the passed in vector for a movement vector to be applied to the entity. Args: x, y, z, entity, Vec3
|
||||
*/
|
||||
public void velocityToAddToEntity (World par1World, int par2, int par3, int par4, Entity par5Entity, Vec3 par6Vec3)
|
||||
{
|
||||
|
@ -62,7 +62,7 @@ public class CastingTableSpecialRenderer extends TileEntitySpecialRenderer
|
||||
if (stack.getItem() instanceof ItemBlock)
|
||||
{
|
||||
GL11.glRotatef(90F, -1, 0F, 0F);
|
||||
GL11.glTranslatef(0F, -10.1F, 0.2275F);
|
||||
GL11.glTranslatef(0F, -0.1F, 0.2275F);
|
||||
}
|
||||
|
||||
RenderItem.renderInFrame = true;
|
||||
|
@ -9,16 +9,21 @@ import javax.xml.parsers.DocumentBuilderFactory;
|
||||
|
||||
import mods.tinker.common.fancyitem.FancyEntityItem;
|
||||
import mods.tinker.common.fancyitem.FancyItemRender;
|
||||
import mods.tinker.golems.client.GolemCoreRender;
|
||||
import mods.tinker.golems.client.GolemCoreSpecialRender;
|
||||
import mods.tinker.golems.logic.GolemCoreLogic;
|
||||
import mods.tinker.tconstruct.TConstruct;
|
||||
import mods.tinker.tconstruct.TContent;
|
||||
import mods.tinker.tconstruct.TProxyCommon;
|
||||
import mods.tinker.tconstruct.client.entityrender.CartRender;
|
||||
import mods.tinker.tconstruct.client.entityrender.CrystalRender;
|
||||
import mods.tinker.tconstruct.client.entityrender.ThrownItemRender;
|
||||
import mods.tinker.tconstruct.client.entityrender.SkylaRender;
|
||||
import mods.tinker.tconstruct.client.entityrender.SlimeRender;
|
||||
import mods.tinker.tconstruct.entity.BlueSlime;
|
||||
import mods.tinker.tconstruct.entity.CartEntity;
|
||||
import mods.tinker.tconstruct.entity.Crystal;
|
||||
import mods.tinker.tconstruct.entity.LaunchedPotion;
|
||||
import mods.tinker.tconstruct.entity.Skyla;
|
||||
import mods.tinker.tconstruct.entity.UnstableCreeper;
|
||||
import mods.tinker.tconstruct.library.client.TConstructClientRegistry;
|
||||
@ -87,6 +92,7 @@ public class TProxyClient extends TProxyCommon
|
||||
RenderingRegistry.registerBlockHandler(new TankRender());
|
||||
RenderingRegistry.registerBlockHandler(new SearedRender());
|
||||
RenderingRegistry.registerBlockHandler(new FluidRender());
|
||||
RenderingRegistry.registerBlockHandler(new GolemCoreRender());
|
||||
|
||||
//Tools
|
||||
//MinecraftForgeClient.preloadTexture(TContent.blockTexture);
|
||||
@ -98,6 +104,7 @@ public class TProxyClient extends TProxyCommon
|
||||
|
||||
//Special Renderers
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(CastingTableLogic.class, new CastingTableSpecialRenderer());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(GolemCoreLogic.class, new GolemCoreSpecialRender());
|
||||
|
||||
//Entities
|
||||
RenderingRegistry.registerEntityRenderingHandler(CartEntity.class, new CartRender());
|
||||
@ -106,6 +113,7 @@ public class TProxyClient extends TProxyCommon
|
||||
RenderingRegistry.registerEntityRenderingHandler(Crystal.class, new CrystalRender());
|
||||
RenderingRegistry.registerEntityRenderingHandler(UnstableCreeper.class, new RenderCreeper());
|
||||
RenderingRegistry.registerEntityRenderingHandler(BlueSlime.class, new SlimeRender(new ModelSlime(16), new ModelSlime(0), 0.25F));
|
||||
RenderingRegistry.registerEntityRenderingHandler(LaunchedPotion.class, new ThrownItemRender(Item.potion, 16384));
|
||||
//RenderingRegistry.registerEntityRenderingHandler(net.minecraft.entity.player.EntityPlayer.class, new PlayerArmorRender()); // <-- Works, woo!
|
||||
|
||||
addRenderMappings();
|
||||
@ -168,6 +176,8 @@ public class TProxyClient extends TProxyCommon
|
||||
|
||||
LanguageRegistry.instance().addStringLocalization("entity.TConstruct.UnstableCreeper.name", "en_US", "Nitro Creeper");
|
||||
LanguageRegistry.instance().addStringLocalization("entity.TConstruct.EdibleSlime.name", "en_US", "Blue Slime");
|
||||
LanguageRegistry.instance().addStringLocalization("entity.tconstruct.UnstableCreeper.name", "en_US", "Nitro Creeper");
|
||||
LanguageRegistry.instance().addStringLocalization("entity.tconstruct.EdibleSlime.name", "en_US", "Blue Slime");
|
||||
LanguageRegistry.instance().addStringLocalization("entity.TConstruct.MetalSlime.name", "en_US", "Metal Slime");
|
||||
//LanguageRegistry.instance().addStringLocalization("item.tconstruct.diary.diary.name", "en_US", "Tinker's Log");
|
||||
LanguageRegistry.instance().addStringLocalization("item.tconstruct.Pattern.blank_pattern.name", "en_US", "Blank Pattern");
|
||||
|
@ -0,0 +1,92 @@
|
||||
package mods.tinker.tconstruct.client.entityrender;
|
||||
|
||||
import mods.tinker.tconstruct.entity.LaunchedPotion;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemPotion;
|
||||
import net.minecraft.potion.PotionHelper;
|
||||
import net.minecraft.util.Icon;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ThrownItemRender extends Render
|
||||
{
|
||||
private Item field_94151_a;
|
||||
private int field_94150_f;
|
||||
|
||||
public ThrownItemRender(Item par1, int par2)
|
||||
{
|
||||
this.field_94151_a = par1;
|
||||
this.field_94150_f = par2;
|
||||
}
|
||||
|
||||
public ThrownItemRender(Item par1)
|
||||
{
|
||||
this(par1, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
|
||||
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
|
||||
* (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
|
||||
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
|
||||
*/
|
||||
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
|
||||
{
|
||||
Icon icon = this.field_94151_a.getIconFromDamage(this.field_94150_f);
|
||||
|
||||
if (icon != null)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)par2, (float)par4, (float)par6);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
this.loadTexture("/gui/items.png");
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
if (icon == ItemPotion.func_94589_d("potion_splash"))
|
||||
{
|
||||
int i = PotionHelper.func_77915_a(((LaunchedPotion)par1Entity).getPotionDamage(), false);
|
||||
float f2 = (float)(i >> 16 & 255) / 255.0F;
|
||||
float f3 = (float)(i >> 8 & 255) / 255.0F;
|
||||
float f4 = (float)(i & 255) / 255.0F;
|
||||
GL11.glColor3f(f2, f3, f4);
|
||||
GL11.glPushMatrix();
|
||||
this.func_77026_a(tessellator, ItemPotion.func_94589_d("potion_contents"));
|
||||
GL11.glPopMatrix();
|
||||
GL11.glColor3f(1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
this.func_77026_a(tessellator, icon);
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
private void func_77026_a(Tessellator par1Tessellator, Icon par2Icon)
|
||||
{
|
||||
float f = par2Icon.getMinU();
|
||||
float f1 = par2Icon.getMaxU();
|
||||
float f2 = par2Icon.getMinV();
|
||||
float f3 = par2Icon.getMaxV();
|
||||
float f4 = 1.0F;
|
||||
float f5 = 0.5F;
|
||||
float f6 = 0.25F;
|
||||
GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
|
||||
par1Tessellator.startDrawingQuads();
|
||||
par1Tessellator.setNormal(0.0F, 1.0F, 0.0F);
|
||||
par1Tessellator.addVertexWithUV((double)(0.0F - f5), (double)(0.0F - f6), 0.0D, (double)f, (double)f3);
|
||||
par1Tessellator.addVertexWithUV((double)(f4 - f5), (double)(0.0F - f6), 0.0D, (double)f1, (double)f3);
|
||||
par1Tessellator.addVertexWithUV((double)(f4 - f5), (double)(f4 - f6), 0.0D, (double)f1, (double)f2);
|
||||
par1Tessellator.addVertexWithUV((double)(0.0F - f5), (double)(f4 - f6), 0.0D, (double)f, (double)f2);
|
||||
par1Tessellator.draw();
|
||||
}
|
||||
}
|
@ -28,11 +28,14 @@ public class BlueSlime extends EntityLiving implements IMob
|
||||
{
|
||||
super(world);
|
||||
this.texture = "/mods/tinker/textures/mob/slimeedible.png";
|
||||
int i = 1 << Math.max(1, this.rand.nextInt(4));
|
||||
int offset = Math.max(1, this.rand.nextInt(4));
|
||||
if (offset >= 3)
|
||||
offset--;
|
||||
int size = 1 << offset;
|
||||
this.yOffset = 0.0F;
|
||||
this.slimeJumpDelay = this.rand.nextInt(120) + 40;
|
||||
this.setSlimeSize(i);
|
||||
this.jumpMovementFactor = 0.004F * i + 0.01F;
|
||||
this.setSlimeSize(size);
|
||||
this.jumpMovementFactor = 0.004F * size + 0.01F;
|
||||
}
|
||||
|
||||
protected void damageEntity (DamageSource damageSource, int damage)
|
||||
@ -128,7 +131,7 @@ public class BlueSlime extends EntityLiving implements IMob
|
||||
this.worldObj.skylightSubtracted = i1;
|
||||
}
|
||||
|
||||
return light <= this.rand.nextInt(10);
|
||||
return light <= this.rand.nextInt(8);
|
||||
}
|
||||
}
|
||||
|
||||
|
192
mods/tinker/tconstruct/entity/LaunchedPotion.java
Normal file
@ -0,0 +1,192 @@
|
||||
package mods.tinker.tconstruct.entity;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class LaunchedPotion extends EntityThrowable
|
||||
{
|
||||
/**
|
||||
* The damage value of the thrown potion that this EntityPotion represents.
|
||||
*/
|
||||
private ItemStack potionDamage;
|
||||
|
||||
public LaunchedPotion(World par1World)
|
||||
{
|
||||
super(par1World);
|
||||
}
|
||||
|
||||
public LaunchedPotion(World par1World, EntityLiving par2EntityLiving, int par3)
|
||||
{
|
||||
this(par1World, par2EntityLiving, new ItemStack(Item.potion, 1, par3));
|
||||
}
|
||||
|
||||
public LaunchedPotion(World par1World, EntityLiving par2EntityLiving, ItemStack par3ItemStack)
|
||||
{
|
||||
super(par1World, par2EntityLiving);
|
||||
this.potionDamage = par3ItemStack;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public LaunchedPotion(World par1World, double par2, double par4, double par6, int par8)
|
||||
{
|
||||
this(par1World, par2, par4, par6, new ItemStack(Item.potion, 1, par8));
|
||||
}
|
||||
|
||||
public LaunchedPotion(World par1World, double par2, double par4, double par6, ItemStack par8ItemStack)
|
||||
{
|
||||
super(par1World, par2, par4, par6);
|
||||
this.potionDamage = par8ItemStack;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the amount of gravity to apply to the thrown entity with each tick.
|
||||
*/
|
||||
protected float getGravityVelocity()
|
||||
{
|
||||
return 0.05F;
|
||||
}
|
||||
|
||||
protected float func_70182_d()
|
||||
{
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
protected float func_70183_g()
|
||||
{
|
||||
return -10.0F;
|
||||
}
|
||||
|
||||
public void setPotionDamage(int par1)
|
||||
{
|
||||
if (this.potionDamage == null)
|
||||
{
|
||||
this.potionDamage = new ItemStack(Item.potion, 1, 0);
|
||||
}
|
||||
|
||||
this.potionDamage.setItemDamage(par1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the damage value of the thrown potion that this EntityPotion represents.
|
||||
*/
|
||||
public int getPotionDamage()
|
||||
{
|
||||
if (this.potionDamage == null)
|
||||
{
|
||||
this.potionDamage = new ItemStack(Item.potion, 1, 0);
|
||||
}
|
||||
|
||||
return this.potionDamage.getItemDamage();
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when this EntityThrowable hits a block or entity.
|
||||
*/
|
||||
protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
|
||||
{
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
List list = Item.potion.getEffects(this.potionDamage);
|
||||
|
||||
if (list != null && !list.isEmpty())
|
||||
{
|
||||
AxisAlignedBB axisalignedbb = this.boundingBox.expand(4.0D, 2.0D, 4.0D);
|
||||
List list1 = this.worldObj.getEntitiesWithinAABB(EntityLiving.class, axisalignedbb);
|
||||
|
||||
if (list1 != null && !list1.isEmpty())
|
||||
{
|
||||
Iterator iterator = list1.iterator();
|
||||
|
||||
while (iterator.hasNext())
|
||||
{
|
||||
EntityLiving entityliving = (EntityLiving)iterator.next();
|
||||
double d0 = this.getDistanceSqToEntity(entityliving);
|
||||
|
||||
if (d0 < 16.0D)
|
||||
{
|
||||
double d1 = 1.0D - Math.sqrt(d0) / 4.0D;
|
||||
|
||||
if (entityliving == par1MovingObjectPosition.entityHit)
|
||||
{
|
||||
d1 = 1.0D;
|
||||
}
|
||||
|
||||
Iterator iterator1 = list.iterator();
|
||||
|
||||
while (iterator1.hasNext())
|
||||
{
|
||||
PotionEffect potioneffect = (PotionEffect)iterator1.next();
|
||||
int i = potioneffect.getPotionID();
|
||||
|
||||
if (Potion.potionTypes[i].isInstant())
|
||||
{
|
||||
Potion.potionTypes[i].affectEntity(this.getThrower(), entityliving, potioneffect.getAmplifier(), d1);
|
||||
}
|
||||
else
|
||||
{
|
||||
int j = (int)(d1 * (double)potioneffect.getDuration() + 0.5D);
|
||||
|
||||
if (j > 20)
|
||||
{
|
||||
entityliving.addPotionEffect(new PotionEffect(i, j, potioneffect.getAmplifier()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.worldObj.playAuxSFX(2002, (int)Math.round(this.posX), (int)Math.round(this.posY), (int)Math.round(this.posZ), this.getPotionDamage());
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||
*/
|
||||
public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
|
||||
{
|
||||
super.readEntityFromNBT(par1NBTTagCompound);
|
||||
|
||||
if (par1NBTTagCompound.hasKey("Potion"))
|
||||
{
|
||||
this.potionDamage = ItemStack.loadItemStackFromNBT(par1NBTTagCompound.getCompoundTag("Potion"));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.setPotionDamage(par1NBTTagCompound.getInteger("potionValue"));
|
||||
}
|
||||
|
||||
if (this.potionDamage == null)
|
||||
{
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||
*/
|
||||
public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
|
||||
{
|
||||
super.writeEntityToNBT(par1NBTTagCompound);
|
||||
|
||||
if (this.potionDamage != null)
|
||||
{
|
||||
par1NBTTagCompound.setCompoundTag("Potion", this.potionDamage.writeToNBT(new NBTTagCompound()));
|
||||
}
|
||||
}
|
||||
}
|
@ -10,7 +10,7 @@ public class UnstableCreeper extends EntityCreeper
|
||||
protected int timeSinceIgnited;
|
||||
protected int lastActiveTime;
|
||||
|
||||
protected int explosionRadius = 3;
|
||||
protected float explosionRadius = 1.5f;
|
||||
|
||||
public UnstableCreeper(World world)
|
||||
{
|
||||
@ -31,11 +31,11 @@ public class UnstableCreeper extends EntityCreeper
|
||||
|
||||
if (this.getPowered())
|
||||
{
|
||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float) (this.explosionRadius * 2), flag);
|
||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float) (this.explosionRadius + 0.75f * (worldObj.difficultySetting-1))* 2, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float) this.explosionRadius, flag);
|
||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float) (this.explosionRadius + 0.75f * (worldObj.difficultySetting-1)), false);
|
||||
}
|
||||
|
||||
this.setDead();
|
||||
@ -87,11 +87,11 @@ public class UnstableCreeper extends EntityCreeper
|
||||
|
||||
if (this.getPowered())
|
||||
{
|
||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float) (this.explosionRadius * 2), flag);
|
||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float) (this.explosionRadius + 0.75f * (worldObj.difficultySetting-1))* 2, flag);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float) this.explosionRadius, flag);
|
||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float) (this.explosionRadius + 0.75f * (worldObj.difficultySetting-1)), flag);
|
||||
}
|
||||
|
||||
this.setDead();
|
||||
|
@ -297,7 +297,7 @@ public class AbilityHelper
|
||||
|
||||
charge -= mineSpeed;
|
||||
ToolCore tool = (ToolCore) stack.getItem();
|
||||
stack.setItemDamage(1 + (tool.getMaxCharge() - charge) * (stack.getMaxDamage() - 1) / tool.getMaxCharge());
|
||||
stack.setItemDamage(1 + (tool.getMaxCharge(stack) - charge) * (stack.getMaxDamage() - 1) / tool.getMaxCharge(stack));
|
||||
tags.setInteger("charge", charge);
|
||||
if (entity instanceof EntityPlayer)
|
||||
chargeFromArmor(stack, (EntityPlayer) entity);
|
||||
@ -317,7 +317,7 @@ public class AbilityHelper
|
||||
IElectricItem electricArmor = (IElectricItem) armor.getItem();
|
||||
ToolCore tool = (ToolCore) stack.getItem();
|
||||
|
||||
if (electricArmor.canProvideEnergy() && electricArmor.getTier() >= ((IElectricItem) stack.getItem()).getTier())
|
||||
if (electricArmor.canProvideEnergy(stack) && electricArmor.getTier(stack) >= ((IElectricItem) stack.getItem()).getTier(stack))
|
||||
{
|
||||
int chargeAmount = tool.charge(stack, Integer.MAX_VALUE, Integer.MAX_VALUE, true, true);
|
||||
chargeAmount = discharge(armor, chargeAmount, Integer.MAX_VALUE, true, false);
|
||||
@ -337,22 +337,22 @@ public class AbilityHelper
|
||||
}
|
||||
}
|
||||
|
||||
public static int discharge (ItemStack itemStack, int amount, int tier, boolean ignoreTransferLimit, boolean simulate)
|
||||
public static int discharge (ItemStack stack, int amount, int tier, boolean ignoreTransferLimit, boolean simulate)
|
||||
{
|
||||
IElectricItem ielectricitem = (IElectricItem) itemStack.getItem();
|
||||
IElectricItem ielectricitem = (IElectricItem) stack.getItem();
|
||||
|
||||
if (ielectricitem instanceof ICustomElectricItem)
|
||||
{
|
||||
return ((ICustomElectricItem) ielectricitem).discharge(itemStack, amount, tier, ignoreTransferLimit, simulate);
|
||||
return ((ICustomElectricItem) ielectricitem).discharge(stack, amount, tier, ignoreTransferLimit, simulate);
|
||||
}
|
||||
else if (amount >= 0 && itemStack.stackSize <= 1 && ielectricitem.getTier() <= tier)
|
||||
else if (amount >= 0 && stack.stackSize <= 1 && ielectricitem.getTier(stack) <= tier)
|
||||
{
|
||||
if (amount > ielectricitem.getTransferLimit() && !ignoreTransferLimit)
|
||||
if (amount > ielectricitem.getTransferLimit(stack) && !ignoreTransferLimit)
|
||||
{
|
||||
amount = ielectricitem.getTransferLimit();
|
||||
amount = ielectricitem.getTransferLimit(stack);
|
||||
}
|
||||
|
||||
NBTTagCompound tags = itemStack.getTagCompound();//StackUtil.getOrCreateNbtData(itemStack);
|
||||
NBTTagCompound tags = stack.getTagCompound();
|
||||
int charge = tags.getInteger("charge");
|
||||
|
||||
if (amount > charge)
|
||||
@ -365,24 +365,24 @@ public class AbilityHelper
|
||||
if (!simulate)
|
||||
{
|
||||
tags.setInteger("charge", charge);
|
||||
itemStack.itemID = charge > 0 ? ielectricitem.getChargedItemId() : ielectricitem.getEmptyItemId();
|
||||
stack.itemID = charge > 0 ? ielectricitem.getChargedItemId(stack) : ielectricitem.getEmptyItemId(stack);
|
||||
|
||||
if (itemStack.getItem() instanceof IElectricItem)
|
||||
if (stack.getItem() instanceof IElectricItem)
|
||||
{
|
||||
ielectricitem = (IElectricItem) itemStack.getItem();
|
||||
ielectricitem = (IElectricItem) stack.getItem();
|
||||
|
||||
if (itemStack.getMaxDamage() > 2)
|
||||
if (stack.getMaxDamage() > 2)
|
||||
{
|
||||
itemStack.setItemDamage(1 + (ielectricitem.getMaxCharge() - charge) * (itemStack.getMaxDamage() - 2) / ielectricitem.getMaxCharge());
|
||||
stack.setItemDamage(1 + (ielectricitem.getMaxCharge(stack) - charge) * (stack.getMaxDamage() - 2) / ielectricitem.getMaxCharge(stack));
|
||||
}
|
||||
else
|
||||
{
|
||||
itemStack.setItemDamage(0);
|
||||
stack.setItemDamage(0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
itemStack.setItemDamage(0);
|
||||
stack.setItemDamage(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -253,15 +253,15 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
|
||||
|
||||
if (power != 0)
|
||||
{
|
||||
if (power <= this.getMaxCharge() / 3)
|
||||
if (power <= this.getMaxCharge(stack) / 3)
|
||||
color = "\u00a74";
|
||||
else if (power > this.getMaxCharge() * 2 / 3)
|
||||
else if (power > this.getMaxCharge(stack) * 2 / 3)
|
||||
color = "\u00a72";
|
||||
else
|
||||
color = "\u00a76";
|
||||
}
|
||||
|
||||
String charge = new StringBuilder().append(color).append(tags.getInteger("charge")).append("/").append(getMaxCharge()).append(" En").toString();
|
||||
String charge = new StringBuilder().append(color).append(tags.getInteger("charge")).append("/").append(getMaxCharge(stack)).append(" En").toString();
|
||||
list.add(charge);
|
||||
}
|
||||
if (tags.hasKey("InfiTool"))
|
||||
@ -557,37 +557,37 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy ()
|
||||
public boolean canProvideEnergy (ItemStack itemStack)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getChargedItemId ()
|
||||
public int getChargedItemId (ItemStack itemStack)
|
||||
{
|
||||
return this.itemID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEmptyItemId ()
|
||||
public int getEmptyItemId (ItemStack itemStack)
|
||||
{
|
||||
return this.itemID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxCharge ()
|
||||
public int getMaxCharge (ItemStack itemStack)
|
||||
{
|
||||
return 10000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier ()
|
||||
public int getTier (ItemStack itemStack)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransferLimit ()
|
||||
public int getTransferLimit (ItemStack itemStack)
|
||||
{
|
||||
return 32;
|
||||
}
|
||||
@ -601,16 +601,16 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
|
||||
|
||||
if (amount > 0)
|
||||
{
|
||||
if (amount > getTransferLimit() && !ignoreTransferLimit)
|
||||
if (amount > getTransferLimit(stack) && !ignoreTransferLimit)
|
||||
{
|
||||
amount = getTransferLimit();
|
||||
amount = getTransferLimit(stack);
|
||||
}
|
||||
|
||||
int charge = tags.getInteger("charge");
|
||||
|
||||
if (amount > getMaxCharge() - charge)
|
||||
if (amount > getMaxCharge(stack) - charge)
|
||||
{
|
||||
amount = getMaxCharge() - charge;
|
||||
amount = getMaxCharge(stack) - charge;
|
||||
}
|
||||
|
||||
charge += amount;
|
||||
@ -618,7 +618,7 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
|
||||
if (!simulate)
|
||||
{
|
||||
tags.setInteger("charge", charge);
|
||||
stack.setItemDamage(1 + (getMaxCharge() - charge) * (stack.getMaxDamage() - 2) / getMaxCharge());
|
||||
stack.setItemDamage(1 + (getMaxCharge(stack) - charge) * (stack.getMaxDamage() - 2) / getMaxCharge(stack));
|
||||
}
|
||||
|
||||
return amount;
|
||||
@ -637,9 +637,9 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
|
||||
|
||||
if (amount > 0)
|
||||
{
|
||||
if (amount > getTransferLimit() && !ignoreTransferLimit)
|
||||
if (amount > getTransferLimit(stack) && !ignoreTransferLimit)
|
||||
{
|
||||
amount = getTransferLimit();
|
||||
amount = getTransferLimit(stack);
|
||||
}
|
||||
|
||||
int charge = tags.getInteger("charge");
|
||||
@ -654,7 +654,7 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
|
||||
if (!simulate)
|
||||
{
|
||||
tags.setInteger("charge", charge);
|
||||
stack.setItemDamage(1 + (getMaxCharge() - charge) * (stack.getMaxDamage() - 1) / getMaxCharge());
|
||||
stack.setItemDamage(1 + (getMaxCharge(stack) - charge) * (stack.getMaxDamage() - 1) / getMaxCharge(stack));
|
||||
}
|
||||
|
||||
return amount;
|
||||
@ -663,16 +663,16 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUse (ItemStack itemStack, int amount)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canShowChargeToolTip (ItemStack itemStack)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUse (ItemStack itemStack, int amount)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
122
mods/tinker/tconstruct/tools/PotionLauncher.java
Normal file
@ -0,0 +1,122 @@
|
||||
package mods.tinker.tconstruct.tools;
|
||||
|
||||
import mods.tinker.tconstruct.entity.LaunchedPotion;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class PotionLauncher extends Item
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private Icon[] icons;
|
||||
public static final String[] textureNames = new String[] { "potionlauncher" };
|
||||
|
||||
public PotionLauncher(int par1)
|
||||
{
|
||||
super(par1);
|
||||
this.maxStackSize = 1;
|
||||
this.setCreativeTab(CreativeTabs.tabCombat);
|
||||
this.setMaxDamage(3);
|
||||
}
|
||||
|
||||
public ItemStack onEaten (ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
if (stack.getItemDamage() == 0)
|
||||
stack.setItemDamage(1);
|
||||
return stack;
|
||||
}
|
||||
|
||||
public void onPlayerStoppedUsing(ItemStack stack, World world, EntityPlayer player, int time)
|
||||
{
|
||||
if (stack.getItemDamage() == 1)
|
||||
stack.setItemDamage(2);
|
||||
}
|
||||
|
||||
/**
|
||||
* How long it takes to use or consume an item
|
||||
*/
|
||||
public int getMaxItemUseDuration (ItemStack stack)
|
||||
{
|
||||
int meta = stack.getItemDamage();
|
||||
if (meta == 1)
|
||||
return 72000;
|
||||
else if (meta == 2)
|
||||
return 0;
|
||||
|
||||
return 30;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns the action that specifies what animation to play when the items is being used
|
||||
*/
|
||||
public EnumAction getItemUseAction (ItemStack stack)
|
||||
{
|
||||
if (stack.getItemDamage() == 0)
|
||||
return EnumAction.bow;
|
||||
else
|
||||
return EnumAction.none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
|
||||
*/
|
||||
public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
if (stack.getItemDamage() == 2)
|
||||
{
|
||||
world.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
|
||||
if (!world.isRemote)
|
||||
{
|
||||
world.spawnEntityInWorld(new LaunchedPotion(world, player, stack));
|
||||
}
|
||||
|
||||
stack.damageItem(1, player);
|
||||
System.out.println("Rawr! "+stack.getItemDamage());
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if (player.capabilities.isCreativeMode)
|
||||
{
|
||||
player.setItemInUse(stack, this.getMaxItemUseDuration(stack));
|
||||
}
|
||||
}
|
||||
return stack;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the enchantability factor of the item, most of the time is based on material.
|
||||
*/
|
||||
public int getItemEnchantability ()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void updateIcons (IconRegister par1IconRegister)
|
||||
{
|
||||
this.icons = new Icon[textureNames.length];
|
||||
|
||||
for (int i = 0; i < this.icons.length; ++i)
|
||||
{
|
||||
this.icons[i] = par1IconRegister.registerIcon("tinker:" + textureNames[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIconFromDamage (int meta)
|
||||
{
|
||||
return icons[0];
|
||||
}
|
||||
}
|
BIN
mods/tinker/textures/GGE/GUIPedestal.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
mods/tinker/textures/GGE/ItemLBInnerSide.png
Normal file
After Width: | Height: | Size: 739 B |
BIN
mods/tinker/textures/GGE/ItemLBOuterSide.png
Normal file
After Width: | Height: | Size: 477 B |
BIN
mods/tinker/textures/GGE/ItemLBPoleSide.png
Normal file
After Width: | Height: | Size: 772 B |
BIN
mods/tinker/textures/GGE/achievementsbg.png
Normal file
After Width: | Height: | Size: 395 B |
BIN
mods/tinker/textures/GGE/b.png
Normal file
After Width: | Height: | Size: 163 B |
BIN
mods/tinker/textures/GGE/core.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
mods/tinker/textures/GGE/corestone.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
mods/tinker/textures/GGE/elderpork.png
Normal file
After Width: | Height: | Size: 426 B |
BIN
mods/tinker/textures/GGE/face.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
mods/tinker/textures/GGE/glowlogside.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
mods/tinker/textures/GGE/glowlogtop.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
mods/tinker/textures/GGE/glowsapling.png
Normal file
After Width: | Height: | Size: 338 B |
BIN
mods/tinker/textures/GGE/lifebench top.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
mods/tinker/textures/GGE/lifebenchside.png
Normal file
After Width: | Height: | Size: 511 B |
BIN
mods/tinker/textures/GGE/lifebenchtop.png
Normal file
After Width: | Height: | Size: 894 B |
BIN
mods/tinker/textures/GGE/notebook.png
Normal file
After Width: | Height: | Size: 441 B |
BIN
mods/tinker/textures/GGE/recharger.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
mods/tinker/textures/GGE/transparency.png
Normal file
After Width: | Height: | Size: 182 B |
BIN
mods/tinker/textures/GGE/wand.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
mods/tinker/textures/blocks/golemcore.png
Normal file
After Width: | Height: | Size: 402 B |
BIN
mods/tinker/textures/blocks/golemhead_face.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
mods/tinker/textures/blocks/golemhead_side.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
mods/tinker/textures/blocks/golemhead_top.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
mods/tinker/textures/blocks/pedestal.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
mods/tinker/textures/blocks/pedestalbottom.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
mods/tinker/textures/blocks/pedestalside.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
mods/tinker/textures/blocks/pedestaltop.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
mods/tinker/textures/blocks/pedestaltopp.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
mods/tinker/textures/blocks/pedestaltops.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 11 KiB |
BIN
mods/tinker/textures/items/potionlauncher.png
Normal file
After Width: | Height: | Size: 1015 B |
14
test/NegaFood.java
Normal file
@ -0,0 +1,14 @@
|
||||
package test;
|
||||
|
||||
import net.minecraft.item.ItemFood;
|
||||
|
||||
public class NegaFood extends ItemFood
|
||||
{
|
||||
|
||||
public NegaFood()
|
||||
{
|
||||
super(10001, -20, 0, false);
|
||||
setAlwaysEdible();
|
||||
}
|
||||
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
package test;
|
||||
|
||||
import mods.tinker.tconstruct.entity.BlueSlime;
|
||||
import mods.tinker.tconstruct.entity.UnstableCreeper;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
@ -28,7 +28,7 @@ public class XinStick extends Item
|
||||
//spawnItem(player.posX, player.posY, player.posZ, tool, world);
|
||||
//CartEntity cart = new CartEntity(world, 1);
|
||||
//cart.cartType = 1;
|
||||
spawnEntity(player.posX, player.posY+1, player.posZ, new BlueSlime(world), world, player);
|
||||
spawnEntity(player.posX, player.posY+1, player.posZ, new UnstableCreeper(world), world, player);
|
||||
return stack;
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,7 @@ import javax.script.ScriptException;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.Init;
|
||||
import cpw.mods.fml.common.Mod.PostInit;
|
||||
@ -24,13 +25,14 @@ public class mod_Test
|
||||
{
|
||||
public static Item xinstick;
|
||||
public static Item TArmorChestplate;
|
||||
public static Item negaFood;
|
||||
public KeyBinding grabKey;
|
||||
EntityPlayer player;
|
||||
|
||||
@PreInit
|
||||
public void preInit(FMLPreInitializationEvent evt)
|
||||
{
|
||||
System.out.println("Test!");
|
||||
//System.out.println("Test!");
|
||||
}
|
||||
|
||||
@Init
|
||||
@ -67,6 +69,8 @@ public class mod_Test
|
||||
static
|
||||
{
|
||||
xinstick = new XinStick(10000).setUnlocalizedName("xinstick");
|
||||
LanguageRegistry.addName(xinstick, "XinRecord");
|
||||
negaFood = new NegaFood().setUnlocalizedName("negaFood");
|
||||
LanguageRegistry.addName(xinstick, "XinBroken");
|
||||
LanguageRegistry.addName(negaFood, "Negafood");
|
||||
}
|
||||
}
|
||||
|