mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-21 04:32:24 +00:00
Update buildscript & spotlessApply
This commit is contained in:
1 parent
e4329e2b8f
commit
8683a345c3
818 files changed
+51123
-49403
No files matched your search
@@ -18,59 +18,71 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
public class PagePlanksOverview extends PageAbstract<ItemStack> {
|
||||
public PagePlanksOverview(IWidget parent, DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
}
|
||||
public PagePlanksOverview(IWidget parent, DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(ItemStack species) {
|
||||
deleteAllChildren();
|
||||
new ControlText(this, new IArea(0.0f, 0.0f, size().x(), 24.0f), species.getDisplayName(), TextJustification.MIDDLE_CENTER);
|
||||
new ControlText(this, new IArea(12.0f, 24.0f, size().x() - 24.0f, 24.0f), I18N.localise("extratrees.gui.database.planks.use"), TextJustification.MIDDLE_LEFT);
|
||||
IPlankType type = WoodManager.get(species);
|
||||
int x = 12;
|
||||
if (type != null) {
|
||||
ItemStack fence = WoodManager.getFence(type, new FenceType(0), 1);
|
||||
ItemStack gate = WoodManager.getGate(type);
|
||||
ItemStack door = WoodManager.getDoor(type, DoorType.STANDARD);
|
||||
if (fence != null) {
|
||||
new ControlItemDisplay(this, x, 48.0f).setItemStack(fence);
|
||||
x += 22;
|
||||
}
|
||||
if (gate != null) {
|
||||
new ControlItemDisplay(this, x, 48.0f).setItemStack(gate);
|
||||
x += 22;
|
||||
}
|
||||
if (door != null) {
|
||||
new ControlItemDisplay(this, x, 48.0f).setItemStack(door);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onValueChanged(ItemStack species) {
|
||||
deleteAllChildren();
|
||||
new ControlText(
|
||||
this,
|
||||
new IArea(0.0f, 0.0f, size().x(), 24.0f),
|
||||
species.getDisplayName(),
|
||||
TextJustification.MIDDLE_CENTER);
|
||||
new ControlText(
|
||||
this,
|
||||
new IArea(12.0f, 24.0f, size().x() - 24.0f, 24.0f),
|
||||
I18N.localise("extratrees.gui.database.planks.use"),
|
||||
TextJustification.MIDDLE_LEFT);
|
||||
IPlankType type = WoodManager.get(species);
|
||||
int x = 12;
|
||||
if (type != null) {
|
||||
ItemStack fence = WoodManager.getFence(type, new FenceType(0), 1);
|
||||
ItemStack gate = WoodManager.getGate(type);
|
||||
ItemStack door = WoodManager.getDoor(type, DoorType.STANDARD);
|
||||
if (fence != null) {
|
||||
new ControlItemDisplay(this, x, 48.0f).setItemStack(fence);
|
||||
x += 22;
|
||||
}
|
||||
if (gate != null) {
|
||||
new ControlItemDisplay(this, x, 48.0f).setItemStack(gate);
|
||||
x += 22;
|
||||
}
|
||||
if (door != null) {
|
||||
new ControlItemDisplay(this, x, 48.0f).setItemStack(door);
|
||||
}
|
||||
}
|
||||
|
||||
ControlText controlDescription = new ControlText(this, new IArea(8.0f, 84.0f, getSize().x() - 16.0f, 0.0f), "", TextJustification.MIDDLE_CENTER);
|
||||
ControlText controlSignature = new ControlText(this, new IArea(8.0f, 84.0f, getSize().x() - 16.0f, 0.0f), "", TextJustification.BOTTOM_RIGHT);
|
||||
String desc = "";
|
||||
if (type != null) {
|
||||
desc = type.getDescription();
|
||||
}
|
||||
ControlText controlDescription = new ControlText(
|
||||
this, new IArea(8.0f, 84.0f, getSize().x() - 16.0f, 0.0f), "", TextJustification.MIDDLE_CENTER);
|
||||
ControlText controlSignature = new ControlText(
|
||||
this, new IArea(8.0f, 84.0f, getSize().x() - 16.0f, 0.0f), "", TextJustification.BOTTOM_RIGHT);
|
||||
String desc = "";
|
||||
if (type != null) {
|
||||
desc = type.getDescription();
|
||||
}
|
||||
|
||||
String descBody = EnumChatFormatting.ITALIC.toString();
|
||||
String descSig = "";
|
||||
if (desc == null || desc.isEmpty() || desc.matches("(\\w+\\.?)+")) {
|
||||
descBody += I18N.localise("binniecore.gui.database.nodescription");
|
||||
} else {
|
||||
String[] descStrings = desc.split("\\|");
|
||||
descBody += descStrings[0];
|
||||
for (int i = 1; i < descStrings.length - 1; ++i) {
|
||||
descBody = descBody + " " + descStrings[i];
|
||||
}
|
||||
if (descStrings.length > 1) {
|
||||
descSig += descStrings[descStrings.length - 1];
|
||||
}
|
||||
}
|
||||
String descBody = EnumChatFormatting.ITALIC.toString();
|
||||
String descSig = "";
|
||||
if (desc == null || desc.isEmpty() || desc.matches("(\\w+\\.?)+")) {
|
||||
descBody += I18N.localise("binniecore.gui.database.nodescription");
|
||||
} else {
|
||||
String[] descStrings = desc.split("\\|");
|
||||
descBody += descStrings[0];
|
||||
for (int i = 1; i < descStrings.length - 1; ++i) {
|
||||
descBody = descBody + " " + descStrings[i];
|
||||
}
|
||||
if (descStrings.length > 1) {
|
||||
descSig += descStrings[descStrings.length - 1];
|
||||
}
|
||||
}
|
||||
|
||||
controlDescription.setValue(descBody + EnumChatFormatting.RESET);
|
||||
controlSignature.setValue(descSig + EnumChatFormatting.RESET);
|
||||
float descHeight = CraftGUI.render.textHeight(controlDescription.getValue(), controlDescription.getSize().x());
|
||||
controlSignature.setPosition(new IPoint(controlSignature.pos().x(), controlDescription.getPosition().y() + descHeight + 10.0f));
|
||||
}
|
||||
controlDescription.setValue(descBody + EnumChatFormatting.RESET);
|
||||
controlSignature.setValue(descSig + EnumChatFormatting.RESET);
|
||||
float descHeight = CraftGUI.render.textHeight(
|
||||
controlDescription.getValue(), controlDescription.getSize().x());
|
||||
controlSignature.setPosition(new IPoint(
|
||||
controlSignature.pos().x(), controlDescription.getPosition().y() + descHeight + 10.0f));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user