Ingot Activate
This commit is contained in:
@@ -20,7 +20,9 @@ import com.kitsu.medievalcraft.packethandle.curedLeather.MsgPacketCuredLeatherX;
|
||||
import com.kitsu.medievalcraft.packethandle.curedLeather.MsgPacketCuredLeatherY;
|
||||
import com.kitsu.medievalcraft.packethandle.curedLeather.MsgPacketCuredLeatherZ;
|
||||
import com.kitsu.medievalcraft.packethandle.forge.MsgHandleForge;
|
||||
import com.kitsu.medievalcraft.packethandle.forge.MsgHandleOn;
|
||||
import com.kitsu.medievalcraft.packethandle.forge.MsgPacketForge;
|
||||
import com.kitsu.medievalcraft.packethandle.forge.MsgPacketOn;
|
||||
import com.kitsu.medievalcraft.packethandle.forgeHammerParticles.MsgHandle;
|
||||
import com.kitsu.medievalcraft.packethandle.forgeHammerParticles.MsgHandleLocY;
|
||||
import com.kitsu.medievalcraft.packethandle.forgeHammerParticles.MsgHandleLocZ;
|
||||
@@ -55,7 +57,7 @@ public class Main {
|
||||
|
||||
public static final String MODID = "kitsumedievalcraft";
|
||||
public static final String MODNAME = "ForgeCraft";
|
||||
public static final String VERSION = "2.2.0";
|
||||
public static final String VERSION = "2.2.2";
|
||||
|
||||
public static SimpleNetworkWrapper sNet;
|
||||
|
||||
@@ -85,6 +87,7 @@ public class Main {
|
||||
sNet.registerMessage(MsgHandleCuredLeatherZ.class, MsgPacketCuredLeatherZ.class, 8, Side.SERVER);
|
||||
sNet.registerMessage(MsgHandleShelfCase.class, MsgPacketShelfCase.class, 9, Side.SERVER);
|
||||
sNet.registerMessage(MsgHandleForge.class, MsgPacketForge.class, 10, Side.SERVER);
|
||||
sNet.registerMessage(MsgHandleOn.class, MsgPacketOn.class, 11, Side.CLIENT);
|
||||
CustomTab.MedievalTab();
|
||||
ModBlocks.init();
|
||||
ModItems.init();
|
||||
|
||||
@@ -109,7 +109,7 @@ public class ModBlocks {
|
||||
|
||||
//MACHINES
|
||||
public static Block formtable;
|
||||
public static Block newForge;
|
||||
//public static Block newForge;
|
||||
public static Block testForge;
|
||||
public static Block forgeAnvil;
|
||||
public static Block waterFilter;
|
||||
|
||||
@@ -12,6 +12,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.kitsu.medievalcraft.Main;
|
||||
import com.kitsu.medievalcraft.item.ModItems;
|
||||
import com.kitsu.medievalcraft.util.CustomTab;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -22,7 +23,7 @@ public abstract class IngotBase extends BlockContainer {
|
||||
private final Random random = new Random();
|
||||
public static boolean makeParts;
|
||||
public static int locX, locY, locZ;
|
||||
|
||||
|
||||
public IngotBase(String unlocalizedName, Material material) {
|
||||
super(material);
|
||||
this.setBlockName(unlocalizedName);
|
||||
@@ -35,9 +36,9 @@ public abstract class IngotBase extends BlockContainer {
|
||||
//xmin, ymin, zmin,
|
||||
//xmax, ymax, zmax
|
||||
this.setBlockBounds(0.25F, 0.0F, 0.35F,
|
||||
0.75F , 0.15F, 0.7F);
|
||||
0.75F , 0.15F, 0.7F);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int metadata, Random random, int fortune) {
|
||||
return Item.getItemFromBlock(this);
|
||||
@@ -46,13 +47,13 @@ public abstract class IngotBase extends BlockContainer {
|
||||
public TileEntity createNewTileEntity(World world, int i) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random p_149745_1_)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public int quantityDropped(Random p_149745_1_)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand)
|
||||
@@ -63,27 +64,31 @@ public abstract class IngotBase extends BlockContainer {
|
||||
makeParts = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_){
|
||||
int a = player.inventory.currentItem;
|
||||
if(player.inventory.getStackInSlot(a)!=null){
|
||||
if(player.inventory.getStackInSlot(a).getItem()==Item.getItemFromBlock(this)){
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int aa, float bb, float cc, float ff){
|
||||
if(player.inventory.getCurrentItem().getItem()!=ModItems.forgeHammer){
|
||||
int a = player.inventory.currentItem;
|
||||
if(player.inventory.getStackInSlot(a)!=null){
|
||||
if(player.inventory.getStackInSlot(a).getItem()==Item.getItemFromBlock(this)){
|
||||
ItemStack jar = new ItemStack(this);
|
||||
player.inventory.addItemStackToInventory(jar);
|
||||
if(!world.isRemote){
|
||||
world.setBlock(x, y, z, Blocks.air, 0, 2);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if(player.inventory.getStackInSlot(a)==null){
|
||||
ItemStack jar = new ItemStack(this);
|
||||
player.inventory.addItemStackToInventory(jar);
|
||||
player.inventory.setInventorySlotContents(a, jar);
|
||||
if(!world.isRemote){
|
||||
world.setBlock(x, y, z, Blocks.air, 0, 2);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if(player.inventory.getStackInSlot(a)==null){
|
||||
ItemStack jar = new ItemStack(this);
|
||||
player.inventory.setInventorySlotContents(a, jar);
|
||||
if(!world.isRemote){
|
||||
world.setBlock(x, y, z, Blocks.air, 0, 2);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
private void parts(World world, int x, int y, int z){
|
||||
@@ -97,7 +102,7 @@ public abstract class IngotBase extends BlockContainer {
|
||||
world.spawnParticle("lava", x+0.5D, y+0.5D, z+0.5D, 0, 0, 0);
|
||||
world.spawnParticle("lava", x+0.5D, y+0.5D, z+0.5D, 0, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 0;
|
||||
|
||||
@@ -42,15 +42,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
public class Firebox extends BlockContainer{
|
||||
|
||||
private final Random random = new Random();
|
||||
/*
|
||||
*
|
||||
*
|
||||
* [Chimney]
|
||||
* [ Forge ]
|
||||
* [Firebox]
|
||||
*
|
||||
*
|
||||
* */
|
||||
|
||||
public Firebox(String unlocalizedName, Material material) {
|
||||
super(material.rock);
|
||||
this.setBlockName(unlocalizedName);
|
||||
|
||||
@@ -29,6 +29,7 @@ import com.kitsu.medievalcraft.Main;
|
||||
import com.kitsu.medievalcraft.block.ModBlocks;
|
||||
import com.kitsu.medievalcraft.item.ModItems;
|
||||
import com.kitsu.medievalcraft.packethandle.forge.MsgPacketForge;
|
||||
import com.kitsu.medievalcraft.packethandle.forge.MsgPacketOn;
|
||||
import com.kitsu.medievalcraft.packethandle.shelf.MsgPacketShelfCase;
|
||||
import com.kitsu.medievalcraft.renderer.RenderId;
|
||||
import com.kitsu.medievalcraft.tileents.machine.TileForge;
|
||||
@@ -43,6 +44,7 @@ public class Forge extends BlockContainer implements TileForgePlaceables{
|
||||
|
||||
private final Random random = new Random();
|
||||
public static int sideMeta;
|
||||
public static boolean furnaceParts;
|
||||
private int c;
|
||||
|
||||
public Forge(String unlocalizedName, Material material) {
|
||||
@@ -72,6 +74,21 @@ public class Forge extends BlockContainer implements TileForgePlaceables{
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand)
|
||||
{
|
||||
super.randomDisplayTick(world, x, y, z, random);
|
||||
if(furnaceParts == true){
|
||||
int l;
|
||||
float f;
|
||||
float f1;
|
||||
float f2;
|
||||
for (l = 0; l < 3; ++l)
|
||||
{
|
||||
f = (float)(x+0.25) + (rand.nextFloat()/2);
|
||||
f1 = (float)y + rand.nextFloat() * 0.4F + 0.3F;
|
||||
f2 = (float)(z+0.25) + (rand.nextFloat()/2);
|
||||
world.spawnParticle("fire", (double)f, (double)f1, (double)f2, 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle("flame", (double)f, (double)f1, (double)f2, 0.0D, 0.0D, 0.0D);
|
||||
//world.spawnParticle("smoke", (double)f, (double)f1, (double)f2, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static int determineOrientation(World p_150071_0_, int p_150071_1_, int p_150071_2_, int p_150071_3_, EntityLivingBase p_150071_4_)
|
||||
@@ -118,6 +135,7 @@ public class Forge extends BlockContainer implements TileForgePlaceables{
|
||||
(player.inventory.getCurrentItem().getItem()==ModItems.fireBow)
|
||||
){
|
||||
tileEnt.isBurning=true;
|
||||
Main.sNet.sendToAll(new MsgPacketOn(tileEnt.isBurning));
|
||||
if(tileEnt.getStackInSlot(1)!=null){
|
||||
tileEnt.isOn=true;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public class BirchSplitLog extends BlockRotatedPillar {
|
||||
this.setHardness(3.0F);
|
||||
this.setResistance(3.0F);
|
||||
this.setStepSound(Block.soundTypeWood);
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 1.0F, 0.75F);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@@ -40,6 +40,7 @@ public class DarkSplitLog extends BlockRotatedPillar {
|
||||
this.setHardness(3.0F);
|
||||
this.setResistance(3.0F);
|
||||
this.setStepSound(Block.soundTypeWood);
|
||||
this.setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 1.0F, 0.75F);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@@ -40,6 +40,7 @@ public class JungleSplitLog extends BlockRotatedPillar {
|
||||
this.setHardness(3.0F);
|
||||
this.setResistance(3.0F);
|
||||
this.setStepSound(Block.soundTypeWood);
|
||||
this.setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 1.0F, 0.75F);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@@ -40,6 +40,7 @@ public class OakSplitLog extends BlockRotatedPillar {
|
||||
this.setHardness(3.0F);
|
||||
this.setResistance(3.0F);
|
||||
this.setStepSound(Block.soundTypeWood);
|
||||
this.setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 1.0F, 0.75F);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@@ -40,6 +40,7 @@ public class SpruceSplitLog extends BlockRotatedPillar {
|
||||
this.setHardness(3.0F);
|
||||
this.setResistance(3.0F);
|
||||
this.setStepSound(Block.soundTypeWood);
|
||||
this.setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 1.0F, 0.75F);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@@ -174,9 +174,9 @@ public final class ModCrafting {
|
||||
{"ccc", "bbb", "bbb",
|
||||
'c', Blocks.crafting_table,
|
||||
'b', Blocks.brick_block});
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.testForge), new Object []
|
||||
{"xxx", "x x", "xxx",
|
||||
'x', Blocks.stonebrick});
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.forge), new Object []
|
||||
{"xax", "xsx", "xxx",
|
||||
'x', Blocks.stonebrick, 'a', Blocks.stone_slab, 's', ModBlocks.firebox});
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.solidFilter), new Object[]
|
||||
{"xyx", "y y", "xyx",
|
||||
'x', ModItems.splitBoard,
|
||||
|
||||
@@ -24,9 +24,9 @@ public class TestForgeCrafting {
|
||||
|
||||
}};
|
||||
|
||||
public static final Hashtable<Integer, Integer> cookTable= new Hashtable <Integer, Integer>(){{
|
||||
/*public static final Hashtable<Integer, Integer> cookTable= new Hashtable <Integer, Integer>(){{
|
||||
|
||||
/*put(0, 300);
|
||||
put(0, 300);
|
||||
put(1, 1000);
|
||||
put(2, 200);
|
||||
put(3, 250);
|
||||
@@ -36,22 +36,22 @@ public class TestForgeCrafting {
|
||||
put(7, 900);
|
||||
put(8, 400);
|
||||
put(9, 400);
|
||||
put(10, 900);*/
|
||||
}};
|
||||
put(10, 900);
|
||||
}};*/
|
||||
|
||||
public static final Hashtable<Integer, Block> blockToCook = new Hashtable <Integer, Block>(){{
|
||||
|
||||
/*put(0, ModBlocks.hotIronBlock);
|
||||
put(1, ModBlocks.hotCrucibleIron);
|
||||
put(2, ModBlocks.emptyCookedCrucible);
|
||||
put(3, ModBlocks.hotIronPlate);
|
||||
put(4, ModBlocks.hotCrucibleIron);
|
||||
put(5, ModBlocks.hotCrucibleDamascus);
|
||||
put(6, ModBlocks.hotDamascusIngot);
|
||||
put(7, ModBlocks.hotLapisCrucible);
|
||||
put(8, ModBlocks.hotLapisIngot);
|
||||
put(9, ModBlocks.hotRedstoneIngot);
|
||||
put(10, ModBlocks.hotRedstoneCrucible);*/
|
||||
put(0, ModBlocks.refinedIron);
|
||||
//put(1, ModBlocks.crucibleIronOre);
|
||||
//put(2, ModBlocks.emptyCookedCrucible);
|
||||
put(3, ModBlocks.ironPlate);
|
||||
//put(4, ModBlocks.hotCrucibleIron);
|
||||
//put(5, ModBlocks.hotCrucibleDamascus);
|
||||
put(6, ModBlocks.damascus);
|
||||
//put(7, ModBlocks.hotLapisCrucible);
|
||||
//put(8, ModBlocks.hotLapisIngot);
|
||||
//put(9, ModBlocks.hotRedstoneIngot);
|
||||
//put(10, ModBlocks.hotRedstoneCrucible);
|
||||
|
||||
}};
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ public class ForgeHammer extends Item implements AnvilUtil{
|
||||
}
|
||||
|
||||
private void onClick(Block block, Block blockSub, World world, int x, int y, int z, EntityPlayer p, ItemStack stack, Random rand){
|
||||
|
||||
System.out.println("Layer 1");
|
||||
if(block == ModBlocks.refinedIron){
|
||||
tileRefIngot = (TileMyIronIngot) world.getTileEntity(x, y, z);
|
||||
}
|
||||
@@ -85,6 +85,7 @@ public class ForgeHammer extends Item implements AnvilUtil{
|
||||
tilePlate = (TileIronPlate) world.getTileEntity(x, y, z);
|
||||
}
|
||||
if((blockSub == ModBlocks.forgeAnvil)&&(p.isSwingInProgress == false)){
|
||||
|
||||
TileEntityAnvilForge tileEnt = (TileEntityAnvilForge) world.getTileEntity(x, y-1, z);
|
||||
if((block instanceof IngotBase)&&(block==ModBlocks.refinedIron)){
|
||||
TileIngotBase tile = (TileIngotBase) world.getTileEntity(x, y, z);
|
||||
@@ -123,6 +124,7 @@ public class ForgeHammer extends Item implements AnvilUtil{
|
||||
//IRON FORMS
|
||||
if(tileEnt.getStackInSlot(0)!=null){
|
||||
if((tileEnt.getStackInSlot(0).getItem() instanceof IronForms)&&(tile.hot==true)){
|
||||
System.out.println("working");
|
||||
p.worldObj.playSoundAtEntity(p, Main.MODID + ":anvilhammer", 1.0F, 1.0F);
|
||||
Main.sNet.sendToAll(new MsgPacket(true));
|
||||
Main.sNet.sendToAll(new MsgPacketLocX(x));
|
||||
@@ -269,6 +271,7 @@ public class ForgeHammer extends Item implements AnvilUtil{
|
||||
Block block = world.getBlock(x, y, z);
|
||||
Block anvil = world.getBlock(x, y-1, z);
|
||||
if(!world.isRemote){
|
||||
System.out.println("Item Use");
|
||||
onClick(block, anvil, world, x, y, z, player, stack, world.rand);
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -41,15 +41,6 @@ public class WorkBlade extends Item {
|
||||
GameRegistry.registerItem(this, name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreated(ItemStack stack, World world, EntityPlayer player) {
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
stack.stackTagCompound.setInteger("X", 1);
|
||||
stack.stackTagCompound.setInteger("Y", 1);
|
||||
stack.stackTagCompound.setInteger("Z", 1);
|
||||
stack.stackTagCompound.setInteger("BARKHITS", 0);
|
||||
}
|
||||
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_){
|
||||
|
||||
if(!world.isRemote){
|
||||
@@ -60,110 +51,79 @@ public class WorkBlade extends Item {
|
||||
}
|
||||
|
||||
private void getBark(World world, int x, int y, int z, EntityPlayer player, ItemStack stack){
|
||||
//if(player.isSwingInProgress == false){
|
||||
if(world.getBlock(x, y, z).getUnlocalizedName().equals("tile.log")){
|
||||
//System.out.println(stack.stackTagCompound.getInteger("BARKHITS"));
|
||||
//System.out.println(stack.stackTagCompound.getInteger("X"));
|
||||
//System.out.println(stack.stackTagCompound.getInteger("Y"));
|
||||
//System.out.println(stack.stackTagCompound.getInteger("Z"));
|
||||
//System.out.println(world.getBlockMetadata(x, y, z));
|
||||
|
||||
if((stack.stackTagCompound.getInteger("BARKHITS") == 0) || (stack.stackTagCompound.getInteger("X") != x) || (stack.stackTagCompound.getInteger("Y") != y) || (stack.stackTagCompound.getInteger("Z") != z)){
|
||||
stack.stackTagCompound.setInteger("X", x);
|
||||
stack.stackTagCompound.setInteger("Y", y);
|
||||
stack.stackTagCompound.setInteger("Z", z);
|
||||
stack.stackTagCompound.setInteger("BARKHITS", 1);
|
||||
player.worldObj.playSoundAtEntity(player, Main.MODID + ":scrapes1", 0.33F, 1.0F);
|
||||
//System.out.println("lvl2");
|
||||
}
|
||||
if(stack.stackTagCompound.getInteger("BARKHITS") > 0){
|
||||
if((stack.stackTagCompound.getInteger("X") == x) && (stack.stackTagCompound.getInteger("Y") == y) && (stack.stackTagCompound.getInteger("Z") == z)){
|
||||
player.worldObj.playSoundAtEntity(player, Main.MODID + ":scrapes1", 0.33F, 1.0F);
|
||||
if (world.rand.nextInt(2) == 0 ) {
|
||||
stack.stackTagCompound.setInteger("BARKHITS", stack.stackTagCompound.getInteger("BARKHITS") + 1);
|
||||
stack.stackTagCompound.setInteger("X", x);
|
||||
stack.stackTagCompound.setInteger("Y", y);
|
||||
stack.stackTagCompound.setInteger("Z", z);
|
||||
stack.damageItem(1, player);
|
||||
//System.out.println("lvl3");
|
||||
if(player.isSwingInProgress == false){
|
||||
if(world.getBlock(x, y, z).getUnlocalizedName().equals("tile.log")){
|
||||
player.worldObj.playSoundAtEntity(player, Main.MODID + ":scrapes1", 0.25F, 1.8F);
|
||||
if(world.rand.nextInt(8)==1){
|
||||
if(world.getBlock(x, y, z).equals(Blocks.log)){
|
||||
//System.out.println("lvl5");
|
||||
int woodMeta = world.getBlockMetadata(x, y, z);
|
||||
if(woodMeta == 0){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanOak, 0, 2);
|
||||
}
|
||||
if(woodMeta == 4){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanOak, 4, 2);
|
||||
}
|
||||
if(woodMeta == 8){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanOak, 8, 2);
|
||||
}
|
||||
if(woodMeta == 1){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanSpruce, 0, 2);
|
||||
}
|
||||
if(woodMeta == 5){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanSpruce, 4, 2);
|
||||
}
|
||||
if(woodMeta == 9){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanSpruce, 8, 2);
|
||||
}
|
||||
if(woodMeta == 2){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanBirch, 0, 2);
|
||||
}
|
||||
if(woodMeta == 6){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanBirch, 4, 2);
|
||||
}
|
||||
if(woodMeta == 10){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanBirch, 8, 2);
|
||||
}
|
||||
if(woodMeta == 3){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanJungle, 0, 2);
|
||||
}
|
||||
if(woodMeta == 7){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanJungle, 4, 2);
|
||||
}
|
||||
if(woodMeta == 11){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanJungle, 8, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(stack.stackTagCompound.getInteger("BARKHITS") >= 6 + world.rand.nextInt(4)){
|
||||
stack.stackTagCompound.setInteger("BARKHITS", 0);
|
||||
stack.stackTagCompound.setInteger("X", 0);
|
||||
stack.stackTagCompound.setInteger("Y", 0);
|
||||
stack.stackTagCompound.setInteger("Z", 0);
|
||||
//System.out.println("lvl4");
|
||||
|
||||
if(world.getBlock(x, y, z).equals(Blocks.log)){
|
||||
//System.out.println("lvl5");
|
||||
int woodMeta = world.getBlockMetadata(x, y, z);
|
||||
if(woodMeta == 0){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanOak, 0, 2);
|
||||
if(world.getBlock(x, y, z).equals(Blocks.log2)){
|
||||
//System.out.println("lvl6");
|
||||
int woodMeta = world.getBlockMetadata(x, y, z);
|
||||
if(woodMeta == 0){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanAcacia, 0, 2);
|
||||
}
|
||||
if(woodMeta == 4){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanAcacia, 4, 2);
|
||||
}
|
||||
if(woodMeta == 8){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanAcacia, 8, 2);
|
||||
}
|
||||
if(woodMeta == 1){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanDarkOak, 0, 2);
|
||||
}
|
||||
if(woodMeta == 5){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanDarkOak, 4, 2);
|
||||
}
|
||||
if(woodMeta == 9){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanDarkOak, 8, 2);
|
||||
}
|
||||
}
|
||||
if(woodMeta == 4){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanOak, 4, 2);
|
||||
}
|
||||
if(woodMeta == 8){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanOak, 8, 2);
|
||||
}
|
||||
if(woodMeta == 1){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanSpruce, 0, 2);
|
||||
}
|
||||
if(woodMeta == 5){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanSpruce, 4, 2);
|
||||
}
|
||||
if(woodMeta == 9){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanSpruce, 8, 2);
|
||||
}
|
||||
if(woodMeta == 2){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanBirch, 0, 2);
|
||||
}
|
||||
if(woodMeta == 6){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanBirch, 4, 2);
|
||||
}
|
||||
if(woodMeta == 10){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanBirch, 8, 2);
|
||||
}
|
||||
if(woodMeta == 3){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanJungle, 0, 2);
|
||||
}
|
||||
if(woodMeta == 7){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanJungle, 4, 2);
|
||||
}
|
||||
if(woodMeta == 11){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanJungle, 8, 2);
|
||||
}
|
||||
}
|
||||
if(world.getBlock(x, y, z).equals(Blocks.log2)){
|
||||
//System.out.println("lvl6");
|
||||
int woodMeta = world.getBlockMetadata(x, y, z);
|
||||
if(woodMeta == 0){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanAcacia, 0, 2);
|
||||
}
|
||||
if(woodMeta == 4){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanAcacia, 4, 2);
|
||||
}
|
||||
if(woodMeta == 8){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanAcacia, 8, 2);
|
||||
}
|
||||
if(woodMeta == 1){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanDarkOak, 0, 2);
|
||||
}
|
||||
if(woodMeta == 5){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanDarkOak, 4, 2);
|
||||
}
|
||||
if(woodMeta == 9){
|
||||
world.setBlock(x, y, z, ModBlocks.cleanDarkOak, 8, 2);
|
||||
}
|
||||
}
|
||||
|
||||
world.spawnEntityInWorld(new EntityItem(world, x, y, z, new ItemStack(ModItems.itemBark, 5 + world.rand.nextInt(4), 0)));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x, y, z, new ItemStack(ModItems.itemBark, 5 + world.rand.nextInt(4), 0)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void makeLonbow(World world, int x, int y, int z, EntityPlayer player, ItemStack stack){
|
||||
if(!world.isRemote){
|
||||
if((world.getBlock(x, y, z).equals(ModBlocks.jungleSplitLog))&&world.getBlock(x, y-1, z).equals(ModBlocks.jungleSplitLog)){
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.kitsu.medievalcraft.packethandle.forge;
|
||||
|
||||
public class MsgHandleBurning {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.kitsu.medievalcraft.packethandle.forge;
|
||||
|
||||
import com.kitsu.medievalcraft.block.machines.Forge;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
|
||||
public class MsgHandleOn implements IMessageHandler<MsgPacketOn, IMessage>{
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(MsgPacketOn message, MessageContext ctx) {
|
||||
Forge.furnaceParts = message.packetOn;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.kitsu.medievalcraft.packethandle.forge;
|
||||
|
||||
public class MsgPacketBurning {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.kitsu.medievalcraft.packethandle.forge;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
|
||||
public class MsgPacketOn implements IMessage {
|
||||
|
||||
public boolean packetOn;
|
||||
|
||||
public MsgPacketOn() {}
|
||||
|
||||
public MsgPacketOn(boolean x){
|
||||
this.packetOn = x;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
this.packetOn = buf.readBoolean();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf buf) {
|
||||
buf.writeBoolean(this.packetOn);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -45,6 +45,7 @@ import com.kitsu.medievalcraft.renderer.itemrenderer.ingotsplates.IronIngotIR;
|
||||
import com.kitsu.medievalcraft.renderer.itemrenderer.ingotsplates.IronPlateIR;
|
||||
import com.kitsu.medievalcraft.renderer.itemrenderer.ingotsplates.LapisIngotIR;
|
||||
import com.kitsu.medievalcraft.renderer.itemrenderer.ingotsplates.RedstoneIngotIR;
|
||||
import com.kitsu.medievalcraft.renderer.itemrenderer.machines.ForgeIR;
|
||||
import com.kitsu.medievalcraft.renderer.itemrenderer.machines.IRBarrelLid;
|
||||
import com.kitsu.medievalcraft.renderer.itemrenderer.machines.IRFirebox;
|
||||
import com.kitsu.medievalcraft.renderer.itemrenderer.machines.IRForgeAnvil;
|
||||
@@ -129,6 +130,7 @@ public class RendererRegistry {
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.smallBarrelLid), new IRBarrelLid());
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.shelfFour), new IRShelfFour());
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.firebox), new IRFirebox());
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.forge), new ForgeIR());
|
||||
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.crucibleIronOre), new IRCrucible());
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.crucibleIronIngot), new IRCrucible());
|
||||
@@ -168,7 +170,6 @@ public class RendererRegistry {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileCrucibleWootz.class, new WootzCrucibleRenderer());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileCrucibleRedstone.class, new RedstoneCrucibleRenderer());
|
||||
|
||||
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileMyIronIngot.class, new IronIngotRenderer());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileDamascus.class, new DamascusIngotRenderer());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileIronPlate.class, new IronPlateRenderer());
|
||||
|
||||
@@ -1,148 +0,0 @@
|
||||
package com.kitsu.medievalcraft.renderer.itemrenderer.crucibles;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.client.model.AdvancedModelLoader;
|
||||
import net.minecraftforge.client.model.IModelCustom;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class ItemRendererCDCrucible implements IItemRenderer {
|
||||
|
||||
public static final ResourceLocation MODEL_CRUCIBLE = new ResourceLocation("kitsumedievalcraft:models/CrucibleModel.obj");
|
||||
public static final ResourceLocation TEXTURE = new ResourceLocation("kitsumedievalcraft:models/CoolCrucible.png");
|
||||
|
||||
public IModelCustom model = AdvancedModelLoader.loadModel(MODEL_CRUCIBLE);
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
|
||||
switch(type) {
|
||||
case EQUIPPED: {
|
||||
return true;
|
||||
}
|
||||
case EQUIPPED_FIRST_PERSON: {
|
||||
return true;
|
||||
}
|
||||
case INVENTORY: {
|
||||
return true;
|
||||
}
|
||||
case ENTITY: {
|
||||
return true;
|
||||
}
|
||||
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item,
|
||||
ItemRendererHelper helper) {
|
||||
|
||||
switch(type) {
|
||||
case EQUIPPED: {
|
||||
return helper == ItemRendererHelper.BLOCK_3D;
|
||||
}
|
||||
case EQUIPPED_FIRST_PERSON: {
|
||||
return helper == ItemRendererHelper.EQUIPPED_BLOCK;
|
||||
}
|
||||
case INVENTORY: {
|
||||
return helper == ItemRendererHelper.INVENTORY_BLOCK;
|
||||
}
|
||||
case ENTITY: {
|
||||
return (helper == ItemRendererHelper.ENTITY_BOBBING ||
|
||||
helper == ItemRendererHelper.ENTITY_ROTATION ||
|
||||
helper == ItemRendererHelper.BLOCK_3D);
|
||||
}
|
||||
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
|
||||
switch(type) {
|
||||
|
||||
case EQUIPPED: {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
float scale = 0.45F;
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
|
||||
//ANGLE, X ROTATE, Y ROTATE, Z ROTATE
|
||||
GL11.glRotatef(25F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(60F, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
GL11.glTranslatef(0.2F, -2.9F, 2.1F);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
|
||||
model.renderAll();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
} break;
|
||||
|
||||
case EQUIPPED_FIRST_PERSON: {
|
||||
float f = 0.4F;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(f, f, f);
|
||||
|
||||
//ANGLE, X ROTATE, Y ROTATE, Z ROTATE
|
||||
|
||||
GL11.glRotatef(-45F, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
GL11.glTranslatef(1.5F, 0.0F, 0.0F);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
|
||||
model.renderAll();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
} break;
|
||||
|
||||
case INVENTORY: {
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
float scale = 0.5F;
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
|
||||
//GL11.glRotatef(90, 1.0F, 0.0F, 0.0F);
|
||||
|
||||
GL11.glTranslatef(0.0F, -1.1F, 0.0F);
|
||||
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
|
||||
model.renderAll();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
} break;
|
||||
|
||||
case ENTITY: {
|
||||
GL11.glPushMatrix();
|
||||
//GL11.glScalef(1.75F, 1.75F, 1.75F);
|
||||
|
||||
|
||||
|
||||
|
||||
//GL11.glTranslatef(0.0F, 0.0F, 0.0F);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
|
||||
model.renderAll();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
} break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,150 +0,0 @@
|
||||
package com.kitsu.medievalcraft.renderer.itemrenderer.crucibles;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.client.model.AdvancedModelLoader;
|
||||
import net.minecraftforge.client.model.IModelCustom;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class ItemRendererCICrucible implements IItemRenderer {
|
||||
|
||||
public static final ResourceLocation MODEL_CRUCIBLE = new ResourceLocation("kitsumedievalcraft:models/CrucibleModel.obj");
|
||||
public static final ResourceLocation TEXTURE = new ResourceLocation("kitsumedievalcraft:models/CoolCrucible.png");
|
||||
|
||||
public IModelCustom model = AdvancedModelLoader.loadModel(MODEL_CRUCIBLE);
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
|
||||
switch(type) {
|
||||
case EQUIPPED: {
|
||||
return true;
|
||||
}
|
||||
case EQUIPPED_FIRST_PERSON: {
|
||||
return true;
|
||||
}
|
||||
case INVENTORY: {
|
||||
return true;
|
||||
}
|
||||
case ENTITY: {
|
||||
return true;
|
||||
}
|
||||
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item,
|
||||
ItemRendererHelper helper) {
|
||||
|
||||
switch(type) {
|
||||
case EQUIPPED: {
|
||||
return helper == ItemRendererHelper.BLOCK_3D;
|
||||
}
|
||||
case EQUIPPED_FIRST_PERSON: {
|
||||
return helper == ItemRendererHelper.EQUIPPED_BLOCK;
|
||||
}
|
||||
case INVENTORY: {
|
||||
return helper == ItemRendererHelper.INVENTORY_BLOCK;
|
||||
}
|
||||
case ENTITY: {
|
||||
return (helper == ItemRendererHelper.ENTITY_BOBBING ||
|
||||
helper == ItemRendererHelper.ENTITY_ROTATION ||
|
||||
helper == ItemRendererHelper.BLOCK_3D);
|
||||
}
|
||||
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
|
||||
switch(type) {
|
||||
|
||||
case EQUIPPED: {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
float scale = 0.45F;
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
|
||||
//ANGLE, X ROTATE, Y ROTATE, Z ROTATE
|
||||
GL11.glRotatef(25F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(60F, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
GL11.glTranslatef(0.2F, -2.9F, 2.1F);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
|
||||
model.renderAll();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
} break;
|
||||
|
||||
case EQUIPPED_FIRST_PERSON: {
|
||||
float f = 0.4F;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(f, f, f);
|
||||
|
||||
//ANGLE, X ROTATE, Y ROTATE, Z ROTATE
|
||||
|
||||
GL11.glRotatef(-45F, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
GL11.glTranslatef(1.5F, 0.0F, 0.0F);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
|
||||
model.renderAll();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
} break;
|
||||
|
||||
case INVENTORY: {
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
float scale = 0.5F;
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
|
||||
//GL11.glRotatef(90, 1.0F, 0.0F, 0.0F);
|
||||
|
||||
GL11.glTranslatef(0.0F, -1.1F, 0.0F);
|
||||
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
|
||||
model.renderAll();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
} break;
|
||||
|
||||
case ENTITY: {
|
||||
GL11.glPushMatrix();
|
||||
//GL11.glScalef(1.75F, 1.75F, 1.75F);
|
||||
|
||||
|
||||
|
||||
|
||||
//GL11.glTranslatef(0.0F, 0.0F, 0.0F);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
|
||||
model.renderAll();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
} break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,146 +0,0 @@
|
||||
package com.kitsu.medievalcraft.renderer.itemrenderer.crucibles;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.client.model.AdvancedModelLoader;
|
||||
import net.minecraftforge.client.model.IModelCustom;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class ItemRendererFICrucible implements IItemRenderer {
|
||||
|
||||
public static final ResourceLocation MODEL_CRUCIBLE = new ResourceLocation("kitsumedievalcraft:models/CrucibleModel.obj");
|
||||
public static final ResourceLocation TEXTURE = new ResourceLocation("kitsumedievalcraft:models/Crucible.png");
|
||||
|
||||
public IModelCustom model = AdvancedModelLoader.loadModel(MODEL_CRUCIBLE);
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
|
||||
switch(type) {
|
||||
case EQUIPPED: {
|
||||
return true;
|
||||
}
|
||||
case EQUIPPED_FIRST_PERSON: {
|
||||
return true;
|
||||
}
|
||||
case INVENTORY: {
|
||||
return true;
|
||||
}
|
||||
case ENTITY: {
|
||||
return true;
|
||||
}
|
||||
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item,
|
||||
ItemRendererHelper helper) {
|
||||
|
||||
switch(type) {
|
||||
case EQUIPPED: {
|
||||
return helper == ItemRendererHelper.BLOCK_3D;
|
||||
}
|
||||
case EQUIPPED_FIRST_PERSON: {
|
||||
return helper == ItemRendererHelper.EQUIPPED_BLOCK;
|
||||
}
|
||||
case INVENTORY: {
|
||||
return helper == ItemRendererHelper.INVENTORY_BLOCK;
|
||||
}
|
||||
case ENTITY: {
|
||||
return (helper == ItemRendererHelper.ENTITY_BOBBING ||
|
||||
helper == ItemRendererHelper.ENTITY_ROTATION ||
|
||||
helper == ItemRendererHelper.BLOCK_3D);
|
||||
}
|
||||
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
|
||||
switch(type) {
|
||||
|
||||
case EQUIPPED: {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
float scale = 0.45F;
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
|
||||
//ANGLE, X ROTATE, Y ROTATE, Z ROTATE
|
||||
GL11.glRotatef(25F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(60F, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
GL11.glTranslatef(0.2F, -2.9F, 2.1F);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
|
||||
model.renderAll();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
} break;
|
||||
|
||||
case EQUIPPED_FIRST_PERSON: {
|
||||
float f = 0.4F;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(f, f, f);
|
||||
|
||||
//ANGLE, X ROTATE, Y ROTATE, Z ROTATE
|
||||
|
||||
GL11.glRotatef(-45F, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
GL11.glTranslatef(1.5F, 0.0F, 0.0F);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
|
||||
model.renderAll();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
} break;
|
||||
|
||||
case INVENTORY: {
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
float scale = 0.5F;
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
|
||||
//GL11.glRotatef(90, 1.0F, 0.0F, 0.0F);
|
||||
|
||||
GL11.glTranslatef(0.0F, -1.1F, 0.0F);
|
||||
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
|
||||
model.renderAll();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
} break;
|
||||
|
||||
case ENTITY: {
|
||||
GL11.glPushMatrix();
|
||||
//GL11.glScalef(1.75F, 1.75F, 1.75F);
|
||||
|
||||
|
||||
|
||||
|
||||
//GL11.glTranslatef(0.0F, 0.0F, 0.0F);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
|
||||
model.renderAll();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
} break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,146 +0,0 @@
|
||||
package com.kitsu.medievalcraft.renderer.itemrenderer.crucibles;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.client.model.AdvancedModelLoader;
|
||||
import net.minecraftforge.client.model.IModelCustom;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class ItemRendererHDCrucible implements IItemRenderer{
|
||||
|
||||
public static final ResourceLocation MODEL_CRUCIBLE = new ResourceLocation("kitsumedievalcraft:models/CrucibleModel.obj");
|
||||
public static final ResourceLocation TEXTURE = new ResourceLocation("kitsumedievalcraft:models/HotDamascusCrucible.png");
|
||||
|
||||
public IModelCustom model = AdvancedModelLoader.loadModel(MODEL_CRUCIBLE);
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
|
||||
switch(type) {
|
||||
case EQUIPPED: {
|
||||
return true;
|
||||
}
|
||||
case EQUIPPED_FIRST_PERSON: {
|
||||
return true;
|
||||
}
|
||||
case INVENTORY: {
|
||||
return true;
|
||||
}
|
||||
case ENTITY: {
|
||||
return true;
|
||||
}
|
||||
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item,
|
||||
ItemRendererHelper helper) {
|
||||
|
||||
switch(type) {
|
||||
case EQUIPPED: {
|
||||
return helper == ItemRendererHelper.BLOCK_3D;
|
||||
}
|
||||
case EQUIPPED_FIRST_PERSON: {
|
||||
return helper == ItemRendererHelper.EQUIPPED_BLOCK;
|
||||
}
|
||||
case INVENTORY: {
|
||||
return helper == ItemRendererHelper.INVENTORY_BLOCK;
|
||||
}
|
||||
case ENTITY: {
|
||||
return (helper == ItemRendererHelper.ENTITY_BOBBING ||
|
||||
helper == ItemRendererHelper.ENTITY_ROTATION ||
|
||||
helper == ItemRendererHelper.BLOCK_3D);
|
||||
}
|
||||
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
|
||||
switch(type) {
|
||||
|
||||
case EQUIPPED: {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
float scale = 0.45F;
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
|
||||
//ANGLE, X ROTATE, Y ROTATE, Z ROTATE
|
||||
GL11.glRotatef(25F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(60F, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
GL11.glTranslatef(0.2F, -2.9F, 2.1F);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
|
||||
model.renderAll();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
} break;
|
||||
|
||||
case EQUIPPED_FIRST_PERSON: {
|
||||
float f = 0.4F;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(f, f, f);
|
||||
|
||||
//ANGLE, X ROTATE, Y ROTATE, Z ROTATE
|
||||
|
||||
GL11.glRotatef(-45F, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
GL11.glTranslatef(1.5F, 0.0F, 0.0F);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
|
||||
model.renderAll();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
} break;
|
||||
|
||||
case INVENTORY: {
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
float scale = 0.5F;
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
|
||||
//GL11.glRotatef(90, 1.0F, 0.0F, 0.0F);
|
||||
|
||||
GL11.glTranslatef(0.0F, -1.1F, 0.0F);
|
||||
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
|
||||
model.renderAll();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
} break;
|
||||
|
||||
case ENTITY: {
|
||||
GL11.glPushMatrix();
|
||||
//GL11.glScalef(1.75F, 1.75F, 1.75F);
|
||||
|
||||
|
||||
|
||||
|
||||
//GL11.glTranslatef(0.0F, 0.0F, 0.0F);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
|
||||
model.renderAll();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
} break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,146 +0,0 @@
|
||||
package com.kitsu.medievalcraft.renderer.itemrenderer.crucibles;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.client.model.AdvancedModelLoader;
|
||||
import net.minecraftforge.client.model.IModelCustom;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class ItemRendererHICrucible implements IItemRenderer{
|
||||
|
||||
public static final ResourceLocation MODEL_CRUCIBLE = new ResourceLocation("kitsumedievalcraft:models/CrucibleModel.obj");
|
||||
public static final ResourceLocation TEXTURE = new ResourceLocation("kitsumedievalcraft:models/HotCrucible.png");
|
||||
|
||||
public IModelCustom model = AdvancedModelLoader.loadModel(MODEL_CRUCIBLE);
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
|
||||
switch(type) {
|
||||
case EQUIPPED: {
|
||||
return true;
|
||||
}
|
||||
case EQUIPPED_FIRST_PERSON: {
|
||||
return true;
|
||||
}
|
||||
case INVENTORY: {
|
||||
return true;
|
||||
}
|
||||
case ENTITY: {
|
||||
return true;
|
||||
}
|
||||
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item,
|
||||
ItemRendererHelper helper) {
|
||||
|
||||
switch(type) {
|
||||
case EQUIPPED: {
|
||||
return helper == ItemRendererHelper.BLOCK_3D;
|
||||
}
|
||||
case EQUIPPED_FIRST_PERSON: {
|
||||
return helper == ItemRendererHelper.EQUIPPED_BLOCK;
|
||||
}
|
||||
case INVENTORY: {
|
||||
return helper == ItemRendererHelper.INVENTORY_BLOCK;
|
||||
}
|
||||
case ENTITY: {
|
||||
return (helper == ItemRendererHelper.ENTITY_BOBBING ||
|
||||
helper == ItemRendererHelper.ENTITY_ROTATION ||
|
||||
helper == ItemRendererHelper.BLOCK_3D);
|
||||
}
|
||||
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
|
||||
switch(type) {
|
||||
|
||||
case EQUIPPED: {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
float scale = 0.45F;
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
|
||||
//ANGLE, X ROTATE, Y ROTATE, Z ROTATE
|
||||
GL11.glRotatef(25F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(60F, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
GL11.glTranslatef(0.2F, -2.9F, 2.1F);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
|
||||
model.renderAll();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
} break;
|
||||
|
||||
case EQUIPPED_FIRST_PERSON: {
|
||||
float f = 0.4F;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(f, f, f);
|
||||
|
||||
//ANGLE, X ROTATE, Y ROTATE, Z ROTATE
|
||||
|
||||
GL11.glRotatef(-45F, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
GL11.glTranslatef(1.5F, 0.0F, 0.0F);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
|
||||
model.renderAll();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
} break;
|
||||
|
||||
case INVENTORY: {
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
float scale = 0.5F;
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
|
||||
//GL11.glRotatef(90, 1.0F, 0.0F, 0.0F);
|
||||
|
||||
GL11.glTranslatef(0.0F, -1.1F, 0.0F);
|
||||
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
|
||||
model.renderAll();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
} break;
|
||||
|
||||
case ENTITY: {
|
||||
GL11.glPushMatrix();
|
||||
//GL11.glScalef(1.75F, 1.75F, 1.75F);
|
||||
|
||||
|
||||
|
||||
|
||||
//GL11.glTranslatef(0.0F, 0.0F, 0.0F);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
|
||||
model.renderAll();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
} break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
package com.kitsu.medievalcraft.renderer.itemrenderer.crucibles;
|
||||
package com.kitsu.medievalcraft.renderer.itemrenderer.machines;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
|
||||
import net.minecraftforge.client.IItemRenderer.ItemRendererHelper;
|
||||
import net.minecraftforge.client.model.AdvancedModelLoader;
|
||||
import net.minecraftforge.client.model.IModelCustom;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class ItemRendererFDCrucible implements IItemRenderer {
|
||||
public class ForgeIR implements IItemRenderer {
|
||||
|
||||
public static final ResourceLocation MODEL_CRUCIBLE = new ResourceLocation("kitsumedievalcraft:models/CrucibleModel.obj");
|
||||
public static final ResourceLocation TEXTURE = new ResourceLocation("kitsumedievalcraft:models/Crucible.png");
|
||||
public static final ResourceLocation MODEL_CRUCIBLE = new ResourceLocation("kitsumedievalcraft:models/SingleForge.obj");
|
||||
public static final ResourceLocation TEXTURE = new ResourceLocation("kitsumedievalcraft:models/SingleForge.png");
|
||||
|
||||
public IModelCustom model = AdvancedModelLoader.loadModel(MODEL_CRUCIBLE);
|
||||
|
||||
@@ -69,14 +71,11 @@ public class ItemRendererFDCrucible implements IItemRenderer {
|
||||
case EQUIPPED: {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
float scale = 0.45F;
|
||||
float scale = 0.5F;
|
||||
GL11.glRotatef(22F, 0.0F, 0.0F, 1.0F);
|
||||
//GL11.glRotatef(0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
|
||||
//ANGLE, X ROTATE, Y ROTATE, Z ROTATE
|
||||
GL11.glRotatef(25F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(60F, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
GL11.glTranslatef(0.2F, -2.9F, 2.1F);
|
||||
GL11.glTranslatef(2.25F, -0.75F, 0.0F);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
|
||||
model.renderAll();
|
||||
@@ -85,15 +84,12 @@ public class ItemRendererFDCrucible implements IItemRenderer {
|
||||
} break;
|
||||
|
||||
case EQUIPPED_FIRST_PERSON: {
|
||||
float f = 0.4F;
|
||||
float f = 0.8F;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(f, f, f);
|
||||
|
||||
//ANGLE, X ROTATE, Y ROTATE, Z ROTATE
|
||||
|
||||
GL11.glRotatef(-45F, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
GL11.glTranslatef(1.5F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(-135F, 0.0F, 1.0F, 0.0F);
|
||||
//GL11.glRotatef(-45F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glTranslatef(1.0F, 0.5F, -0.4F);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
|
||||
model.renderAll();
|
||||
@@ -108,11 +104,7 @@ public class ItemRendererFDCrucible implements IItemRenderer {
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
float scale = 0.5F;
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
|
||||
//GL11.glRotatef(90, 1.0F, 0.0F, 0.0F);
|
||||
|
||||
GL11.glTranslatef(0.0F, -1.1F, 0.0F);
|
||||
|
||||
GL11.glTranslatef(0.0F, 0.0F, 0.0F);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
|
||||
model.renderAll();
|
||||
@@ -124,11 +116,7 @@ public class ItemRendererFDCrucible implements IItemRenderer {
|
||||
case ENTITY: {
|
||||
GL11.glPushMatrix();
|
||||
//GL11.glScalef(1.75F, 1.75F, 1.75F);
|
||||
|
||||
|
||||
|
||||
|
||||
//GL11.glTranslatef(0.0F, 0.0F, 0.0F);
|
||||
GL11.glTranslatef(0.0F, 0.5F, 0.0F);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
|
||||
model.renderAll();
|
||||
@@ -136,14 +136,14 @@ public class TileEntityTestForge extends TileEntity implements IInventory {
|
||||
}
|
||||
return TestForgeCrafting.blockToCheck.get(type);
|
||||
}
|
||||
private int getCookTime(int a){
|
||||
/*private int getCookTime(int a){
|
||||
for(int i = 0; i < TestForgeCrafting.cookTable.size(); i++){
|
||||
if(a == TestForgeCrafting.cookTable.get(i)){
|
||||
cookKey = i;
|
||||
}
|
||||
}
|
||||
return TestForgeCrafting.cookTable.get(cookKey);
|
||||
}
|
||||
}*/
|
||||
|
||||
private void cook(World world, int x, int y, int z){
|
||||
Block isAir = world.getBlock(x, y+2, z);
|
||||
|
||||
@@ -20,7 +20,9 @@ import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.kitsu.medievalcraft.Main;
|
||||
import com.kitsu.medievalcraft.block.ingots.IngotBase;
|
||||
import com.kitsu.medievalcraft.packethandle.forge.MsgPacketOn;
|
||||
import com.kitsu.medievalcraft.tileents.ingots.TileIngotBase;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
@@ -223,8 +225,6 @@ public class TileForge extends TileEntity implements IInventory{
|
||||
if(this.isOn==true){
|
||||
if(tile.hot==false){
|
||||
tile.heatTicks--;
|
||||
//System.out.println(tile.hot);
|
||||
//System.out.println(tile.heatTicks);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -332,6 +332,7 @@ public class TileForge extends TileEntity implements IInventory{
|
||||
if(this.getStackInSlot(0)==null){
|
||||
this.isOn = false;
|
||||
this.isBurning = false;
|
||||
Main.sNet.sendToAll(new MsgPacketOn(this.isBurning));
|
||||
}
|
||||
if(this.getStackInSlot(1)==null){
|
||||
this.isOn = false;
|
||||
|
||||
Reference in New Issue
Block a user