diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modGUIs/GuiEnderCoreGenerator.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modGUIs/GuiEnderCoreGenerator.java index e4fc901..dfb7b55 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modGUIs/GuiEnderCoreGenerator.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modGUIs/GuiEnderCoreGenerator.java @@ -17,7 +17,9 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; public class GuiEnderCoreGenerator extends GuiContainer { - + + int scaledtobar, scaledtopercentage, scaledtofueltransfer, currentcooldown, currentpower; + private ResourceLocation resource = new ResourceLocation(ModInfo.MODID + ":" + "textures/gui/GuiCoreGenerator.png"); private TileEntityEnderCoreGenerator tileentity; @@ -58,11 +60,11 @@ public class GuiEnderCoreGenerator extends GuiContainer { @Override protected void drawGuiContainerBackgroundLayer(float f, int mx, int my) { this.mc.getTextureManager().bindTexture(resource); - int scaledtobar = this.tileentity.powerScaled(100); - int scaledtopercentage = this.tileentity.powerScaled(100); - int scaledtofueltransfer = this.tileentity.genscaled(100); - int cooldown = this.tileentity.cooldownscaled(100); - int currentpower = this.tileentity.currentPower; + scaledtobar = this.tileentity.powerScaled(100); + scaledtopercentage = this.tileentity.powerScaled(100); + scaledtofueltransfer = this.tileentity.genscaled(100); + currentcooldown = this.tileentity.cooldownscaled(100); + currentpower = this.tileentity.currentPower; int percentagefontcolor; drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); @@ -70,7 +72,7 @@ public class GuiEnderCoreGenerator extends GuiContainer { drawTexturedModalRect(guiLeft+7, guiTop+8, 0, 149, scaledtobar, 16); drawTexturedModalRect(guiLeft+7, guiTop+8 + 12, 100, 149, scaledtofueltransfer, 4); - drawTexturedModalRect(guiLeft+7, guiTop+8 + 12 + 3, 100, 149 + 4, cooldown, 3); + drawTexturedModalRect(guiLeft+7, guiTop+8 + 12 + 3, 100, 149 + 4, currentcooldown, 3); drawCenteredString(fontRendererObj, "Ender Core Generator", guiLeft+90, guiTop-10, 0xFFFFFF); @@ -83,15 +85,10 @@ public class GuiEnderCoreGenerator extends GuiContainer { drawString(fontRendererObj, scaledtofueltransfer + "% fuel", guiLeft+40, guiTop+38, percentagefontcolor); - if (mx >= guiLeft+7 && mx <= guiLeft +7+100 && my >= guiTop + 8 && my <= guiTop + 16 + 8) { + if (mx >= guiLeft+7 && mx <= guiLeft +7+100 && my >= guiTop +8 && my <= guiTop + 16 +8) { - drawString(fontRendererObj, "Current MoE: " + currentpower, mx+10, my, 0xa8a8a8); + drawString(fontRendererObj, "MoE: " + currentpower + "/" + tileentity.maxpower, guiLeft+12, guiTop+12, 0xa8a8a8); } } - - @Override - protected void drawGuiContainerForegroundLayer(int mx, int my) { - - } } diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modGUIs/GuiNetherCoreGenerator.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modGUIs/GuiNetherCoreGenerator.java index f85fe90..9f1dea0 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modGUIs/GuiNetherCoreGenerator.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modGUIs/GuiNetherCoreGenerator.java @@ -16,6 +16,8 @@ import net.minecraft.inventory.Container; import net.minecraft.util.ResourceLocation; public class GuiNetherCoreGenerator extends GuiContainer { + int scaledtobar, scaledtopercentage, scaledtofueltransfer, currentcooldown, currentpower; + private ResourceLocation resource = new ResourceLocation(ModInfo.MODID + ":" + "textures/gui/GUICoreGenerator.png"); private TileEntityNetherCoreGenerator tileentity; @@ -56,24 +58,23 @@ public class GuiNetherCoreGenerator extends GuiContainer { @Override protected void drawGuiContainerBackgroundLayer(float f, int mx, int my) { this.mc.getTextureManager().bindTexture(resource); - int scaledtobar = this.tileentity.powerScaled(100); - int scaledtopercentage = this.tileentity.powerScaled(100); - int scaledtofueltransfer = this.tileentity.genscaled(100); - int cooldown = this.tileentity.cooldownscaled(100); - int currentpower = this.tileentity.currentPower; + scaledtobar = this.tileentity.powerScaled(100); + scaledtopercentage = this.tileentity.powerScaled(100); + scaledtofueltransfer = this.tileentity.genscaled(100); + currentcooldown = this.tileentity.cooldownscaled(100); + currentpower = this.tileentity.currentPower; int percentagefontcolor; - int White; drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); drawTexturedModalRect(guiLeft+7, guiTop+8, 0, 149, scaledtobar, 16); drawTexturedModalRect(guiLeft+7, guiTop+8 + 12, 100, 149, scaledtofueltransfer, 4); - drawTexturedModalRect(guiLeft+7, guiTop+8 + 12 + 3, 100, 149 + 4, cooldown, 3); + drawTexturedModalRect(guiLeft+7, guiTop+8 + 12 + 3, 100, 149 + 4, currentcooldown, 3); drawCenteredString(fontRendererObj, "Nether Core Generator", guiLeft+90, guiTop-10, 0xFFFFFF); - if (currentpower ==0) { + if (currentpower == 0) { percentagefontcolor = 0xFF0000; } else { percentagefontcolor = 1111111; @@ -83,8 +84,7 @@ public class GuiNetherCoreGenerator extends GuiContainer { drawString(fontRendererObj, scaledtofueltransfer + "% fuel", guiLeft+40, guiTop+38, percentagefontcolor); if (mx >= guiLeft+7 && mx <= guiLeft +7+100 && my >= guiTop +8 && my <= guiTop + 16 +8) { - - drawString(fontRendererObj, "Current MoE: " + currentpower + "/" + tileentity.maxpower, mx+10, my, 0xa8a8a8); + drawString(fontRendererObj, "MoE: " + currentpower + "/" + tileentity.maxpower, guiLeft+12, guiTop+12, 0xa8a8a8); } } } diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/CoreStabilizer.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/CoreStabilizer.java index 5b6c7ad..6a461be 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/CoreStabilizer.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/CoreStabilizer.java @@ -61,26 +61,13 @@ public class CoreStabilizer extends ModMachineBlock { } public void isMultBlock(World world, int x, int y, int z) { - if (world.getTileEntity(x, y+1, z) instanceof TileEntityCoreGenerator) { world.scheduleBlockUpdate(x, y+1, z, world.getBlock(x, y+1, z), 0); - ((TileEntityCoreStabilizer)world.getTileEntity(x, y, z)).version = 2; - if (((TileEntityCoreGenerator)world.getTileEntity(x, y+1, z)).multiblock == true) { - ((TileEntityCoreStabilizer)world.getTileEntity(x, y, z)).multiblock = true; - } else { - ((TileEntityCoreStabilizer)world.getTileEntity(x, y, z)).multiblock = false; - } } else if (world.getTileEntity(x, y-1, z) instanceof TileEntityCoreGenerator) { world.scheduleBlockUpdate(x, y-1, z, world.getBlock(x, y-1, z), 0); - ((TileEntityCoreStabilizer)world.getTileEntity(x, y, z)).version = 1; - if (((TileEntityCoreGenerator)world.getTileEntity(x, y-1, z)).multiblock == true) { - ((TileEntityCoreStabilizer)world.getTileEntity(x, y, z)).multiblock = true; - } else { - ((TileEntityCoreStabilizer)world.getTileEntity(x, y, z)).multiblock = false; - } } else { - ((TileEntityCoreStabilizer)world.getTileEntity(x, y, z)).version = 0; + ((TileEntityCoreStabilizer)world.getTileEntity(x, y, z)).multiblock = false; + world.markBlockForUpdate(x, y, z); } - world.markBlockForUpdate(x, y, z); } } diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/EnderCoreGenerator.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/EnderCoreGenerator.java index 69ca325..9f4d9cb 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/EnderCoreGenerator.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/EnderCoreGenerator.java @@ -4,6 +4,7 @@ import java.util.Random; import org.bitbucket.alltra101ify.advancedsatelliteutilization.AdvancedSatelliteUtilization; import org.bitbucket.alltra101ify.advancedsatelliteutilization.modGUIs.ModGUIs; +import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityCoreStabilizer; import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityEnderCoreGenerator; import org.bitbucket.alltra101ify.advancedsatelliteutilization.moditems.ModItems; import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModCreativeTabs; @@ -41,6 +42,12 @@ public class EnderCoreGenerator extends ModMachineBlock { this.isBlockContainer = true; } + @Override + public void onBlockAdded(World world, int x, int y, int z) { + ((TileEntityCoreGenerator)world.getTileEntity(x, y, z)).setCoords(x, y, z); + super.onBlockAdded(world, x, y, z); + } + @Override public TileEntity createNewTileEntity(World world, int var) { return new TileEntityEnderCoreGenerator(); @@ -81,8 +88,22 @@ public class EnderCoreGenerator extends ModMachineBlock { public void isMultiBlock(World world, int x, int y, int z) { if (world.getBlock(x, y+1, z) == ModBlocks.CoreStabilizer && world.getBlock(x, y-1, z) == ModBlocks.CoreStabilizer && world.getBlock(x, y-2, z) == ModBlocks.blockofashadwithquaridium && world.getBlock(x, y+2, z) == ModBlocks.blockofashadwithquaridium) { ((TileEntityEnderCoreGenerator)world.getTileEntity(x, y, z)).multiblock = true; + ((TileEntityCoreStabilizer)world.getTileEntity(x, y+1, z)).multiblock = true; + ((TileEntityCoreStabilizer)world.getTileEntity(x, y-1, z)).multiblock = true; + world.markBlockForUpdate(x, y+1, z); + world.markBlockForUpdate(x, y-1, z); } else { ((TileEntityEnderCoreGenerator)world.getTileEntity(x, y, z)).multiblock = false; + if (world.getTileEntity(x, y+1, z) instanceof TileEntityCoreStabilizer) { + ((TileEntityCoreStabilizer)world.getTileEntity(x, y+1, z)).multiblock = false; + ((TileEntityCoreStabilizer)world.getTileEntity(x, y+1, z)).version = 0; + world.markBlockForUpdate(x, y+1, z); + } + if (world.getTileEntity(x, y-1, z) instanceof TileEntityCoreStabilizer) { + ((TileEntityCoreStabilizer)world.getTileEntity(x, y-1, z)).multiblock = false; + ((TileEntityCoreStabilizer)world.getTileEntity(x, y-1, z)).version = 0; + world.markBlockForUpdate(x, y-1, z); + } } world.markBlockForUpdate(x, y, z); } diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/NetherCoreGenerator.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/NetherCoreGenerator.java index 5711927..0a822b1 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/NetherCoreGenerator.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/NetherCoreGenerator.java @@ -11,6 +11,7 @@ import net.minecraft.world.World; import org.bitbucket.alltra101ify.advancedsatelliteutilization.AdvancedSatelliteUtilization; import org.bitbucket.alltra101ify.advancedsatelliteutilization.modGUIs.ModGUIs; +import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityCoreStabilizer; import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityEnderCoreGenerator; import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityNetherCoreGenerator; import org.bitbucket.alltra101ify.advancedsatelliteutilization.moditems.ModItems; @@ -37,7 +38,6 @@ public class NetherCoreGenerator extends ModMachineBlock { @Override public TileEntity createNewTileEntity(World world, int var) { - // TODO Auto-generated method stub return new TileEntityNetherCoreGenerator(); } @@ -53,6 +53,12 @@ public class NetherCoreGenerator extends ModMachineBlock { super.updateTick(world, x, y, z, r); } + @Override + public void onBlockAdded(World world, int x, int y, int z) { + ((TileEntityCoreGenerator)world.getTileEntity(x, y, z)).setCoords(x, y, z); + super.onBlockAdded(world, x, y, z); + } + @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { if (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == ModItems.wrench) { @@ -74,9 +80,20 @@ public class NetherCoreGenerator extends ModMachineBlock { public void isMultiBlock(World world, int x, int y, int z) { if (world.getBlock(x, y+1, z) == ModBlocks.CoreStabilizer && world.getBlock(x, y-1, z) == ModBlocks.CoreStabilizer && world.getBlock(x, y-2, z) == ModBlocks.blockofashadwithquaridium && world.getBlock(x, y+2, z) == ModBlocks.blockofashadwithquaridium) { ((TileEntityNetherCoreGenerator)world.getTileEntity(x, y, z)).multiblock = true; - + ((TileEntityCoreStabilizer)world.getTileEntity(x, y+1, z)).multiblock = true; + ((TileEntityCoreStabilizer)world.getTileEntity(x, y-1, z)).multiblock = true; + world.markBlockForUpdate(x, y+1, z); + world.markBlockForUpdate(x, y-1, z); } else { ((TileEntityNetherCoreGenerator)world.getTileEntity(x, y, z)).multiblock = false; + if (world.getTileEntity(x, y+1, z) instanceof TileEntityCoreStabilizer) { + ((TileEntityCoreStabilizer)world.getTileEntity(x, y+1, z)).multiblock = false; + world.markBlockForUpdate(x, y+1, z); + } + if (world.getTileEntity(x, y-1, z) instanceof TileEntityCoreStabilizer) { + ((TileEntityCoreStabilizer)world.getTileEntity(x, y-1, z)).multiblock = false; + world.markBlockForUpdate(x, y-1, z); + } } world.markBlockForUpdate(x, y, z); } diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/tileentities/TileEntityCoreStabilizer.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/tileentities/TileEntityCoreStabilizer.java index 2d32b45..eb03923 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/tileentities/TileEntityCoreStabilizer.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/tileentities/TileEntityCoreStabilizer.java @@ -1,6 +1,5 @@ package org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities; - import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; @@ -9,10 +8,8 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; public class TileEntityCoreStabilizer extends TileEntity { - World world; public TileEntityCoreStabilizer(World world) { - this.world = world; } public TileEntityCoreStabilizer() { @@ -20,30 +17,19 @@ public class TileEntityCoreStabilizer extends TileEntity { public float rotationY; float speed; - - - - public boolean onOff = false; - - public boolean multiblock; public byte version; - + public boolean multiblock; @Override public void updateEntity() { - - if (!multiblock && onOff) { - onOff = false; - } - rotationY += speed; if (rotationY >= 6.3f) { rotationY = 0f; } - if (onOff && speed < 0.055f) { + if (multiblock && speed < 0.08f) { speed += 0.001f; - } else if (onOff == false && speed > 0f) { + } else if (multiblock == false && speed > 0f) { speed -= 0.001f; } @@ -53,7 +39,7 @@ public class TileEntityCoreStabilizer extends TileEntity { public void readFromNBT(NBTTagCompound var1) { this.rotationY = var1.getFloat("rotationY"); this.speed = var1.getFloat("speed"); - this.onOff = var1.getBoolean("onOff"); + this.multiblock = var1.getBoolean("multiblock"); super.readFromNBT(var1); } @@ -61,7 +47,7 @@ public class TileEntityCoreStabilizer extends TileEntity { public void writeToNBT(NBTTagCompound var1) { var1.setFloat("rotationY", this.rotationY); var1.setFloat("speed", this.speed); - var1.setBoolean("onOff", this.onOff); + var1.setBoolean("multiblock", this.multiblock); super.writeToNBT(var1); } diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/tileentities/TileEntityEnderCoreGenerator.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/tileentities/TileEntityEnderCoreGenerator.java index 5b43ee1..ee06c5d 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/tileentities/TileEntityEnderCoreGenerator.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/tileentities/TileEntityEnderCoreGenerator.java @@ -9,6 +9,7 @@ import net.minecraft.nbt.NBTTagList; public class TileEntityEnderCoreGenerator extends TileEntityCoreGenerator implements ISidedInventory { int[] fuelqueue; + public TileEntityEnderCoreGenerator() { fuelqueue = new int[1]; fuelqueue[0] = 100; diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/tileentities/TileEntityNetherCoreGenerator.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/tileentities/TileEntityNetherCoreGenerator.java index 893c5cf..57d7b08 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/tileentities/TileEntityNetherCoreGenerator.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/tileentities/TileEntityNetherCoreGenerator.java @@ -13,15 +13,13 @@ public class TileEntityNetherCoreGenerator extends TileEntityCoreGenerator imple Item[] item; int[] fuel; public TileEntityNetherCoreGenerator() { - fuel = new int[1]; item = new Item[1]; fuel[0] = 110; item[0] = Items.blaze_rod; - + setParticle("flame"); configureVars(fuel, 30000, 125); - ItemValidityByItem(item); - + ItemValidityByItem(item); } @Override diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/moditems/Wrench.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/moditems/Wrench.java index b1648a8..a9ece83 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/moditems/Wrench.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/moditems/Wrench.java @@ -27,35 +27,13 @@ public class Wrench extends Item { setCreativeTab(ModCreativeTabs.TabASU); setUnlocalizedName("WrenchUtility"); setMaxStackSize(1); + setTextureName(ModInfo.MODID + ":" + getUnlocalizedName().substring(5)); } @Override public boolean isFull3D() { return true; } - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister register) { - iconArray = new IIcon[2]; - - for (int i = 0; i < iconArray.length; ++i) { - iconArray[i] = register.registerIcon(ModInfo.MODID + ":" + "WrenchUtility/" + getUnlocalizedName().substring(5) + i); - } - - this.itemIcon = iconArray[0]; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(ItemStack stack, int renderPass) { - if (stack.stackTagCompound != null && stack.stackTagCompound.getByte("Mode") == -1) { - return iconArray[0]; - } else if (stack.stackTagCompound != null && stack.stackTagCompound.getByte("Mode") != -1) { - return iconArray[1]; - } - return iconArray[0]; - }; - @Override public void onCreated(ItemStack itemstack, World world, EntityPlayer player) { NBTSetup(itemstack, world, player); diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/packets/ASUCoreTogglePacket.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/packets/ASUCoreTogglePacket.java index 8ce2d8b..968956f 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/packets/ASUCoreTogglePacket.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/packets/ASUCoreTogglePacket.java @@ -45,7 +45,7 @@ public class ASUCoreTogglePacket implements IMessage { @Override public IMessage onMessage(ASUCoreTogglePacket message, MessageContext ctx) { TileEntity tileentity = ctx.getServerHandler().playerEntity.getEntityWorld().getTileEntity(message.x, message.y, message.z); - if (message.toggle == 1) { + if (tileentity instanceof TileEntityCoreGenerator && message.toggle == 1) { ((TileEntityCoreGenerator)tileentity).toggle = true; } else { ((TileEntityCoreGenerator)tileentity).toggle = false; diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/reference/moditemblockreference/TileEntityCoreGenerator.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/reference/moditemblockreference/TileEntityCoreGenerator.java index df5a10f..6892f44 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/reference/moditemblockreference/TileEntityCoreGenerator.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/reference/moditemblockreference/TileEntityCoreGenerator.java @@ -1,5 +1,7 @@ package org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference; +import java.util.Random; + import org.bitbucket.alltra101ify.advancedsatelliteutilization.moditems.ModItems; import net.minecraft.entity.player.EntityPlayer; @@ -15,38 +17,13 @@ import net.minecraft.tileentity.TileEntity; public class TileEntityCoreGenerator extends TileEntity implements ISidedInventory { protected ItemStack[] items = new ItemStack[4]; - - public boolean inputItems; - public boolean outputPower; - - public boolean toggle; - - public boolean multiblock; - + public boolean toggle, multiblock; protected String customName; - - protected int currentfuelqueue; - - private int fuelqueue[]; - - public float rotationY; - - public float rotationX; - - public int maxpower; - - public int currentPower; - - protected float speed; - - protected float speedSlower; - - protected int cooldown; - - public int currentcooldown; - + public int currentfuelqueue, maxpower, currentPower, cooldown, currentcooldown, fuelqueue[]; + public float rotationX, rotationY, speed, speedSlower; Item[] validItemByItem; - String validItemByString; + String validItemByString, particle; + protected int x, y, z; @Override public void updateEntity() { @@ -74,19 +51,17 @@ public class TileEntityCoreGenerator extends TileEntity implements ISidedInvento } if (currentPower >= maxpower) { - inputItems = false; currentPower = maxpower; } if (currentPower <= 0) { - outputPower = false; currentPower = 0; } - if (toggle) { + if (toggle) { //Register fuel and such using item and fuel index system if (items[0] != null && this.validItemByItem != null) { for (int i = 0; i < validItemByItem.length; i++) { - if (currentfuelqueue <= maxpower - fuelqueue[i] && currentcooldown == 0 && items[0].getItem() == validItemByItem[i]) { + if (currentcooldown == 0 && currentfuelqueue <= maxpower - fuelqueue[i] && items[0].getItem() == validItemByItem[i]) { if (items[0].stackSize == 1) { this.items[0] = null; } else { @@ -145,7 +120,6 @@ public class TileEntityCoreGenerator extends TileEntity implements ISidedInvento } else if (toggle == false && speed > 0f) { speed -= 0.0005f; - speedSlower -= 0.00007f; } @@ -352,5 +326,21 @@ public class TileEntityCoreGenerator extends TileEntity implements ISidedInvento this.validItemByString = string; } -} - + public int RetrievePower (int amountofpower) { + if (currentPower >= amountofpower) { + currentPower = currentPower - amountofpower; + } + return amountofpower; + } + + public void setCoords(int x, int y, int z) { + this.x = x; + this.y = y; + this.z = z; + } + + public void setParticle(String particle) { + this.particle = particle; + } + +} \ No newline at end of file diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/renderer/RenderCoreStabilizer.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/renderer/RenderCoreStabilizer.java index 68a280e..ba6a4b9 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/renderer/RenderCoreStabilizer.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/renderer/RenderCoreStabilizer.java @@ -26,7 +26,7 @@ public class RenderCoreStabilizer extends TileEntitySpecialRenderer { GL11.glTranslatef((float) x + 0.5f, (float) y + 1.5f, (float) z + 0.5f); GL11.glRotatef(180, 0f, 0f, 1f); - this.bindTexture(texture[tileentity.version]); + this.bindTexture(texture[1]); modelASU.renderModel(0.0625f); @@ -35,9 +35,9 @@ public class RenderCoreStabilizer extends TileEntitySpecialRenderer { } public RenderCoreStabilizer() { - texture[0] = new ResourceLocation(ModInfo.MODID + ":" + "/textures/models/CoreStabilizer/ModelCoreStabilizer0.png"); - texture[1] = new ResourceLocation(ModInfo.MODID + ":" + "/textures/models/CoreStabilizer/ModelCoreStabilizer1.png"); - texture[2] = new ResourceLocation(ModInfo.MODID + ":" + "/textures/models/CoreStabilizer/ModelCoreStabilizer2.png"); + for (int i = 0; i < texture.length; i++) { + texture[i] = new ResourceLocation(ModInfo.MODID + ":" + "/textures/models/CoreStabilizer/ModelCoreStabilizer" + i +".png"); + } } diff --git a/src/main/resources/assets/asu/textures/gui/GUICoreGenerator.png b/src/main/resources/assets/asu/textures/gui/GUICoreGenerator.png index 266fb74..b41b9ef 100644 Binary files a/src/main/resources/assets/asu/textures/gui/GUICoreGenerator.png and b/src/main/resources/assets/asu/textures/gui/GUICoreGenerator.png differ diff --git a/src/main/resources/assets/asu/textures/gui/WrenchGUI.png b/src/main/resources/assets/asu/textures/gui/WrenchGUI.png index 5d08cd0..8edb620 100644 Binary files a/src/main/resources/assets/asu/textures/gui/WrenchGUI.png and b/src/main/resources/assets/asu/textures/gui/WrenchGUI.png differ diff --git a/src/main/resources/assets/asu/textures/items/SolderingIron.png b/src/main/resources/assets/asu/textures/items/SolderingIron.png index 85eea15..99196c3 100644 Binary files a/src/main/resources/assets/asu/textures/items/SolderingIron.png and b/src/main/resources/assets/asu/textures/items/SolderingIron.png differ diff --git a/src/main/resources/assets/asu/textures/items/WrenchUtility.png b/src/main/resources/assets/asu/textures/items/WrenchUtility.png new file mode 100644 index 0000000..dd641d4 Binary files /dev/null and b/src/main/resources/assets/asu/textures/items/WrenchUtility.png differ diff --git a/src/main/resources/assets/asu/textures/items/WrenchUtility/WrenchUtility0.png b/src/main/resources/assets/asu/textures/items/WrenchUtility/WrenchUtility0.png deleted file mode 100644 index d3643ec..0000000 Binary files a/src/main/resources/assets/asu/textures/items/WrenchUtility/WrenchUtility0.png and /dev/null differ diff --git a/src/main/resources/assets/asu/textures/items/WrenchUtility/WrenchUtility1.png b/src/main/resources/assets/asu/textures/items/WrenchUtility/WrenchUtility1.png deleted file mode 100644 index 9d1c89c..0000000 Binary files a/src/main/resources/assets/asu/textures/items/WrenchUtility/WrenchUtility1.png and /dev/null differ diff --git a/src/main/resources/assets/asu/textures/items/WrenchUtility/WrenchUtility1.png.mcmeta b/src/main/resources/assets/asu/textures/items/WrenchUtility/WrenchUtility1.png.mcmeta deleted file mode 100644 index 7644671..0000000 --- a/src/main/resources/assets/asu/textures/items/WrenchUtility/WrenchUtility1.png.mcmeta +++ /dev/null @@ -1,38 +0,0 @@ -{ - "animation": { - "frames": [ - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - 30, - 31, - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15 - ] - } -} diff --git a/src/main/resources/assets/asu/textures/items/fanModule.png b/src/main/resources/assets/asu/textures/items/fanModule.png index 7063c56..cd8059e 100644 Binary files a/src/main/resources/assets/asu/textures/items/fanModule.png and b/src/main/resources/assets/asu/textures/items/fanModule.png differ diff --git a/src/main/resources/assets/asu/textures/items/humaninterfacegate.png b/src/main/resources/assets/asu/textures/items/humaninterfacegate.png index 0cf556d..353fba6 100644 Binary files a/src/main/resources/assets/asu/textures/items/humaninterfacegate.png and b/src/main/resources/assets/asu/textures/items/humaninterfacegate.png differ