mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-17 19:15:13 +00:00
Update buildscript & apply automatic formatting rules
This commit is contained in:
1 parent
a7683b885d
commit
e1dc20499c
173 files changed
+4581
-5321
No files matched your search
@@ -7,10 +7,8 @@ import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerRecipe extends Container
|
||||
{
|
||||
private class RecipeInventory implements IInventory
|
||||
{
|
||||
public class ContainerRecipe extends Container {
|
||||
private class RecipeInventory implements IInventory {
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer entityplayer) {
|
||||
return true;
|
||||
@@ -23,8 +21,7 @@ public class ContainerRecipe extends Container
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int i) {
|
||||
if (i < 0 || i > inventoryItemStacks.size())
|
||||
return null;
|
||||
if (i < 0 || i > inventoryItemStacks.size()) return null;
|
||||
return (ItemStack) inventoryItemStacks.get(i);
|
||||
}
|
||||
|
||||
@@ -35,8 +32,7 @@ public class ContainerRecipe extends Container
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int slot, ItemStack itemstack) {
|
||||
if (slot < 0 || slot >= inventoryItemStacks.size())
|
||||
return;
|
||||
if (slot < 0 || slot >= inventoryItemStacks.size()) return;
|
||||
|
||||
inventoryItemStacks.set(slot, itemstack);
|
||||
}
|
||||
@@ -52,16 +48,13 @@ public class ContainerRecipe extends Container
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markDirty() {
|
||||
}
|
||||
public void markDirty() {}
|
||||
|
||||
@Override
|
||||
public void openInventory() {
|
||||
}
|
||||
public void openInventory() {}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {
|
||||
}
|
||||
public void closeInventory() {}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int var1) {
|
||||
@@ -78,47 +71,37 @@ public class ContainerRecipe extends Container
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private final RecipeInventory recipeInventory = new RecipeInventory();
|
||||
|
||||
public void clearInventory()
|
||||
{
|
||||
|
||||
public void clearInventory() {
|
||||
inventoryItemStacks.clear();
|
||||
inventorySlots.clear();
|
||||
}
|
||||
|
||||
public ItemStack slotClick(int slot, int button, boolean flag, EntityPlayer entityplayer)
|
||||
{
|
||||
if(slot < 0)
|
||||
return null;
|
||||
|
||||
|
||||
public ItemStack slotClick(int slot, int button, boolean flag, EntityPlayer entityplayer) {
|
||||
if (slot < 0) return null;
|
||||
|
||||
ItemStack stack = recipeInventory.getStackInSlot(slot);
|
||||
if(stack != null)
|
||||
{
|
||||
if(button == 0)
|
||||
GuiCraftingRecipe.openRecipeGui("item", stack);
|
||||
else if(button == 1)
|
||||
GuiUsageRecipe.openRecipeGui("item", stack);
|
||||
if (stack != null) {
|
||||
if (button == 0) GuiCraftingRecipe.openRecipeGui("item", stack);
|
||||
else if (button == 1) GuiUsageRecipe.openRecipeGui("item", stack);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void addSlot(PositionedStack stack, int recipex, int recipey)
|
||||
{
|
||||
|
||||
public void addSlot(PositionedStack stack, int recipex, int recipey) {
|
||||
int slot = inventorySlots.size();
|
||||
addSlotToContainer(new Slot(recipeInventory, slot, recipex+stack.relx, recipey+stack.rely)
|
||||
{
|
||||
addSlotToContainer(new Slot(recipeInventory, slot, recipex + stack.relx, recipey + stack.rely) {
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack par1ItemStack)
|
||||
{
|
||||
public boolean isItemValid(ItemStack par1ItemStack) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
recipeInventory.setInventorySlotContents(slot, stack.item);
|
||||
}
|
||||
|
||||
public Slot getSlotWithStack(PositionedStack stack, int recipex, int recipey)
|
||||
{
|
||||
public Slot getSlotWithStack(PositionedStack stack, int recipex, int recipey) {
|
||||
for (Object inventorySlot : inventorySlots) {
|
||||
Slot slot = (Slot) inventorySlot;
|
||||
if (slot.xDisplayPosition == (stack.relx + recipex) && slot.yDisplayPosition == (stack.rely + recipey))
|
||||
@@ -126,21 +109,18 @@ public class ContainerRecipe extends Container
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean canInteractWith(EntityPlayer entityplayer)
|
||||
{
|
||||
|
||||
public boolean canInteractWith(EntityPlayer entityplayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void putStackInSlot(int par1, ItemStack par2ItemStack)
|
||||
{
|
||||
//Server side updates do nothing!
|
||||
public void putStackInSlot(int par1, ItemStack par2ItemStack) {
|
||||
// Server side updates do nothing!
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
||||
{
|
||||
return null;//no shift clicking (scrolling...)
|
||||
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
|
||||
return null; // no shift clicking (scrolling...)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user