mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-20 12:19:47 +00:00
Clean Up
This commit is contained in:
1 parent
49d80c847e
commit
58c36b3c92
16 files changed
+21
-26
No files matched your search
@@ -19,7 +19,7 @@ public class ControlColourOption extends ControlTextOption<IFlowerColour> {
|
||||
this.addAttribute(Attribute.MouseOver);
|
||||
CraftGUIUtil.moveWidget(this.textWidget, new IPoint(22, 0));
|
||||
this.textWidget.setSize(this.textWidget.getSize().sub(new IPoint(24, 0)));
|
||||
final int th = (int) CraftGUI.render.textHeight(this.textWidget.getValue(), this.textWidget.getSize().x());
|
||||
final int th = CraftGUI.render.textHeight(this.textWidget.getValue(), this.textWidget.getSize().x());
|
||||
final int height = Math.max(20, th + 6);
|
||||
this.setSize(new IPoint(this.size().x(), height));
|
||||
this.textWidget.setSize(new IPoint(this.textWidget.getSize().x(), height));
|
||||
|
||||
@@ -25,7 +25,6 @@ import binnie.botany.items.ItemPigment;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.IInitializable;
|
||||
import binnie.core.Mods;
|
||||
import binnie.core.block.ItemMetadata;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.core.item.ItemMisc;
|
||||
import binnie.extratrees.carpentry.ItemDesign;
|
||||
|
||||
@@ -21,8 +21,6 @@ import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import scala.concurrent.OnCompleteRunnable;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -164,7 +162,8 @@ public class ItemFluidContainer extends ItemFood implements IItemModelRegister,
|
||||
return new ActionResult(EnumActionResult.PASS, stack);
|
||||
}
|
||||
|
||||
public float getSaturationModifier(ItemStack stack){
|
||||
@Override
|
||||
public float getSaturationModifier(ItemStack stack){
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ public class ControlTextEdit extends Control implements IControlValue<String> {
|
||||
this.addEventHandler(new EventMouse.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(final EventMouse.Down event) {
|
||||
ControlTextEdit.this.field.mouseClicked((int) ControlTextEdit.this.getRelativeMousePosition().x(), (int) ControlTextEdit.this.getRelativeMousePosition().y(), event.getButton());
|
||||
ControlTextEdit.this.field.mouseClicked(ControlTextEdit.this.getRelativeMousePosition().x(), ControlTextEdit.this.getRelativeMousePosition().y(), event.getButton());
|
||||
}
|
||||
}.setOrigin(EventHandler.Origin.Self, this));
|
||||
this.addEventHandler(new EventWidget.GainFocus.Handler() {
|
||||
@@ -83,8 +83,8 @@ public class ControlTextEdit extends Control implements IControlValue<String> {
|
||||
}
|
||||
|
||||
protected void renderTextField() {
|
||||
this.field.width = (int) this.w();
|
||||
this.field.height = (int) this.h();
|
||||
this.field.width = this.w();
|
||||
this.field.height = this.h();
|
||||
this.field.xPosition = (int) ((this.h() - 8.0f) / 2.0f);
|
||||
this.field.yPosition = (int) ((this.h() - 8.0f) / 2.0f);
|
||||
this.field.drawTextBox();
|
||||
|
||||
@@ -68,7 +68,7 @@ public class ControlList<T> extends Control implements IControlValue<T> {
|
||||
entry.getValue().show();
|
||||
this.optionWidgets.put(entry.getKey(), entry.getValue());
|
||||
entry.getValue().setPosition(new IPoint(0, height));
|
||||
height += (int) entry.getValue().getSize().y();
|
||||
height += entry.getValue().getSize().y();
|
||||
} else {
|
||||
entry.getValue().hide();
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
|
||||
@Override
|
||||
public void drawScreen(final int mouseX, final int mouseY, final float par3) {
|
||||
this.window.setMousePosition(mouseX - (int) this.window.getPosition().x(), mouseY - (int) this.window.getPosition().y());
|
||||
this.window.setMousePosition(mouseX - this.window.getPosition().x(), mouseY - this.window.getPosition().y());
|
||||
this.drawDefaultBackground();
|
||||
GlStateManager.disableRescaleNormal();
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
@@ -110,8 +110,8 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
}
|
||||
|
||||
public void renderTooltip(final IPoint mousePosition, final MinecraftTooltip tooltip) {
|
||||
final int mouseX = (int) mousePosition.x();
|
||||
final int mouseY = (int) mousePosition.y();
|
||||
final int mouseX = mousePosition.x();
|
||||
final int mouseY = mousePosition.y();
|
||||
final FontRenderer font = this.getFontRenderer();
|
||||
GlStateManager.disableRescaleNormal();
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
@@ -270,8 +270,8 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
}
|
||||
|
||||
public void resize(final IPoint size) {
|
||||
this.xSize = (int) size.x();
|
||||
this.ySize = (int) size.y();
|
||||
this.xSize = size.x();
|
||||
this.ySize = size.y();
|
||||
this.guiLeft = (this.width - this.xSize) / 2;
|
||||
this.guiTop = (this.height - this.ySize) / 2;
|
||||
this.window.setPosition(new IPoint(this.guiLeft, this.guiTop));
|
||||
|
||||
@@ -13,7 +13,7 @@ public class ControlPlayerInventory extends Control {
|
||||
private List<ControlSlot> slots;
|
||||
|
||||
public ControlPlayerInventory(final IWidget parent, final boolean wide) {
|
||||
super(parent, (int) (parent.getSize().x() / 2) - (wide ? 110 : 81), (int) parent.getSize().y() - (wide ? 54 : 76) - 12, wide ? 220 : 162, wide ? 54 : 76);
|
||||
super(parent, parent.getSize().x() / 2 - (wide ? 110 : 81), parent.getSize().y() - (wide ? 54 : 76) - 12, wide ? 220 : 162, wide ? 54 : 76);
|
||||
this.slots = new ArrayList<>();
|
||||
for (int row = 0; row < 3; ++row) {
|
||||
for (int column = 0; column < 9; ++column) {
|
||||
|
||||
@@ -41,7 +41,7 @@ public abstract class ControlSlotBase extends Control implements ITooltip {
|
||||
|
||||
@Override
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
final int size = (int) this.getSize().x();
|
||||
final int size = this.getSize().x();
|
||||
CraftGUI.render.texture(CraftGUITexture.Slot, this.getArea());
|
||||
if (this.getSuperParent().getMousedOverWidget() == this) {
|
||||
RenderUtil.drawGradientRect(new IArea(new IPoint(1, 1), this.getArea().size().sub(new IPoint(2, 2))), -2130706433, -2130706433);
|
||||
|
||||
@@ -19,7 +19,7 @@ public class ControlItemStackOption extends ControlTextOption<ItemStack> {
|
||||
this.addAttribute(Attribute.MouseOver);
|
||||
CraftGUIUtil.moveWidget(this.textWidget, new IPoint(22, 0));
|
||||
this.textWidget.setSize(this.textWidget.getSize().sub(new IPoint(24, 0)));
|
||||
final int th = (int) CraftGUI.render.textHeight(this.textWidget.getValue(), this.textWidget.getSize().x());
|
||||
final int th = CraftGUI.render.textHeight(this.textWidget.getValue(), this.textWidget.getSize().x());
|
||||
final int height = Math.max(20, th + 6);
|
||||
this.setSize(new IPoint(this.size().x(), height));
|
||||
this.textWidget.setSize(new IPoint(this.textWidget.getSize().x(), height));
|
||||
|
||||
@@ -24,7 +24,7 @@ class ControlSpeciexBoxOption extends ControlTextOption<IAlleleSpecies> {
|
||||
}
|
||||
CraftGUIUtil.moveWidget(this.textWidget, new IPoint(22, 0));
|
||||
this.textWidget.setSize(this.textWidget.getSize().sub(new IPoint(24, 0)));
|
||||
final int th = (int) CraftGUI.render.textHeight(this.textWidget.getValue(), this.textWidget.getSize().x());
|
||||
final int th = CraftGUI.render.textHeight(this.textWidget.getValue(), this.textWidget.getSize().x());
|
||||
final int height = Math.max(20, th + 6);
|
||||
this.setSize(new IPoint(this.size().x(), height));
|
||||
this.textWidget.setSize(new IPoint(this.textWidget.getSize().x(), height));
|
||||
|
||||
@@ -3,7 +3,6 @@ package binnie.extratrees.block;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import binnie.Constants;
|
||||
import forestry.api.arboriculture.EnumForestryWoodType;
|
||||
import forestry.api.arboriculture.IWoodType;
|
||||
import forestry.api.arboriculture.TreeManager;
|
||||
import forestry.api.arboriculture.WoodBlockKind;
|
||||
|
||||
-1
@@ -2,7 +2,6 @@ package binnie.extratrees.integration.jei.lumbermill;
|
||||
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.item.ExtraTreeItems;
|
||||
import binnie.extratrees.item.ModuleItems;
|
||||
import binnie.extratrees.machines.lumbermill.LumbermillLogic;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
|
||||
@@ -38,7 +38,7 @@ public class ControlSlotFluid extends Control implements ITooltip {
|
||||
|
||||
@Override
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
final int size = (int) this.getSize().x();
|
||||
final int size = this.getSize().x();
|
||||
CraftGUI.render.texture(CraftGUITexture.Slot, this.getArea());
|
||||
if (this.getSuperParent().getMousedOverWidget() == this) {
|
||||
RenderUtil.drawGradientRect(new IArea(new IPoint(1, 1), this.getArea().size().sub(new IPoint(2, 2))), -2130706433, -2130706433);
|
||||
|
||||
@@ -4,7 +4,6 @@ import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.power.ComponentProcessSetCost;
|
||||
import binnie.core.machines.power.ErrorState;
|
||||
import binnie.core.machines.power.IProcess;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.item.ExtraTreeItems;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
|
||||
@@ -38,8 +38,8 @@ public class AnalystPageBehaviour extends ControlAnalystPage {
|
||||
final String effectDesc = BinnieCore.proxy.localiseOrBlank("allele." + effect.getUID() + ".desc");
|
||||
final String loc = effectDesc.equals("") ? ("Effect: " + effect.getName()) : effectDesc;
|
||||
new ControlText(this, new IArea(4, y, this.w() - 8, 0), loc, TextJustification.TopCenter).setColour(this.getColour());
|
||||
y += (int) (CraftGUI.render.textHeight(loc, this.w() - 8) + 1);
|
||||
new ControlTextCentered(this, y, "§oWithin " + (int) (t.getX() / 2) + " blocks").setColour(this.getColour());
|
||||
y += CraftGUI.render.textHeight(loc, this.w() - 8) + 1;
|
||||
new ControlTextCentered(this, y, "§oWithin " + t.getX() / 2 + " blocks").setColour(this.getColour());
|
||||
y += 22;
|
||||
}
|
||||
new ControlTextCentered(this, y, "Territory: §o" + t.getX() + "x" + t.getY() + "x" + t.getZ()).setColour(this.getColour());
|
||||
@@ -58,7 +58,7 @@ public class AnalystPageBehaviour extends ControlAnalystPage {
|
||||
final String effectDesc2 = BinnieCore.proxy.localiseOrBlank("allele." + effect2.getUID() + ".desc");
|
||||
final String loc2 = effectDesc2.equals("") ? ("Effect: " + effect2.getName()) : effectDesc2;
|
||||
new ControlText(this, new IArea(4, y, this.w() - 8, 0), loc2, TextJustification.TopCenter).setColour(this.getColour());
|
||||
y += (int) (CraftGUI.render.textHeight(loc2, this.w() - 8) + 1);
|
||||
y += CraftGUI.render.textHeight(loc2, this.w() - 8) + 1;
|
||||
y += 22;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public abstract class ControlToleranceBar<T extends Enum<T>> extends Control imp
|
||||
@Override
|
||||
public void getTooltip(final Tooltip list) {
|
||||
final int types = this.fullSet.size();
|
||||
final int type = (int) ((int) this.getRelativeMousePosition().x() / (this.getSize().x() / types));
|
||||
final int type = this.getRelativeMousePosition().x() / (this.getSize().x() / types);
|
||||
for (final T tol : this.fullSet) {
|
||||
if (tol.ordinal() - ((this.enumClass == EnumTemperature.class) ? 1 : 0) == type) {
|
||||
list.add((this.tolerated.contains(tol) ? "" : TextFormatting.DARK_GRAY) + this.getName(tol));
|
||||
|
||||
Reference in new issue
Block a user