mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-22 13:09:53 +00:00
[ci skip] spotlessApply with the new settings
This commit is contained in:
1 parent
83698cb73c
commit
84c2239244
561 files changed
+8872
-9300
No files matched your search
@@ -5,21 +5,24 @@ import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.*;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.tools.logic.BattlesignLogic;
|
||||
import tconstruct.util.network.SignDataPacket;
|
||||
|
||||
public class BattlesignGui extends GuiScreen {
|
||||
|
||||
private final BattlesignLogic battlesign;
|
||||
|
||||
private float bgColR = 1F;
|
||||
private float bgColG = 1F;
|
||||
private float bgColB = 1F;
|
||||
private static final ResourceLocation background = new ResourceLocation("tinker:textures/gui/battlesignText.png");
|
||||
private final String[] text = {"", "", "", "", ""};
|
||||
private final String[] text = { "", "", "", "", "" };
|
||||
int currentLine = 0;
|
||||
|
||||
public BattlesignGui(BattlesignLogic logic) {
|
||||
@@ -72,19 +75,14 @@ public class BattlesignGui extends GuiScreen {
|
||||
|
||||
float lum = calcLuminance(bgColR, bgColG, bgColB);
|
||||
for (int i = 0; i < text.length; i++) {
|
||||
final EnumChatFormatting chatFormatting = lum >= 35F
|
||||
? EnumChatFormatting.BLACK
|
||||
final EnumChatFormatting chatFormatting = lum >= 35F ? EnumChatFormatting.BLACK
|
||||
: lum >= 31F ? EnumChatFormatting.GRAY : EnumChatFormatting.WHITE;
|
||||
fontRendererObj.drawString(
|
||||
chatFormatting
|
||||
+ (i == currentLine ? "> " : "")
|
||||
chatFormatting + (i == currentLine ? "> " : "")
|
||||
+ text[i]
|
||||
+ (i == currentLine ? " " + EnumChatFormatting.RESET + chatFormatting + "<" : ""),
|
||||
k
|
||||
- fontRendererObj.getStringWidth(
|
||||
(i == currentLine ? "> " : "") + text[i] + (i == currentLine ? " <" : ""))
|
||||
/ 2
|
||||
+ 51,
|
||||
k - fontRendererObj.getStringWidth(
|
||||
(i == currentLine ? "> " : "") + text[i] + (i == currentLine ? " <" : "")) / 2 + 51,
|
||||
l + 4 + 10 * i,
|
||||
0);
|
||||
}
|
||||
@@ -97,8 +95,7 @@ public class BattlesignGui extends GuiScreen {
|
||||
super.keyTyped(c, i);
|
||||
|
||||
if (fontRendererObj.getStringWidth(text[currentLine]) < 90 && ChatAllowedCharacters.isAllowedCharacter(c)) {
|
||||
if (Keyboard.isKeyDown(56)
|
||||
&& c == 'f'
|
||||
if (Keyboard.isKeyDown(56) && c == 'f'
|
||||
&& (text[currentLine].length() == 0
|
||||
|| text[currentLine].charAt(text[currentLine].length() - 1) != '\u00A7')) {
|
||||
text[currentLine] += "\u00A7";
|
||||
@@ -146,12 +143,13 @@ public class BattlesignGui extends GuiScreen {
|
||||
|
||||
Keyboard.enableRepeatEvents(false);
|
||||
|
||||
TConstruct.packetPipeline.sendToServer(new SignDataPacket(
|
||||
battlesign.getWorldObj().provider.dimensionId,
|
||||
battlesign.xCoord,
|
||||
battlesign.yCoord,
|
||||
battlesign.zCoord,
|
||||
text));
|
||||
TConstruct.packetPipeline.sendToServer(
|
||||
new SignDataPacket(
|
||||
battlesign.getWorldObj().provider.dimensionId,
|
||||
battlesign.xCoord,
|
||||
battlesign.yCoord,
|
||||
battlesign.zCoord,
|
||||
text));
|
||||
}
|
||||
|
||||
private float calcLuminance(float r, float g, float b) {
|
||||
|
||||
Reference in new issue
Block a user