mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-22 13:09:47 +00:00
Improve code readability in binnie.genetics package
Drop unused (empty) method MachinePackage#register() from all classes
This commit is contained in:
1 parent
856f08b752
commit
730043ba9c
112 files changed
+4354
-4697
No files matched your search
@@ -1,7 +1,3 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.genetics.craftgui;
|
||||
|
||||
import binnie.core.craftgui.IWidget;
|
||||
@@ -18,47 +14,51 @@ import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class ControlSequencerProgress extends ControlProgressBase
|
||||
{
|
||||
ControlText textControl;
|
||||
public class ControlSequencerProgress extends ControlProgressBase {
|
||||
protected ControlText textControl;
|
||||
|
||||
public ControlSequencerProgress(final IWidget parent, final int x, final int y) {
|
||||
public ControlSequencerProgress(IWidget parent, int x, int y) {
|
||||
super(parent, x, y, 100.0f, 52.0f);
|
||||
final Panel panel = new Panel(this, 0.0f, 0.0f, 100.0f, 52.0f, MinecraftGUI.PanelType.Gray);
|
||||
this.textControl = new ControlText(panel, new IArea(4.0f, 4.0f, 92.0f, 44.0f), "", TextJustification.MiddleCenter);
|
||||
Panel panel = new Panel(this, 0.0f, 0.0f, 100.0f, 52.0f, MinecraftGUI.PanelType.Gray);
|
||||
textControl = new ControlText(panel, new IArea(4.0f, 4.0f, 92.0f, 44.0f), "", TextJustification.MiddleCenter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateClient() {
|
||||
super.onUpdateClient();
|
||||
final ItemStack stack = Machine.getMachine(Window.get(this).getInventory()).getMachineUtil().getStack(5);
|
||||
ItemStack stack = Machine.getMachine(Window.get(this).getInventory()).getMachineUtil().getStack(5);
|
||||
if (stack == null) {
|
||||
this.textControl.setValue("");
|
||||
textControl.setValue("");
|
||||
return;
|
||||
}
|
||||
else {
|
||||
final Random rand = new Random(stack.getDisplayName().length());
|
||||
String text = "";
|
||||
final String[] codes = { "A", "T", "G", "C" };
|
||||
EnumChatFormatting[] colors = {
|
||||
EnumChatFormatting.GREEN,
|
||||
EnumChatFormatting.LIGHT_PURPLE,
|
||||
EnumChatFormatting.AQUA,
|
||||
EnumChatFormatting.RED
|
||||
};
|
||||
|
||||
for (int i = 0; i < 65; ++i) {
|
||||
final int k = rand.nextInt(4);
|
||||
final String code = codes[k];
|
||||
if (rand.nextFloat() < this.progress) {
|
||||
String col = colors[k].toString();
|
||||
text = text + EnumChatFormatting.RESET + col + EnumChatFormatting.BOLD + code;
|
||||
}
|
||||
else {
|
||||
text = text + EnumChatFormatting.RESET + EnumChatFormatting.GRAY
|
||||
+ EnumChatFormatting.OBFUSCATED + EnumChatFormatting.BOLD + code;
|
||||
}
|
||||
Random rand = new Random(stack.getDisplayName().length());
|
||||
StringBuilder text = new StringBuilder();
|
||||
String[] codes = {"A", "T", "G", "C"};
|
||||
EnumChatFormatting[] colors = {
|
||||
EnumChatFormatting.GREEN,
|
||||
EnumChatFormatting.LIGHT_PURPLE,
|
||||
EnumChatFormatting.AQUA,
|
||||
EnumChatFormatting.RED
|
||||
};
|
||||
|
||||
for (int i = 0; i < 65; ++i) {
|
||||
int k = rand.nextInt(4);
|
||||
String code = codes[k];
|
||||
if (rand.nextFloat() < progress) {
|
||||
String col = colors[k].toString();
|
||||
text.append(EnumChatFormatting.RESET)
|
||||
.append(col)
|
||||
.append(EnumChatFormatting.BOLD)
|
||||
.append(code);
|
||||
} else {
|
||||
text.append(EnumChatFormatting.RESET)
|
||||
.append(EnumChatFormatting.GRAY)
|
||||
.append(EnumChatFormatting.OBFUSCATED)
|
||||
.append(EnumChatFormatting.BOLD)
|
||||
.append(code);
|
||||
}
|
||||
this.textControl.setValue(text);
|
||||
}
|
||||
textControl.setValue(text.toString());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user