mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-28 02:05:39 +00:00
Proper Reformating
This commit is contained in:
1 parent
ce75880aba
commit
180d257024
1179 files changed
+59847
-61583
No files matched your search
@@ -15,87 +15,82 @@ import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.RoleFollower;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class GuiNpcFollowerHire extends GuiContainerNPCInterface
|
||||
{
|
||||
private final ResourceLocation resource = new ResourceLocation("customnpcs","textures/gui/followerhire.png");
|
||||
private EntityNPCInterface npc;
|
||||
private ContainerNPCFollowerHire container;
|
||||
private RoleFollower role;
|
||||
public GuiNpcFollowerHire(EntityNPCInterface npc,ContainerNPCFollowerHire container)
|
||||
{
|
||||
public class GuiNpcFollowerHire extends GuiContainerNPCInterface {
|
||||
private final ResourceLocation resource = new ResourceLocation("customnpcs", "textures/gui/followerhire.png");
|
||||
private EntityNPCInterface npc;
|
||||
private ContainerNPCFollowerHire container;
|
||||
private RoleFollower role;
|
||||
|
||||
public GuiNpcFollowerHire(EntityNPCInterface npc, ContainerNPCFollowerHire container) {
|
||||
super(npc, container);
|
||||
this.container = container;
|
||||
this.npc = npc;
|
||||
role = (RoleFollower) npc.roleInterface;
|
||||
closeOnEsc = true;
|
||||
}
|
||||
public void initGui()
|
||||
{
|
||||
super.initGui();
|
||||
addButton(new GuiNpcButton(5, guiLeft + 26, guiTop+ 60, 50, 20, StatCollector.translateToLocal("follower.hire")));
|
||||
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
addButton(new GuiNpcButton(5, guiLeft + 26, guiTop + 60, 50, 20, StatCollector.translateToLocal("follower.hire")));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(GuiButton guibutton)
|
||||
{
|
||||
super.actionPerformed(guibutton);
|
||||
if(guibutton.id == 5)
|
||||
{
|
||||
public void actionPerformed(GuiButton guibutton) {
|
||||
super.actionPerformed(guibutton);
|
||||
if (guibutton.id == 5) {
|
||||
PacketClient.sendClient(new FollowerPacket(FollowerPacket.Action.Hire));
|
||||
close();
|
||||
close();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||
{
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
|
||||
//fontRenderer.drawString("Inventory", 8, (ySize - 96) + 2, 0x404040);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float f, int i, int j)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
mc.renderEngine.bindTexture(resource);
|
||||
int l = (width - xSize) / 2;
|
||||
int i1 = (height - ySize) / 2;
|
||||
drawTexturedModalRect(l, i1, 0, 0, xSize, ySize);
|
||||
int index = 0;
|
||||
for(int id : role.inventory.items.keySet()){
|
||||
ItemStack itemstack = role.inventory.items.get(id);
|
||||
if(itemstack == null)
|
||||
continue;
|
||||
int days = 1;
|
||||
if(role.rates.containsKey(id))
|
||||
days = role.rates.get(id);
|
||||
int index = 0;
|
||||
for (int id : role.inventory.items.keySet()) {
|
||||
ItemStack itemstack = role.inventory.items.get(id);
|
||||
if (itemstack == null)
|
||||
continue;
|
||||
int days = 1;
|
||||
if (role.rates.containsKey(id))
|
||||
days = role.rates.get(id);
|
||||
|
||||
|
||||
int yOffset = index * 26;
|
||||
int yOffset = index * 26;
|
||||
|
||||
int x = guiLeft + 78;
|
||||
int y = guiTop + yOffset + 10;
|
||||
int x = guiLeft + 78;
|
||||
int y = guiTop + yOffset + 10;
|
||||
GL11.glEnable(32826 /*GL_RESCALE_NORMAL_EXT*/);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
itemRender.renderItemIntoGUI(fontRendererObj, mc.renderEngine, itemstack, x + 11,y);
|
||||
itemRender.renderItemOverlayIntoGUI(fontRendererObj, mc.renderEngine, itemstack, x+11,y);
|
||||
itemRender.renderItemIntoGUI(fontRendererObj, mc.renderEngine, itemstack, x + 11, y);
|
||||
itemRender.renderItemOverlayIntoGUI(fontRendererObj, mc.renderEngine, itemstack, x + 11, y);
|
||||
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glDisable(32826 /*GL_RESCALE_NORMAL_EXT*/);
|
||||
|
||||
String daysS = days + " " + ((days == 1)?StatCollector.translateToLocal("follower.day"):StatCollector.translateToLocal("follower.days"));
|
||||
fontRendererObj.drawString(" = "+daysS, x + 27, y + 4, CustomNpcResourceListener.DefaultTextColor);
|
||||
//fontRenderer.drawString(quantity, x + 0 + (12-fontRenderer.getStringWidth(quantity))/2, y + 4, 0x404040);
|
||||
String daysS = days + " " + ((days == 1) ? StatCollector.translateToLocal("follower.day") : StatCollector.translateToLocal("follower.days"));
|
||||
fontRendererObj.drawString(" = " + daysS, x + 27, y + 4, CustomNpcResourceListener.DefaultTextColor);
|
||||
//fontRenderer.drawString(quantity, x + 0 + (12-fontRenderer.getStringWidth(quantity))/2, y + 4, 0x404040);
|
||||
|
||||
if (this.func_146978_c(x - guiLeft + 11, y - guiTop, 16, 16, mouseX, mouseY))
|
||||
{
|
||||
this.renderToolTip(itemstack, mouseX, mouseY);
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if (this.func_146978_c(x - guiLeft + 11, y - guiTop, 16, 16, mouseX, mouseY)) {
|
||||
this.renderToolTip(itemstack, mouseX, mouseY);
|
||||
}
|
||||
index++;
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public void save() {
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save() {
|
||||
return;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user