From ab24bb27464fef7a01aae814dc2fb05caf9afeb2 Mon Sep 17 00:00:00 2001 From: Calclavia Date: Sat, 11 Jan 2014 00:08:58 +0800 Subject: [PATCH] Added solar panels --- .../core/prefab/tile/TileEntityMachine.java | 1 - .../core/resource/item/ItemBlockOre.java | 1 - .../electrical/ClientProxy.java | 9 ++- .../electrical/Electrical.java | 24 ++++-- .../electrical/battery/BlockBattery.java | 4 +- .../generator/solar/BlockSolarPanel.java | 73 +++--------------- .../generator/solar}/ModelSolarPanel.java | 8 +- .../generator/solar/RenderSolarPanel.java} | 12 ++- .../generator/solar/TileEntitySolarBox.java | 23 ------ .../generator/solar/TileEntitySolarPanel.java | 56 -------------- .../generator/solar/TileSolarPanel.java | 35 +++++++++ .../ElectricalBlockRenderingHandler.java} | 20 ++++- .../{fx => render}/FXElectricBolt.java | 2 +- .../electrical/tesla/BlockTesla.java | 4 +- .../old/client/ClientProxy.java | 1 - .../transport/ResonantInductionTransport.java | 4 - .../transport/imprinter/BlockImprinter.java | 1 - .../transport/levitator/BlockLevitator.java | 4 +- .../languages/en_US.properties | 8 +- .../{textures => }/models/solarPanel.png | Bin 20 files changed, 104 insertions(+), 186 deletions(-) rename src/main/java/resonantinduction/{old/client/model => electrical/generator/solar}/ModelSolarPanel.java (91%) rename src/main/java/resonantinduction/{old/client/render/RenderBlockSolarPanel.java => electrical/generator/solar/RenderSolarPanel.java} (68%) delete mode 100644 src/main/java/resonantinduction/electrical/generator/solar/TileEntitySolarBox.java delete mode 100644 src/main/java/resonantinduction/electrical/generator/solar/TileEntitySolarPanel.java create mode 100644 src/main/java/resonantinduction/electrical/generator/solar/TileSolarPanel.java rename src/main/java/resonantinduction/{old/core/render/BlockRenderingHandler.java => electrical/render/ElectricalBlockRenderingHandler.java} (76%) rename src/main/java/resonantinduction/electrical/{fx => render}/FXElectricBolt.java (99%) rename src/main/resources/assets/resonantinduction/{textures => }/models/solarPanel.png (100%) diff --git a/src/main/java/resonantinduction/core/prefab/tile/TileEntityMachine.java b/src/main/java/resonantinduction/core/prefab/tile/TileEntityMachine.java index 8f1de63f..f9323868 100644 --- a/src/main/java/resonantinduction/core/prefab/tile/TileEntityMachine.java +++ b/src/main/java/resonantinduction/core/prefab/tile/TileEntityMachine.java @@ -9,7 +9,6 @@ import net.minecraft.network.packet.Packet; import net.minecraft.util.AxisAlignedBB; import net.minecraftforge.common.Configuration; import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.Reference; import resonantinduction.core.ResonantInduction; import resonantinduction.core.network.ISimplePacketReceiver; import universalelectricity.api.vector.Vector3; diff --git a/src/main/java/resonantinduction/core/resource/item/ItemBlockOre.java b/src/main/java/resonantinduction/core/resource/item/ItemBlockOre.java index 4092e84a..2c3bdd57 100644 --- a/src/main/java/resonantinduction/core/resource/item/ItemBlockOre.java +++ b/src/main/java/resonantinduction/core/resource/item/ItemBlockOre.java @@ -3,7 +3,6 @@ package resonantinduction.core.resource.item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import resonantinduction.core.Reference; -import resonantinduction.core.resource.BlockOre; import resonantinduction.core.resource.BlockOre.OreData; public class ItemBlockOre extends ItemBlock diff --git a/src/main/java/resonantinduction/electrical/ClientProxy.java b/src/main/java/resonantinduction/electrical/ClientProxy.java index 43a44d4d..3edde97b 100644 --- a/src/main/java/resonantinduction/electrical/ClientProxy.java +++ b/src/main/java/resonantinduction/electrical/ClientProxy.java @@ -6,12 +6,14 @@ import net.minecraft.world.World; import net.minecraftforge.client.MinecraftForgeClient; import resonantinduction.electrical.battery.RenderBattery; import resonantinduction.electrical.battery.TileBattery; -import resonantinduction.electrical.fx.FXElectricBolt; +import resonantinduction.electrical.generator.solar.RenderSolarPanel; +import resonantinduction.electrical.generator.solar.TileSolarPanel; import resonantinduction.electrical.multimeter.GuiMultimeter; import resonantinduction.electrical.multimeter.PartMultimeter; +import resonantinduction.electrical.render.ElectricalBlockRenderingHandler; +import resonantinduction.electrical.render.FXElectricBolt; import resonantinduction.electrical.tesla.RenderTesla; import resonantinduction.electrical.tesla.TileTesla; -import resonantinduction.old.core.render.BlockRenderingHandler; import resonantinduction.old.core.render.RenderRIItem; import resonantinduction.old.transport.levitator.RenderLevitator; import resonantinduction.old.transport.levitator.TileEMLevitator; @@ -34,12 +36,13 @@ public class ClientProxy extends CommonProxy @Override public void preInit() { - RenderingRegistry.registerBlockHandler(BlockRenderingHandler.INSTANCE); + RenderingRegistry.registerBlockHandler(ElectricalBlockRenderingHandler.INSTANCE); MinecraftForgeClient.registerItemRenderer(Electrical.itemMultimeter.itemID, RenderRIItem.INSTANCE); MinecraftForgeClient.registerItemRenderer(Electrical.itemTransformer.itemID, RenderRIItem.INSTANCE); ClientRegistry.bindTileEntitySpecialRenderer(TileTesla.class, new RenderTesla()); ClientRegistry.bindTileEntitySpecialRenderer(TileEMLevitator.class, new RenderLevitator()); ClientRegistry.bindTileEntitySpecialRenderer(TileBattery.class, new RenderBattery()); + ClientRegistry.bindTileEntitySpecialRenderer(TileSolarPanel.class, new RenderSolarPanel()); } @Override diff --git a/src/main/java/resonantinduction/electrical/Electrical.java b/src/main/java/resonantinduction/electrical/Electrical.java index bb9f044d..e5efe1ed 100644 --- a/src/main/java/resonantinduction/electrical/Electrical.java +++ b/src/main/java/resonantinduction/electrical/Electrical.java @@ -1,8 +1,9 @@ package resonantinduction.electrical; +import ic2.api.item.Items; + import java.util.Map; -import ic2.api.item.Items; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -15,10 +16,11 @@ import resonantinduction.core.ResonantInduction; import resonantinduction.core.ResonantInductionTabs; import resonantinduction.core.Settings; import resonantinduction.core.part.BlockMachinePart; -import resonantinduction.core.resource.fluid.TileFluidMixture; import resonantinduction.electrical.battery.BlockBattery; 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.multimeter.ItemMultimeter; import resonantinduction.electrical.tesla.BlockTesla; import resonantinduction.electrical.tesla.TileTesla; @@ -38,10 +40,10 @@ import calclavia.lib.network.PacketHandler; import calclavia.lib.recipe.UniversalRecipe; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.ObfuscationReflectionHelper; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.ModMetadata; +import cpw.mods.fml.common.ObfuscationReflectionHelper; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; @@ -56,7 +58,7 @@ import cpw.mods.fml.common.registry.GameRegistry; * @author Calclavia * */ -@Mod(modid = Electrical.ID, name = Electrical.NAME, version = Reference.VERSION, dependencies = "required-after:" + ResonantInduction.ID) +@Mod(modid = Electrical.ID, name = Electrical.NAME, version = Reference.VERSION, dependencies = "before:ThermalExpansion;required-after:" + ResonantInduction.ID) @NetworkMod(channels = Reference.CHANNEL, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class) public class Electrical { @@ -80,12 +82,15 @@ public class Electrical public static Block blockTesla; public static Block blockBattery; - // Transport - public static Block blockEMContractor; + // Generators + public static Block blockSolarPanel; // Machines public static Block blockAdvancedFurnace, blockMachinePart, blockGrinderWheel, blockPurifier; + // Transport + public static Block blockEMContractor; + @EventHandler public void preInit(FMLPreInitializationEvent evt) { @@ -108,6 +113,9 @@ public class Electrical blockGrinderWheel = new BlockGrinderWheel(Settings.getNextBlockID()); blockPurifier = new BlockPurifier(Settings.getNextBlockID()); + // Generator + blockSolarPanel = new BlockSolarPanel(); + if (Settings.REPLACE_FURNACE) { blockAdvancedFurnace = BlockAdvancedFurnace.createNew(false); @@ -120,6 +128,7 @@ public class Electrical GameRegistry.registerItem(itemMultimeter, itemMultimeter.getUnlocalizedName()); GameRegistry.registerItem(itemTransformer, itemTransformer.getUnlocalizedName()); + GameRegistry.registerBlock(blockSolarPanel, blockSolarPanel.getUnlocalizedName()); GameRegistry.registerBlock(blockTesla, blockTesla.getUnlocalizedName()); GameRegistry.registerBlock(blockBattery, ItemBlockBattery.class, blockBattery.getUnlocalizedName()); GameRegistry.registerBlock(blockGrinderWheel, blockGrinderWheel.getUnlocalizedName()); @@ -130,8 +139,7 @@ public class Electrical // Tiles GameRegistry.registerTileEntity(TileTesla.class, blockTesla.getUnlocalizedName()); GameRegistry.registerTileEntity(TileBattery.class, blockBattery.getUnlocalizedName()); - - // Tiles + GameRegistry.registerTileEntity(TileSolarPanel.class, blockSolarPanel.getUnlocalizedName()); GameRegistry.registerTileEntity(TilePurifier.class, blockPurifier.getUnlocalizedName()); GameRegistry.registerTileEntity(TileGrinderWheel.class, blockGrinderWheel.getUnlocalizedName()); GameRegistry.registerTileEntity(TileEMLevitator.class, blockEMContractor.getUnlocalizedName()); diff --git a/src/main/java/resonantinduction/electrical/battery/BlockBattery.java b/src/main/java/resonantinduction/electrical/battery/BlockBattery.java index 6ced6490..63ea7010 100644 --- a/src/main/java/resonantinduction/electrical/battery/BlockBattery.java +++ b/src/main/java/resonantinduction/electrical/battery/BlockBattery.java @@ -12,7 +12,7 @@ import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import resonantinduction.core.Reference; import resonantinduction.core.prefab.block.BlockIOBase; -import resonantinduction.old.core.render.BlockRenderingHandler; +import resonantinduction.electrical.render.ElectricalBlockRenderingHandler; import universalelectricity.api.CompatibilityModule; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -70,7 +70,7 @@ public class BlockBattery extends BlockIOBase implements ITileEntityProvider @SideOnly(Side.CLIENT) public int getRenderType() { - return BlockRenderingHandler.INSTANCE.getRenderId(); + return ElectricalBlockRenderingHandler.INSTANCE.getRenderId(); } @Override diff --git a/src/main/java/resonantinduction/electrical/generator/solar/BlockSolarPanel.java b/src/main/java/resonantinduction/electrical/generator/solar/BlockSolarPanel.java index 83134be0..000a122d 100644 --- a/src/main/java/resonantinduction/electrical/generator/solar/BlockSolarPanel.java +++ b/src/main/java/resonantinduction/electrical/generator/solar/BlockSolarPanel.java @@ -1,41 +1,25 @@ package resonantinduction.electrical.generator.solar; -import java.util.List; -import java.util.Set; - -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.Configuration; -import net.minecraftforge.oredict.OreDictionary; -import resonantinduction.core.prefab.block.BlockMachine; -import resonantinduction.old.client.render.BlockRenderingHandler; -import resonantinduction.old.client.render.RenderBlockSolarPanel; - -import com.builtbroken.common.Pair; - import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import dark.lib.IExtraInfo.IExtraBlockInfo; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import resonantinduction.core.prefab.block.BlockMachine; +import resonantinduction.electrical.render.ElectricalBlockRenderingHandler; +import resonantinduction.old.client.render.BlockRenderingHandler; -public class BlockSolarPanel extends BlockMachine implements IExtraBlockInfo +public class BlockSolarPanel extends BlockMachine { - public static int tickRate = 10; - public static long wattDay = 120; - public static long wattNight = 1; - public static long wattStorm = 5; - public BlockSolarPanel() { - super("BlockSolarPanel"); - this.setBlockBounds(0, 0, 0, 1f, .6f, 1f); + super("solarPanel"); + this.setBlockBounds(0, 0, 0, 1, 0.5f, 1); } @Override public TileEntity createNewTileEntity(World world) { - return new TileEntitySolarPanel(); + return new TileSolarPanel(); } @Override @@ -50,45 +34,10 @@ public class BlockSolarPanel extends BlockMachine implements IExtraBlockInfo return false; } + @SideOnly(Side.CLIENT) @Override public int getRenderType() { - return BlockRenderingHandler.BLOCK_RENDER_ID; + return ElectricalBlockRenderingHandler.ID; } - - @Override - public void getTileEntities(int blockID, Set>> list) - { - list.add(new Pair>("DMSolarCell", TileEntitySolarPanel.class)); - } - - @Override - @SideOnly(Side.CLIENT) - public void getClientTileEntityRenderers(List, TileEntitySpecialRenderer>> list) - { - list.add(new Pair, TileEntitySpecialRenderer>(TileEntitySolarPanel.class, new RenderBlockSolarPanel())); - - } - - @Override - public void loadExtraConfigs(Configuration config) - { - tickRate = config.get("settings", "PanelUpdateRate", tickRate).getInt(); - wattDay = config.get("settings", "WattDayLight", 120).getInt(); - wattNight = config.get("settings", "WattMoonLight", 1).getInt(); - wattStorm = config.get("settings", "WattStorm", 6).getInt(); - } - - @Override - public void loadOreNames() - { - OreDictionary.registerOre("SolarPanel", new ItemStack(this, 1, 0)); - } - - @Override - public boolean hasExtraConfigs() - { - // TODO Auto-generated method stub - return false; - } } diff --git a/src/main/java/resonantinduction/old/client/model/ModelSolarPanel.java b/src/main/java/resonantinduction/electrical/generator/solar/ModelSolarPanel.java similarity index 91% rename from src/main/java/resonantinduction/old/client/model/ModelSolarPanel.java rename to src/main/java/resonantinduction/electrical/generator/solar/ModelSolarPanel.java index 50f1de17..9c78a6aa 100644 --- a/src/main/java/resonantinduction/old/client/model/ModelSolarPanel.java +++ b/src/main/java/resonantinduction/electrical/generator/solar/ModelSolarPanel.java @@ -1,10 +1,4 @@ -// Date: 9/20/2013 12:38:02 PM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package resonantinduction.old.client.model; +package resonantinduction.electrical.generator.solar; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; diff --git a/src/main/java/resonantinduction/old/client/render/RenderBlockSolarPanel.java b/src/main/java/resonantinduction/electrical/generator/solar/RenderSolarPanel.java similarity index 68% rename from src/main/java/resonantinduction/old/client/render/RenderBlockSolarPanel.java rename to src/main/java/resonantinduction/electrical/generator/solar/RenderSolarPanel.java index c00bd376..fc1a11ee 100644 --- a/src/main/java/resonantinduction/old/client/render/RenderBlockSolarPanel.java +++ b/src/main/java/resonantinduction/electrical/generator/solar/RenderSolarPanel.java @@ -1,4 +1,4 @@ -package resonantinduction.old.client.render; +package resonantinduction.electrical.generator.solar; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; @@ -7,16 +7,14 @@ import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import resonantinduction.core.Reference; -import resonantinduction.old.client.model.ModelSolarPanel; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) -public class RenderBlockSolarPanel extends TileEntitySpecialRenderer +public class RenderSolarPanel extends TileEntitySpecialRenderer { - public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "SolarPanel.png"); - - public static final ModelSolarPanel model = new ModelSolarPanel(); + public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "solarPanel.png"); + public static final ModelSolarPanel MODEL = new ModelSolarPanel(); @Override public void renderTileEntityAt(TileEntity tileentity, double d, double d1, double d2, float f) @@ -26,7 +24,7 @@ public class RenderBlockSolarPanel extends TileEntitySpecialRenderer GL11.glPushMatrix(); GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); GL11.glScalef(1.0F, -1F, -1F); - model.render(0.0625F); + MODEL.render(0.0625F); GL11.glPopMatrix(); } } \ No newline at end of file diff --git a/src/main/java/resonantinduction/electrical/generator/solar/TileEntitySolarBox.java b/src/main/java/resonantinduction/electrical/generator/solar/TileEntitySolarBox.java deleted file mode 100644 index 4ecda1d2..00000000 --- a/src/main/java/resonantinduction/electrical/generator/solar/TileEntitySolarBox.java +++ /dev/null @@ -1,23 +0,0 @@ -package resonantinduction.electrical.generator.solar; - -import resonantinduction.core.prefab.tile.TileGenerator; - -/** TileEntity that acts as the connection node for the solar panel */ -public class TileEntitySolarBox extends TileGenerator -{ - - @Override - public boolean hasFuel() - { - // TODO Auto-generated method stub - return false; - } - - @Override - public void consumeFuel() - { - // TODO Auto-generated method stub - - } - -} diff --git a/src/main/java/resonantinduction/electrical/generator/solar/TileEntitySolarPanel.java b/src/main/java/resonantinduction/electrical/generator/solar/TileEntitySolarPanel.java deleted file mode 100644 index e5883090..00000000 --- a/src/main/java/resonantinduction/electrical/generator/solar/TileEntitySolarPanel.java +++ /dev/null @@ -1,56 +0,0 @@ -package resonantinduction.electrical.generator.solar; - -import java.util.EnumSet; - -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.prefab.tile.TileGenerator; - -public class TileEntitySolarPanel extends TileGenerator -{ - public TileEntitySolarPanel() - { - super(); - } - - @Override - public EnumSet getOutputDirections() - { - return EnumSet.of(ForgeDirection.DOWN); - } - - @Override - public boolean hasFuel() - { - return this.JOULES_PER_TICK > 0; - } - - @Override - public void consumeFuel() - { - if (!this.worldObj.isRemote && this.ticks % BlockSolarPanel.tickRate == 0) - { - this.setJoulesPerSecound(0); - if (this.worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord) && !this.worldObj.provider.hasNoSky) - { - if (this.worldObj.isDaytime()) - { - this.setJoulesPerTick(BlockSolarPanel.wattDay); - if (this.worldObj.isThundering() || this.worldObj.isRaining()) - { - this.setJoulesPerSecound(BlockSolarPanel.wattStorm); - } - } - else - { - if (!this.worldObj.isThundering() && !this.worldObj.isRaining()) - { - this.setJoulesPerTick(BlockSolarPanel.wattNight); - } - } - //TODO add GC support - //this.setJoulesPerSecound(this.JOULES_PER_TICK + this.JOULES_PER_TICK * (this.worldObj.provider instanceof ISolarLevel ? (int) ((ISolarLevel) this.worldObj.provider).getSolarEnergyMultiplier() : 0)); - } - } - } - -} diff --git a/src/main/java/resonantinduction/electrical/generator/solar/TileSolarPanel.java b/src/main/java/resonantinduction/electrical/generator/solar/TileSolarPanel.java new file mode 100644 index 00000000..cd3fb820 --- /dev/null +++ b/src/main/java/resonantinduction/electrical/generator/solar/TileSolarPanel.java @@ -0,0 +1,35 @@ +package resonantinduction.electrical.generator.solar; + +import universalelectricity.api.energy.EnergyStorageHandler; +import calclavia.lib.prefab.tile.TileElectrical; + +public class TileSolarPanel extends TileElectrical +{ + public TileSolarPanel() + { + this.energy = new EnergyStorageHandler(200); + this.ioMap = 728; + } + + @Override + public void updateEntity() + { + super.updateEntity(); + + if (!this.worldObj.isRemote) + { + if (this.worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord) && !this.worldObj.provider.hasNoSky) + { + if (this.worldObj.isDaytime()) + { + if (!(this.worldObj.isThundering() || this.worldObj.isRaining())) + { + this.energy.receiveEnergy(1, true); + this.produce(); + } + } + } + } + } + +} diff --git a/src/main/java/resonantinduction/old/core/render/BlockRenderingHandler.java b/src/main/java/resonantinduction/electrical/render/ElectricalBlockRenderingHandler.java similarity index 76% rename from src/main/java/resonantinduction/old/core/render/BlockRenderingHandler.java rename to src/main/java/resonantinduction/electrical/render/ElectricalBlockRenderingHandler.java index 639b744e..ed60f8bc 100644 --- a/src/main/java/resonantinduction/old/core/render/BlockRenderingHandler.java +++ b/src/main/java/resonantinduction/electrical/render/ElectricalBlockRenderingHandler.java @@ -1,7 +1,7 @@ /** * */ -package resonantinduction.old.core.render; +package resonantinduction.electrical.render; import static org.lwjgl.opengl.GL11.glPopMatrix; import static org.lwjgl.opengl.GL11.glPushMatrix; @@ -12,8 +12,13 @@ import static org.lwjgl.opengl.GL11.glTranslatef; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.world.IBlockAccess; + +import org.lwjgl.opengl.GL11; + import resonantinduction.electrical.battery.BlockBattery; import resonantinduction.electrical.battery.RenderBattery; +import resonantinduction.electrical.generator.solar.BlockSolarPanel; +import resonantinduction.electrical.generator.solar.RenderSolarPanel; import resonantinduction.electrical.tesla.BlockTesla; import resonantinduction.electrical.tesla.RenderTesla; import resonantinduction.old.transport.levitator.BlockLevitator; @@ -29,10 +34,10 @@ import cpw.mods.fml.relauncher.SideOnly; * */ @SideOnly(Side.CLIENT) -public class BlockRenderingHandler implements ISimpleBlockRenderingHandler +public class ElectricalBlockRenderingHandler implements ISimpleBlockRenderingHandler { - public static final BlockRenderingHandler INSTANCE = new BlockRenderingHandler(); - private static final int ID = RenderingRegistry.getNextAvailableRenderId(); + public static final ElectricalBlockRenderingHandler INSTANCE = new ElectricalBlockRenderingHandler(); + public static final int ID = RenderingRegistry.getNextAvailableRenderId(); @Override public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) @@ -65,6 +70,13 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler RenderBattery.MODEL.renderAll(); glPopMatrix(); } + else if (block instanceof BlockSolarPanel) + { + FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderSolarPanel.TEXTURE); + GL11.glTranslatef(0.0F, 1.1F, 0.0F); + GL11.glRotatef(180f, 0f, 0f, 1f); + RenderSolarPanel.MODEL.render(0.0625F); + } } @Override diff --git a/src/main/java/resonantinduction/electrical/fx/FXElectricBolt.java b/src/main/java/resonantinduction/electrical/render/FXElectricBolt.java similarity index 99% rename from src/main/java/resonantinduction/electrical/fx/FXElectricBolt.java rename to src/main/java/resonantinduction/electrical/render/FXElectricBolt.java index e7bb518d..38f12be0 100644 --- a/src/main/java/resonantinduction/electrical/fx/FXElectricBolt.java +++ b/src/main/java/resonantinduction/electrical/render/FXElectricBolt.java @@ -1,4 +1,4 @@ -package resonantinduction.electrical.fx; +package resonantinduction.electrical.render; import static org.lwjgl.opengl.GL11.GL_BLEND; import static org.lwjgl.opengl.GL11.GL_ONE_MINUS_SRC_ALPHA; diff --git a/src/main/java/resonantinduction/electrical/tesla/BlockTesla.java b/src/main/java/resonantinduction/electrical/tesla/BlockTesla.java index d3293e11..6813a1f8 100644 --- a/src/main/java/resonantinduction/electrical/tesla/BlockTesla.java +++ b/src/main/java/resonantinduction/electrical/tesla/BlockTesla.java @@ -11,7 +11,7 @@ import net.minecraft.world.World; import resonantinduction.core.Reference; import resonantinduction.core.Utility; import resonantinduction.core.prefab.block.BlockIOBase; -import resonantinduction.old.core.render.BlockRenderingHandler; +import resonantinduction.electrical.render.ElectricalBlockRenderingHandler; import calclavia.lib.utility.LanguageUtility; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -107,7 +107,7 @@ public class BlockTesla extends BlockIOBase implements ITileEntityProvider @Override public int getRenderType() { - return BlockRenderingHandler.INSTANCE.getRenderId(); + return ElectricalBlockRenderingHandler.INSTANCE.getRenderId(); } @Override diff --git a/src/main/java/resonantinduction/old/client/ClientProxy.java b/src/main/java/resonantinduction/old/client/ClientProxy.java index 3361c52f..c0ca0979 100644 --- a/src/main/java/resonantinduction/old/client/ClientProxy.java +++ b/src/main/java/resonantinduction/old/client/ClientProxy.java @@ -28,7 +28,6 @@ import resonantinduction.old.client.render.RenderTurkey; import resonantinduction.old.core.misc.EntityFarmEgg; import resonantinduction.old.core.misc.EntityTurkey; import resonantinduction.old.core.recipe.RecipeLoader; -import resonantinduction.old.mechanics.CommonProxy; import resonantinduction.old.mechanics.processor.TileEntityProcessor; import resonantinduction.old.transport.encoder.TileEntityEncoder; import resonantinduction.old.transport.fluid.TileEntityReleaseValve; diff --git a/src/main/java/resonantinduction/old/transport/ResonantInductionTransport.java b/src/main/java/resonantinduction/old/transport/ResonantInductionTransport.java index 41e5aa58..9d385427 100644 --- a/src/main/java/resonantinduction/old/transport/ResonantInductionTransport.java +++ b/src/main/java/resonantinduction/old/transport/ResonantInductionTransport.java @@ -21,7 +21,6 @@ import resonantinduction.archaic.blocks.BlockColorSand; import resonantinduction.archaic.blocks.BlockTurntable; import resonantinduction.archaic.blocks.ItemBlockColored; import resonantinduction.core.ResonantInductionTabs; -import resonantinduction.core.Settings; import resonantinduction.core.debug.BlockDebug; import resonantinduction.core.network.PacketIDTile; import resonantinduction.core.resource.BlockGasOre; @@ -82,9 +81,6 @@ import resonantinduction.old.transport.fluid.pump.BlockPumpMachine; import resonantinduction.old.transport.hopper.BlockAdvancedHopper; import resonantinduction.old.transport.imprinter.BlockImprinter; import resonantinduction.old.transport.imprinter.ItemImprinter; -import resonantinduction.old.transport.levitator.BlockLevitator; -import resonantinduction.old.transport.levitator.ItemBlockContractor; -import resonantinduction.old.transport.levitator.TileEMLevitator; import resonantinduction.old.transport.logistic.BlockDetector; import resonantinduction.old.transport.logistic.BlockManipulator; import resonantinduction.old.transport.logistic.BlockRejector; diff --git a/src/main/java/resonantinduction/old/transport/imprinter/BlockImprinter.java b/src/main/java/resonantinduction/old/transport/imprinter/BlockImprinter.java index f920d872..e157996a 100644 --- a/src/main/java/resonantinduction/old/transport/imprinter/BlockImprinter.java +++ b/src/main/java/resonantinduction/old/transport/imprinter/BlockImprinter.java @@ -15,7 +15,6 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import resonantinduction.core.Reference; import resonantinduction.core.prefab.block.BlockMachine; -import resonantinduction.old.mechanics.CommonProxy; import resonantinduction.old.transport.ResonantInductionTransport; import com.builtbroken.common.Pair; diff --git a/src/main/java/resonantinduction/old/transport/levitator/BlockLevitator.java b/src/main/java/resonantinduction/old/transport/levitator/BlockLevitator.java index 9b40c19f..8151c6c1 100644 --- a/src/main/java/resonantinduction/old/transport/levitator/BlockLevitator.java +++ b/src/main/java/resonantinduction/old/transport/levitator/BlockLevitator.java @@ -8,7 +8,7 @@ import net.minecraft.world.World; import net.minecraftforge.common.ForgeDirection; import resonantinduction.core.Reference; import resonantinduction.core.prefab.block.BlockMachine; -import resonantinduction.old.core.render.BlockRenderingHandler; +import resonantinduction.electrical.render.ElectricalBlockRenderingHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -24,7 +24,7 @@ public class BlockLevitator extends BlockMachine @Override public int getRenderType() { - return BlockRenderingHandler.INSTANCE.getRenderId(); + return ElectricalBlockRenderingHandler.INSTANCE.getRenderId(); } @Override diff --git a/src/main/resources/assets/resonantinduction/languages/en_US.properties b/src/main/resources/assets/resonantinduction/languages/en_US.properties index d6d93aee..c4c42e5e 100644 --- a/src/main/resources/assets/resonantinduction/languages/en_US.properties +++ b/src/main/resources/assets/resonantinduction/languages/en_US.properties @@ -9,6 +9,7 @@ meta.resonantinduction.credits=Visit website for credits. fluid.mixture=Mixture +### Electrical Module ## Blocks tile.resonantinduction\:tesla.name=Tesla Coil tile.resonantinduction\:levitator.name=Electromagnetic Levitator @@ -17,6 +18,7 @@ tile.resonantinduction\:machinePart.name=Machine Part tile.resonantinduction\:grindingWheel.name=Grinder Wheel tile.resonantinduction\:purifier.name=Purifier Rotor tile.resonantinduction\:filter.name=Filter +tile.resonantinduction\:solarPanel.name=Solar Panel ## Items item.resonantinduction\:quantumEntangler.name=Quantum Entangler @@ -72,7 +74,11 @@ message.tesla.mode=Tesla receive mode is now %v ## Misc. Stuff misc.resonantinduction.ingot=Ingot -# Assembly Line Language Properties + + + + +# OLD!!! Assembly Line Language Properties # @author alGuardsman itemGroup.Automation = Automation itemGroup.Industrial = Industrial diff --git a/src/main/resources/assets/resonantinduction/textures/models/solarPanel.png b/src/main/resources/assets/resonantinduction/models/solarPanel.png similarity index 100% rename from src/main/resources/assets/resonantinduction/textures/models/solarPanel.png rename to src/main/resources/assets/resonantinduction/models/solarPanel.png