mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-24 22:14:42 +00:00
Started work on enchanter.
This commit is contained in:
1 parent
d8d40b2330
commit
766b26dff3
9 files changed
+572
-1
No files matched your search
@@ -59,6 +59,7 @@ import crazypants.enderio.machine.alloy.BlockAlloySmelter;
|
||||
import crazypants.enderio.machine.crafter.BlockCrafter;
|
||||
import crazypants.enderio.machine.crusher.BlockCrusher;
|
||||
import crazypants.enderio.machine.crusher.CrusherRecipeManager;
|
||||
import crazypants.enderio.machine.enchanter.BlockEnchanter;
|
||||
import crazypants.enderio.machine.farm.BlockFarmStation;
|
||||
import crazypants.enderio.machine.farm.FarmersRegistry;
|
||||
import crazypants.enderio.machine.generator.combustion.BlockCombustionGenerator;
|
||||
@@ -181,6 +182,8 @@ public class EnderIO {
|
||||
public static BlockPoweredSpawner blockPoweredSpawner;
|
||||
public static ItemBrokenSpawner itemBrokenSpawner;
|
||||
|
||||
public static BlockEnchanter blockEncahnter;
|
||||
|
||||
public static BlockElectricLight blockElectricLight;
|
||||
public static BlockLightNode blockLightNode;
|
||||
|
||||
@@ -268,6 +271,8 @@ public class EnderIO {
|
||||
blockTank = BlockTank.create();
|
||||
blockReservoir = BlockReservoir.create();
|
||||
blockVacuumChest = BlockVacuumChest.create();
|
||||
|
||||
blockEncahnter = BlockEnchanter.create();
|
||||
|
||||
blockDarkSteelPressurePlate = BlockDarkSteelPressurePlate.create();
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ public class GuiHandler implements IGuiHandler {
|
||||
public static final int GUI_ID_POWERED_SPAWNER = 88;
|
||||
public static final int GUI_ID_VACUUM_CHEST = 89;
|
||||
public static final int GUI_ID_WIRELESS_CHARGER = 90;
|
||||
public static final int GUI_ID_ENCHANTER = 91;
|
||||
|
||||
protected final Map<Integer, IGuiHandler> guiHandlers = new HashMap<Integer, IGuiHandler>();
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ public enum ModObject {
|
||||
blockCrafter,
|
||||
blockVacuumChest,
|
||||
blockWirelessCharger,
|
||||
blockEnchanter,
|
||||
|
||||
blockPoweredSpawner,
|
||||
itemBrokenSpawner,
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
package crazypants.enderio.machine.enchanter;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import buildcraft.api.tools.IToolWrench;
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import crazypants.enderio.BlockEio;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.GuiHandler;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.conduit.ConduitUtil;
|
||||
import crazypants.enderio.gui.IResourceTooltipProvider;
|
||||
import crazypants.enderio.machine.vacuum.BlockVacuumChest;
|
||||
import crazypants.enderio.machine.vacuum.ContainerVacuumChest;
|
||||
import crazypants.enderio.machine.vacuum.GuiVacuumChest;
|
||||
import crazypants.enderio.machine.vacuum.TileVacuumChest;
|
||||
import crazypants.util.Util;
|
||||
|
||||
public class BlockEnchanter extends BlockEio implements IGuiHandler, IResourceTooltipProvider {
|
||||
|
||||
public static BlockEnchanter create() {
|
||||
BlockEnchanter res = new BlockEnchanter();
|
||||
res.init();
|
||||
return res;
|
||||
}
|
||||
|
||||
public static int renderId;
|
||||
|
||||
protected BlockEnchanter() {
|
||||
super(ModObject.blockEnchanter.unlocalisedName, TileEnchanter.class);
|
||||
setBlockTextureName("enderio:blockEnchanter");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
super.init();
|
||||
EnderIO.guiHandler.registerGuiHandler(GuiHandler.GUI_ID_ENCHANTER, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float par7, float par8, float par9) {
|
||||
|
||||
if(ConduitUtil.isToolEquipped(entityPlayer)) {
|
||||
if(entityPlayer.isSneaking() && entityPlayer.getCurrentEquippedItem().getItem() instanceof IToolWrench) {
|
||||
IToolWrench wrench = (IToolWrench) entityPlayer.getCurrentEquippedItem().getItem();
|
||||
if(wrench.canWrench(entityPlayer, x, y, z)) {
|
||||
removedByPlayer(world, entityPlayer, x, y, z, false);
|
||||
if(entityPlayer.getCurrentEquippedItem().getItem() instanceof IToolWrench) {
|
||||
((IToolWrench) entityPlayer.getCurrentEquippedItem().getItem()).wrenchUsed(entityPlayer, x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(entityPlayer.isSneaking()) {
|
||||
return false;
|
||||
}
|
||||
entityPlayer.openGui(EnderIO.instance, GuiHandler.GUI_ID_ENCHANTER, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean harvested) {
|
||||
if(!world.isRemote) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te instanceof TileVacuumChest) {
|
||||
TileEnchanter cb = (TileEnchanter) te;
|
||||
if(!player.capabilities.isCreativeMode) {
|
||||
ItemStack itemStack = new ItemStack(this);
|
||||
float f = 0.7F;
|
||||
double d0 = world.rand.nextFloat() * f + (1.0F - f) * 0.5D;
|
||||
double d1 = world.rand.nextFloat() * f + (1.0F - f) * 0.5D;
|
||||
double d2 = world.rand.nextFloat() * f + (1.0F - f) * 0.5D;
|
||||
EntityItem entityitem = new EntityItem(world, x + d0, y + d1, z + d2, itemStack);
|
||||
entityitem.delayBeforeCanPickup = 10;
|
||||
world.spawnEntityInWorld(entityitem);
|
||||
|
||||
Util.dropItems(world, cb, x, y, z, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.removedByPlayer(world, player, x, y, z, harvested);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random p_149745_1_) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return renderId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te instanceof TileEnchanter) {
|
||||
return new ContainerEnchanter(player, player.inventory, (TileEnchanter) te);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te instanceof TileEnchanter) {
|
||||
return new GuiEnchanter(player, player.inventory, (TileEnchanter) te);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int p_149749_6_) {
|
||||
super.breakBlock(world, x, y, z, block, p_149749_6_);
|
||||
world.removeTileEntity(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedNameForTooltip(ItemStack itemStack) {
|
||||
return getUnlocalizedName();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
package crazypants.enderio.machine.enchanter;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentData;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ContainerRepair;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerEnchanter extends Container {
|
||||
|
||||
private TileEnchanter enchanter;
|
||||
|
||||
public ContainerEnchanter(EntityPlayer player, InventoryPlayer playerInv, TileEnchanter te) {
|
||||
|
||||
enchanter = te;
|
||||
|
||||
addSlotToContainer(new Slot(te, 0, 27, 35) {
|
||||
|
||||
@Override
|
||||
public int getSlotStackLimit() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack itemStack) {
|
||||
return enchanter.isItemValidForSlot(0, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSlotChanged() {
|
||||
updateOutput();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
addSlotToContainer(new Slot(te, 1, 76, 35) {
|
||||
|
||||
@Override
|
||||
public int getSlotStackLimit() {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack itemStack) {
|
||||
return enchanter.isItemValidForSlot(1, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSlotChanged() {
|
||||
updateOutput();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
addSlotToContainer(new Slot(te, 2, 134, 35) {
|
||||
|
||||
@Override
|
||||
public int getSlotStackLimit() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack itemStack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void onPickupFromSlot(EntityPlayer player, ItemStack stack) {
|
||||
if(!player.capabilities.isCreativeMode) {
|
||||
player.addExperienceLevel(-enchanter.getCurrentEnchantmentCost());
|
||||
}
|
||||
enchanter.setInventorySlotContents(0, (ItemStack) null);
|
||||
enchanter.setInventorySlotContents(1, (ItemStack) null);
|
||||
// if (!p_i1800_2_.isRemote) {
|
||||
// p_i1800_2_.playAuxSFX(1021, p_i1800_3_, p_i1800_4_, p_i1800_5_, 0);
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canTakeStack(EntityPlayer player) {
|
||||
return playerHasEnoughLevels(player);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
int x = 8;
|
||||
int y = 84;
|
||||
// add players inventory
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, x + j * 18, y + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
addSlotToContainer(new Slot(playerInv, i, x + i * 18, y + 58));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer p_75145_1_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean playerHasEnoughLevels(EntityPlayer player) {
|
||||
if(player.capabilities.isCreativeMode) {
|
||||
return true;
|
||||
}
|
||||
return player.experienceLevel >= enchanter.getCurrentEnchantmentCost();
|
||||
}
|
||||
|
||||
private void updateOutput() {
|
||||
ItemStack output = null;
|
||||
EnchantmentData enchantment = enchanter.getCurrentEnchantment();
|
||||
if(enchantment != null) {
|
||||
output = new ItemStack(Items.enchanted_book);
|
||||
Items.enchanted_book.addEnchantment(output, enchantment);
|
||||
}
|
||||
enchanter.setOutput(output);
|
||||
}
|
||||
|
||||
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
|
||||
ItemStack copyStack = null;
|
||||
Slot slot = (Slot) this.inventorySlots.get(par2);
|
||||
|
||||
if(slot != null && slot.getHasStack()) {
|
||||
ItemStack origStack = slot.getStack();
|
||||
copyStack = origStack.copy();
|
||||
|
||||
if(par2 < 2) {
|
||||
if(!mergeItemStack(origStack, 2, inventorySlots.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
if(!enchanter.isItemValidForSlot(0, origStack) || !mergeItemStack(origStack, 0, 1, false)) {
|
||||
if(!enchanter.isItemValidForSlot(1, origStack) || !mergeItemStack(origStack, 1, 2, false)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(origStack.stackSize == 0) {
|
||||
slot.putStack((ItemStack) null);
|
||||
} else {
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
}
|
||||
return copyStack;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package crazypants.enderio.machine.enchanter;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import crazypants.enderio.machine.vacuum.ContainerVacuumChest;
|
||||
import crazypants.render.ColorUtil;
|
||||
import crazypants.render.RenderUtil;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
public class GuiEnchanter extends GuiContainer {
|
||||
|
||||
private TileEnchanter te;
|
||||
private ContainerEnchanter container;
|
||||
|
||||
public GuiEnchanter(EntityPlayer player, InventoryPlayer inventory, TileEnchanter te) {
|
||||
super(new ContainerEnchanter(player, inventory, te));
|
||||
container = (ContainerEnchanter)inventorySlots;
|
||||
this.te = te;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
RenderUtil.bindTexture("enderio:textures/gui/enchanter.png");
|
||||
int sx = (width - xSize) / 2;
|
||||
int sy = (height - ySize) / 2;
|
||||
drawTexturedModalRect(sx, sy, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
int curCost = te.getCurrentEnchantmentCost();
|
||||
|
||||
if(curCost > 0) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
int col;
|
||||
if(container.playerHasEnoughLevels(Minecraft.getMinecraft().thePlayer)) {
|
||||
col = 8453920; //all good
|
||||
} else {
|
||||
col = 16736352; //not enough levels
|
||||
drawTexturedModalRect(sx + 99, sy + 33, 176, 0, 28, 21);
|
||||
}
|
||||
String s = I18n.format("container.repair.cost", new Object[] {Integer.valueOf(curCost)});
|
||||
drawCenteredString(Minecraft.getMinecraft().fontRenderer, s, sx + xSize/2, sy + 57, col);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,217 @@
|
||||
package crazypants.enderio.machine.enchanter;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentData;
|
||||
import net.minecraft.enchantment.EnchantmentProtection;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.TileEntityEio;
|
||||
import crazypants.enderio.enderface.TileEnderIO;
|
||||
|
||||
public class TileEnchanter extends TileEntityEio implements ISidedInventory {
|
||||
|
||||
private ItemStack[] inv = new ItemStack[3];
|
||||
|
||||
@Override
|
||||
protected void writeCustomNBT(NBTTagCompound root) {
|
||||
NBTTagList itemList = new NBTTagList();
|
||||
for (int i = 0; i < inv.length; i++) {
|
||||
if(inv[i] != null) {
|
||||
NBTTagCompound itemStackNBT = new NBTTagCompound();
|
||||
itemStackNBT.setByte("Slot", (byte) i);
|
||||
inv[i].writeToNBT(itemStackNBT);
|
||||
itemList.appendTag(itemStackNBT);
|
||||
}
|
||||
}
|
||||
root.setTag("Items", itemList);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readCustomNBT(NBTTagCompound root) {
|
||||
NBTTagList itemList = (NBTTagList) root.getTag("Items");
|
||||
if(itemList != null) {
|
||||
for (int i = 0; i < itemList.tagCount(); i++) {
|
||||
NBTTagCompound itemStack = itemList.getCompoundTagAt(i);
|
||||
byte slot = itemStack.getByte("Slot");
|
||||
if(slot >= 0 && slot < inv.length) {
|
||||
inv[slot] = ItemStack.loadItemStackFromNBT(itemStack);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return inv.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int slot) {
|
||||
if(slot < 0 || slot >= inv.length) {
|
||||
return null;
|
||||
}
|
||||
return inv[slot];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int slot, int amount) {
|
||||
if(amount <= 0 || slot < 0 || slot >= inv.length || inv[slot] == null) {
|
||||
return null;
|
||||
}
|
||||
ItemStack fromStack = inv[slot];
|
||||
if(fromStack == null) {
|
||||
return null;
|
||||
}
|
||||
if(fromStack.stackSize <= amount) {
|
||||
inv[slot] = null;
|
||||
return fromStack;
|
||||
}
|
||||
ItemStack result = new ItemStack(fromStack.getItem(), amount, fromStack.getItemDamage());
|
||||
if(fromStack.stackTagCompound != null) {
|
||||
result.stackTagCompound = (NBTTagCompound) fromStack.stackTagCompound.copy();
|
||||
}
|
||||
fromStack.stackSize -= amount;
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int p_70304_1_) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int slot, ItemStack contents) {
|
||||
if(contents == null) {
|
||||
inv[slot] = contents;
|
||||
} else {
|
||||
inv[slot] = contents.copy();
|
||||
}
|
||||
if(contents != null && contents.stackSize > getInventoryStackLimit()) {
|
||||
contents.stackSize = getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return ModObject.blockEnchanter.unlocalisedName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer p_70300_1_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int slot, ItemStack stack) {
|
||||
if(stack == null) {
|
||||
return false;
|
||||
}
|
||||
if(slot == 0) {
|
||||
return Items.writable_book == stack.getItem();
|
||||
}
|
||||
if(slot == 1) {
|
||||
//TODO:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public EnchantmentData getCurrentEnchantment() {
|
||||
if(inv[0] == null) {
|
||||
return null;
|
||||
}
|
||||
if(inv[1] == null) {
|
||||
return null;
|
||||
}
|
||||
return new EnchantmentData(Enchantment.looting, inv[1].stackSize);
|
||||
}
|
||||
|
||||
public int getCurrentEnchantmentCost() {
|
||||
|
||||
EnchantmentData enchData = getCurrentEnchantment();
|
||||
if(enchData == null) {
|
||||
return 0;
|
||||
}
|
||||
int level = enchData.enchantmentLevel;
|
||||
Enchantment enchantment = enchData.enchantmentobj;
|
||||
|
||||
if(level > enchantment.getMaxLevel()) {
|
||||
level = enchantment.getMaxLevel();
|
||||
}
|
||||
int costPerLevel = 0;
|
||||
switch (enchantment.getWeight()) {
|
||||
case 1:
|
||||
costPerLevel = 8;
|
||||
break;
|
||||
case 2:
|
||||
costPerLevel = 4;
|
||||
case 3:
|
||||
case 4:
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
default:
|
||||
break;
|
||||
case 5:
|
||||
costPerLevel = 2;
|
||||
break;
|
||||
case 10:
|
||||
costPerLevel = 1;
|
||||
}
|
||||
|
||||
int res = 0;
|
||||
for (int i = 0; i < level; i++) {
|
||||
res += costPerLevel * level;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public void setOutput(ItemStack output) {
|
||||
inv[inv.length - 1] = output;
|
||||
markDirty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int p_94128_1_) {
|
||||
return new int[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user