Fix lots of issues

This commit is contained in:
Prospector 2016-03-28 19:47:00 -07:00
parent 620bbfc1df
commit cec54aa0c8
16 changed files with 1009 additions and 1461 deletions

View file

@ -24,7 +24,7 @@ public class BlockStorage2 extends BaseBlock implements ITexturedBlock
public static final String[] types = new String[] { "tungstensteel", "lodestone", "tellurium",
"iridium_reinforced_tungstensteel", "iridium_reinforced_stone", "ruby", "sapphire", "peridot",
"yellowGarnet", "redGarnet", "copper", "tin" };
"yellowGarnet", "redGarnet", "copper", "tin", "refinedIron" };
public PropertyInteger METADATA;
public BlockStorage2(Material material)

View file

@ -123,7 +123,7 @@ public class GuiHandler implements IGuiHandler
(TileIndustrialElectrolyzer) world.getTileEntity(new BlockPos(x, y, z)), player);
} else if (ID == aesuID)
{
return new ContainerAesu((TileAesu) world.getTileEntity(new BlockPos(x, y, z)), player);
return new ContainerAESU((TileAesu) world.getTileEntity(new BlockPos(x, y, z)), player);
} else if (ID == alloyFurnaceID)
{
return new ContainerAlloyFurnace((TileAlloyFurnace) world.getTileEntity(new BlockPos(x, y, z)), player);
@ -143,7 +143,7 @@ public class GuiHandler implements IGuiHandler
return new ContainerDestructoPack(player);
} else if (ID == lesuID)
{
return new ContainerLesu((TileLesu) world.getTileEntity(new BlockPos(x, y, z)), player);
return new ContainerLESU((TileLesu) world.getTileEntity(new BlockPos(x, y, z)), player);
} else if (ID == idsuID)
{
return new ContainerIDSU((TileIDSU) world.getTileEntity(new BlockPos(x, y, z)), player);
@ -252,7 +252,7 @@ public class GuiHandler implements IGuiHandler
(TileIndustrialElectrolyzer) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == aesuID)
{
return new GuiAesu(player, (TileAesu) world.getTileEntity(new BlockPos(x, y, z)));
return new GuiAESU(player, (TileAesu) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == alloyFurnaceID)
{
return new GuiAlloyFurnace(player, (TileAlloyFurnace) world.getTileEntity(new BlockPos(x, y, z)));
@ -270,7 +270,7 @@ public class GuiHandler implements IGuiHandler
return new GuiDestructoPack(new ContainerDestructoPack(player));
} else if (ID == lesuID)
{
return new GuiLesu(player, (TileLesu) world.getTileEntity(new BlockPos(x, y, z)));
return new GuiLESU(player, (TileLesu) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == idsuID)
{
return new GuiIDSU(player, (TileIDSU) world.getTileEntity(new BlockPos(x, y, z)));

View file

@ -8,66 +8,55 @@ import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileAesu;
public class ContainerAesu extends RebornContainer
{
public class ContainerAESU extends RebornContainer {
public int euOut;
public int storedEu;
public int euChange;
EntityPlayer player;
TileAesu tile;
public ContainerAesu(TileAesu tileaesu, EntityPlayer player)
{
public ContainerAESU(TileAesu tileaesu, EntityPlayer player) {
tile = tileaesu;
this.player = player;
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
for (i = 0; i < 3; ++i) {
for (int j = 0; j < 9; ++j) {
this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 115 + i * 18));
}
}
for (i = 0; i < 9; ++i)
{
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 173));
}
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@Override
public void detectAndSendChanges()
{
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); i++)
{
for (int i = 0; i < this.crafters.size(); i++) {
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if (this.euOut != tile.getMaxOutput())
{
if (this.euOut != tile.getMaxOutput()) {
icrafting.sendProgressBarUpdate(this, 0, (int) tile.getMaxOutput());
}
if (this.storedEu != tile.getEnergy())
{
if (this.storedEu != tile.getEnergy()) {
icrafting.sendProgressBarUpdate(this, 1, (int) tile.getEnergy());
}
if (this.euChange != tile.getEuChange() && tile.getEuChange() != -1)
{
if (this.euChange != tile.getEuChange() && tile.getEuChange() != -1) {
icrafting.sendProgressBarUpdate(this, 2, (int) tile.getEuChange());
}
}
}
@Override
public void onCraftGuiOpened(ICrafting crafting)
{
public void onCraftGuiOpened(ICrafting crafting) {
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 0, (int) tile.getMaxOutput());
crafting.sendProgressBarUpdate(this, 1, (int) tile.getEnergy());
@ -76,16 +65,12 @@ public class ContainerAesu extends RebornContainer
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 0)
{
public void updateProgressBar(int id, int value) {
if (id == 0) {
this.euOut = value;
} else if (id == 1)
{
} else if (id == 1) {
this.storedEu = value;
} else if (id == 2)
{
} else if (id == 2) {
this.euChange = value;
}
}

View file

@ -8,8 +8,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.idsu.TileIDSU;
public class ContainerIDSU extends RebornContainer
{
public class ContainerIDSU extends RebornContainer {
public int euOut;
public int storedEu;
@ -17,58 +16,48 @@ public class ContainerIDSU extends RebornContainer
public int channel;
EntityPlayer player;
TileIDSU tile;
public ContainerIDSU(TileIDSU tileIDSU, EntityPlayer player)
{
public ContainerIDSU(TileIDSU tileIDSU, EntityPlayer player) {
tile = tileIDSU;
this.player = player;
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
for (i = 0; i < 3; ++i) {
for (int j = 0; j < 9; ++j) {
this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 115 + i * 18));
}
}
for (i = 0; i < 9; ++i)
{
this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142));
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 173));
}
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@Override
public void detectAndSendChanges()
{
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); i++)
{
for (int i = 0; i < this.crafters.size(); i++) {
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if (this.euOut != tile.output)
{
if (this.euOut != tile.output) {
icrafting.sendProgressBarUpdate(this, 0, tile.output);
}
if (this.storedEu != (int) tile.getEnergy())
{
if (this.storedEu != (int) tile.getEnergy()) {
icrafting.sendProgressBarUpdate(this, 1, (int) tile.getEnergy());
}
if (this.euChange != tile.getEuChange() && tile.getEuChange() != -1)
{
if (this.euChange != tile.getEuChange() && tile.getEuChange() != -1) {
icrafting.sendProgressBarUpdate(this, 2, (int) tile.getEuChange());
}
}
}
@Override
public void onCraftGuiOpened(ICrafting crafting)
{
public void onCraftGuiOpened(ICrafting crafting) {
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 0, tile.output);
crafting.sendProgressBarUpdate(this, 1, (int) tile.getEnergy());
@ -77,19 +66,14 @@ public class ContainerIDSU extends RebornContainer
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 0)
{
public void updateProgressBar(int id, int value) {
if (id == 0) {
this.euOut = value;
} else if (id == 1)
{
} else if (id == 1) {
this.storedEu = value;
} else if (id == 2)
{
} else if (id == 2) {
this.euChange = value;
} else if (id == 3)
{
} else if (id == 3) {
this.channel = value;
}
}

View file

@ -9,8 +9,7 @@ import reborncore.common.container.RebornContainer;
import techreborn.config.ConfigTechReborn;
import techreborn.tiles.lesu.TileLesu;
public class ContainerLesu extends RebornContainer
{
public class ContainerLESU extends RebornContainer {
public int euOut;
public int storedEu;
@ -19,8 +18,8 @@ public class ContainerLesu extends RebornContainer
public double euStorage;
EntityPlayer player;
TileLesu tile;
public ContainerLesu(TileLesu tileaesu, EntityPlayer player)
{
public ContainerLESU(TileLesu tileaesu, EntityPlayer player) {
tile = tileaesu;
this.player = player;
@ -30,55 +29,44 @@ public class ContainerLesu extends RebornContainer
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
for (i = 0; i < 3; ++i) {
for (int j = 0; j < 9; ++j) {
this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 115 + i * 18));
}
}
for (i = 0; i < 9; ++i)
{
this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142));
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 173));
}
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@Override
public void detectAndSendChanges()
{
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); i++)
{
for (int i = 0; i < this.crafters.size(); i++) {
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if (this.euOut != tile.getMaxOutput())
{
if (this.euOut != tile.getMaxOutput()) {
icrafting.sendProgressBarUpdate(this, 0, (int) tile.getMaxOutput());
}
if (this.storedEu != tile.getEnergy())
{
if (this.storedEu != tile.getEnergy()) {
icrafting.sendProgressBarUpdate(this, 1, (int) tile.getEnergy());
}
if (this.euChange != tile.getEuChange() && tile.getEuChange() != -1)
{
if (this.euChange != tile.getEuChange() && tile.getEuChange() != -1) {
icrafting.sendProgressBarUpdate(this, 2, (int) tile.getEuChange());
}
if (this.connectedBlocks != tile.connectedBlocks)
{
if (this.connectedBlocks != tile.connectedBlocks) {
icrafting.sendProgressBarUpdate(this, 3, tile.connectedBlocks);
}
}
}
@Override
public void onCraftGuiOpened(ICrafting crafting)
{
public void onCraftGuiOpened(ICrafting crafting) {
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 0, (int) tile.getMaxOutput());
crafting.sendProgressBarUpdate(this, 1, (int) tile.getEnergy());
@ -88,22 +76,16 @@ public class ContainerLesu extends RebornContainer
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 0)
{
public void updateProgressBar(int id, int value) {
if (id == 0) {
this.euOut = value;
} else if (id == 1)
{
} else if (id == 1) {
this.storedEu = value;
} else if (id == 2)
{
} else if (id == 2) {
this.euChange = value;
} else if (id == 3)
{
} else if (id == 3) {
this.connectedBlocks = value;
} else if (id == 4)
{
} else if (id == 4) {
this.euStorage = value;
}
this.euStorage = ((connectedBlocks + 1) * ConfigTechReborn.LesuStoragePerBlock);

View file

@ -8,29 +8,29 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import reborncore.common.packets.PacketHandler;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.client.container.ContainerAesu;
import techreborn.client.container.ContainerAESU;
import techreborn.packets.PacketAesu;
import techreborn.tiles.TileAesu;
import java.awt.*;
import java.io.IOException;
public class GuiAesu extends GuiContainer
public class GuiAESU extends GuiContainer
{
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/aesu.png");
TileAesu aesu;
ContainerAesu containerAesu;
ContainerAESU containerAesu;
public GuiAesu(EntityPlayer player, TileAesu tileaesu)
public GuiAESU(EntityPlayer player, TileAesu tileaesu)
{
super(new ContainerAesu(tileaesu, player));
super(new ContainerAESU(tileaesu, player));
this.xSize = 176;
this.ySize = 197;
aesu = tileaesu;
this.containerAesu = (ContainerAesu) this.inventorySlots;
this.containerAesu = (ContainerAESU) this.inventorySlots;
}
@Override

View file

@ -28,7 +28,7 @@ public class GuiIDSU extends GuiContainer
{
super(new ContainerIDSU(tileIDSU, player));
this.xSize = 176;
this.ySize = 165;
this.ySize = 197;
idsu = tileIDSU;
this.containerIDSU = (ContainerIDSU) this.inventorySlots;
}

View file

@ -8,25 +8,25 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.client.container.ContainerLesu;
import techreborn.client.container.ContainerLESU;
import techreborn.tiles.lesu.TileLesu;
public class GuiLesu extends GuiContainer
public class GuiLESU extends GuiContainer
{
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/aesu.png");
TileLesu aesu;
ContainerLesu containerLesu;
ContainerLESU containerLesu;
public GuiLesu(EntityPlayer player, TileLesu tileaesu)
public GuiLESU(EntityPlayer player, TileLesu tileaesu)
{
super(new ContainerLesu(tileaesu, player));
super(new ContainerLESU(tileaesu, player));
this.xSize = 176;
this.ySize = 165;
this.ySize = 197;
aesu = tileaesu;
this.containerLesu = (ContainerLesu) this.inventorySlots;
this.containerLesu = (ContainerLESU) this.inventorySlots;
}
@Override

File diff suppressed because it is too large Load diff

View file

@ -11,8 +11,7 @@ import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.init.ModItems;
import techreborn.lib.ModInfo;
public class ItemDusts extends ItemTextureBase
{
public class ItemDusts extends ItemTextureBase {
public static final String[] types = new String[] { "almandine", "aluminumBrass", "aluminum", "alumite",
"andradite", "antimony", "ardite", "ashes", "basalt", "bauxite", "biotite", "brass", "bronze", "cadmium",
"calcite", "charcoal", "chrome", "cinnabar", "clay", "coal", "cobalt", "copper", "cupronickel", "darkAshes",
@ -23,52 +22,42 @@ public class ItemDusts extends ItemTextureBase
"potassiumFeldspar", "pyrite", "pyrope", "redGarnet", "redrock", "ruby", "saltpeter", "sapphire", "sawDust",
"silicon", "silver", "sodalite", "spessartine", "sphalerite", "steel", "sulfur", "tellurium", "teslatite",
"tetrahedrite", "tin", "titanium", "tungsten", "uvarovite", "vinteum", "voidstone", "yellowGarnet", "zinc",
"greenSapphire", "olivine" };
"olivine" };
public ItemDusts()
{
public ItemDusts() {
setUnlocalizedName("techreborn.dust");
setHasSubtypes(true);
setCreativeTab(TechRebornCreativeTabMisc.instance);
}
public static ItemStack getDustByName(String name, int count)
{
for (int i = 0; i < types.length; i++)
{
if (types[i].equalsIgnoreCase(name))
{
public static ItemStack getDustByName(String name, int count) {
for (int i = 0; i < types.length; i++) {
if (types[i].equalsIgnoreCase(name)) {
return new ItemStack(ModItems.dusts, count, i);
}
}
if (name.equalsIgnoreCase("glowstone"))
{
if (name.equalsIgnoreCase("glowstone")) {
return new ItemStack(Items.glowstone_dust, count);
}
if (name.equalsIgnoreCase("redstone"))
{
if (name.equalsIgnoreCase("redstone")) {
return new ItemStack(Items.redstone, count);
}
if (name.equalsIgnoreCase("gunpowder"))
{
if (name.equalsIgnoreCase("gunpowder")) {
return new ItemStack(Items.gunpowder, count);
}
throw new InvalidParameterException("The dust " + name + " could not be found.");
}
public static ItemStack getDustByName(String name)
{
public static ItemStack getDustByName(String name) {
return getDustByName(name, 1);
}
@Override
// gets Unlocalized Name depending on meta data
public String getUnlocalizedName(ItemStack itemStack)
{
public String getUnlocalizedName(ItemStack itemStack) {
int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= types.length)
{
if (meta < 0 || meta >= types.length) {
meta = 0;
}
@ -76,23 +65,19 @@ public class ItemDusts extends ItemTextureBase
}
// Adds Dusts SubItems To Creative Tab
public void getSubItems(Item item, CreativeTabs creativeTabs, List list)
{
for (int meta = 0; meta < types.length; ++meta)
{
public void getSubItems(Item item, CreativeTabs creativeTabs, List list) {
for (int meta = 0; meta < types.length; ++meta) {
list.add(new ItemStack(item, 1, meta));
}
}
@Override
public String getTextureName(int damage)
{
public String getTextureName(int damage) {
return ModInfo.MOD_ID + ":items/dust/" + types[damage] + "Dust";
}
@Override
public int getMaxMeta()
{
public int getMaxMeta() {
return types.length;
}

View file

@ -11,12 +11,12 @@ import techreborn.api.upgrade.IMachineUpgrade;
import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.init.ModItems;
public class ItemUpgrade extends ItemTR implements IMachineUpgrade
public class ItemUpgrades extends ItemTR implements IMachineUpgrade
{
public static final String[] types = new String[] { "0.2Speed", "0.2Power", "0.5Speed" };
public static final String[] types = new String[] { "Overclock", "Transformer", "EnergyStorage" };
public ItemUpgrade()
public ItemUpgrades()
{
setUnlocalizedName("techreborn.upgrade");
setHasSubtypes(true);

View file

@ -281,7 +281,6 @@ item.techreborn.dust.voidstone.name=Voidstone Dust
item.techreborn.dust.yellowGarnet.name=Yellow Garnet Dust
item.techreborn.dust.zinc.name=Zinc Dust
item.techreborn.dust.galena.name=Galena Dust
item.techreborn.dust.greenSapphire.name=Green Sapphire Dust
item.techreborn.dust.sawDust.name=Saw Dust
item.techreborn.dust.olivine.name=Olivine Dust
item.techreborn.ingot.refinedIron.name=Refined Iron Ingot
@ -439,7 +438,7 @@ item.techreborn.nanosaber.name=Nanosaber
#Gems
item.techreborn.gem.ruby.name=Ruby
item.techreborn.gem.sapphire.name=Sapphire
item.techreborn.gem.peridot.name=Green Sapphire
item.techreborn.gem.peridot.name=Peridot
item.techreborn.gem.redGarnet.name=Red Garnet
item.techreborn.gem.yellowGarnet.name=Yellow Garnet

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 520 B