forge updates

This commit is contained in:
kitsushadow
2015-07-02 05:01:11 -04:00
parent 80231e7888
commit 590ba1b08e
32 changed files with 114 additions and 126 deletions

View File

@@ -35,7 +35,7 @@ public class Forge extends BlockContainer implements TileForgePlaceables{
super(material.rock);
this.setBlockName(unlocalizedName);
this.setBlockTextureName(Main.MODID + ":" + unlocalizedName);
this.setCreativeTab(CustomTab.MedievalCraftTab);
//this.setCreativeTab(CustomTab.MedievalCraftTab);
this.setHardness(3.0F);
this.setResistance(5.0F);
this.setHarvestLevel("pickaxe", 1, 0);
@@ -92,8 +92,8 @@ public class Forge extends BlockContainer implements TileForgePlaceables{
player.inventory.getCurrentItem().getItem()==placeMe.get(2).getItem()||
player.inventory.getCurrentItem().getItem()==placeMe.get(3).getItem()||
player.inventory.getCurrentItem().getItem()==placeMe.get(4).getItem()){
tileEnt.setInventorySlotContents(0, player.inventory.getCurrentItem());
ItemStack tempStack = new ItemStack(player.inventory.getCurrentItem().getItem(), 1);
tileEnt.setInventorySlotContents(0, tempStack);
player.inventory.decrStackSize(player.inventory.currentItem, 1);
}
}

View File

