From 52092fdd4f59c1d347b45eb391c82356dda68a6e Mon Sep 17 00:00:00 2001 From: alltra101ify Date: Sat, 14 Nov 2015 18:02:43 -0500 Subject: [PATCH] Fixed code, changed textures, and more logic! --- .../modGUIs/GuiEnderCoreGenerator.java | 25 +++---- .../modGUIs/GuiNetherCoreGenerator.java | 20 +++--- .../modblocks/CoreStabilizer.java | 17 +---- .../modblocks/EnderCoreGenerator.java | 21 ++++++ .../modblocks/NetherCoreGenerator.java | 21 +++++- .../TileEntityCoreStabilizer.java | 24 ++----- .../TileEntityEnderCoreGenerator.java | 1 + .../TileEntityNetherCoreGenerator.java | 6 +- .../moditems/Wrench.java | 24 +------ .../packets/ASUCoreTogglePacket.java | 2 +- .../TileEntityCoreGenerator.java | 64 ++++++++---------- .../renderer/RenderCoreStabilizer.java | 8 +-- .../asu/textures/gui/GUICoreGenerator.png | Bin 2215 -> 2276 bytes .../assets/asu/textures/gui/WrenchGUI.png | Bin 2181 -> 2181 bytes .../asu/textures/items/SolderingIron.png | Bin 239 -> 261 bytes .../asu/textures/items/WrenchUtility.png | Bin 0 -> 336 bytes .../items/WrenchUtility/WrenchUtility0.png | Bin 340 -> 0 bytes .../items/WrenchUtility/WrenchUtility1.png | Bin 1903 -> 0 bytes .../WrenchUtility/WrenchUtility1.png.mcmeta | 38 ----------- .../assets/asu/textures/items/fanModule.png | Bin 514 -> 443 bytes .../asu/textures/items/humaninterfacegate.png | Bin 507 -> 262 bytes 21 files changed, 104 insertions(+), 167 deletions(-) create mode 100644 src/main/resources/assets/asu/textures/items/WrenchUtility.png delete mode 100644 src/main/resources/assets/asu/textures/items/WrenchUtility/WrenchUtility0.png delete mode 100644 src/main/resources/assets/asu/textures/items/WrenchUtility/WrenchUtility1.png delete mode 100644 src/main/resources/assets/asu/textures/items/WrenchUtility/WrenchUtility1.png.mcmeta 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 266fb74de2c09b9405df05aa277d949fd576c037..b41b9ef2d8988b97617ef2a65902d366ce5e8290 100644 GIT binary patch delta 1150 zcmZ23_(X6+2n*LX1_r)ujOR}5Tsk?9MZMn3)5S5QBJS;s?y|*ZBCd0NW}RDHy8P$= z`mYKv8T4joZYt${^2S%J{lsa7-1wHYm!B3{@lF3WM{jxmV}XPRB}+cm|H;W$;Qmo5 z5*I&P+JmX&+un~xPv59Luz7gcufeWTP|M+Z$I}?LZPWY?YGf*~|g=SZ=Ff6@Q%K2z*}i{I$+vo%8i~#u1+byx&wF@O3rZFRtbG>5LJYJ-t4f_hg+~zhU zp5A@Iv%qU+Tga|nkLPPD zDEwy6erLyhA!+}nUr$_DG_YSaMx>qt5EbG^y#&O63Qy)IJCXykLvfV49idU0vI65#e2`s2HXJ+KkVEU4pobpL`N%G@q8H~R+8GhKf zU5rJ6fsq5D2E=M$U{Ofe$FYC=v;@Yea!JmZ+kt&+vO2{Ucu8~UJo_C5Rshn~@arxQ zP=7tdfQE)0Q|E-~9%S0`&PZs-w#71$SA}#PrkV*vocX>LW=jLZ*WHp}`#`oZFcxZC zu8nG9m0<>PUX>eHF-BF(a>m>bh1j_KtiuE5xBGCpQX$WDd#HE)hK6LIX%*ZRy#fW6 zOFzrCF)&V_e6E&dR=+*xi@fH;0akY>U9MKmKP9zK_k*kD;(x9AQvRk}nf_J$pI278 zqW^WI+;b(M$W_q^ELRrUt$Ug+^da>B8rR1w(*h4XvUnZ8Vts@4g^E>`T@CX74v$wp z(_|`H8{5S2wUCWzim^cbf;o*0Pi11Wrz<$r&PmiynE13%Z&CK!Nl}dDe$g-Hy?Kr^F?vM{EZD+I9V(qV#=uPp)|(z*Et2!y`s5T~LBqh{>FVdQ I&MBb@03k5dZU6uP literal 2215 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K58911MRQ8&P5Fo{p?&#~tz_78O`%fY(0|PTd zfKP}kP~6^dC7l)|5FA2&ldbYN96w;i97!!@BC-@|MutqgwD>+uCA``?(UwR zo@2+3-MDe%|Ns9$jiX>R1crJDY`*Js2b57tg8YJksd^*>hT!k)s=)Z$F~R;kLiAY&Il{Ws!QfD1$>Zx z&2UI9mfMZtp)g|$KQF@^hC^Wtg~I!ixdi0(a&p!;Je+$$D1n2)y`h_j(JhzBAo`#G z6DFB2|1VCEJTNtiDI$>R$Bxg-5A2w={m8QE(Y^Qhue{1Wa5w8~?1Q|gj2Y=`KHYw> z328atL9d%wjqud})DB)y;G6)2d_Y%z8CW4KlEz}vTC2_=H}X32fs zKbP^yeD2lv*%B6?Ti;M2dgXuminV(4m_XS-Ean$p)}bGh;KS%@ zw+i|AZym(KFL}kQ9!cNYWed~MaBg=5jLpFC_1&{+w}K@T-#uH4 z;mcgPYJSo9dWMR6sW;0?E~&nrXIy>h%*)bc`m-i~+W&FY*OckpAHM#qzVT#fam>9x zR_T|kHl5zb#N?1?b$sbwmIm?KjV5c=cSkndEPYn5{GTgg;dnk5zACtpnGX|4f=0Qnq+4rBjiLao-%Ar6Q6waQmelF{r5}E*n&hs1q diff --git a/src/main/resources/assets/asu/textures/gui/WrenchGUI.png b/src/main/resources/assets/asu/textures/gui/WrenchGUI.png index 5d08cd00033b18320974a54370e8d72d1435dcc6..8edb620857b488ca5bfc755ce3fa900a608182b5 100644 GIT binary patch delta 21 dcmZn_Y!#ef!?l-zfp0IP`|k;BH@ew#002vt2T1?` delta 21 dcmZn_Y!#ef!?llrfo~t_FJH!M2TxeNpOBz zNqJ&XDnmhHW?qS2UTTSgiJpO;*`J=|`#?3#o-U3d7XC~7F7h5w;Bc9HWC^oHQ?x}m z`^!mFvYRwNc5VAx!8pG_vGaufiW=sr`33#gW{KG+86*pA4b#2n8W8Dq(Wr`Ts={-f z*>%gaTh23RF^ZL^iaDts5VDw}ks?s8qq6IWt%TU863=`kotD@~Y|1)E^j_YZC91?`}RayW5 delta 211 zcmZo=de1mPrJgOx+ueoXKL{?^yL>VO0|RG)M`SSr1Gg{;GcwGYBLNg-FY)wsWxvlN z#>^$Ps+F|>C?uO15>euupPQSSR|4cRFgO>bCYGe8D3oWGWGJ|M`Ua%vrLqIXgFRgw zLo7}wCrGeLB)q$`^Z&~%4rRHW|BtLlR`R*D=>HU{hRXtONhYyVr=%nR!G*eiGS2+M znu#o?FYGn-8g{ch<0_dhAkEej;H%Qk7#Zjt&%lrvA-dzjn_rtj7JIt-xvX!lvI6;>1s;*b z3=Dh+L6~vJ#O${~L5ULAh?3y^w370~qEv>0#LT=By}Z;C1rt33J+nVO$@hV3&Uv~x zhFJLbPTDBgY{27sv&m}9&M%Tm&M9o>d3%{ueUByTx}Kj?v+3ZRZtXGL#X zQ?OORX~NBOxeSN=E48gRIrY9g9PQxnPpgG->q2LfoA;PF9=-Z~>d<3#N^B^R_vdac0rHWdbFpH&^6M_#3jW+-OSc{4?`z=kIg>x6xKvx$o43r>pm;PkFge fX$$|c2`~9$AGD}?3D0^3^cjPvtDnm{r-UW|K#7Ux literal 0 HcmV?d00001 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 d3643ec3d358fbf9971ca17889754f6916f29e44..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 340 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85p>QK$!8;-MT+OLG}_)Usv|~EV9f}`iWmdn1MnPC9V-A!TD(= z<%vb93~dIox?sjWt-KsB2@T^vI!{I^ax$lGinz|#B4)A>SEwu0`C zj*?0KabKot{gByyE%%W}xtV-eRN;+zvCdjcm&|i{@_ON-<|w0;Pj%nIF&sP z&faxziMGk%mc-jq+zPWVW;t%N7Px(b=f<{wbsMyq0ep25@A&t;ucLK6ULJA7XN 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 9d1c89c217c208e74e29595ceb6dae65fb28f936..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1903 zcmeAS@N?(olHy`uVBq!ia0vp^0t^gH3><7gR`;$qmw^;xage(c!@6@aFM%AEbVpxD z28NCO+M1MG8<*qQo_#Bsf2{C!sQJctFziEg4Ng*v^A>n;jn**k|LY0~rgU#m!%X~Jis^QD#iGO+`z{R_C z!n?(_^Xu#%oVom&VOu)mjEZNC>Yvui{bc-jrg;{oXXbuyp2;4)VwRTjx3#CuEnJ&? zbWW)Ro-q~fHtCd;R?OZX8-(d7{h90=a$inJdHj>x$L8|^;h$mse;O*DIr`2_3H>Q^ zO=91vi3>ZXy;8XA{yS;G($-|t)+1um_v`2Ut>E|6Yu|pK_W*&wTF(=*%Mct`AL=d$ zO|s$GHkpt|YJdG@Fg*BI*J%>_(KF3#KOK_}ZLfO54zwuil*;N;&o>1l6H!Z2^6pjoYOgzJaP>8>qiK2 zdKa=VDgt9Te~Ra#8QE%LnL@T^PS@&oFTqS4k8M04w!M4bdz1-^y%lpX-l0aoqo9dIpZ0d2nAdzR=?W*!M`)WR7G5Fs=fL9;I_HWljQ$D zn}sv2Zut86Z}khiTi;bbGt8UE{<+TJvw~{Z&a|Y7Y8R80Q{Ha(#*AZe=3L$>62MUX z_rL#1{5r#rHS=B&$TSmLx384}rnY&r*bP1>G~!CrcDDQ$&AsVzXKXYkDhPKQd5RRD zJ)-2h=(yX7Tlv%RWc|XQe-cigQ#{#UU+haD-<)z-Iu)94%=3s#b-ip}cO_P9s%)$H zU)%T_SX%IR;YmnnrIKNN{uULXX^%LVoF2_&zppXb#qhe1&Lx$qoR&3z%RDhN_P!js zg8I{!6i+_=0FG=zWd^Ju`+i@1+gq7QF~BsJCbxu;Ex=%q1_#6XYWpAYgmURohtu-! z!NukE+B$~Yo`edgEV&bP0l+XkK0LP3C 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 7063c56c44087a3019a931d43e9e42cffbd1e6ab..cd8059ec7a7dc50d46e6dfdb5d6619c6ee6c17d9 100644 GIT binary patch delta 357 zcmV-r0h<1T1iJ%}JPN`901m^QE~aTpp64g!*$!&k_IbTtU+w~wMgj~`6rDGJ zn+;*ISS%z-l27%0Ti5l=ZnrzLftKLg_(}+CmSsV6C75D@q0 zJ9bv@_ltOv4J{BotEGcjR8tM!32!~6D6}RBAu#rT>!p300000NkvXXu0mjf DeI}a~ delta 429 zcmV;e0aE_E1A+vQJPN@801m+cxRGn^kwzzffJsC_R5(wak~?m~KoEvGgnfXBGbAaJ z10X6W!8SrXx+FqK7zrrod7K3bjsR^EI7VzLXo8f;N;!e+_6o7*u2-b~8Lz>Nh zrWA`sAilQlSWTzXdyRRgPzqoJI-Sn4-|v&0Ks?WTGaFbt1f)oQiMS%B~RFIwS?#9pr_ z?RHyArBc$3@ui}Mx+y>uMXt{05kxS5)u{>u7^7$>Z?;ehpk%L5C?st%zXoqe1f<&F zgH8Si(2oRwF&KnVYS>C$e`FN80f>nhd=bDE=~b<4AXjMS7Os|S#Ne|4eIy$y6JVvu z0T8;QfW~~xX0z-Oz%qb%KA&fIyPbo!+pUYSJZFXY6foksr=RjIGU?YXMzyjSOGGli XZlT(Xp#>R@00000NkvXXu0mjf)-J@; diff --git a/src/main/resources/assets/asu/textures/items/humaninterfacegate.png b/src/main/resources/assets/asu/textures/items/humaninterfacegate.png index 0cf556d225e3d4bd82ab2ccb3e9b69b4f0505872..353fba66199f2295c7fedc32588c37dde86c0b99 100644 GIT binary patch delta 179 zcmV;k08Ib;1BL>SB#|)~3c>&Y4#EKyC`y2lQzm}^gh@m}R5(w)kkJi*APhvAk~tWG z75HQvCc~Wc1fdZ~h?l%n)O$9Xsmxl!hXi3RvzX z&bfPTZO}@*_m2SYNVTLFP(pfv)M~U1SmgD;8vvYH2JKJ8bE%e409t{@=LTdZP&e2? hYVRA+x;hWUmCUQ3ih_vz3;O7G zyV7d4#Pd8U7K<_(jbt*J$ap-q7z_sD`@VEK9R+8tz-DN^N;fgSSpghn7I6tx-3^W>zRN(KB!Z)pJLq(A? SKP>