Renamed Wind Turbine to Wind Generator, started work on turbine rods/blades for Industrial Turbine
This commit is contained in:
parent
66cc62a600
commit
4c2b470213
15 changed files with 243 additions and 42 deletions
|
@ -4,4 +4,4 @@ FMP_version=1.1.2.331
|
|||
CCLIB_version=1.1.3.136
|
||||
NEI_version=1.0.4.101
|
||||
CCC_version=1.0.6.39
|
||||
mod_version=8.1.8
|
||||
mod_version=9.0.0
|
||||
|
|
|
@ -71,14 +71,14 @@ import mekanism.common.recipe.inputs.ItemStackInput;
|
|||
import mekanism.common.recipe.machines.SmeltingRecipe;
|
||||
import mekanism.common.recipe.outputs.ItemStackOutput;
|
||||
import mekanism.common.tile.TileEntityAdvancedBoundingBlock;
|
||||
import mekanism.common.tile.TileEntityThermoelectricBoiler;
|
||||
import mekanism.common.tile.TileEntityThermoelectricValve;
|
||||
import mekanism.common.tile.TileEntityBoundingBlock;
|
||||
import mekanism.common.tile.TileEntityCardboardBox;
|
||||
import mekanism.common.tile.TileEntityElectricBlock;
|
||||
import mekanism.common.tile.TileEntityEntangledBlock;
|
||||
import mekanism.common.tile.TileEntitySolarEvaporationBlock;
|
||||
import mekanism.common.tile.TileEntitySolarEvaporationValve;
|
||||
import mekanism.common.tile.TileEntityThermoelectricBoiler;
|
||||
import mekanism.common.tile.TileEntityThermoelectricValve;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import mekanism.common.voice.VoiceServerManager;
|
||||
|
@ -140,7 +140,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
|||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
@Mod(modid = "Mekanism", name = "Mekanism", version = "8.1.8", guiFactory = "mekanism.client.gui.ConfigGuiFactory",
|
||||
@Mod(modid = "Mekanism", name = "Mekanism", version = "9.0.0", guiFactory = "mekanism.client.gui.ConfigGuiFactory",
|
||||
dependencies = "after:ForgeMultipart;after:BuildCraft;after:BuildCraftAPI;after:IC2;after:CoFHCore;" +
|
||||
"after:ComputerCraft;after:Galacticraft API;after:MetallurgyCore")
|
||||
public class Mekanism
|
||||
|
@ -166,7 +166,7 @@ public class Mekanism
|
|||
public static Configuration configuration;
|
||||
|
||||
/** Mekanism version number */
|
||||
public static Version versionNumber = new Version(8, 1, 8);
|
||||
public static Version versionNumber = new Version(9, 0, 0);
|
||||
|
||||
/** MultiblockManagers for various structrures */
|
||||
public static MultiblockManager<SynchronizedTankData> tankManager = new MultiblockManager<SynchronizedTankData>("dynamicTank");
|
||||
|
|
|
@ -80,7 +80,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler
|
|||
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "GasGenerator.png"));
|
||||
hydrogenGenerator.render(0.0625F);
|
||||
}
|
||||
else if(metadata == GeneratorType.WIND_TURBINE.meta)
|
||||
else if(metadata == GeneratorType.WIND_GENERATOR.meta)
|
||||
{
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(180F, 0.0F, 1.0F, 0.0F);
|
||||
|
|
|
@ -10,7 +10,7 @@ import mekanism.generators.client.gui.GuiReactorHeat;
|
|||
import mekanism.generators.client.gui.GuiReactorLogicAdapter;
|
||||
import mekanism.generators.client.gui.GuiReactorStats;
|
||||
import mekanism.generators.client.gui.GuiSolarGenerator;
|
||||
import mekanism.generators.client.gui.GuiWindTurbine;
|
||||
import mekanism.generators.client.gui.GuiWindGenerator;
|
||||
import mekanism.generators.client.render.RenderAdvancedSolarGenerator;
|
||||
import mekanism.generators.client.render.RenderBioGenerator;
|
||||
import mekanism.generators.client.render.RenderGasGenerator;
|
||||
|
@ -24,7 +24,7 @@ import mekanism.generators.common.tile.TileEntityBioGenerator;
|
|||
import mekanism.generators.common.tile.TileEntityGasGenerator;
|
||||
import mekanism.generators.common.tile.TileEntityHeatGenerator;
|
||||
import mekanism.generators.common.tile.TileEntitySolarGenerator;
|
||||
import mekanism.generators.common.tile.TileEntityWindTurbine;
|
||||
import mekanism.generators.common.tile.TileEntityWindGenerator;
|
||||
import mekanism.generators.common.tile.reactor.TileEntityReactorController;
|
||||
import mekanism.generators.common.tile.reactor.TileEntityReactorLogicAdapter;
|
||||
import mekanism.generators.common.tile.reactor.TileEntityReactorNeutronCapture;
|
||||
|
@ -48,7 +48,7 @@ public class GeneratorsClientProxy extends GeneratorsCommonProxy
|
|||
ClientRegistry.registerTileEntity(TileEntityBioGenerator.class, "BioGenerator", new RenderBioGenerator());
|
||||
ClientRegistry.registerTileEntity(TileEntityHeatGenerator.class, "HeatGenerator", new RenderHeatGenerator());
|
||||
ClientRegistry.registerTileEntity(TileEntityGasGenerator.class, "GasGenerator", new RenderGasGenerator());
|
||||
ClientRegistry.registerTileEntity(TileEntityWindTurbine.class, "WindTurbine", new RenderWindTurbine());
|
||||
ClientRegistry.registerTileEntity(TileEntityWindGenerator.class, "WindTurbine", new RenderWindTurbine());
|
||||
ClientRegistry.registerTileEntity(TileEntityReactorController.class, "ReactorController", new RenderReactor());
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ public class GeneratorsClientProxy extends GeneratorsCommonProxy
|
|||
case 4:
|
||||
return new GuiBioGenerator(player.inventory, (TileEntityBioGenerator)tileEntity);
|
||||
case 5:
|
||||
return new GuiWindTurbine(player.inventory, (TileEntityWindTurbine)tileEntity);
|
||||
return new GuiWindGenerator(player.inventory, (TileEntityWindGenerator)tileEntity);
|
||||
case 10:
|
||||
return new GuiReactorController(player.inventory, (TileEntityReactorController)tileEntity);
|
||||
case 11:
|
||||
|
|
|
@ -17,8 +17,8 @@ import mekanism.client.gui.element.GuiSlot.SlotType;
|
|||
import mekanism.common.util.LangUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import mekanism.generators.common.inventory.container.ContainerWindTurbine;
|
||||
import mekanism.generators.common.tile.TileEntityWindTurbine;
|
||||
import mekanism.generators.common.inventory.container.ContainerWindGenerator;
|
||||
import mekanism.generators.common.tile.TileEntityWindGenerator;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
@ -26,15 +26,15 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiWindTurbine extends GuiMekanism
|
||||
public class GuiWindGenerator extends GuiMekanism
|
||||
{
|
||||
public TileEntityWindTurbine tileEntity;
|
||||
public TileEntityWindGenerator tileEntity;
|
||||
|
||||
private DecimalFormat powerFormat = new DecimalFormat("0.##");
|
||||
|
||||
public GuiWindTurbine(InventoryPlayer inventory, TileEntityWindTurbine tentity)
|
||||
public GuiWindGenerator(InventoryPlayer inventory, TileEntityWindGenerator tentity)
|
||||
{
|
||||
super(new ContainerWindTurbine(inventory, tentity));
|
||||
super(new ContainerWindGenerator(inventory, tentity));
|
||||
tileEntity = tentity;
|
||||
guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiWindTurbine.png")));
|
||||
guiElements.add(new GuiEnergyInfo(new IInfoHandler()
|
|
@ -4,7 +4,7 @@ import mekanism.common.Mekanism;
|
|||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import mekanism.generators.client.model.ModelWindTurbine;
|
||||
import mekanism.generators.common.tile.TileEntityWindTurbine;
|
||||
import mekanism.generators.common.tile.TileEntityWindGenerator;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
@ -18,10 +18,10 @@ public class RenderWindTurbine extends TileEntitySpecialRenderer
|
|||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTick)
|
||||
{
|
||||
renderAModelAt((TileEntityWindTurbine)tileEntity, x, y, z, partialTick);
|
||||
renderAModelAt((TileEntityWindGenerator)tileEntity, x, y, z, partialTick);
|
||||
}
|
||||
|
||||
private void renderAModelAt(TileEntityWindTurbine tileEntity, double x, double y, double z, float partialTick)
|
||||
private void renderAModelAt(TileEntityWindGenerator tileEntity, double x, double y, double z, float partialTick)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
|
||||
|
|
|
@ -10,13 +10,13 @@ import mekanism.generators.common.inventory.container.ContainerHeatGenerator;
|
|||
import mekanism.generators.common.inventory.container.ContainerNeutronCapture;
|
||||
import mekanism.generators.common.inventory.container.ContainerReactorController;
|
||||
import mekanism.generators.common.inventory.container.ContainerSolarGenerator;
|
||||
import mekanism.generators.common.inventory.container.ContainerWindTurbine;
|
||||
import mekanism.generators.common.inventory.container.ContainerWindGenerator;
|
||||
import mekanism.generators.common.tile.TileEntityAdvancedSolarGenerator;
|
||||
import mekanism.generators.common.tile.TileEntityBioGenerator;
|
||||
import mekanism.generators.common.tile.TileEntityGasGenerator;
|
||||
import mekanism.generators.common.tile.TileEntityHeatGenerator;
|
||||
import mekanism.generators.common.tile.TileEntitySolarGenerator;
|
||||
import mekanism.generators.common.tile.TileEntityWindTurbine;
|
||||
import mekanism.generators.common.tile.TileEntityWindGenerator;
|
||||
import mekanism.generators.common.tile.reactor.TileEntityReactorController;
|
||||
import mekanism.generators.common.tile.reactor.TileEntityReactorFrame;
|
||||
import mekanism.generators.common.tile.reactor.TileEntityReactorGlass;
|
||||
|
@ -63,7 +63,7 @@ public class GeneratorsCommonProxy
|
|||
GameRegistry.registerTileEntity(TileEntityBioGenerator.class, "BioGenerator");
|
||||
GameRegistry.registerTileEntity(TileEntityHeatGenerator.class, "HeatGenerator");
|
||||
GameRegistry.registerTileEntity(TileEntityGasGenerator.class, "GasGenerator");
|
||||
GameRegistry.registerTileEntity(TileEntityWindTurbine.class, "WindTurbine");
|
||||
GameRegistry.registerTileEntity(TileEntityWindGenerator.class, "WindTurbine");
|
||||
GameRegistry.registerTileEntity(TileEntityReactorController.class, "ReactorController");
|
||||
}
|
||||
|
||||
|
@ -157,7 +157,7 @@ public class GeneratorsCommonProxy
|
|||
case 4:
|
||||
return new ContainerBioGenerator(player.inventory, (TileEntityBioGenerator)tileEntity);
|
||||
case 5:
|
||||
return new ContainerWindTurbine(player.inventory, (TileEntityWindTurbine)tileEntity);
|
||||
return new ContainerWindGenerator(player.inventory, (TileEntityWindGenerator)tileEntity);
|
||||
case 10:
|
||||
return new ContainerReactorController(player.inventory, (TileEntityReactorController)tileEntity);
|
||||
case 11:
|
||||
|
|
|
@ -34,7 +34,7 @@ import net.minecraftforge.oredict.OreDictionary;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@Mod(modid = "MekanismGenerators", name = "MekanismGenerators", version = "8.1.8", dependencies = "required-after:Mekanism", guiFactory = "mekanism.generators.client.gui.GeneratorsGuiFactory")
|
||||
@Mod(modid = "MekanismGenerators", name = "MekanismGenerators", version = "9.0.0", dependencies = "required-after:Mekanism", guiFactory = "mekanism.generators.client.gui.GeneratorsGuiFactory")
|
||||
public class MekanismGenerators implements IModule
|
||||
{
|
||||
/** Mekanism Generators Packet Pipeline */
|
||||
|
@ -47,7 +47,7 @@ public class MekanismGenerators implements IModule
|
|||
public static MekanismGenerators instance;
|
||||
|
||||
/** MekanismGenerators version number */
|
||||
public static Version versionNumber = new Version(8, 1, 8);
|
||||
public static Version versionNumber = new Version(9, 0, 0);
|
||||
|
||||
@EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event)
|
||||
|
|
|
@ -43,7 +43,8 @@ import java.util.Random;
|
|||
* 3: Hydrogen Generator
|
||||
* 4: Bio-Generator
|
||||
* 5: Advanced Solar Generator
|
||||
* 6: Wind Turbine
|
||||
* 6: Wind Generator
|
||||
* 7: Turbine Rod
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
|
@ -161,6 +162,7 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds
|
|||
{
|
||||
int metadata = world.getBlockMetadata(x, y, z);
|
||||
TileEntityElectricBlock tileEntity = (TileEntityElectricBlock)world.getTileEntity(x, y, z);
|
||||
|
||||
if(MekanismUtils.isActive(world, x, y, z))
|
||||
{
|
||||
float xRandom = (float)x + 0.5F;
|
||||
|
@ -254,7 +256,7 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds
|
|||
|
||||
return (!nonAir) && canPlace;
|
||||
}
|
||||
else if(world.getBlockMetadata(x, y, z) == GeneratorType.WIND_TURBINE.meta)
|
||||
else if(world.getBlockMetadata(x, y, z) == GeneratorType.WIND_GENERATOR.meta)
|
||||
{
|
||||
boolean canPlace = super.canPlaceBlockAt(world, x, y, z);
|
||||
|
||||
|
@ -313,7 +315,9 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds
|
|||
}
|
||||
|
||||
if(MekanismUtils.isBCWrench(tool))
|
||||
{
|
||||
((IToolWrench)tool).wrenchUsed(entityplayer, x, y, z);
|
||||
}
|
||||
|
||||
int change = ForgeDirection.ROTATION_MATRIX[ForgeDirection.UP.ordinal()][tileEntity.facing];
|
||||
|
||||
|
@ -501,7 +505,7 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds
|
|||
{
|
||||
int metadata = world.getBlockMetadata(x, y, z);
|
||||
|
||||
if(metadata != GeneratorType.SOLAR_GENERATOR.meta && metadata != GeneratorType.ADVANCED_SOLAR_GENERATOR.meta && metadata != GeneratorType.WIND_TURBINE.meta)
|
||||
if(metadata != GeneratorType.SOLAR_GENERATOR.meta && metadata != GeneratorType.ADVANCED_SOLAR_GENERATOR.meta && metadata != GeneratorType.WIND_GENERATOR.meta)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -516,7 +520,7 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds
|
|||
GAS_GENERATOR(3, "GasGenerator", 3, general.FROM_H2*100, TileEntityGasGenerator.class, true),
|
||||
BIO_GENERATOR(4, "BioGenerator", 4, 160000, TileEntityBioGenerator.class, true),
|
||||
ADVANCED_SOLAR_GENERATOR(5, "AdvancedSolarGenerator", 1, 200000, TileEntityAdvancedSolarGenerator.class, true),
|
||||
WIND_TURBINE(6, "WindTurbine", 5, 200000, TileEntityWindTurbine.class, true);
|
||||
WIND_GENERATOR(6, "WindGenerator", 5, 200000, TileEntityWindGenerator.class, true);
|
||||
|
||||
public int meta;
|
||||
public String name;
|
||||
|
@ -540,8 +544,11 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds
|
|||
for(GeneratorType type : values())
|
||||
{
|
||||
if(type.meta == meta)
|
||||
{
|
||||
return type;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ package mekanism.generators.common.inventory.container;
|
|||
|
||||
import mekanism.common.inventory.slot.SlotEnergy.SlotCharge;
|
||||
import mekanism.common.util.ChargeUtils;
|
||||
import mekanism.generators.common.tile.TileEntityWindTurbine;
|
||||
import mekanism.generators.common.tile.TileEntityWindGenerator;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
@ -10,11 +10,11 @@ import net.minecraft.inventory.Container;
|
|||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerWindTurbine extends Container
|
||||
public class ContainerWindGenerator extends Container
|
||||
{
|
||||
private TileEntityWindTurbine tileEntity;
|
||||
private TileEntityWindGenerator tileEntity;
|
||||
|
||||
public ContainerWindTurbine(InventoryPlayer inventory, TileEntityWindTurbine tentity)
|
||||
public ContainerWindGenerator(InventoryPlayer inventory, TileEntityWindGenerator tentity)
|
||||
{
|
||||
tileEntity = tentity;
|
||||
addSlotToContainer(new SlotCharge(tentity, 0, 143, 35));
|
|
@ -45,7 +45,8 @@ import ic2.api.item.ISpecialElectricItem;
|
|||
* 3: Hydrogen Generator
|
||||
* 4: Bio-Generator
|
||||
* 5: Advanced Solar Generator
|
||||
* 6: Wind Turbine
|
||||
* 6: Wind Generator
|
||||
* 7: Turbine Rod
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
|
@ -145,7 +146,7 @@ public class ItemBlockGenerator extends ItemBlock implements IEnergizedItem, ISp
|
|||
}
|
||||
}
|
||||
}
|
||||
else if(stack.getItemDamage() == GeneratorType.WIND_TURBINE.meta)
|
||||
else if(stack.getItemDamage() == GeneratorType.WIND_GENERATOR.meta)
|
||||
{
|
||||
if(!block.isReplaceable(world, x, y, z))
|
||||
{
|
||||
|
|
|
@ -10,14 +10,14 @@ import mekanism.common.util.MekanismUtils;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityWindTurbine extends TileEntityGenerator implements IBoundingBlock
|
||||
public class TileEntityWindGenerator extends TileEntityGenerator implements IBoundingBlock
|
||||
{
|
||||
/** The angle the blades of this Wind Turbine are currently at. */
|
||||
public double angle;
|
||||
|
||||
public TileEntityWindTurbine()
|
||||
public TileEntityWindGenerator()
|
||||
{
|
||||
super("wind", "WindTurbine", 200000, (generators.windGenerationMax)*2);
|
||||
super("wind", "WindGenerator", 200000, (generators.windGenerationMax)*2);
|
||||
inventory = new ItemStack[1];
|
||||
}
|
||||
|
|
@ -0,0 +1,190 @@
|
|||
package mekanism.generators.common.tile.turbine;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.Range4D;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.base.ITileComponent;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.tile.TileEntityBasicBlock;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityTurbineRod extends TileEntityBasicBlock
|
||||
{
|
||||
public List<Coord4D> rods = new ArrayList<Coord4D>();
|
||||
|
||||
//Total blades on server, housed blades on client
|
||||
public int blades = 0;
|
||||
|
||||
@Override
|
||||
public boolean canUpdate()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborChange(Block block)
|
||||
{
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
updateRods();
|
||||
}
|
||||
}
|
||||
|
||||
private void updateRods()
|
||||
{
|
||||
Coord4D current = Coord4D.get(this);
|
||||
Coord4D up = current.getFromSide(ForgeDirection.UP);
|
||||
Coord4D down = current.getFromSide(ForgeDirection.DOWN);
|
||||
|
||||
if((isRod(up) != !rods.contains(up)) || (isRod(down) != !rods.contains(down)))
|
||||
{
|
||||
buildRods();
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
}
|
||||
}
|
||||
|
||||
private void buildRods()
|
||||
{
|
||||
List<Coord4D> newRods = new ArrayList<Coord4D>();
|
||||
int newBlades = 0;
|
||||
|
||||
Coord4D pointer = Coord4D.get(this);
|
||||
|
||||
//Go to bottom rod
|
||||
while(true)
|
||||
{
|
||||
if(isRod(pointer.getFromSide(ForgeDirection.DOWN)))
|
||||
{
|
||||
pointer.step(ForgeDirection.DOWN);
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
//Put all rods in new list, top to bottom
|
||||
while(true)
|
||||
{
|
||||
newRods.add(pointer.clone());
|
||||
newBlades += ((TileEntityTurbineRod)pointer.getTileEntity(worldObj)).getHousedBlades();
|
||||
|
||||
if(isRod(pointer.getFromSide(ForgeDirection.UP)))
|
||||
{
|
||||
pointer.step(ForgeDirection.UP);
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
//Update all rods, send packet if necessary
|
||||
for(Coord4D coord : newRods)
|
||||
{
|
||||
TileEntityTurbineRod rod = (TileEntityTurbineRod)coord.getTileEntity(worldObj);
|
||||
int prev = rod.getHousedBlades();
|
||||
|
||||
rod.rods = newRods;
|
||||
rod.blades = newBlades;
|
||||
|
||||
if(rod.getHousedBlades() != prev)
|
||||
{
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(coord, rod.getNetworkedData(new ArrayList())), new Range4D(coord));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean editBlade(boolean add)
|
||||
{
|
||||
if((add && (rods.size()*2) - blades > 0) || (!add && (blades > 0)))
|
||||
{
|
||||
for(Coord4D coord : rods)
|
||||
{
|
||||
TileEntityTurbineRod rod = (TileEntityTurbineRod)coord.getTileEntity(worldObj);
|
||||
rod.internalEditBlade(add);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void internalEditBlade(boolean add)
|
||||
{
|
||||
int prev = getHousedBlades();
|
||||
|
||||
blades += add ? 1 : -1;
|
||||
|
||||
if(getHousedBlades() != prev)
|
||||
{
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
}
|
||||
}
|
||||
|
||||
public int getHousedBlades()
|
||||
{
|
||||
return Math.max(0, Math.min(2, blades - (rods.indexOf(Coord4D.get(this))+1)*2));
|
||||
}
|
||||
|
||||
private boolean isRod(Coord4D coord)
|
||||
{
|
||||
return coord.getTileEntity(worldObj) instanceof TileEntityTurbineRod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkLoad()
|
||||
{
|
||||
super.onChunkLoad();
|
||||
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
updateRods();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlePacketData(ByteBuf dataStream)
|
||||
{
|
||||
super.handlePacketData(dataStream);
|
||||
|
||||
blades = dataStream.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
data.add(blades);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbtTags)
|
||||
{
|
||||
super.readFromNBT(nbtTags);
|
||||
|
||||
blades = nbtTags.getInteger("blades");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbtTags)
|
||||
{
|
||||
super.writeToNBT(nbtTags);
|
||||
|
||||
nbtTags.setInteger("blades", getHousedBlades());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {}
|
||||
}
|
|
@ -28,7 +28,7 @@ import net.minecraftforge.event.entity.living.LivingSpawnEvent;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@Mod(modid = "MekanismTools", name = "MekanismTools", version = "8.1.8", dependencies = "required-after:Mekanism", guiFactory = "mekanism.tools.client.gui.ToolsGuiFactory")
|
||||
@Mod(modid = "MekanismTools", name = "MekanismTools", version = "9.0.0", dependencies = "required-after:Mekanism", guiFactory = "mekanism.tools.client.gui.ToolsGuiFactory")
|
||||
public class MekanismTools implements IModule
|
||||
{
|
||||
@SidedProxy(clientSide = "mekanism.tools.client.ToolsClientProxy", serverSide = "mekanism.tools.common.ToolsCommonProxy")
|
||||
|
@ -38,7 +38,7 @@ public class MekanismTools implements IModule
|
|||
public static MekanismTools instance;
|
||||
|
||||
/** MekanismTools version number */
|
||||
public static Version versionNumber = new Version(8, 1, 8);
|
||||
public static Version versionNumber = new Version(9, 0, 0);
|
||||
|
||||
//Enums: Tools
|
||||
public static ToolMaterial toolOBSIDIAN;
|
||||
|
|
|
@ -734,7 +734,8 @@ tooltip.SolarGenerator=A generator that uses the power !nof the sun to produce e
|
|||
tooltip.GasGenerator=A generator that harnesses the molecular !nvarying gasses to produce energy.
|
||||
tooltip.BioGenerator=A generator that burns organic materials of !nthe world to produce energy.
|
||||
tooltip.AdvancedSolarGenerator=An advanced generator that directly !nabsorbs the sun's rays with little loss !nto produce energy.
|
||||
tooltip.WindTurbine=A generator that uses the strength of the wind !nto produce energy, with greater efficiency !nat higher levels.
|
||||
tooltip.WindGenerator=A generator that uses the strength of the wind !nto produce energy, with greater efficiency !nat higher levels.
|
||||
tooltip.TurbineRod=The steel rod that is used to house !nTurbine Blades within an Industrial Turbine.
|
||||
|
||||
tooltip.ReactorGlass=Reinforced glass that can be used in !nthe Fusion Reactor multiblock.
|
||||
tooltip.ReactorLaserFocusMatrix=A panel of Reactor Glass that !nis capable of absorbing optical energy and !nthereby heating up the Fusion Reactor.
|
||||
|
@ -837,6 +838,7 @@ nei.rotaryCondensentrator=R. Condensentrator
|
|||
//Items
|
||||
item.SolarPanel.name=Solar Panel
|
||||
item.Hohlraum.name=Hohlraum
|
||||
item.TurbineBlade.name=Turbine Blade
|
||||
|
||||
//Generators
|
||||
tile.Generator.HeatGenerator.name=Heat Generator
|
||||
|
@ -844,7 +846,8 @@ tile.Generator.SolarGenerator.name=Solar Generator
|
|||
tile.Generator.GasGenerator.name=Gas-Burning Generator
|
||||
tile.Generator.BioGenerator.name=Bio-Generator
|
||||
tile.Generator.AdvancedSolarGenerator.name=Advanced Solar Generator
|
||||
tile.Generator.WindTurbine.name=Wind Turbine
|
||||
tile.Generator.WindGenerator.name=Wind Generator
|
||||
tile.Generator.TurbineRod.name=Turbine Rod
|
||||
|
||||
tile.Reactor.ReactorController.name=Reactor Controller
|
||||
tile.Reactor.ReactorFrame.name=Reactor Frame
|
||||
|
|
Loading…
Reference in a new issue