@@ -54,8 +54,8 @@ public class ForgeRenderer extends TileEntitySpecialRenderer {
this.entCoal.hoverStart = 0.0F;
RenderItem.renderInFrame = true;
GL11.glScalef(0.5f, 0.5f, 0.5f);
GL11.glRotatef(90, 1, 0, 0);
RenderManager.instance.renderEntityWithPosYaw(entCoal, 1.55D, 1.3D, -0.79D, 0.0F, 0.0F);
RenderManager.instance.renderEntityWithPosYaw(entCoal, 1.0D, 1.0D, -0.5D, 0.0F, 0.0F);
RenderManager.instance.renderEntityWithPosYaw(entCoal, 1.15D, 1.3D, -0.79D, 0.0F, 0.0F);
RenderManager.instance.renderEntityWithPosYaw(entCoal, 0.75D, 1.3D, -0.79D, 0.0F, 0.0F);
RenderManager.instance.renderEntityWithPosYaw(entCoal, 0.35D, 1.3D, -0.79D, 0.0F, 0.0F);
@@ -85,7 +85,7 @@ public class ForgeRenderer extends TileEntitySpecialRenderer {
RenderItem.renderInFrame = true;
GL11.glScalef(1.0f, 1.0f, 1.0f);
GL11.glRotatef(10, 0, 1, 0);
RenderManager.instance.renderEntityWithPosYaw(entItem, 0.4D, 0.325D, 0.6D, 0.0F, 0.0F);
RenderManager.instance.renderEntityWithPosYaw(entItem, 0.4D, 0.3D, 0.6D, 0.0F, 0.0F);
RenderItem.renderInFrame = false;
GL11.glPopMatrix();
}
@@ -101,7 +101,7 @@ public class ForgeRenderer extends TileEntitySpecialRenderer {
GL11.glPushMatrix();
//GL11.glRotatef(15F, 0F, 1F, 0F);
float scale = 0.50f;
GL11.glScalef(scale, scale, scale);
GL11.glScalef(scale, 1f, scale);
GL11.glTranslatef(1.0F, 0.2F, 1.0F);
int dir = world.getBlockMetadata(i, j, k);
if(dir == 1){

View File

@@ -15,6 +15,8 @@ public class IronPlateIR implements IItemRenderer {
public static final ResourceLocation MODEL_CRUCIBLE = new ResourceLocation("kitsumedievalcraft:models/IronPlate.obj");
public static final ResourceLocation TEXTURE = new ResourceLocation("kitsumedievalcraft:models/IronPlate.png");
public static final ResourceLocation TEXTURE1 = new ResourceLocation("kitsumedievalcraft:models/HotIronPlate.png");
private ResourceLocation loc;
public IModelCustom model = AdvancedModelLoader.loadModel(MODEL_CRUCIBLE);
@@ -73,14 +75,15 @@ public class IronPlateIR implements IItemRenderer {
GL11.glPushMatrix();
float scale = 0.75F;
GL11.glScalef(scale, 3.5F, scale);
//ANGLE, X ROTATE, Y ROTATE, Z ROTATE
//GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F);
//GL11.glRotatef(10F, 1.0F, 0.0F, 0.0F);
//GL11.glRotated(90, 1.0, 0.0, 0.0);
GL11.glTranslatef(1.0F, 0.0F, 0.0F);
if(item.getItemDamage()==0){
loc=TEXTURE;
}
if(item.getItemDamage()==1){
loc=TEXTURE1;
}
Minecraft.getMinecraft().renderEngine.bindTexture(loc);
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
model.renderAll();
@@ -92,15 +95,15 @@ public class IronPlateIR implements IItemRenderer {
float f = 2.0F;
GL11.glPushMatrix();
GL11.glScalef(f, 8.0F, f);
//ANGLE, X ROTATE, Y ROTATE, Z ROTATE
GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F);
GL11.glTranslatef(1.3F, -0.2F, 1.7F);
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
if(item.getItemDamage()==0){
loc=TEXTURE;
}
if(item.getItemDamage()==1){
loc=TEXTURE1;
}
Minecraft.getMinecraft().renderEngine.bindTexture(loc);
model.renderAll();
GL11.glPopMatrix();
@@ -113,13 +116,13 @@ public class IronPlateIR implements IItemRenderer {
GL11.glEnable(GL11.GL_TEXTURE_2D);
float f = 0.66F;
GL11.glScalef(f, 4.0F, f);
//GL11.glRotatef(90, 1.0F, 0.0F, 0.0F);
//GL11.glTranslatef(1.0F, 0.0F, -1.0F);
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
if(item.getItemDamage()==0){
loc=TEXTURE;
}
if(item.getItemDamage()==1){
loc=TEXTURE1;
}
Minecraft.getMinecraft().renderEngine.bindTexture(loc);
model.renderAll();
GL11.glPopMatrix();
@@ -128,12 +131,14 @@ public class IronPlateIR implements IItemRenderer {
case ENTITY: {
GL11.glPushMatrix();
//float f = 0.8F;
GL11.glScalef(1.0F, 3.0F, 1.0F);
//GL11.glTranslatef(0.0F, 0.0F, 0.0F);
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
if(item.getItemDamage()==0){
loc=TEXTURE;
}
if(item.getItemDamage()==1){
loc=TEXTURE1;
}
Minecraft.getMinecraft().renderEngine.bindTexture(loc);
model.renderAll();
GL11.glPopMatrix();

View File

@@ -35,12 +35,14 @@ public class TileIngotBase extends TileEntity {
if(!world.isRemote){
if(this.heatTicks<=0){
world.setBlockMetadataWithNotify(x, y, z, 1, 2);
this.hot=true;
this.heatTicks=100;
}
if(this.coolTicks<=0){
world.setBlockMetadataWithNotify(x, y, z, 0, 2);
}
coolDown(world, x, y, z);
//System.out.println(this.hot);
//System.out.println(this.heatTicks);
}
}

View File

@@ -1,7 +1,5 @@
package com.kitsu.medievalcraft.tileents.machine;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
@@ -23,7 +21,9 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import com.kitsu.medievalcraft.block.ModBlocks;
import com.kitsu.medievalcraft.block.ingots.IngotBase;
import com.kitsu.medievalcraft.crafting.TestForgeCrafting;
import com.kitsu.medievalcraft.tileents.ingots.TileIngotBase;
import cpw.mods.fml.common.registry.GameRegistry;
@@ -151,31 +151,16 @@ public class TileEntityTestForge extends TileEntity implements IInventory {
Block fire = world.getBlock(x, y-1, z);
TileEntityTestForge tileEnt = (TileEntityTestForge) world.getTileEntity(x, y, z);
if(!world.isRemote){
if(fire.equals(Blocks.fire)){
if(checkBlock.equals(Blocks.snow) || checkBlock.equals(Blocks.snow_layer)){
world.setBlock(x, y+1, z, Blocks.air, 0, 2);
this.worldObj.playSoundEffect(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D, "random.fizz", 0.2F, 0.4F);
}
if(checkBlock.equals(Blocks.ice) || checkBlock.equals(Blocks.packed_ice)){
world.setBlock(x, y+1, z, Blocks.water, 0, 2);
this.worldObj.playSoundEffect(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D, "random.fizz", 0.2F, 0.4F);
}
if((checkBlock.equals(getBlock(checkBlock))) && (isItemFuel(tileEnt.getStackInSlot(0))) && (isAir.equals(Blocks.air)) && (fire.equals(Blocks.fire))){
Random rand = new Random();
if ((rand.nextInt(20) == 0)){
world.setBlock(x, y+3, z, ModBlocks.blockSmoke, 0, 2);
if(fire==ModBlocks.firebox){
TileEntityFirebox box = (TileEntityFirebox) world.getTileEntity(x, y-1, z);
if(checkBlock instanceof IngotBase && box.isOn==true && isItemFuel(this.getStackInSlot(0))==true){
TileIngotBase tile = (TileIngotBase) world.getTileEntity(x, y+1, z);
System.out.println(tile.hot);
System.out.println(tile.heatTicks);
if(tile.hot==false){
tile.heatTicks--;
}
ticks++;
//System.out.println(tag.getInteger("TICKS") + ":" + tag.getInteger("FUELTICKS"));
if(ticks == getCookTime(ticks)){
world.setBlock(x, y+1, z, TestForgeCrafting.blockToCook.get(type), 0, 2);
ticks=0;
}
}
}
}
}
}
@@ -189,7 +174,7 @@ public class TileEntityTestForge extends TileEntity implements IInventory {
fuelTicks++;
//System.out.println(fuelTicks + " " + getItemBurnTime(tileEnt.getStackInSlot(0)));
if(fuelTicks >= getItemBurnTime(tileEnt.getStackInSlot(0))){
if(fuelTicks >= 2*getItemBurnTime(tileEnt.getStackInSlot(0))){
fuelTicks = 0;
if (tileEnt.getStackInSlot(0).stackSize == 1){

View File

@@ -191,11 +191,7 @@ public class TileForge extends TileEntity implements IInventory{
int z = this.zCoord;
if(!world.isRemote){
if(!world.isRemote){
if(this.getStackInSlot(0)!=null){
System.out.println(this.getStackInSlot(0).getItemDamage());
ItemStack c = new ItemStack(this.getStackInSlot(0).getItem(),1,1);
this.setInventorySlotContents(0, c);
}
}
/*if(world.getBlock(x, y+1, z).equals(Blocks.air)||this.getStackInSlot(0)==null){
this.isOn = false;