From eab51b61cccfae3a2911bc5af9c0a9480b40e3d5 Mon Sep 17 00:00:00 2001 From: Calclavia Date: Sat, 11 Jan 2014 11:04:30 +0800 Subject: [PATCH] Fixed EMLevitator --- build.gradle | 5 ++++ .../electrical/ClientProxy.java | 4 ++-- .../electrical/CommonProxy.java | 11 +++++---- .../electrical/Electrical.java | 6 ++--- .../electrical/battery/TileBattery.java | 11 +++------ .../levitator/BlockFilter.java | 2 +- .../levitator/BlockLevitator.java | 2 +- .../levitator/ItemBlockContractor.java | 2 +- .../levitator/ModelEMContractor.java | 2 +- .../levitator/PathfinderEMContractor.java | 2 +- .../levitator/RenderLevitator.java | 2 +- .../levitator/ThreadEMPathfinding.java | 2 +- .../levitator/TileEMLevitator.java | 14 ++++++----- .../ElectricalBlockRenderingHandler.java | 4 ++-- .../electrical/tesla/TileTesla.java | 4 ++-- .../mechanical/belt/BlockConveyorBelt.java | 24 +++++++++---------- ...onveyorBelt.java => TileConveyorBelt.java} | 7 +++--- .../old/client/render/RenderConveyorBelt.java | 16 ++++++------- 18 files changed, 62 insertions(+), 58 deletions(-) rename src/main/java/resonantinduction/{old/transport => electrical}/levitator/BlockFilter.java (84%) rename src/main/java/resonantinduction/{old/transport => electrical}/levitator/BlockLevitator.java (98%) rename src/main/java/resonantinduction/{old/transport => electrical}/levitator/ItemBlockContractor.java (96%) rename src/main/java/resonantinduction/{old/transport => electrical}/levitator/ModelEMContractor.java (99%) rename src/main/java/resonantinduction/{old/transport => electrical}/levitator/PathfinderEMContractor.java (97%) rename src/main/java/resonantinduction/{old/transport => electrical}/levitator/RenderLevitator.java (97%) rename src/main/java/resonantinduction/{old/transport => electrical}/levitator/ThreadEMPathfinding.java (92%) rename src/main/java/resonantinduction/{old/transport => electrical}/levitator/TileEMLevitator.java (94%) rename src/main/java/resonantinduction/mechanical/belt/{TileEntityConveyorBelt.java => TileConveyorBelt.java} (95%) diff --git a/build.gradle b/build.gradle index ac123069e..a7044c1ee 100644 --- a/build.gradle +++ b/build.gradle @@ -59,6 +59,11 @@ artifacts { archives apiZip } +compileJava { + sourceCompatability = "1.7" + targetCompatability = "1.7" +} + jar { dependsOn copyBuildXml classifier = '' diff --git a/src/main/java/resonantinduction/electrical/ClientProxy.java b/src/main/java/resonantinduction/electrical/ClientProxy.java index 3edde97ba..8ac0e2deb 100644 --- a/src/main/java/resonantinduction/electrical/ClientProxy.java +++ b/src/main/java/resonantinduction/electrical/ClientProxy.java @@ -8,6 +8,8 @@ import resonantinduction.electrical.battery.RenderBattery; import resonantinduction.electrical.battery.TileBattery; import resonantinduction.electrical.generator.solar.RenderSolarPanel; import resonantinduction.electrical.generator.solar.TileSolarPanel; +import resonantinduction.electrical.levitator.RenderLevitator; +import resonantinduction.electrical.levitator.TileEMLevitator; import resonantinduction.electrical.multimeter.GuiMultimeter; import resonantinduction.electrical.multimeter.PartMultimeter; import resonantinduction.electrical.render.ElectricalBlockRenderingHandler; @@ -15,8 +17,6 @@ import resonantinduction.electrical.render.FXElectricBolt; import resonantinduction.electrical.tesla.RenderTesla; import resonantinduction.electrical.tesla.TileTesla; import resonantinduction.old.core.render.RenderRIItem; -import resonantinduction.old.transport.levitator.RenderLevitator; -import resonantinduction.old.transport.levitator.TileEMLevitator; import universalelectricity.api.vector.Vector3; import codechicken.multipart.TMultiPart; import codechicken.multipart.TileMultipart; diff --git a/src/main/java/resonantinduction/electrical/CommonProxy.java b/src/main/java/resonantinduction/electrical/CommonProxy.java index 79a247ef0..adbe5350e 100644 --- a/src/main/java/resonantinduction/electrical/CommonProxy.java +++ b/src/main/java/resonantinduction/electrical/CommonProxy.java @@ -1,5 +1,7 @@ package resonantinduction.electrical; +import java.awt.Color; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; @@ -7,7 +9,6 @@ import resonantinduction.core.prefab.ProxyBase; import resonantinduction.electrical.multimeter.ContainerMultimeter; import resonantinduction.electrical.multimeter.PartMultimeter; import universalelectricity.api.vector.Vector3; -import codechicken.lib.colour.ColourRGBA; import codechicken.multipart.TMultiPart; import codechicken.multipart.TileMultipart; @@ -40,14 +41,14 @@ public class CommonProxy extends ProxyBase this.renderElectricShock(world, start, target, r, g, b, true); } - public void renderElectricShock(World world, Vector3 start, Vector3 target, ColourRGBA color) + public void renderElectricShock(World world, Vector3 start, Vector3 target, Color color) { - this.renderElectricShock(world, start, target, color.r / 255f, color.g / 255f, color.b / 255f); + this.renderElectricShock(world, start, target, color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f); } - public void renderElectricShock(World world, Vector3 start, Vector3 target, ColourRGBA color, boolean split) + public void renderElectricShock(World world, Vector3 start, Vector3 target, Color color, boolean split) { - this.renderElectricShock(world, start, target, color.r / 255f, color.g / 255f, color.b / 255f, split); + this.renderElectricShock(world, start, target, color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, split); } public void renderElectricShock(World world, Vector3 start, Vector3 target) diff --git a/src/main/java/resonantinduction/electrical/Electrical.java b/src/main/java/resonantinduction/electrical/Electrical.java index e5efe1edc..0f324856d 100644 --- a/src/main/java/resonantinduction/electrical/Electrical.java +++ b/src/main/java/resonantinduction/electrical/Electrical.java @@ -21,6 +21,9 @@ import resonantinduction.electrical.battery.ItemBlockBattery; import resonantinduction.electrical.battery.TileBattery; import resonantinduction.electrical.generator.solar.BlockSolarPanel; import resonantinduction.electrical.generator.solar.TileSolarPanel; +import resonantinduction.electrical.levitator.BlockLevitator; +import resonantinduction.electrical.levitator.ItemBlockContractor; +import resonantinduction.electrical.levitator.TileEMLevitator; import resonantinduction.electrical.multimeter.ItemMultimeter; import resonantinduction.electrical.tesla.BlockTesla; import resonantinduction.electrical.tesla.TileTesla; @@ -33,9 +36,6 @@ import resonantinduction.mechanical.grinder.TilePurifier; import resonantinduction.old.mechanics.furnace.BlockAdvancedFurnace; import resonantinduction.old.mechanics.furnace.TileAdvancedFurnace; import resonantinduction.old.mechanics.purifier.BlockPurifier; -import resonantinduction.old.transport.levitator.BlockLevitator; -import resonantinduction.old.transport.levitator.ItemBlockContractor; -import resonantinduction.old.transport.levitator.TileEMLevitator; import calclavia.lib.network.PacketHandler; import calclavia.lib.recipe.UniversalRecipe; import cpw.mods.fml.common.Loader; diff --git a/src/main/java/resonantinduction/electrical/battery/TileBattery.java b/src/main/java/resonantinduction/electrical/battery/TileBattery.java index 898433c32..98d108ffb 100644 --- a/src/main/java/resonantinduction/electrical/battery/TileBattery.java +++ b/src/main/java/resonantinduction/electrical/battery/TileBattery.java @@ -74,6 +74,7 @@ public class TileBattery extends TileElectrical implements IConnector, TileEntitySpecialRenderer>> list) { - list.add(new Pair, TileEntitySpecialRenderer>(TileEntityConveyorBelt.class, new RenderConveyorBelt())); + list.add(new Pair, TileEntitySpecialRenderer>(TileConveyorBelt.class, new RenderConveyorBelt())); } @Override public void getTileEntities(int blockID, Set>> list) { - list.add(new Pair>("ALConveyorBelt", TileEntityConveyorBelt.class)); + list.add(new Pair>("ALConveyorBelt", TileConveyorBelt.class)); } /** Returns the TileEntity used by this block. */ @Override public TileEntity createNewTileEntity(World var1) { - return new TileEntityConveyorBelt(); + return new TileConveyorBelt(); } @SideOnly(Side.CLIENT) diff --git a/src/main/java/resonantinduction/mechanical/belt/TileEntityConveyorBelt.java b/src/main/java/resonantinduction/mechanical/belt/TileConveyorBelt.java similarity index 95% rename from src/main/java/resonantinduction/mechanical/belt/TileEntityConveyorBelt.java rename to src/main/java/resonantinduction/mechanical/belt/TileConveyorBelt.java index 994ddb1f6..7ffc0b039 100644 --- a/src/main/java/resonantinduction/mechanical/belt/TileEntityConveyorBelt.java +++ b/src/main/java/resonantinduction/mechanical/belt/TileConveyorBelt.java @@ -10,6 +10,7 @@ import net.minecraft.network.packet.Packet; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraftforge.common.ForgeDirection; +import resonantinduction.core.ResonantInduction; import resonantinduction.old.api.IBelt; import resonantinduction.old.core.recipe.RecipeLoader; import resonantinduction.old.transport.TileEntityAssembly; @@ -26,7 +27,7 @@ import cpw.mods.fml.common.network.Player; * * @author DarkGuardsman */ -public class TileEntityConveyorBelt extends TileEntityAssembly implements IBelt, IRotatable +public class TileConveyorBelt extends TileEntityAssembly implements IBelt, IRotatable { public enum SlantType @@ -50,7 +51,7 @@ public class TileEntityConveyorBelt extends TileEntityAssembly implements IBelt, /** Entities that are ignored allowing for other tiles to interact with them */ public List IgnoreList = new ArrayList(); - public TileEntityConveyorBelt() + public TileConveyorBelt() { super(1); } @@ -110,7 +111,7 @@ public class TileEntityConveyorBelt extends TileEntityAssembly implements IBelt, { if (this.slantType != SlantType.NONE) { - return PacketHandler.instance().getTilePacket(this.getChannel(), slantPacketID, this, this.isFunctioning(), this.slantType.ordinal()); + return ResonantInduction.PACKET_TILE.getPacket(this, slantPacketID, this.isFunctioning(), this.slantType.ordinal()); } return super.getDescriptionPacket(); } diff --git a/src/main/java/resonantinduction/old/client/render/RenderConveyorBelt.java b/src/main/java/resonantinduction/old/client/render/RenderConveyorBelt.java index b1b7472ff..29ae9e316 100644 --- a/src/main/java/resonantinduction/old/client/render/RenderConveyorBelt.java +++ b/src/main/java/resonantinduction/old/client/render/RenderConveyorBelt.java @@ -7,8 +7,8 @@ import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import resonantinduction.core.Reference; -import resonantinduction.mechanical.belt.TileEntityConveyorBelt; -import resonantinduction.mechanical.belt.TileEntityConveyorBelt.SlantType; +import resonantinduction.mechanical.belt.TileConveyorBelt; +import resonantinduction.mechanical.belt.TileConveyorBelt.SlantType; import resonantinduction.old.client.model.ModelAngledBelt; import resonantinduction.old.client.model.ModelConveyorBelt; import cpw.mods.fml.relauncher.Side; @@ -20,7 +20,7 @@ public class RenderConveyorBelt extends TileEntitySpecialRenderer public static final ModelConveyorBelt MODEL = new ModelConveyorBelt(); public static final ModelAngledBelt MODEL2 = new ModelAngledBelt(); - private void renderAModelAt(TileEntityConveyorBelt tileEntity, double x, double y, double z, float f) + private void renderAModelAt(TileConveyorBelt tileEntity, double x, double y, double z, float f) { SlantType slantType = tileEntity.getSlant(); int face = tileEntity.getDirection().ordinal(); @@ -60,9 +60,9 @@ public class RenderConveyorBelt extends TileEntitySpecialRenderer TileEntity test = tileEntity.worldObj.getBlockTileEntity(tileEntity.xCoord + tileEntity.getDirection().offsetX, tileEntity.yCoord, tileEntity.zCoord + tileEntity.getDirection().offsetZ); if (test != null) { - if (test instanceof TileEntityConveyorBelt) + if (test instanceof TileConveyorBelt) { - if (((TileEntityConveyorBelt) test).getSlant() == SlantType.TOP) + if (((TileConveyorBelt) test).getSlant() == SlantType.TOP) { GL11.glRotatef(10f, 1f, 0f, 0f); slantAdjust = true; @@ -80,9 +80,9 @@ public class RenderConveyorBelt extends TileEntitySpecialRenderer TileEntity test = tileEntity.worldObj.getBlockTileEntity(tileEntity.xCoord - tileEntity.getDirection().offsetX, tileEntity.yCoord, tileEntity.zCoord - tileEntity.getDirection().offsetZ); if (test != null) { - if (test instanceof TileEntityConveyorBelt) + if (test instanceof TileConveyorBelt) { - if (((TileEntityConveyorBelt) test).getSlant() == SlantType.TOP) + if (((TileConveyorBelt) test).getSlant() == SlantType.TOP) { GL11.glRotatef(-10f, 1f, 0f, 0f); GL11.glTranslatef(0f, 0.25f, 0f); @@ -133,7 +133,7 @@ public class RenderConveyorBelt extends TileEntitySpecialRenderer @Override public void renderTileEntityAt(TileEntity tileEntity, double var2, double var4, double var6, float var8) { - this.renderAModelAt((TileEntityConveyorBelt) tileEntity, var2, var4, var6, var8); + this.renderAModelAt((TileConveyorBelt) tileEntity, var2, var4, var6, var8); } } \ No newline at end of file