diff --git a/resources/assets/resonantinduction/textures/models/fadedSphere.png b/resources/assets/resonantinduction/textures/models/fadedSphere.png new file mode 100644 index 00000000..c1a45319 Binary files /dev/null and b/resources/assets/resonantinduction/textures/models/fadedSphere.png differ diff --git a/src/resonantinduction/ClientProxy.java b/src/resonantinduction/ClientProxy.java index 5ecea24f..68c6d830 100644 --- a/src/resonantinduction/ClientProxy.java +++ b/src/resonantinduction/ClientProxy.java @@ -5,6 +5,7 @@ package resonantinduction; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; +import resonantinduction.base.Vector3; import resonantinduction.render.BlockRenderingHandler; import resonantinduction.render.RenderTesla; import resonantinduction.tesla.TileEntityTesla; @@ -33,4 +34,9 @@ public class ClientProxy extends CommonProxy return null; } + @Override + public void renderElectricShock(World world, Vector3 start, Vector3 target, float r, float g, float b) + { + + } } diff --git a/src/resonantinduction/CommonProxy.java b/src/resonantinduction/CommonProxy.java index a1ab2b7b..26d4a010 100644 --- a/src/resonantinduction/CommonProxy.java +++ b/src/resonantinduction/CommonProxy.java @@ -3,6 +3,7 @@ */ package resonantinduction; +import resonantinduction.base.Vector3; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; import cpw.mods.fml.common.network.IGuiHandler; @@ -30,4 +31,9 @@ public class CommonProxy implements IGuiHandler return null; } + public void renderElectricShock(World world, Vector3 start, Vector3 target, float r, float g, float b) + { + + } + } diff --git a/src/resonantinduction/ResonantInduction.java b/src/resonantinduction/ResonantInduction.java index 4f2c274a..980a729a 100644 --- a/src/resonantinduction/ResonantInduction.java +++ b/src/resonantinduction/ResonantInduction.java @@ -67,7 +67,7 @@ public class ResonantInduction public static final String ITEM_TEXTURE_DIRECTORY = TEXTURE_DIRECTORY + "items/"; public static final String MODEL_TEXTURE_DIRECTORY = TEXTURE_DIRECTORY + "models/"; - public static final String LANGUAGE_DIRECTORY = TEXTURE_DIRECTORY + "languages/"; + public static final String LANGUAGE_DIRECTORY = DIRECTORY + "languages/"; public static final String[] LANGUAGES = new String[] { "en_US" }; /** @@ -111,7 +111,6 @@ public class ResonantInduction CONFIGURATION.save(); GameRegistry.registerBlock(blockTesla, blockTesla.getUnlocalizedName()); - GameRegistry.registerTileEntity(TileEntityTesla.class, blockTesla.getUnlocalizedName()); this.proxy.registerRenderers(); diff --git a/src/resonantinduction/base/Vector3.java b/src/resonantinduction/base/Vector3.java index 8e969ee6..b45b5bcd 100644 --- a/src/resonantinduction/base/Vector3.java +++ b/src/resonantinduction/base/Vector3.java @@ -48,6 +48,6 @@ public class Vector3 public double distance(Vector3 compare) { Vector3 difference = this.difference(compare); - return this.getMagnitude(); + return difference.getMagnitude(); } } diff --git a/src/resonantinduction/fx/FxElectric.java b/src/resonantinduction/fx/FxElectric.java new file mode 100644 index 00000000..1618ec63 --- /dev/null +++ b/src/resonantinduction/fx/FxElectric.java @@ -0,0 +1,15 @@ +/** + * + */ +package resonantinduction.fx; + +/** + * Electric shock Fxs. + * + * @author Calclavia + * + */ +public class FxElectric +{ + +} diff --git a/src/resonantinduction/model/ModelTeslaBottom.java b/src/resonantinduction/model/ModelTeslaBottom.java index 3d0348e1..e977a215 100644 --- a/src/resonantinduction/model/ModelTeslaBottom.java +++ b/src/resonantinduction/model/ModelTeslaBottom.java @@ -1,8 +1,11 @@ package resonantinduction.model; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; +@SideOnly(Side.CLIENT) public class ModelTeslaBottom extends ModelBase { // fields diff --git a/src/resonantinduction/model/ModelTeslaMiddle.java b/src/resonantinduction/model/ModelTeslaMiddle.java index 0d18fc67..590a99cc 100644 --- a/src/resonantinduction/model/ModelTeslaMiddle.java +++ b/src/resonantinduction/model/ModelTeslaMiddle.java @@ -1,8 +1,11 @@ package resonantinduction.model; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; +@SideOnly(Side.CLIENT) public class ModelTeslaMiddle extends ModelBase { // fields diff --git a/src/resonantinduction/render/BlockRenderingHandler.java b/src/resonantinduction/render/BlockRenderingHandler.java index 6a95b658..f83eddd5 100644 --- a/src/resonantinduction/render/BlockRenderingHandler.java +++ b/src/resonantinduction/render/BlockRenderingHandler.java @@ -24,6 +24,7 @@ import cpw.mods.fml.relauncher.SideOnly; public class BlockRenderingHandler implements ISimpleBlockRenderingHandler { public static final BlockRenderingHandler INSTANCE = new BlockRenderingHandler(); + private static final int ID = RenderingRegistry.getNextAvailableRenderId(); @Override public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) @@ -54,7 +55,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler @Override public int getRenderId() { - return RenderingRegistry.getNextAvailableRenderId(); + return ID; } } diff --git a/src/resonantinduction/tesla/TileEntityTesla.java b/src/resonantinduction/tesla/TileEntityTesla.java index cdb5553a..1e167e22 100644 --- a/src/resonantinduction/tesla/TileEntityTesla.java +++ b/src/resonantinduction/tesla/TileEntityTesla.java @@ -46,12 +46,15 @@ public class TileEntityTesla extends TileEntityBase implements ITesla } } - float transferEnergy = this.getEnergyStored() / transferTeslaCoils.size(); - - for (ITesla tesla : transferTeslaCoils) + if (transferTeslaCoils.size() > 0) { - tesla.transfer(transferEnergy); - this.transfer(-transferEnergy); + float transferEnergy = this.getEnergyStored() / transferTeslaCoils.size(); + + for (ITesla tesla : transferTeslaCoils) + { + tesla.transfer(transferEnergy * (1 - (this.worldObj.rand.nextFloat() * 0.1f))); + this.transfer(-transferEnergy); + } } } @@ -66,7 +69,7 @@ public class TileEntityTesla extends TileEntityBase implements ITesla { TileEntityFurnace furnaceTile = (TileEntityFurnace) tileEntity; - boolean doBlockStateUpdate = false; + boolean doBlockStateUpdate = furnaceTile.furnaceBurnTime > 0; if (furnaceTile.furnaceBurnTime == 0) { @@ -76,7 +79,6 @@ public class TileEntityTesla extends TileEntityBase implements ITesla furnaceTile.decrStackSize(1, 1); furnaceTile.furnaceBurnTime = burnTime; } - doBlockStateUpdate = true; } else { @@ -84,9 +86,8 @@ public class TileEntityTesla extends TileEntityBase implements ITesla furnaceTile.furnaceBurnTime--; } - if (doBlockStateUpdate) + if (doBlockStateUpdate != furnaceTile.furnaceBurnTime > 0) { - BlockFurnace.updateFurnaceBlockState(furnaceTile.furnaceBurnTime > 0, furnaceTile.worldObj, furnaceTile.xCoord, furnaceTile.yCoord, furnaceTile.zCoord); } } @@ -95,7 +96,6 @@ public class TileEntityTesla extends TileEntityBase implements ITesla @Override public void transfer(float transferEnergy) { - System.out.println(transferEnergy); this.energy += transferEnergy; this.doTransfer = true; }