Auto-format spaces to tabs (#2)

This commit is contained in:
mezz committed 2016-10-27 02:49:49 -07:00
1 parent 25be7fd254
commit 5bb4b5d9a5
756 files changed
+49198 -48489

No files matched your search

@@ -2,7 +2,11 @@ package binnie.craftgui.minecraft.control;
import binnie.core.machines.power.ErrorState;
import binnie.craftgui.controls.core.Control;
import binnie.craftgui.core.*;
import binnie.craftgui.core.Attribute;
import binnie.craftgui.core.CraftGUI;
import binnie.craftgui.core.ITooltip;
import binnie.craftgui.core.IWidget;
import binnie.craftgui.core.Tooltip;
import binnie.craftgui.core.geometry.IPoint;
import binnie.craftgui.minecraft.CustomSlot;
import binnie.craftgui.minecraft.MinecraftTooltip;
@@ -11,84 +15,84 @@ import binnie.craftgui.resource.minecraft.CraftGUITexture;
import net.minecraft.entity.player.InventoryPlayer;
public class ControlErrorState extends Control implements ITooltip {
private ErrorState errorState;
private int type;
private ErrorState errorState;
private int type;
@Override
public void onRenderBackground() {
Object texture = CraftGUITexture.StateWarning;
if (this.errorState == null) {
texture = CraftGUITexture.StateNone;
} else if (this.type == 0) {
texture = CraftGUITexture.StateError;
}
CraftGUI.Render.texture(texture, IPoint.ZERO);
super.onRenderBackground();
}
@Override
public void onRenderBackground() {
Object texture = CraftGUITexture.StateWarning;
if (this.errorState == null) {
texture = CraftGUITexture.StateNone;
} else if (this.type == 0) {
texture = CraftGUITexture.StateError;
}
CraftGUI.Render.texture(texture, IPoint.ZERO);
super.onRenderBackground();
}
public ErrorState getError() {
return Window.get(this).getContainer().getErrorState();
}
public ErrorState getError() {
return Window.get(this).getContainer().getErrorState();
}
@Override
public final void onUpdateClient() {
this.errorState = this.getError();
this.type = Window.get(this).getContainer().getErrorType();
ControlSlot.highlighting.get(EnumHighlighting.Error).clear();
ControlSlot.highlighting.get(EnumHighlighting.Warning).clear();
ControlLiquidTank.tankError.clear();
ControlEnergyBar.isError = false;
if (!this.isMouseOver() || this.errorState == null) {
return;
}
ControlEnergyBar.isError = this.errorState.isPowerError();
if (this.errorState.isItemError()) {
for (final int slot : this.errorState.getData()) {
int id = -1;
for (final CustomSlot cslot : Window.get(this).getContainer().getCustomSlots()) {
if (!(cslot.inventory instanceof InventoryPlayer) && cslot.getSlotIndex() == slot) {
id = cslot.slotNumber;
}
}
if (id >= 0) {
if (this.type == 0) {
ControlSlot.highlighting.get(EnumHighlighting.Error).add(id);
} else {
ControlSlot.highlighting.get(EnumHighlighting.Warning).add(id);
}
}
}
}
if (this.errorState.isTankError()) {
for (final int slot : this.errorState.getData()) {
ControlLiquidTank.tankError.add(slot);
}
}
}
@Override
public final void onUpdateClient() {
this.errorState = this.getError();
this.type = Window.get(this).getContainer().getErrorType();
ControlSlot.highlighting.get(EnumHighlighting.Error).clear();
ControlSlot.highlighting.get(EnumHighlighting.Warning).clear();
ControlLiquidTank.tankError.clear();
ControlEnergyBar.isError = false;
if (!this.isMouseOver() || this.errorState == null) {
return;
}
ControlEnergyBar.isError = this.errorState.isPowerError();
if (this.errorState.isItemError()) {
for (final int slot : this.errorState.getData()) {
int id = -1;
for (final CustomSlot cslot : Window.get(this).getContainer().getCustomSlots()) {
if (!(cslot.inventory instanceof InventoryPlayer) && cslot.getSlotIndex() == slot) {
id = cslot.slotNumber;
}
}
if (id >= 0) {
if (this.type == 0) {
ControlSlot.highlighting.get(EnumHighlighting.Error).add(id);
} else {
ControlSlot.highlighting.get(EnumHighlighting.Warning).add(id);
}
}
}
}
if (this.errorState.isTankError()) {
for (final int slot : this.errorState.getData()) {
ControlLiquidTank.tankError.add(slot);
}
}
}
public ControlErrorState(final IWidget parent, final float x, final float y) {
super(parent, x, y, 16.0f, 16.0f);
this.type = 0;
this.addAttribute(Attribute.MouseOver);
}
public ControlErrorState(final IWidget parent, final float x, final float y) {
super(parent, x, y, 16.0f, 16.0f);
this.type = 0;
this.addAttribute(Attribute.MouseOver);
}
@Override
public void getTooltip(final Tooltip tooltipOrig) {
final MinecraftTooltip tooltip = (MinecraftTooltip) tooltipOrig;
if (this.errorState != null) {
if (this.type == 0) {
tooltip.setType(MinecraftTooltip.Type.Error);
} else {
tooltip.setType(MinecraftTooltip.Type.Warning);
}
tooltip.add(this.errorState.toString());
if (this.errorState.getTooltip().length() > 0) {
tooltip.add(this.errorState.getTooltip());
}
}
}
@Override
public void getTooltip(final Tooltip tooltipOrig) {
final MinecraftTooltip tooltip = (MinecraftTooltip) tooltipOrig;
if (this.errorState != null) {
if (this.type == 0) {
tooltip.setType(MinecraftTooltip.Type.Error);
} else {
tooltip.setType(MinecraftTooltip.Type.Warning);
}
tooltip.add(this.errorState.toString());
if (this.errorState.getTooltip().length() > 0) {
tooltip.add(this.errorState.getTooltip());
}
}
}
public ErrorState getErrorState() {
return this.errorState;
}
public ErrorState getErrorState() {
return this.errorState;
}
}