diff --git a/.classpath b/.classpath
index 770a4f99..c3151cc0 100644
--- a/.classpath
+++ b/.classpath
@@ -4,63 +4,63 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.gradle/2.0/taskArtifacts/cache.properties.lock b/.gradle/2.0/taskArtifacts/cache.properties.lock
index 04c2ea59..44915c06 100644
Binary files a/.gradle/2.0/taskArtifacts/cache.properties.lock and b/.gradle/2.0/taskArtifacts/cache.properties.lock differ
diff --git a/.gradle/2.0/taskArtifacts/fileHashes.bin b/.gradle/2.0/taskArtifacts/fileHashes.bin
index da91365f..74baf615 100644
Binary files a/.gradle/2.0/taskArtifacts/fileHashes.bin and b/.gradle/2.0/taskArtifacts/fileHashes.bin differ
diff --git a/.gradle/2.0/taskArtifacts/fileSnapshots.bin b/.gradle/2.0/taskArtifacts/fileSnapshots.bin
index cd82bb50..b80c0c48 100644
Binary files a/.gradle/2.0/taskArtifacts/fileSnapshots.bin and b/.gradle/2.0/taskArtifacts/fileSnapshots.bin differ
diff --git a/.gradle/2.0/taskArtifacts/taskArtifacts.bin b/.gradle/2.0/taskArtifacts/taskArtifacts.bin
index df7c8d83..53323a1c 100644
Binary files a/.gradle/2.0/taskArtifacts/taskArtifacts.bin and b/.gradle/2.0/taskArtifacts/taskArtifacts.bin differ
diff --git a/.gradle/gradle.log b/.gradle/gradle.log
index 970f888d..7d52b4d2 100644
--- a/.gradle/gradle.log
+++ b/.gradle/gradle.log
@@ -12,4 +12,4 @@
BUILD SUCCESSFUL
-Total time: 9.254 secs
+Total time: 7.332 secs
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
index 15ed9034..378f6e5d 100644
--- a/.settings/org.eclipse.jdt.core.prefs
+++ b/.settings/org.eclipse.jdt.core.prefs
@@ -1,5 +1,5 @@
#
-#Mon Jul 06 01:21:49 EDT 2015
+#Mon Jul 06 13:18:27 EDT 2015
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
diff --git a/bin/com/kitsu/medievalcraft/block/machines/Forge.class b/bin/com/kitsu/medievalcraft/block/machines/Forge.class
index 8e3e331a..d680f9c8 100644
Binary files a/bin/com/kitsu/medievalcraft/block/machines/Forge.class and b/bin/com/kitsu/medievalcraft/block/machines/Forge.class differ
diff --git a/bin/com/kitsu/medievalcraft/block/machines/TestForge.class b/bin/com/kitsu/medievalcraft/block/machines/TestForge.class
index 5977bac5..75ac3fdc 100644
Binary files a/bin/com/kitsu/medievalcraft/block/machines/TestForge.class and b/bin/com/kitsu/medievalcraft/block/machines/TestForge.class differ
diff --git a/bin/com/kitsu/medievalcraft/renderer/blocks/machine/ForgeRenderer.class b/bin/com/kitsu/medievalcraft/renderer/blocks/machine/ForgeRenderer.class
index d170440c..4b9c99a4 100644
Binary files a/bin/com/kitsu/medievalcraft/renderer/blocks/machine/ForgeRenderer.class and b/bin/com/kitsu/medievalcraft/renderer/blocks/machine/ForgeRenderer.class differ
diff --git a/bin/com/kitsu/medievalcraft/tileents/machine/TileForge.class b/bin/com/kitsu/medievalcraft/tileents/machine/TileForge.class
index 7f8213c7..97a7a828 100644
Binary files a/bin/com/kitsu/medievalcraft/tileents/machine/TileForge.class and b/bin/com/kitsu/medievalcraft/tileents/machine/TileForge.class differ
diff --git a/src/main/java/com/kitsu/medievalcraft/block/machines/Forge.java b/src/main/java/com/kitsu/medievalcraft/block/machines/Forge.java
index d5512853..eab63522 100644
--- a/src/main/java/com/kitsu/medievalcraft/block/machines/Forge.java
+++ b/src/main/java/com/kitsu/medievalcraft/block/machines/Forge.java
@@ -38,6 +38,7 @@ import com.kitsu.medievalcraft.tileents.machine.TileForge;
import com.kitsu.medievalcraft.util.CustomTab;
import com.kitsu.medievalcraft.util.TileForgePlaceables;
+import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -76,44 +77,45 @@ 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(this.furnaceParts==true){
- world.spawnParticle("fire", (double)locX, (double)locY+1f, (double)locZ, 0.0D, 0.0D, 0.0D);
- world.spawnParticle("flame", (double)locX, (double)locY+1f, (double)locZ, 0.0D, 0.0D, 0.0D);
- world.spawnParticle("smoke", (double)locX, (double)locY+1f, (double)locZ, 0.0D, 0.0D, 0.0D);
- }
- //if(x==locX&&y==locY&&z==locZ){
- /*if(this.furnaceParts == true){
- int l;
- float f;
- float f1;
- float f2;
- for (l = 0; l < 3; ++l)
- {
- f = (float)(locX+0.25) + (rand.nextFloat()/2);
- f1 = (float)locY + rand.nextFloat() * 0.4F + 0.3F;
- f2 = (float)(locZ+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);
- }
+
+ if(world.getBlockMetadata(x, y, z)>=4&&world.getBlockMetadata(x, y, z)<=7){
+ 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);
}
- if(this.coalParts == true){
- int l;
- float f;
- float f1;
- float f2;
- for (l = 0; l < 3; ++l)
- {
- f = (float)(locX+0.25) + (rand.nextFloat()/2);
- //f1 = (float)y + rand.nextFloat() * 0.4F + 0.3F;
- f1 = locY;
- f2 = (float)(locZ+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);
- }
- }*/
- //}
+ }
+ if(world.getBlockMetadata(x, y, z)>=8){
+ 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;
+ f1 = y+1.1f;
+ 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);
+ }
+ 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);
+ }
+ }
}
public static int determineOrientation(World p_150071_0_, int p_150071_1_, int p_150071_2_, int p_150071_3_, EntityLivingBase p_150071_4_)
@@ -132,7 +134,15 @@ public class Forge extends BlockContainer implements TileForgePlaceables{
@Override
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);
+ if(l==1){
+ l=5;
+ }
+ if(l==0){
+ l=5;
+ }
+ l=l-2;
world.setBlockMetadataWithNotify(x, y, z, l, 2);
+ System.out.println(l);
world.markBlockForUpdate(x, y, z);
}
@@ -147,26 +157,25 @@ public class Forge extends BlockContainer implements TileForgePlaceables{
public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int q, float a, float b, float c) {
TileForge tileEnt = (TileForge) world.getTileEntity(x, y, z);
-
if(world.isRemote){
MovingObjectPosition mop = Minecraft.getMinecraft().renderViewEntity.rayTrace(5, 1.0F);
c = (int)mop.sideHit;
Main.sNet.sendToServer(new MsgPacketForge((int) c));
}
+ System.out.println(sideMeta + " " + world.getBlockMetadata(x, y, z));
if(!world.isRemote){
if(player.inventory.getCurrentItem()!=null){
if((player.inventory.getCurrentItem().getItem()==Item.getItemFromBlock(Blocks.torch))||
(player.inventory.getCurrentItem().getItem()==Items.flint_and_steel)||
- (player.inventory.getCurrentItem().getItem()==ModItems.fireBow)
- ){
- tileEnt.isBurning=true;
- Main.sNet.sendToAll(new MsgPacketOn(tileEnt.isBurning));
- Main.sNet.sendToAll(new MsgPacketForgeX(tileEnt.xCoord));
- Main.sNet.sendToAll(new MsgPacketForgeY(tileEnt.yCoord));
- Main.sNet.sendToAll(new MsgPacketForgeZ(tileEnt.zCoord));
+ (player.inventory.getCurrentItem().getItem()==ModItems.fireBow)){
+ if(world.getBlockMetadata(x, y, z)<=3){
+ world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z)+4, 2);
+ }
+ tileEnt.markForUpdate();
if(tileEnt.getStackInSlot(1)!=null){
- tileEnt.isOn=true;
- Main.sNet.sendToAll(new MsgPacketBurning(tileEnt.isOn));
+ if(world.getBlockMetadata(x, y, z)>=4&&world.getBlockMetadata(x, y, z)<=7){
+ world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z)+4, 2);
+ }
}
}
}
@@ -212,7 +221,7 @@ public class Forge extends BlockContainer implements TileForgePlaceables{
return true;
}
}
- if(sideMeta == world.getBlockMetadata(x, y, z)){
+ if(sideMeta-2 == world.getBlockMetadata(x, y, z)||sideMeta == world.getBlockMetadata(x, y, z)-4||sideMeta == world.getBlockMetadata(x, y, z)-8){
if(player.inventory.getCurrentItem()!=null){
if(tileEnt.getStackInSlot(0)==null){
System.out.println();
diff --git a/src/main/java/com/kitsu/medievalcraft/block/machines/SolidFilter.java b/src/main/java/com/kitsu/medievalcraft/block/machines/SolidFilter.java
index 1a175898..605dfde2 100644
--- a/src/main/java/com/kitsu/medievalcraft/block/machines/SolidFilter.java
+++ b/src/main/java/com/kitsu/medievalcraft/block/machines/SolidFilter.java
@@ -125,42 +125,4 @@ public class SolidFilter extends BlockContainer {
public boolean isOpaqueCube() {
return false;
}
-}
-
-
-
-
-
-/*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_){
-//System.out.println(Minecraft.getMinecraft().objectMouseOver.blockX);
-//System.out.println(Minecraft.getMinecraft().objectMouseOver.blockY);
-//System.out.println(Minecraft.getMinecraft().objectMouseOver.blockZ);
-//System.out.println(x + ":" + y + ":" + z);
-//int newX = Minecraft.getMinecraft().objectMouseOver.blockX;
-//int newY = Minecraft.getMinecraft().objectMouseOver.blockY;
-//int newZ = Minecraft.getMinecraft().objectMouseOver.blockZ;
-TileEntitySandFilter tileSand = (TileEntitySandFilter) world.getTileEntity(x, y, z);
-if(!world.isRemote){
-//--------REMOVES THE FILTER FROM THE SLOT IF THE PLAYER IS SNEAKING------------------//
- if(tileSand.getStackInSlot(0)!=null){
- int a = player.inventory.currentItem;
- if((player.inventory.getStackInSlot(a)==null)&&(player.isSneaking())){
- player.inventory.setInventorySlotContents(a, tileSand.getStackInSlot(0));
- tileSand.setInventorySlotContents(0, null);
- world.setBlock(x, y, z, ModBlocks.sandFilterEmpty, 0, 2);
- }
- }
- if(tileSand.getStackInSlot(0)!=null){
- int a = player.inventory.currentItem;
- if((player.inventory.getStackInSlot(a)==null)&&(!player.isSneaking())){
- if(world.getBlock(x, y+1, z).equals(Blocks.sand)){
- int h = tileSand.tag.getInteger("FILTERHITS");
- tileSand.tag.setInteger("FILTERHITS", h+1);
- player.worldObj.playSoundAtEntity(player, "step.sand", 0.5F, 0.5F);
- tileSand.getStackInSlot(0).setItemDamage(tileSand.getStackInSlot(0).getItemDamage()+1);
- }
- }
- }
-}
-return true;
-}*/
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/src/main/java/com/kitsu/medievalcraft/block/machines/TestForge.java b/src/main/java/com/kitsu/medievalcraft/block/machines/TestForge.java
index b2545b2e..77798e66 100644
--- a/src/main/java/com/kitsu/medievalcraft/block/machines/TestForge.java
+++ b/src/main/java/com/kitsu/medievalcraft/block/machines/TestForge.java
@@ -94,9 +94,9 @@ public class TestForge extends BlockContainer {
super.randomDisplayTick(world, x, y, z, random);
TileEntityTestForge tileEnt = (TileEntityTestForge) world.getTileEntity(x, y, z);
- if(tileEnt.isRunning == true){
+ /*if(tileEnt.isRunning == true){
- }
+ }*/
/*Block test = world.getBlock(x, y+1, z);
if (test == TestForgeCrafting.blockToCheck.get(0) || test == TestForgeCrafting.blockToCheck.get(1) || test == TestForgeCrafting.blockToCheck.get(2)
|| test == TestForgeCrafting.blockToCheck.get(3) || test == TestForgeCrafting.blockToCheck.get(4)) {
diff --git a/src/main/java/com/kitsu/medievalcraft/renderer/blocks/machine/ForgeRenderer.java b/src/main/java/com/kitsu/medievalcraft/renderer/blocks/machine/ForgeRenderer.java
index 171c2efd..54edb25b 100644
--- a/src/main/java/com/kitsu/medievalcraft/renderer/blocks/machine/ForgeRenderer.java
+++ b/src/main/java/com/kitsu/medievalcraft/renderer/blocks/machine/ForgeRenderer.java
@@ -106,16 +106,16 @@ public class ForgeRenderer extends TileEntitySpecialRenderer {
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(1.0F, 1.0F, 1.0F);
int dir = world.getBlockMetadata(i, j, k);
- //System.out.println(dir);
- if(dir == 4){
+
+ if(dir == 2||dir == 6||dir == 10){
GL11.glRotated(-180F, 0.0, 1.0F, 0.0F);
}
- if(dir == 5){
+ if(dir == 3||dir == 7||dir == 11){
}
- if(dir == 2){
+ if(dir == 0||dir == 4||dir == 8){
GL11.glRotated(90F, 0.0, 1.0F, 0.0F);
}
- if(dir == 3){
+ if(dir == 1||dir == 5||dir == 9){
GL11.glRotated(-90F, 0.0, 1.0F, 0.0F);
}
diff --git a/src/main/java/com/kitsu/medievalcraft/tileents/machine/TileForge.java b/src/main/java/com/kitsu/medievalcraft/tileents/machine/TileForge.java
index c0a9b47b..63e417a2 100644
--- a/src/main/java/com/kitsu/medievalcraft/tileents/machine/TileForge.java
+++ b/src/main/java/com/kitsu/medievalcraft/tileents/machine/TileForge.java
@@ -1,5 +1,7 @@
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;
@@ -22,6 +24,10 @@ import net.minecraft.world.World;
import com.kitsu.medievalcraft.Main;
import com.kitsu.medievalcraft.block.ingots.IngotBase;
+import com.kitsu.medievalcraft.packethandle.forge.MsgPacketBurning;
+import com.kitsu.medievalcraft.packethandle.forge.MsgPacketForgeX;
+import com.kitsu.medievalcraft.packethandle.forge.MsgPacketForgeY;
+import com.kitsu.medievalcraft.packethandle.forge.MsgPacketForgeZ;
import com.kitsu.medievalcraft.packethandle.forge.MsgPacketOn;
import com.kitsu.medievalcraft.tileents.ingots.TileIngotBase;
@@ -35,6 +41,7 @@ public class TileForge extends TileEntity implements IInventory{
public boolean isOn;
public boolean isBurning;
private int ticks;
+ private Random rand;
public TileForge(){
this.inv = new ItemStack[2];
@@ -205,7 +212,7 @@ public class TileForge extends TileEntity implements IInventory{
@Override
public void updateEntity() {
- World world = getWorldObj();
+ World world = this.getWorldObj();
int x = this.xCoord;
int y = this.yCoord;
int z = this.zCoord;
@@ -215,6 +222,7 @@ public class TileForge extends TileEntity implements IInventory{
fireboxFuelDec(world, x, y, z,this.getStackInSlot(0), this.ticks);
fireboxFuelDec2(world, x, y, z,this.getStackInSlot(1), this.ticks);
}
+
if (worldObj.isRemote) return;
}
@@ -327,15 +335,23 @@ public class TileForge extends TileEntity implements IInventory{
{
return getItemBurnTime(stack) > 0;
}
+
+ //Main.sNet.sendToAll(new MsgPacketOn(tileEnt.isBurning));
+ //Main.sNet.sendToAll(new MsgPacketForgeX(tileEnt.xCoord));
+ //Main.sNet.sendToAll(new MsgPacketForgeY(tileEnt.yCoord));
+ //Main.sNet.sendToAll(new MsgPacketForgeZ(tileEnt.zCoord));
+ //Main.sNet.sendToAll(new MsgPacketBurning(tileEnt.isOn));
private void forgeMaint(World world, int x, int y, int z){
if(this.getStackInSlot(0)==null){
- this.isOn = false;
- this.isBurning = false;
- Main.sNet.sendToAll(new MsgPacketOn(this.isBurning));
+ if(world.getBlockMetadata(x, y, z)>=4&&world.getBlockMetadata(x, y, z)<=7){
+ world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z)-4, 2);
+ }
}
if(this.getStackInSlot(1)==null){
- this.isOn = false;
+ if(world.getBlockMetadata(x, y, z)>=8){
+ world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z)-4, 2);
+ }
}
}
}