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

@@ -1,7 +1,11 @@
package binnie.craftgui.minecraft.control;
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.IArea;
import binnie.craftgui.core.geometry.IPoint;
import binnie.craftgui.events.EventWidget;
@@ -10,53 +14,53 @@ import binnie.craftgui.resource.minecraft.CraftGUITexture;
import net.minecraft.item.ItemStack;
public abstract class ControlSlotBase extends Control implements ITooltip {
private ControlItemDisplay itemDisplay;
private ControlItemDisplay itemDisplay;
public ControlSlotBase(final IWidget parent, final float x, final float y) {
this(parent, x, y, 18);
}
public ControlSlotBase(final IWidget parent, final float x, final float y) {
this(parent, x, y, 18);
}
public ControlSlotBase(final IWidget parent, final float x, final float y, final int size) {
super(parent, x, y, size, size);
this.addAttribute(Attribute.MouseOver);
this.itemDisplay = new ControlItemDisplay(this, 1.0f, 1.0f, size - 2);
this.addSelfEventHandler(new EventWidget.ChangeSize.Handler() {
@Override
public void onEvent(final EventWidget.ChangeSize event) {
if (ControlSlotBase.this.itemDisplay != null) {
ControlSlotBase.this.itemDisplay.setSize(ControlSlotBase.this.getSize().sub(new IPoint(2.0f, 2.0f)));
}
}
});
}
public ControlSlotBase(final IWidget parent, final float x, final float y, final int size) {
super(parent, x, y, size, size);
this.addAttribute(Attribute.MouseOver);
this.itemDisplay = new ControlItemDisplay(this, 1.0f, 1.0f, size - 2);
this.addSelfEventHandler(new EventWidget.ChangeSize.Handler() {
@Override
public void onEvent(final EventWidget.ChangeSize event) {
if (ControlSlotBase.this.itemDisplay != null) {
ControlSlotBase.this.itemDisplay.setSize(ControlSlotBase.this.getSize().sub(new IPoint(2.0f, 2.0f)));
}
}
});
}
protected void setRotating() {
this.itemDisplay.setRotating();
}
protected void setRotating() {
this.itemDisplay.setRotating();
}
@Override
public void onRenderBackground() {
final int size = (int) this.getSize().x();
CraftGUI.Render.texture(CraftGUITexture.Slot, this.getArea());
if (this.getSuperParent().getMousedOverWidget() == this) {
CraftGUI.Render.gradientRect(new IArea(new IPoint(1.0f, 1.0f), this.getArea().size().sub(new IPoint(2.0f, 2.0f))), -2130706433, -2130706433);
}
}
@Override
public void onRenderBackground() {
final int size = (int) this.getSize().x();
CraftGUI.Render.texture(CraftGUITexture.Slot, this.getArea());
if (this.getSuperParent().getMousedOverWidget() == this) {
CraftGUI.Render.gradientRect(new IArea(new IPoint(1.0f, 1.0f), this.getArea().size().sub(new IPoint(2.0f, 2.0f))), -2130706433, -2130706433);
}
}
@Override
public void onUpdateClient() {
super.onUpdateClient();
this.itemDisplay.setItemStack(this.getItemStack());
}
@Override
public void onUpdateClient() {
super.onUpdateClient();
this.itemDisplay.setItemStack(this.getItemStack());
}
@Override
public void getTooltip(final Tooltip tooltip) {
final ItemStack item = this.getItemStack();
if (item == null) {
return;
}
tooltip.add(item.getTooltip(((Window) this.getSuperParent()).getPlayer(), false));
}
@Override
public void getTooltip(final Tooltip tooltip) {
final ItemStack item = this.getItemStack();
if (item == null) {
return;
}
tooltip.add(item.getTooltip(((Window) this.getSuperParent()).getPlayer(), false));
}
public abstract ItemStack getItemStack();
public abstract ItemStack getItemStack();
}