Fixed Teleposers
This commit is contained in:
parent
c36f752612
commit
da9866ac8f
15 changed files with 78 additions and 116 deletions
|
@ -23,7 +23,6 @@ public class TECrucible extends TEInventory
|
|||
public int ticksRemaining = 0;
|
||||
public int minValue = 0;
|
||||
public int maxValue = 0;
|
||||
public float incrementValue = 0;
|
||||
|
||||
public int state = 0; //0 is when it gives off gray particles, 1 is when it gives off white particles (player can't use this incense anymore), 2 is the normal colour of the incense, 3 means no particles (it is out)
|
||||
|
||||
|
@ -60,8 +59,6 @@ public class TECrucible extends TEInventory
|
|||
minValue = incense.getMinLevel(stack);
|
||||
maxValue = incense.getMaxLevel(stack);
|
||||
|
||||
incrementValue = incense.getTickRate(stack);
|
||||
|
||||
stack.stackSize--;
|
||||
if(stack.stackSize <= 0)
|
||||
{
|
||||
|
@ -81,7 +78,7 @@ public class TECrucible extends TEInventory
|
|||
|
||||
for(EntityPlayer player : playerList)
|
||||
{
|
||||
if(ticksRemaining > 0 && PlayerSacrificeHandler.incrementIncense(player, minValue, maxValue, incrementValue))
|
||||
if(ticksRemaining > 0 && PlayerSacrificeHandler.incrementIncense(player, minValue, maxValue))
|
||||
{
|
||||
ticksRemaining--;
|
||||
if(state != 2)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package WayofTime.alchemicalWizardry.common.tileEntity.container;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.items.TelepositionFocus;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
@ -14,7 +15,7 @@ public class ContainerTeleposer extends Container
|
|||
public ContainerTeleposer(InventoryPlayer inventoryPlayer, TETeleposer te)
|
||||
{
|
||||
tileEntity = te;
|
||||
addSlotToContainer(new Slot(tileEntity, 0, 80, 67));
|
||||
addSlotToContainer(new Slot(tileEntity, 0, 80, 15));
|
||||
bindPlayerInventory(inventoryPlayer);
|
||||
}
|
||||
|
||||
|
@ -30,13 +31,13 @@ public class ContainerTeleposer extends Container
|
|||
{
|
||||
for (int j = 0; j < 9; j++)
|
||||
{
|
||||
addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 140 + i * 18));
|
||||
addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 39 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 9; i++)
|
||||
{
|
||||
addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 198));
|
||||
addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 97));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,30 +46,27 @@ public class ContainerTeleposer extends Container
|
|||
{
|
||||
ItemStack stack = null;
|
||||
Slot slotObject = (Slot) inventorySlots.get(slot);
|
||||
int slots = inventorySlots.size();
|
||||
|
||||
if (slotObject != null && slotObject.getHasStack())
|
||||
{
|
||||
ItemStack stackInSlot = slotObject.getStack();
|
||||
stack = stackInSlot.copy();
|
||||
System.out.println("Slots: " + slots);
|
||||
|
||||
if (slot == 7)
|
||||
if (stack.getItem() instanceof TelepositionFocus)
|
||||
{
|
||||
if (!this.mergeItemStack(stackInSlot, 7, 35, true))
|
||||
if (slot <= slots)
|
||||
{
|
||||
if (!this.mergeItemStack(stackInSlot, 0, slots, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (!this.mergeItemStack(stackInSlot, slots, 36 + slots, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
slotObject.onSlotChange(stackInSlot, stack);
|
||||
}
|
||||
if (slot < 1)
|
||||
{
|
||||
if (!this.mergeItemStack(stackInSlot, 7, 35, true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (!this.mergeItemStack(stackInSlot, 0, 0, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (stackInSlot.stackSize == 0)
|
||||
|
|
|
@ -62,13 +62,15 @@ public class ContainerWritingTable extends Container
|
|||
{
|
||||
return null;
|
||||
}
|
||||
} else if (stack.getItem() instanceof IBloodOrb)
|
||||
}
|
||||
else if (stack.getItem() instanceof IBloodOrb)
|
||||
{
|
||||
if (!this.mergeItemStack(stackInSlot, 0, 1, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
} else if (!this.mergeItemStack(stackInSlot, 1, 6, false))
|
||||
}
|
||||
else if (!this.mergeItemStack(stackInSlot, 1, 6, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -15,16 +15,16 @@ public class GuiTeleposer extends GuiContainer
|
|||
{
|
||||
super(new ContainerTeleposer(inventoryPlayer, tileEntity));
|
||||
xSize = 176;
|
||||
ySize = 222;
|
||||
ySize = 121;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int param1, int param2)
|
||||
{
|
||||
//the parameters for drawString are: string, x, y, color
|
||||
fontRendererObj.drawString("Teleposer", 8, 6, 4210752);
|
||||
fontRendererObj.drawString("Teleposer", 64, 5, 4210752);
|
||||
//draws "Inventory" or your regional equivalent
|
||||
fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, 130, 4210752);
|
||||
fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, 29, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -37,6 +37,5 @@ public class GuiTeleposer extends GuiContainer
|
|||
int x = (width - xSize) / 2;
|
||||
int y = (height - ySize) / 2;
|
||||
this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
|
||||
GuiBrewingStand d;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue