Improve code readability in binnie.extrabees package and other packages

* Improve code readability in binnie.extrabees package and other packages
* Fix compile error after refactoring
This commit is contained in:
Alexander Kornilov authored and marcin212 committed 2017-04-29 13:43:35 +02:00
1 parent b609d6688f
commit c09ad04284
95 files changed
+3916 -3900

No files matched your search

@@ -1,37 +1,32 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extrabees.gui;
import binnie.extrabees.ExtraBees;
import binnie.core.AbstractMod;
import binnie.core.craftgui.minecraft.control.ControlItemDisplay;
import net.minecraft.item.ItemStack;
import binnie.extrabees.apiary.machine.AlvearyMutator;
import binnie.core.craftgui.controls.ControlText;
import binnie.core.craftgui.geometry.TextJustification;
import binnie.core.craftgui.geometry.IArea;
import binnie.core.craftgui.minecraft.control.ControlSlot;
import binnie.core.machines.TileEntityMachine;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.inventory.IInventory;
import net.minecraft.entity.player.EntityPlayer;
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
import binnie.core.machines.Machine;
import binnie.core.craftgui.geometry.TextJustification;
import binnie.core.craftgui.minecraft.Window;
import binnie.core.craftgui.minecraft.control.ControlItemDisplay;
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
import binnie.core.craftgui.minecraft.control.ControlSlot;
import binnie.core.machines.Machine;
import binnie.core.machines.TileEntityMachine;
import binnie.extrabees.ExtraBees;
import binnie.extrabees.apiary.machine.AlvearyMutator;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
public class WindowAlvearyMutator extends Window
{
Machine machine;
ControlPlayerInventory playerInventory;
public class WindowAlvearyMutator extends Window {
protected Machine machine;
protected ControlPlayerInventory playerInventory;
public WindowAlvearyMutator(final EntityPlayer player, final IInventory inventory, final Side side) {
public WindowAlvearyMutator(EntityPlayer player, IInventory inventory, Side side) {
super(176.0f, 176.0f, player, inventory, side);
this.machine = ((TileEntityMachine) inventory).getMachine();
machine = ((TileEntityMachine) inventory).getMachine();
}
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
public static Window create(EntityPlayer player, IInventory inventory, Side side) {
if (player == null || inventory == null) {
return null;
}
@@ -40,21 +35,24 @@ public class WindowAlvearyMutator extends Window
@Override
public void initialiseClient() {
this.setTitle("Mutator");
this.playerInventory = new ControlPlayerInventory(this);
final ControlSlot slot = new ControlSlot(this, 79.0f, 30.0f);
setTitle("Mutator");
playerInventory = new ControlPlayerInventory(this);
ControlSlot slot = new ControlSlot(this, 79.0f, 30.0f);
slot.assign(0);
new ControlText(this, new IArea(0.0f, 52.0f, this.w(), 16.0f), "Possible Mutagens:", TextJustification.MiddleCenter).setColor(5592405);
final int size = AlvearyMutator.getMutagens().size();
final int w = size * 18;
if (size > 0) {
float x = (this.w() - w) / 2.0f;
for (final ItemStack stack : AlvearyMutator.getMutagens()) {
final ControlItemDisplay display = new ControlItemDisplay(this, x, 66.0f);
display.setItemStack(stack);
display.hastooltip = true;
x += 18.0f;
}
new ControlText(this, new IArea(0.0f, 52.0f, w(), 16.0f), "Possible Mutagens:", TextJustification.MiddleCenter).setColor(5592405);
int size = AlvearyMutator.getMutagens().size();
int w = size * 18;
if (size <= 0) {
return;
}
float x = (w() - w) / 2.0f;
for (ItemStack stack : AlvearyMutator.getMutagens()) {
ControlItemDisplay display = new ControlItemDisplay(this, x, 66.0f);
display.setItemStack(stack);
display.hastooltip = true;
x += 18.0f;
}
}