ForgeHammer update rewrite fk refactoriung
This commit is contained in:
@@ -79,16 +79,8 @@ public class Forge extends BlockContainer implements TileForgePlaceables{
|
||||
if (MathHelper.abs((float)p_150071_4_.posX - (float)p_150071_1_) < 2.0F && MathHelper.abs((float)p_150071_4_.posZ - (float)p_150071_3_) < 2.0F)
|
||||
{
|
||||
double d0 = p_150071_4_.posY + 1.82D - (double)p_150071_4_.yOffset;
|
||||
|
||||
if (d0 - (double)p_150071_2_ > 2.0D)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ((double)p_150071_2_ - d0 > 0.0D)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if (d0 - (double)p_150071_2_ > 2.0D){return 1;}
|
||||
if ((double)p_150071_2_ - d0 > 0.0D) {return 0;}
|
||||
}
|
||||
|
||||
int l = MathHelper.floor_double((double)(p_150071_4_.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
||||
@@ -99,8 +91,6 @@ public class Forge extends BlockContainer implements TileForgePlaceables{
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack p_149689_6_) {
|
||||
int l = determineOrientation(world, x, y, z, player);
|
||||
world.setBlockMetadataWithNotify(x, y, z, l, 2);
|
||||
System.out.println(world.getBlockMetadata(x, y, z));
|
||||
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}
|
||||
|
||||
@@ -127,8 +117,10 @@ public class Forge extends BlockContainer implements TileForgePlaceables{
|
||||
(player.inventory.getCurrentItem().getItem()==Items.flint_and_steel)||
|
||||
(player.inventory.getCurrentItem().getItem()==ModItems.fireBow)
|
||||
){
|
||||
tileEnt.isOn=true;
|
||||
System.out.println(tileEnt.isOn);
|
||||
tileEnt.isBurning=true;
|
||||
if(tileEnt.getStackInSlot(1)!=null){
|
||||
tileEnt.isOn=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ public final class ModCrafting {
|
||||
GameRegistry.addRecipe(new ItemStack(Items.chainmail_boots), new Object[] {" ", "x x", "x x", 'x', ModItems.ironRingMesh});
|
||||
//Character.valueOf('x'), new ItemStack(ModItems.forgeHammer, 1, OreDictionary.WILDCARD_VALUE)
|
||||
GameRegistry.addRecipe(new ItemStack(Items.saddle), new Object[]{"WWW", "i i", "x x", 'W', ModItems.wovenLeather, 'i', ModItems.leatherStrap, 'x', ModItems.ironRing});
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.shitblock), new Object[]{"xx", "xx", 'x', ModItems.itemShit});
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.shitblock), new Object[]{"xxx", "xxx","xxx", 'x', ModItems.itemShit});
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.eggWashedWall, 5), new Object[]{"xyx", "yxy","xyx", 'y', Items.egg, 'x', Blocks.stone});
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.eggWashedBrick, 5), new Object[]{"xyx", "yxy","xyx", 'y', Items.egg, 'x', ModBlocks.eggWashedWall});
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.woodenPlate), new Object[]{" x ", "xxx", " x ", 'x', Blocks.wooden_slab});
|
||||
|
||||
@@ -743,28 +743,26 @@ public final class ModItems {
|
||||
GameRegistry.registerItem(charcoalFilter, "charcoalFilter");
|
||||
|
||||
rawCuredLeather = new RawCuredLeather();
|
||||
//ironShield = new ItemIronShield();
|
||||
fireBow = new FireBow();
|
||||
leatherShears = new LeatherShears();
|
||||
ironSaw = new IronSaw();
|
||||
flintSaw = new FlintSaw();
|
||||
|
||||
ironPickaxeForm = new IronPickaxeForm();
|
||||
ironSpadForm = new IronSpadeForm();
|
||||
ironHoeForm = new IronHoeForm();
|
||||
ironAxeForm = new IronAxeForm();
|
||||
ironLongswordForm = new IronLongswordForm();
|
||||
ironShortSwordForm = new IronShortSwordForm();
|
||||
ironDaggerForm = new IronDaggerForm();
|
||||
ironHandleForm = new IronHandleForm();
|
||||
ironSpearTipForm = new IronSpearTipForm();
|
||||
ironMaceHeadForm = new IronMaceHeadForm();
|
||||
ironBattleAxeForm = new IronBattleAxeForm();
|
||||
ironSawBladeForm = new IronSawBladeForm();
|
||||
ironSharpTipForm = new IronSharpTipForm();
|
||||
ironRingForm = new IronRingForm();
|
||||
ironAxeForm = new IronAxeForm("ironAxeForm", ironAxeForm);
|
||||
ironBattleAxeForm = new IronBattleAxeForm("ironBattleAxeForm", ironBattleAxeForm);
|
||||
ironDaggerForm = new IronDaggerForm("ironDaggerForm", ironDaggerForm);
|
||||
ironHandleForm = new IronHandleForm("ironHandleForm", ironHandleForm);
|
||||
ironHoeForm = new IronHoeForm("ironHoeForm", ironHoeForm);
|
||||
ironLongswordForm = new IronLongswordForm("ironLongswordForm", ironLongswordForm);
|
||||
ironMaceHeadForm = new IronMaceHeadForm("ironMaceHeadForm", ironMaceHeadForm);
|
||||
ironPickaxeForm = new IronPickaxeForm("ironPickaxeForm", ironPickaxeForm);
|
||||
ironRingForm = new IronRingForm("ironRingForm", ironRingForm);
|
||||
ironSawBladeForm = new IronSawBladeForm("ironSawBladeForm", ironSawBladeForm);
|
||||
ironSharpTipForm = new IronSharpTipForm("ironSharpTipForm", ironSharpTipForm);
|
||||
ironShortSwordForm = new IronShortSwordForm("ironShortSwordForm", ironShortSwordForm);
|
||||
ironSpadForm = new IronSpadeForm("ironSpadeForm", ironSpadForm);
|
||||
ironSpearTipForm = new IronSpearTipForm("ironSpearTipForm", ironSpearTipForm);
|
||||
//clayFormBook = new ItemClayFormBook();
|
||||
|
||||
|
||||
//-----------------------MATERIALS REGISTERY-----------------------//
|
||||
|
||||
|
||||
@@ -17,28 +17,28 @@ import net.minecraft.world.World;
|
||||
|
||||
import com.kitsu.medievalcraft.Main;
|
||||
import com.kitsu.medievalcraft.block.ModBlocks;
|
||||
import com.kitsu.medievalcraft.block.ingots.IngotBase;
|
||||
import com.kitsu.medievalcraft.crafting.ForgeAnvilCrafting;
|
||||
import com.kitsu.medievalcraft.crafting.TestForgeCrafting;
|
||||
import com.kitsu.medievalcraft.item.ModItems;
|
||||
import com.kitsu.medievalcraft.packethandle.forgeHammerParticles.MsgPacket;
|
||||
import com.kitsu.medievalcraft.packethandle.forgeHammerParticles.MsgPacketLocY;
|
||||
import com.kitsu.medievalcraft.packethandle.forgeHammerParticles.MsgPacketLocZ;
|
||||
import com.kitsu.medievalcraft.packethandle.forgeHammerParticles.MsgPacketlTicks;
|
||||
import com.kitsu.medievalcraft.item.forms.iron.IronForms;
|
||||
import com.kitsu.medievalcraft.tileents.ingots.TileIronPlate;
|
||||
import com.kitsu.medievalcraft.tileents.ingots.TileMyIronIngot;
|
||||
import com.kitsu.medievalcraft.tileents.machine.TileEntityAnvilForge;
|
||||
import com.kitsu.medievalcraft.util.CustomTab;
|
||||
import com.kitsu.medievalcraft.util.IronFormNames;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
|
||||
public class ForgeHammer extends Item {
|
||||
public class ForgeHammer extends Item implements IronFormNames{
|
||||
|
||||
private String name = "forgeHammer";
|
||||
private Item item;
|
||||
//private Block test;
|
||||
private int hit, key, blockKey, keys;
|
||||
public static boolean forgeHammerLeftClick;
|
||||
//TileEntityHotIronIngotBlock tileBlock;
|
||||
//TileEntityHotIronPlate tilePlate;
|
||||
TileMyIronIngot tileRefIngot;
|
||||
TileIronPlate tilePlate;
|
||||
Random rand;
|
||||
|
||||
public ForgeHammer() {
|
||||
@@ -72,18 +72,31 @@ public class ForgeHammer extends Item {
|
||||
|
||||
private void onClick(Block block, Block blockSub, World world, int x, int y, int z, EntityPlayer p, ItemStack stack, Random rand){
|
||||
|
||||
if(block == ModBlocks.hotIronBlock){
|
||||
tileBlock = (TileEntityHotIronIngotBlock) world.getTileEntity(x, y, z);
|
||||
if(block == ModBlocks.refinedIron){
|
||||
tileRefIngot = (TileMyIronIngot) world.getTileEntity(x, y, z);
|
||||
}
|
||||
if(block == ModBlocks.hotIronPlate){
|
||||
tilePlate = (TileEntityHotIronPlate) world.getTileEntity(x, y, z);
|
||||
if(block == ModBlocks.ironPlate){
|
||||
tilePlate = (TileIronPlate) world.getTileEntity(x, y, z);
|
||||
}
|
||||
if((block == blockToRun(block)) && (blockSub == ModBlocks.forgeAnvil) && (p.isSwingInProgress == false)){
|
||||
TileEntityAnvilForge tileEnt = (TileEntityAnvilForge) world.getTileEntity(x, y-1, z);
|
||||
|
||||
if((block instanceof IngotBase)&&(blockSub == ModBlocks.forgeAnvil) && (p.isSwingInProgress == false)){
|
||||
TileEntityAnvilForge tileEnt = (TileEntityAnvilForge) world.getTileEntity(x, y-1, z);
|
||||
if(tileEnt.getStackInSlot(0).getItem() instanceof IronForms){
|
||||
if(){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*if((block == blockToRun(block)) && (blockSub == ModBlocks.forgeAnvil) && (p.isSwingInProgress == false)){
|
||||
TileEntityAnvilForge tileEnt = (TileEntityAnvilForge) world.getTileEntity(x, y-1, z);
|
||||
|
||||
if((tileEnt.getStackInSlot(0) == null) && (blockKey == 0)){
|
||||
if (rand.nextInt(2) == 0 ) {
|
||||
tileBlock.hits++;
|
||||
tileRefIngot.hits++;
|
||||
}
|
||||
p.worldObj.playSoundAtEntity(p, Main.MODID + ":anvilhammer", 1.0F, 1.0F);
|
||||
Main.sNet.sendToAll(new MsgPacket(true));
|
||||
@@ -91,8 +104,8 @@ public class ForgeHammer extends Item {
|
||||
Main.sNet.sendToAll(new MsgPacketLocY(y));
|
||||
Main.sNet.sendToAll(new MsgPacketLocZ(z));
|
||||
|
||||
if(tileBlock.hits >= 4){
|
||||
tileBlock.hits = 0;
|
||||
if(tileRefIngot.hits >= 4){
|
||||
tileRefIngot.hits = 0;
|
||||
p.worldObj.playSoundAtEntity(p, Main.MODID + ":anvilhammer", 1.0F, 1.0F);
|
||||
Main.sNet.sendToAll(new MsgPacket(true));
|
||||
Main.sNet.sendToAll(new MsgPacketlTicks(x));
|
||||
@@ -105,7 +118,7 @@ public class ForgeHammer extends Item {
|
||||
if((tileEnt.getStackInSlot(0) != null)){
|
||||
if((tileEnt.getStackInSlot(0).getItem() == Items.flower_pot) && (blockKey == 0)){
|
||||
if (rand.nextInt(2) == 0 ) {
|
||||
tileBlock.hits++;
|
||||
tileRefIngot.hits++;
|
||||
}
|
||||
p.worldObj.playSoundAtEntity(p, Main.MODID + ":anvilhammer", 1.0F, 1.0F);
|
||||
Main.sNet.sendToAll(new MsgPacket(true));
|
||||
@@ -113,8 +126,8 @@ public class ForgeHammer extends Item {
|
||||
Main.sNet.sendToAll(new MsgPacketLocY(y));
|
||||
Main.sNet.sendToAll(new MsgPacketLocZ(z));
|
||||
|
||||
if(tileBlock.hits >= 4){
|
||||
tileBlock.hits = 0;
|
||||
if(tileRefIngot.hits >= 4){key
|
||||
tileRefIngot.hits = 0;
|
||||
p.worldObj.playSoundAtEntity(p, Main.MODID + ":anvilhammer", 1.0F, 1.0F);
|
||||
Main.sNet.sendToAll(new MsgPacket(true));
|
||||
Main.sNet.sendToAll(new MsgPacketlTicks(x));
|
||||
@@ -142,11 +155,11 @@ public class ForgeHammer extends Item {
|
||||
Main.sNet.sendToAll(new MsgPacketLocZ(z));
|
||||
stack.damageItem(1, p);
|
||||
if (rand.nextInt(2) == 0 ) {
|
||||
tileBlock.hits++;
|
||||
tileRefIngot.hits++;
|
||||
}
|
||||
}
|
||||
if(tileBlock.hits >= 4){
|
||||
tileBlock.hits=0;
|
||||
if(tileRefIngot.hits >= 4){
|
||||
tileRefIngot.hits=0;
|
||||
checkItem.setDamage(tileEnt.getStackInSlot(0), 0);
|
||||
world.setBlock(x, y, z, Blocks.air, 0, 2);
|
||||
}
|
||||
@@ -158,7 +171,7 @@ public class ForgeHammer extends Item {
|
||||
Main.sNet.sendToAll(new MsgPacketlTicks(x));
|
||||
Main.sNet.sendToAll(new MsgPacketLocY(y));
|
||||
Main.sNet.sendToAll(new MsgPacketLocZ(z));
|
||||
tilePlate.hitGood=true;
|
||||
|
||||
if (rand.nextInt(2) == 0 ) {
|
||||
tilePlate.hits++;
|
||||
}
|
||||
@@ -174,7 +187,7 @@ public class ForgeHammer extends Item {
|
||||
if((checkItem == getItem(checkItem)) || (checkItem == getItem3(checkItem)) || (checkItem == getItem2(checkItem).getItem())){
|
||||
if (rand.nextInt(2) == 0 ) {
|
||||
if(blockKey == 0){
|
||||
tileBlock.hits++;
|
||||
tileRefIngot.hits++;
|
||||
}
|
||||
if(blockKey == 3){
|
||||
tilePlate.hits++;
|
||||
@@ -188,8 +201,8 @@ public class ForgeHammer extends Item {
|
||||
|
||||
if((blockKey == 0) && (checkItem == getItem(checkItem))){
|
||||
|
||||
if(tileBlock.hits >= 4){
|
||||
tileBlock.hits=0;
|
||||
if(tileRefIngot.hits >= 4){
|
||||
tileRefIngot.hits=0;
|
||||
giveItem(key, world, x, y, z, p);
|
||||
stack.damageItem(1, p);
|
||||
if(tileEnt.getStackInSlot(0).getMaxStackSize() == 1){
|
||||
@@ -204,8 +217,8 @@ public class ForgeHammer extends Item {
|
||||
}
|
||||
|
||||
if((blockKey == 0) && (checkItem == getItem3(checkItem))){
|
||||
if(tileBlock.hits >= 4){
|
||||
tileBlock.hits=0;
|
||||
if(tileRefIngot.hits >= 4){
|
||||
tileRefIngot.hits=0;
|
||||
giveItem(key, world, x, y, z, p);
|
||||
stack.damageItem(1, p);
|
||||
if(tileEnt.getStackInSlot(0).getMaxStackSize() == 1){
|
||||
@@ -238,6 +251,7 @@ public class ForgeHammer extends Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
/*
|
||||
@@ -248,15 +262,9 @@ public class ForgeHammer extends Item {
|
||||
|
||||
public void giveItem(int a, World world, int x, int y, int z, EntityPlayer p){
|
||||
if(blockKey == 0){
|
||||
//Item item = ForgeAnvilCrafting.itemToGive.get(key);
|
||||
//ItemStack stack = ForgeAnvilCrafting.itemToGive.get(key);
|
||||
|
||||
//world.spawnParticle("lava", x, y, z, 0.0F, 0.0F, 0.0F);
|
||||
world.setBlock(x, y, z, Blocks.air, 0, 2);
|
||||
p.worldObj.playSoundAtEntity(p, Main.MODID + ":anvilhammer", 1.0F, 1.0F);
|
||||
world.spawnEntityInWorld(new EntityItem(world, x+0.5D, y+0.6D, z+0.5D, ForgeAnvilCrafting.itemToGive.get(key)));
|
||||
//stack.stackTagCompound = new NBTTagCompound();
|
||||
//stack.stackTagCompound.setInteger("UPGRADES", 0);
|
||||
}
|
||||
if(blockKey == 3){
|
||||
Item item = ForgeAnvilCrafting.itemToCheck.get(key);
|
||||
|
||||
@@ -5,48 +5,13 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.kitsu.medievalcraft.Main;
|
||||
import com.kitsu.medievalcraft.util.CustomTab;
|
||||
import com.kitsu.medievalcraft.item.ModItems;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class IronAxeForm extends Item {
|
||||
private String name = "ironAxeForm";
|
||||
private Item item;
|
||||
|
||||
public IronAxeForm() {
|
||||
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName(name);
|
||||
setCreativeTab(CustomTab.MedievalCraftTab);
|
||||
setTextureName(Main.MODID + ":" + name);
|
||||
setMaxDamage(64);
|
||||
setNoRepair();
|
||||
|
||||
item = this;
|
||||
|
||||
GameRegistry.registerItem(this, name);
|
||||
|
||||
|
||||
public class IronAxeForm extends IronForms {
|
||||
|
||||
public IronAxeForm(String name, Item item) {
|
||||
super(name, item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemstack) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getContainerItem()
|
||||
{
|
||||
item.setDamage(new ItemStack(item), +1);
|
||||
//itemStack.setItemDamage(itemStack.getItemDamage() + 1);
|
||||
return item;
|
||||
}
|
||||
|
||||
public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,45 +8,9 @@ import com.kitsu.medievalcraft.util.CustomTab;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class IronBattleAxeForm extends Item {
|
||||
private String name = "ironBattleAxeForm";
|
||||
private Item item;
|
||||
|
||||
public IronBattleAxeForm() {
|
||||
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName(name);
|
||||
setCreativeTab(CustomTab.MedievalCraftTab);
|
||||
setTextureName(Main.MODID + ":" + name);
|
||||
setMaxDamage(64);
|
||||
setNoRepair();
|
||||
|
||||
item = this;
|
||||
|
||||
GameRegistry.registerItem(this, name);
|
||||
|
||||
|
||||
public class IronBattleAxeForm extends IronForms {
|
||||
|
||||
public IronBattleAxeForm(String name, Item item) {
|
||||
super(name, item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemstack) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getContainerItem()
|
||||
{
|
||||
item.setDamage(new ItemStack(item), +1);
|
||||
//itemStack.setItemDamage(itemStack.getItemDamage() + 1);
|
||||
return item;
|
||||
}
|
||||
|
||||
public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,45 +8,11 @@ import com.kitsu.medievalcraft.util.CustomTab;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class IronDaggerForm extends Item {
|
||||
private String name = "ironDaggerForm";
|
||||
private Item item;
|
||||
|
||||
public IronDaggerForm() {
|
||||
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName(name);
|
||||
setCreativeTab(CustomTab.MedievalCraftTab);
|
||||
setTextureName(Main.MODID + ":" + name);
|
||||
setMaxDamage(64);
|
||||
setNoRepair();
|
||||
|
||||
item = this;
|
||||
|
||||
GameRegistry.registerItem(this, name);
|
||||
|
||||
|
||||
public class IronDaggerForm extends IronForms {
|
||||
|
||||
public IronDaggerForm(String name, Item item) {
|
||||
super(name, item);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemstack) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getContainerItem()
|
||||
{
|
||||
item.setDamage(new ItemStack(item), +1);
|
||||
//itemStack.setItemDamage(itemStack.getItemDamage() + 1);
|
||||
return item;
|
||||
}
|
||||
|
||||
public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.kitsu.medievalcraft.item.forms.iron;
|
||||
|
||||
import com.kitsu.medievalcraft.Main;
|
||||
import com.kitsu.medievalcraft.util.CustomTab;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public abstract class IronForms extends Item {
|
||||
|
||||
protected IronForms(String name, Item item){
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName(name);
|
||||
setCreativeTab(CustomTab.MedievalCraftTab);
|
||||
setTextureName(Main.MODID + ":" + name);
|
||||
setMaxDamage(64);
|
||||
setNoRepair();
|
||||
item = this;
|
||||
GameRegistry.registerItem(this, name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemstack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getContainerItem()
|
||||
{
|
||||
this.setDamage(new ItemStack(this), +1);
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,43 +8,11 @@ import com.kitsu.medievalcraft.util.CustomTab;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class IronHandleForm extends Item {
|
||||
private String name = "ironHandleForm";
|
||||
private Item item;
|
||||
|
||||
public IronHandleForm() {
|
||||
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName(name);
|
||||
setCreativeTab(CustomTab.MedievalCraftTab);
|
||||
setTextureName(Main.MODID + ":" + name);
|
||||
setMaxDamage(64);
|
||||
setNoRepair();
|
||||
|
||||
item = this;
|
||||
|
||||
GameRegistry.registerItem(this, name);
|
||||
public class IronHandleForm extends IronForms {
|
||||
|
||||
public IronHandleForm(String name, Item item) {
|
||||
super(name, item);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemstack) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getContainerItem()
|
||||
{
|
||||
item.setDamage(new ItemStack(item), +1);
|
||||
//itemStack.setItemDamage(itemStack.getItemDamage() + 1);
|
||||
return item;
|
||||
}
|
||||
|
||||
public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -8,45 +8,11 @@ import com.kitsu.medievalcraft.util.CustomTab;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class IronHoeForm extends Item {
|
||||
private String name = "ironHoeForm";
|
||||
private Item item;
|
||||
|
||||
public IronHoeForm() {
|
||||
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName(name);
|
||||
setCreativeTab(CustomTab.MedievalCraftTab);
|
||||
setTextureName(Main.MODID + ":" + name);
|
||||
setMaxDamage(64);
|
||||
setNoRepair();
|
||||
|
||||
item = this;
|
||||
|
||||
GameRegistry.registerItem(this, name);
|
||||
|
||||
|
||||
public class IronHoeForm extends IronForms {
|
||||
|
||||
public IronHoeForm(String name, Item item) {
|
||||
super(name, item);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemstack) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getContainerItem()
|
||||
{
|
||||
item.setDamage(new ItemStack(item), +1);
|
||||
//itemStack.setItemDamage(itemStack.getItemDamage() + 1);
|
||||
return item;
|
||||
}
|
||||
|
||||
public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -8,44 +8,11 @@ import com.kitsu.medievalcraft.util.CustomTab;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class IronLongswordForm extends Item {
|
||||
private String name = "ironLongswordForm";
|
||||
private Item item;
|
||||
|
||||
public IronLongswordForm() {
|
||||
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName(name);
|
||||
setCreativeTab(CustomTab.MedievalCraftTab);
|
||||
setTextureName(Main.MODID + ":" + name);
|
||||
setMaxDamage(64);
|
||||
setNoRepair();
|
||||
|
||||
item = this;
|
||||
|
||||
GameRegistry.registerItem(this, name);
|
||||
|
||||
|
||||
public class IronLongswordForm extends IronForms {
|
||||
|
||||
public IronLongswordForm(String name, Item item) {
|
||||
super(name, item);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemstack) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getContainerItem()
|
||||
{
|
||||
item.setDamage(new ItemStack(item), +1);
|
||||
return item;
|
||||
}
|
||||
|
||||
public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,45 +8,10 @@ import com.kitsu.medievalcraft.util.CustomTab;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class IronMaceHeadForm extends Item {
|
||||
private String name = "ironMaceHeadForm";
|
||||
private Item item;
|
||||
|
||||
public IronMaceHeadForm() {
|
||||
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName(name);
|
||||
setCreativeTab(CustomTab.MedievalCraftTab);
|
||||
setTextureName(Main.MODID + ":" + name);
|
||||
setMaxDamage(64);
|
||||
setNoRepair();
|
||||
|
||||
item = this;
|
||||
|
||||
GameRegistry.registerItem(this, name);
|
||||
|
||||
|
||||
public class IronMaceHeadForm extends IronForms {
|
||||
|
||||
public IronMaceHeadForm(String name, Item item) {
|
||||
super(name, item);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemstack) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getContainerItem()
|
||||
{
|
||||
item.setDamage(new ItemStack(item), +1);
|
||||
//itemStack.setItemDamage(itemStack.getItemDamage() + 1);
|
||||
return item;
|
||||
}
|
||||
|
||||
public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,43 +8,10 @@ import com.kitsu.medievalcraft.util.CustomTab;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class IronPickaxeForm extends Item {
|
||||
private String name = "ironPickaxeForm";
|
||||
private Item item;
|
||||
|
||||
public IronPickaxeForm() {
|
||||
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName(name);
|
||||
setCreativeTab(CustomTab.MedievalCraftTab);
|
||||
setTextureName(Main.MODID + ":" + name);
|
||||
setMaxDamage(64);
|
||||
setNoRepair();
|
||||
|
||||
item = this;
|
||||
|
||||
GameRegistry.registerItem(this, name);
|
||||
public class IronPickaxeForm extends IronForms {
|
||||
|
||||
public IronPickaxeForm(String name, Item item) {
|
||||
super(name, item);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemstack) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getContainerItem()
|
||||
{
|
||||
item.setDamage(new ItemStack(item), +1);
|
||||
//itemStack.setItemDamage(itemStack.getItemDamage() + 1);
|
||||
return item;
|
||||
}
|
||||
|
||||
public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,45 +8,10 @@ import com.kitsu.medievalcraft.util.CustomTab;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class IronRingForm extends Item {
|
||||
private String name = "ironRingForm";
|
||||
private Item item;
|
||||
|
||||
public IronRingForm() {
|
||||
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName(name);
|
||||
setCreativeTab(CustomTab.MedievalCraftTab);
|
||||
setTextureName(Main.MODID + ":" + name);
|
||||
setMaxDamage(200);
|
||||
setNoRepair();
|
||||
|
||||
item = this;
|
||||
|
||||
GameRegistry.registerItem(this, name);
|
||||
|
||||
|
||||
public class IronRingForm extends IronForms {
|
||||
|
||||
public IronRingForm(String name, Item item) {
|
||||
super(name, item);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemstack) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getContainerItem()
|
||||
{
|
||||
item.setDamage(new ItemStack(item), +1);
|
||||
//itemStack.setItemDamage(itemStack.getItemDamage() + 1);
|
||||
return item;
|
||||
}
|
||||
|
||||
public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,45 +8,11 @@ import com.kitsu.medievalcraft.util.CustomTab;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class IronSawBladeForm extends Item {
|
||||
private String name = "ironSawBladeForm";
|
||||
private Item item;
|
||||
|
||||
public IronSawBladeForm() {
|
||||
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName(name);
|
||||
setCreativeTab(CustomTab.MedievalCraftTab);
|
||||
setTextureName(Main.MODID + ":" + name);
|
||||
setMaxDamage(64);
|
||||
setNoRepair();
|
||||
|
||||
item = this;
|
||||
|
||||
GameRegistry.registerItem(this, name);
|
||||
|
||||
|
||||
public class IronSawBladeForm extends IronForms {
|
||||
|
||||
public IronSawBladeForm(String name, Item item) {
|
||||
super(name, item);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemstack) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getContainerItem()
|
||||
{
|
||||
item.setDamage(new ItemStack(item), +1);
|
||||
//itemStack.setItemDamage(itemStack.getItemDamage() + 1);
|
||||
return item;
|
||||
}
|
||||
|
||||
public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,45 +8,11 @@ import com.kitsu.medievalcraft.util.CustomTab;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class IronSharpTipForm extends Item {
|
||||
private String name = "ironSharpTipForm";
|
||||
private Item item;
|
||||
|
||||
public IronSharpTipForm() {
|
||||
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName(name);
|
||||
setCreativeTab(CustomTab.MedievalCraftTab);
|
||||
setTextureName(Main.MODID + ":" + name);
|
||||
setMaxDamage(200);
|
||||
setNoRepair();
|
||||
|
||||
item = this;
|
||||
|
||||
GameRegistry.registerItem(this, name);
|
||||
|
||||
|
||||
public class IronSharpTipForm extends IronForms {
|
||||
|
||||
public IronSharpTipForm(String name, Item item) {
|
||||
super(name, item);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemstack) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getContainerItem()
|
||||
{
|
||||
item.setDamage(new ItemStack(item), +1);
|
||||
//itemStack.setItemDamage(itemStack.getItemDamage() + 1);
|
||||
return item;
|
||||
}
|
||||
|
||||
public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,45 +8,10 @@ import com.kitsu.medievalcraft.util.CustomTab;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class IronShortSwordForm extends Item {
|
||||
private String name = "ironShortSwordForm";
|
||||
private Item item;
|
||||
|
||||
public IronShortSwordForm() {
|
||||
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName(name);
|
||||
setCreativeTab(CustomTab.MedievalCraftTab);
|
||||
setTextureName(Main.MODID + ":" + name);
|
||||
setMaxDamage(64);
|
||||
setNoRepair();
|
||||
|
||||
item = this;
|
||||
|
||||
GameRegistry.registerItem(this, name);
|
||||
|
||||
|
||||
public class IronShortSwordForm extends IronForms {
|
||||
|
||||
public IronShortSwordForm(String name, Item item) {
|
||||
super(name, item);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemstack) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getContainerItem()
|
||||
{
|
||||
item.setDamage(new ItemStack(item), +1);
|
||||
//itemStack.setItemDamage(itemStack.getItemDamage() + 1);
|
||||
return item;
|
||||
}
|
||||
|
||||
public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,45 +8,12 @@ import com.kitsu.medievalcraft.util.CustomTab;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class IronSpadeForm extends Item {
|
||||
private String name = "ironSpadForm";
|
||||
private Item item;
|
||||
|
||||
public IronSpadeForm() {
|
||||
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName(name);
|
||||
setCreativeTab(CustomTab.MedievalCraftTab);
|
||||
setTextureName(Main.MODID + ":" + name);
|
||||
setMaxDamage(64);
|
||||
setNoRepair();
|
||||
|
||||
item = this;
|
||||
|
||||
GameRegistry.registerItem(this, name);
|
||||
|
||||
|
||||
public class IronSpadeForm extends IronForms {
|
||||
|
||||
public IronSpadeForm(String name, Item item) {
|
||||
super(name, item);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemstack) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getContainerItem()
|
||||
{
|
||||
item.setDamage(new ItemStack(item), +1);
|
||||
//itemStack.setItemDamage(itemStack.getItemDamage() + 1);
|
||||
return item;
|
||||
}
|
||||
|
||||
public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,45 +8,10 @@ import com.kitsu.medievalcraft.util.CustomTab;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class IronSpearTipForm extends Item {
|
||||
private String name = "ironSpearTipForm";
|
||||
private Item item;
|
||||
|
||||
public IronSpearTipForm() {
|
||||
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName(name);
|
||||
setCreativeTab(CustomTab.MedievalCraftTab);
|
||||
setTextureName(Main.MODID + ":" + name);
|
||||
setMaxDamage(64);
|
||||
setNoRepair();
|
||||
|
||||
item = this;
|
||||
|
||||
GameRegistry.registerItem(this, name);
|
||||
|
||||
|
||||
public class IronSpearTipForm extends IronForms {
|
||||
|
||||
public IronSpearTipForm(String name, Item item) {
|
||||
super(name, item);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemstack) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getContainerItem()
|
||||
{
|
||||
item.setDamage(new ItemStack(item), +1);
|
||||
//itemStack.setItemDamage(itemStack.getItemDamage() + 1);
|
||||
return item;
|
||||
}
|
||||
|
||||
public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
||||
public class ForgeAnvilRenderer extends TileEntitySpecialRenderer {
|
||||
|
||||
ItemStack stack;
|
||||
EntityItem entItem = null;
|
||||
|
||||
private static final ResourceLocation MODEL_CRUCIBLE = new ResourceLocation("kitsumedievalcraft:models/ForgeAnvil.obj");
|
||||
@@ -32,20 +31,10 @@ public class ForgeAnvilRenderer extends TileEntitySpecialRenderer {
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float scale) {
|
||||
TileEntityAnvilForge tileEntity = (TileEntityAnvilForge)tile;
|
||||
if(tileEntity.getStackInSlot(0)!=null){
|
||||
stack = tileEntity.getStackInSlot(0);
|
||||
}
|
||||
if(tileEntity.getStackInSlot(0)==null){
|
||||
stack = null;
|
||||
}
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glTranslatef((float) x, (float) y, (float) z);
|
||||
|
||||
renderBlock(tileEntity, tile.getWorldObj(), tile.xCoord,tile.yCoord, tile.zCoord, ModBlocks.forgeAnvil);
|
||||
if(stack != null){
|
||||
entItem = new EntityItem(tileEntity.getWorldObj(), x, y, z, stack);
|
||||
if(tileEntity.getStackInSlot(0)!=null){
|
||||
entItem = new EntityItem(tileEntity.getWorldObj(), x, y, z, tileEntity.getStackInSlot(0));
|
||||
GL11.glPushMatrix();
|
||||
this.entItem.hoverStart = 0.0F;
|
||||
RenderItem.renderInFrame = true;
|
||||
@@ -54,11 +43,11 @@ public class ForgeAnvilRenderer extends TileEntitySpecialRenderer {
|
||||
RenderItem.renderInFrame = false;
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
renderBlock(tileEntity, tile.getWorldObj(), tile.xCoord,tile.yCoord, tile.zCoord, ModBlocks.forgeAnvil);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "cast"})
|
||||
|
||||
public void renderBlock(TileEntityAnvilForge tl, World world, int i, int j,int k, Block block) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
// This will make your block brightness dependent from surroundings
|
||||
|
||||
@@ -30,6 +30,9 @@ public class ForgeRenderer extends TileEntitySpecialRenderer {
|
||||
EntityItem entItem1 = null;
|
||||
public static final ResourceLocation MODEL = new ResourceLocation("kitsumedievalcraft:models/SingleForge.obj");
|
||||
public static final ResourceLocation TEXTURE = new ResourceLocation("kitsumedievalcraft:models/SingleForge.png");
|
||||
public static final ResourceLocation TEXTURE1 = new ResourceLocation("kitsumedievalcraft:models/SingleForgeBurning.png");
|
||||
public static final ResourceLocation TEXTURE2 = new ResourceLocation("kitsumedievalcraft:models/SingleForgeOn.png");
|
||||
private ResourceLocation loc;
|
||||
|
||||
IModelCustom model = AdvancedModelLoader.loadModel(MODEL);
|
||||
|
||||
@@ -37,10 +40,9 @@ public class ForgeRenderer extends TileEntitySpecialRenderer {
|
||||
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float scale) {
|
||||
TileForge tileEntity = (TileForge)tile;
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glTranslatef((float) x, (float) y, (float) z);
|
||||
|
||||
renderBlock(tileEntity, tile.getWorldObj(), tile.xCoord,tile.yCoord, tile.zCoord, ModBlocks.forge);
|
||||
|
||||
|
||||
if(tileEntity.getStackInSlot(1) != null){
|
||||
entItem1 = new EntityItem(tileEntity.getWorldObj(), x, y, z, tileEntity.getStackInSlot(1));
|
||||
@@ -80,11 +82,20 @@ public class ForgeRenderer extends TileEntitySpecialRenderer {
|
||||
tileEntity.markForUpdate();
|
||||
tileEntity.markDirty();
|
||||
}
|
||||
/*if(tileEntity.isOn==false && tileEntity.isBurning==false){
|
||||
loc = TEXTURE;
|
||||
}
|
||||
if(tileEntity.isOn==false && tileEntity.isBurning==true){
|
||||
loc = TEXTURE1;
|
||||
}*/
|
||||
|
||||
if(loc == null){
|
||||
loc = TEXTURE;
|
||||
}
|
||||
|
||||
|
||||
//tileEntity.markForUpdate();
|
||||
//tileEntity.markDirty();
|
||||
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(loc);
|
||||
renderBlock(tileEntity, tile.getWorldObj(), tile.xCoord,tile.yCoord, tile.zCoord, ModBlocks.forge);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
}
|
||||
@@ -107,7 +118,7 @@ public class ForgeRenderer extends TileEntitySpecialRenderer {
|
||||
if(dir == 3){
|
||||
GL11.glRotated(-90F, 0.0, 1.0F, 0.0F);
|
||||
}
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE);
|
||||
|
||||
|
||||
this.model.renderAll();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
/*
|
||||
package com.kitsu.medievalcraft.renderer.blocks.machine;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.kitsu.medievalcraft.block.ModBlocks;
|
||||
import com.kitsu.medievalcraft.tileents.machine.ModelSandFilter;
|
||||
import com.kitsu.medievalcraft.tileents.machine.TileEntitySandFilterEmpty;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
||||
public class SandFilterEmptyRenderer extends TileEntitySpecialRenderer {
|
||||
|
||||
private ModelSandFilter model;
|
||||
public static boolean render;
|
||||
|
||||
public SandFilterEmptyRenderer () {
|
||||
model = new ModelSandFilter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEnt, double x, double y, double z, float scale) {
|
||||
World world = tileEnt.getWorldObj();
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glTranslatef((float) x, (float) y, (float) z);
|
||||
TileEntitySandFilterEmpty tileEntityBlock = (TileEntitySandFilterEmpty) world.getTileEntity((int) x, (int) y, (int) z);
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(ModelSandFilter.TEXTUREEMPTY);
|
||||
//FMLClientHandler.instance().getClient().renderEngine.bindTexture(SandFilterTexture.filterText.get(renderInt));
|
||||
|
||||
renderBlock(tileEntityBlock, tileEnt.getWorldObj(), tileEnt.xCoord, tileEnt.yCoord, tileEnt.zCoord, ModBlocks.sandFilterEmpty);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@SuppressWarnings({"cast"})
|
||||
public void renderBlock(TileEntitySandFilterEmpty tileSand, World world, int x, int y,int z, Block block) {
|
||||
tileSand = (TileEntitySandFilterEmpty) world.getTileEntity(x, y, z);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
float f = block.getLightOpacity(world, x, y, z);
|
||||
int l = world.getLightBrightnessForSkyBlocks(x, y, z, 0);
|
||||
int l1 = l % 65536;
|
||||
int l2 = l / 65536;
|
||||
tessellator.setColorOpaque_F(f, f, f);
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit,(float) l1, (float) l2);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
float scale = 0.8F;
|
||||
GL11.glScalef(scale, scale-0.05F, scale);
|
||||
GL11.glTranslatef(0.62F,0.58F,0.62F);
|
||||
|
||||
//ResourceLocation TEXTUREGET = new ResourceLocation(tileSand.getTexture(world, x, y, z));
|
||||
//ResourceLocation TEXTURE = new ResourceLocation("kitsumedievalcraft:models/SandFilter.png");
|
||||
//ResourceLocation TEXTUREEMPTY = new ResourceLocation("kitsumedievalcraft:models/SandFilterEmpty.png");
|
||||
|
||||
//if (render == false){
|
||||
//FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTUREGET);
|
||||
//}
|
||||
//if (render == true){
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(ModelSandFilter.TEXTUREEMPTY);
|
||||
//}
|
||||
//FMLClientHandler.instance().getClient().renderEngine.bindTexture(ModelSandFilter.TEXTURE);
|
||||
//FMLClientHandler.instance().getClient().renderEngine.bindTexture(tileSand.getTexture(world, x, y, z));
|
||||
|
||||
this.model.render();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
@@ -8,8 +8,8 @@ public class TileDamascus extends TileIngotBase{
|
||||
super(nameCustom);
|
||||
this.hits = 0;
|
||||
this.hot = false;
|
||||
this.coolTicks = 100;
|
||||
this.heatTicks = 100;
|
||||
|
||||
this.heatTicks = 500;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package com.kitsu.medievalcraft.tileents.ingots;
|
||||
|
||||
import com.kitsu.medievalcraft.block.ModBlocks;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
@@ -10,11 +7,15 @@ import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileIngotBase extends TileEntity {
|
||||
import com.kitsu.medievalcraft.block.ModBlocks;
|
||||
import com.kitsu.medievalcraft.tileents.machine.TileEntityAnvilForge;
|
||||
import com.kitsu.medievalcraft.util.IronFormNames;
|
||||
|
||||
public class TileIngotBase extends TileEntity implements IronFormNames{
|
||||
|
||||
private String specName;
|
||||
public int hits = 0;
|
||||
public int coolTicks = 100;
|
||||
public int coolTicks = 250;
|
||||
public int heatTicks = 100;
|
||||
public boolean hot;
|
||||
|
||||
@@ -41,8 +42,8 @@ public class TileIngotBase extends TileEntity {
|
||||
if(this.coolTicks<=0){
|
||||
world.setBlockMetadataWithNotify(x, y, z, 0, 2);
|
||||
}
|
||||
coolDown(world, x, y, z);
|
||||
//System.out.println(this.heatTicks);
|
||||
coolDown(world,x,y,z);
|
||||
//makeItem(world,x,y,z);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -61,7 +62,24 @@ public class TileIngotBase extends TileEntity {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
private void makeItem(World world, int x, int y, int z){
|
||||
if(this.hits==0 && this.hot==true && world.getBlock(x, y-1, z).equals(ModBlocks.forgeAnvil)){
|
||||
TileEntityAnvilForge tile = (TileEntityAnvilForge) world.getTileEntity(x, y-1, z);
|
||||
if(tile.getStackInSlot(0)!=null){
|
||||
|
||||
|
||||
|
||||
System.out.println(forms.get(tile.getStackInSlot(0).getItem().getUnlocalizedName()));
|
||||
if(tile.getStackInSlot(0).equals(forms.get(tile.getStackInSlot(0).getItem().getUnlocalizedName()))){
|
||||
System.out.println("Logic is Working");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tagCompound)
|
||||
{
|
||||
|
||||
@@ -8,8 +8,7 @@ public class TileIronPlate extends TileIngotBase{
|
||||
super(nameCustom);
|
||||
this.hits = 0;
|
||||
this.hot = false;
|
||||
this.coolTicks = 100;
|
||||
this.heatTicks = 100;
|
||||
this.heatTicks = 450;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@ public class TileLapisIngot extends TileIngotBase{
|
||||
super(nameCustom);
|
||||
this.hits = 0;
|
||||
this.hot = false;
|
||||
this.coolTicks = 100;
|
||||
this.heatTicks = 100;
|
||||
this.coolTicks = 300;
|
||||
this.heatTicks = 600;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@ public class TileMyIronIngot extends TileIngotBase{
|
||||
super(nameCustom);
|
||||
this.hits = 0;
|
||||
this.hot = false;
|
||||
this.coolTicks = 100;
|
||||
this.heatTicks = 100;
|
||||
|
||||
this.heatTicks = 450;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@ public class TileRedstoneIngot extends TileIngotBase{
|
||||
super(nameCustom);
|
||||
this.hits = 0;
|
||||
this.hot = false;
|
||||
this.coolTicks = 100;
|
||||
this.heatTicks = 100;
|
||||
this.coolTicks = 300;
|
||||
this.heatTicks = 600;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -238,7 +238,6 @@ public class TileEntityFirebox extends TileEntity implements IInventory{
|
||||
if(isItemFuel(stack)==true){
|
||||
this.ticks++;
|
||||
double burnTime = (this.getItemBurnTime(stack)+((fuelMulti(stack.stackSize, stack)*this.getItemBurnTime(stack))));
|
||||
//System.out.println(this.ticks+" "+ burnTime+" "+this.getStackInSlot(0).stackSize);
|
||||
if(time >= burnTime){
|
||||
decrStackSize(0, 1);
|
||||
this.ticks=0;
|
||||
@@ -264,7 +263,6 @@ public class TileEntityFirebox extends TileEntity implements IInventory{
|
||||
}
|
||||
}
|
||||
return 0.0d;
|
||||
|
||||
}
|
||||
public static int getItemBurnTime(ItemStack p_145952_0_)
|
||||
{
|
||||
|
||||
@@ -1,8 +1,17 @@
|
||||
package com.kitsu.medievalcraft.tileents.machine;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemHoe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemSword;
|
||||
import net.minecraft.item.ItemTool;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
@@ -14,13 +23,16 @@ import net.minecraft.world.World;
|
||||
import com.kitsu.medievalcraft.block.ingots.IngotBase;
|
||||
import com.kitsu.medievalcraft.tileents.ingots.TileIngotBase;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class TileForge extends TileEntity implements IInventory{
|
||||
private String tileForgeName;
|
||||
private ItemStack[] inv;
|
||||
private NBTTagCompound tag = new NBTTagCompound();
|
||||
public int heat;
|
||||
public boolean isOn;
|
||||
public boolean grate;
|
||||
public boolean isBurning;
|
||||
private int ticks;
|
||||
|
||||
public TileForge(){
|
||||
this.inv = new ItemStack[2];
|
||||
@@ -148,8 +160,9 @@ public class TileForge extends TileEntity implements IInventory{
|
||||
}
|
||||
//this.stack0 = tagCompound.getString("stack0");
|
||||
this.heat = tag.getInteger("HEAT");
|
||||
this.isOn = tag.getBoolean("ISCOAL");
|
||||
this.grate = tag.getBoolean("GRATE");
|
||||
this.isOn = tag.getBoolean("ISON");
|
||||
this.ticks = tag.getInteger("TICKS");
|
||||
this.isBurning = tag.getBoolean("BURNING");
|
||||
|
||||
}
|
||||
|
||||
@@ -169,9 +182,10 @@ public class TileForge extends TileEntity implements IInventory{
|
||||
}
|
||||
tagCompound.setTag("Inventory", itemList);
|
||||
tag.setInteger("HEAT", this.heat);
|
||||
tag.setBoolean("ISCOAL", this.isOn);
|
||||
tag.setBoolean("GRATE", this.grate);
|
||||
|
||||
tag.setBoolean("ISON", this.isOn);
|
||||
tag.setBoolean("BURNING", this.isBurning);
|
||||
tag.setInteger("TICKS", this.ticks);
|
||||
|
||||
}
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
@@ -193,42 +207,136 @@ public class TileForge extends TileEntity implements IInventory{
|
||||
int x = this.xCoord;
|
||||
int y = this.yCoord;
|
||||
int z = this.zCoord;
|
||||
heatIngot(world, x, y, z);
|
||||
/*if(world.getBlock(x, y+1, z).equals(Blocks.air)||this.getStackInSlot(0)==null){
|
||||
this.isOn = false;
|
||||
}
|
||||
if((this.getStackInSlot(0)==null)&&(world.getBlock(x, y+1, z).equals(Blocks.fire))){
|
||||
world.setBlock(x, y+1, z, Blocks.air, 0, 2);
|
||||
this.isOn=false;
|
||||
}
|
||||
if(this.isOn==true && world.getBlock(x, y+1, z).equals(Blocks.air)){
|
||||
world.setBlock(x, y+1, z, Blocks.fire, 0, 2);
|
||||
}
|
||||
if(world.getBlock(x, y+1, z).equals(Blocks.fire)){
|
||||
this.isOn = true;
|
||||
}
|
||||
*/
|
||||
//fireboxFuelDec(world, x, y, z, this.getStackInSlot(0), this.ticks);
|
||||
//isFurnace(world, x, y, z);
|
||||
//isCrucible(world, x, y, z);
|
||||
//isIngot(world, x, y, z);
|
||||
|
||||
if(!world.isRemote){
|
||||
forgeMaint(world,x,y,z);
|
||||
heatIngot(world, x, y, z);
|
||||
fireboxFuelDec(world, x, y, z,this.getStackInSlot(0), this.ticks);
|
||||
fireboxFuelDec2(world, x, y, z,this.getStackInSlot(1), this.ticks);
|
||||
}
|
||||
if (worldObj.isRemote) return;
|
||||
}
|
||||
|
||||
|
||||
private void heatIngot(World world, int x, int y, int z){
|
||||
if(!world.isRemote){
|
||||
if(world.getBlock(x, y+1, z) instanceof IngotBase){
|
||||
TileIngotBase tile = (TileIngotBase) world.getTileEntity(x, y+1, z);
|
||||
if(tile.hot==false){
|
||||
tile.heatTicks--;
|
||||
System.out.println(tile.hot);
|
||||
System.out.println(tile.heatTicks);
|
||||
if(this.isOn==true){
|
||||
if(tile.hot==false){
|
||||
tile.heatTicks--;
|
||||
//System.out.println(tile.hot);
|
||||
//System.out.println(tile.heatTicks);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void fireboxFuelDec(World world, int x, int y, int z, ItemStack stack, int time){
|
||||
if(world.getBlock(x, y+1, z).equals(Blocks.fire)){
|
||||
if(stack!=null){
|
||||
if(isItemFuel(stack)==true){
|
||||
this.ticks++;
|
||||
double burnTime = (this.getItemBurnTime(stack)+((fuelMulti(stack.stackSize, stack)*this.getItemBurnTime(stack))));
|
||||
//System.out.println(this.ticks+" "+ burnTime+" "+this.getStackInSlot(0).stackSize);
|
||||
if(time >= burnTime){
|
||||
decrStackSize(0, 1);
|
||||
this.ticks=0;
|
||||
}
|
||||
markForUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void fireboxFuelDec2(World world, int x, int y, int z, ItemStack stack, int time){
|
||||
if(world.getBlock(x, y+1, z).equals(Blocks.fire)){
|
||||
if(stack!=null){
|
||||
if(isItemFuel(stack)==true){
|
||||
this.ticks++;
|
||||
double burnTime = 1.5*(this.getItemBurnTime(stack)+((fuelMulti(stack.stackSize, stack)*this.getItemBurnTime(stack))));
|
||||
//System.out.println(this.ticks+" "+ burnTime+" "+this.getStackInSlot(0).stackSize);
|
||||
if(time >= burnTime){
|
||||
decrStackSize(0, 1);
|
||||
this.ticks=0;
|
||||
}
|
||||
markForUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static double fuelMulti(int i, ItemStack stack){
|
||||
if(stack!=null){
|
||||
if(stack.stackSize<=15){
|
||||
return 0.25;
|
||||
}
|
||||
if(stack.stackSize>=16 && stack.stackSize<=31){
|
||||
return 0.5;
|
||||
}
|
||||
if(stack.stackSize>=32 && stack.stackSize<=47){
|
||||
return 0.75;
|
||||
}
|
||||
if(stack.stackSize>=48){
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0.0d;
|
||||
}
|
||||
|
||||
public static int getItemBurnTime(ItemStack p_145952_0_)
|
||||
{
|
||||
if (p_145952_0_ == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
Item item = p_145952_0_.getItem();
|
||||
|
||||
if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air)
|
||||
{
|
||||
Block block = Block.getBlockFromItem(item);
|
||||
|
||||
if (block == Blocks.wooden_slab)
|
||||
{
|
||||
return 150;
|
||||
}
|
||||
|
||||
if (block.getMaterial() == Material.wood)
|
||||
{
|
||||
return 300;
|
||||
}
|
||||
|
||||
if (block == Blocks.coal_block)
|
||||
{
|
||||
return 16000;
|
||||
}
|
||||
}
|
||||
|
||||
if (item instanceof ItemTool && ((ItemTool)item).getToolMaterialName().equals("WOOD")) return 200;
|
||||
if (item instanceof ItemSword && ((ItemSword)item).getToolMaterialName().equals("WOOD")) return 200;
|
||||
if (item instanceof ItemHoe && ((ItemHoe)item).getToolMaterialName().equals("WOOD")) return 200;
|
||||
if (item == Items.stick) return 100;
|
||||
if (item == Items.coal) return 1600;
|
||||
if (item == Items.lava_bucket) return 20000;
|
||||
if (item == Item.getItemFromBlock(Blocks.sapling)) return 100;
|
||||
if (item == Items.blaze_rod) return 2400;
|
||||
return GameRegistry.getFuelValue(p_145952_0_);
|
||||
}
|
||||
|
||||
public static boolean isItemFuel(ItemStack stack)
|
||||
{
|
||||
return getItemBurnTime(stack) > 0;
|
||||
}
|
||||
|
||||
private void forgeMaint(World world, int x, int y, int z){
|
||||
if(this.getStackInSlot(0)==null){
|
||||
this.isOn = false;
|
||||
this.isBurning = false;
|
||||
}
|
||||
if(this.getStackInSlot(1)==null){
|
||||
this.isOn = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.kitsu.medievalcraft.util;
|
||||
|
||||
import java.util.Hashtable;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.kitsu.medievalcraft.block.ModBlocks;
|
||||
import com.kitsu.medievalcraft.item.ModItems;
|
||||
|
||||
public interface IronFormNames {
|
||||
|
||||
static final Hashtable<Item, ItemStack> forms = new Hashtable <Item, ItemStack>(){{
|
||||
|
||||
put(ModItems.ironAxeForm, new ItemStack(ModItems.ironaxeHead, 1));
|
||||
put(ModItems.ironBattleAxeForm, new ItemStack(ModItems.ironbattleaxeHead, 1));
|
||||
put(ModItems.ironDaggerForm, new ItemStack(ModItems.irondaggerBlade, 1));
|
||||
put(ModItems.ironHandleForm, new ItemStack(ModItems.ironweaponHandle, 1));
|
||||
put(ModItems.ironHoeForm, new ItemStack(ModItems.ironhoeHead, 1));
|
||||
put(ModItems.ironLongswordForm, new ItemStack(ModItems.ironlongswordBlade, 1));
|
||||
put(ModItems.ironMaceHeadForm, new ItemStack(ModItems.ironmaceHead, 1));
|
||||
put(ModItems.ironPickaxeForm, new ItemStack(ModItems.ironpickaxeHead, 1));
|
||||
put(ModItems.ironRingForm, new ItemStack(ModItems.ironRing, 1));
|
||||
put(ModItems.ironSawBladeForm, new ItemStack(ModItems.ironsawBlade, 1));
|
||||
put(ModItems.ironSharpTipForm, new ItemStack(ModItems.ironsharpTip, 1));
|
||||
put(ModItems.ironShortSwordForm, new ItemStack(ModItems.ironshortswordBlade, 1));
|
||||
put(ModItems.ironSpadForm, new ItemStack(ModItems.ironspadeHead, 1));
|
||||
put(ModItems.ironSpearTipForm, new ItemStack(ModItems.ironspearTip, 1));
|
||||
|
||||
}};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user