mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-20 20:32:24 +00:00
Allow only the diamond chisel to have modes. Fix breaking sounds up more
This commit is contained in:
1 parent
5188e39b57
commit
5b4af2ee49
10 files changed
+81
-43
No files matched your search
@@ -2,12 +2,10 @@ package com.cricketcraft.chisel.client.gui;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import net.minecraft.inventory.Slot;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.cricketcraft.chisel.api.IChiselItem;
|
||||
import com.cricketcraft.chisel.inventory.ContainerChisel;
|
||||
import com.cricketcraft.chisel.inventory.InventoryChiselSelection;
|
||||
import com.cricketcraft.chisel.inventory.SlotChiselInput;
|
||||
@@ -45,24 +46,36 @@ public class GuiChisel extends GuiContainer {
|
||||
super.initGui();
|
||||
currentMode = General.getChiselMode(container.chisel);
|
||||
|
||||
int x = this.width / 2 - 120;
|
||||
int y = this.height / 2 - 6;
|
||||
buttonList.add(new GuiButton(0, x, y, 53, 20, ""));
|
||||
setButtonText();
|
||||
if (showMode()) {
|
||||
int x = this.width / 2 - 120;
|
||||
int y = this.height / 2 - 6;
|
||||
buttonList.add(new GuiButton(0, x, y, 53, 20, ""));
|
||||
setButtonText();
|
||||
}
|
||||
}
|
||||
|
||||
private void setButtonText() {
|
||||
((GuiButton) buttonList.get(0)).displayString = I18n.format(container.inventory.getInventoryName() + ".mode." + currentMode.name().toLowerCase());
|
||||
}
|
||||
|
||||
private boolean showMode() {
|
||||
if (container.chisel != null && container.chisel.getItem() instanceof IChiselItem) {
|
||||
return ((IChiselItem) container.chisel.getItem()).hasModes(container.chisel);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int j, int i) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
String line = I18n.format(this.container.inventory.getInventoryName() + ".title");
|
||||
fontRendererObj.drawSplitString(line, 50 - fontRendererObj.getStringWidth(line) / 2, 60, 40, 0x404040);
|
||||
line = I18n.format(this.container.inventory.getInventoryName() + ".mode");
|
||||
fontRendererObj.drawString(line, fontRendererObj.getStringWidth(line) / 2 + 6, 85, 0x404040);
|
||||
|
||||
if (showMode()) {
|
||||
line = I18n.format(this.container.inventory.getInventoryName() + ".mode");
|
||||
fontRendererObj.drawString(line, fontRendererObj.getStringWidth(line) / 2 + 6, 85, 0x404040);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -186,9 +186,6 @@ public class RenderAutoChisel extends TileEntitySpecialRenderer implements ISimp
|
||||
renderItem.doRender(item, 0, 0, 0, 0, 0);
|
||||
settings.fancyGraphics = was;
|
||||
glPopMatrix();
|
||||
} else {
|
||||
autoChisel.chiselRot = 0;
|
||||
autoChisel.chiseling = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user