Jump to content

wookiederk

Members
  • Posts

    77
  • Joined

  • Last visited

Everything posted by wookiederk

  1. Thats what I use under my Init. KeyBindingRegsitry.registerKeyHandler
  2. In your LanguageRegistry for pizza slices dont use an itemstack; use the item or block itself. To do that, change it to: LanguageRegistry.addName(new ItemStack(pizzaSlice, 1, i).getItem(), ItemPizzaSlice.sliceName[i]) hope this helps
  3. Another way you can do this is to make your own bedrock. In init, you can do something like Block.blocklist[block.bedrock.blockID] = yourNewBedrock.blockID And with that new bedrock you can set the hardness using YourNewBedrock.setHardness(1F) Hope this helps
  4. you can use a forge hook for the bucket handler. add this line to your init: MinecraftForge.EVENT_BUS.register(new YourBucketHandler()); Then create the class. it should look something like: public class YourBucketHandler { @ForgeSubscribe public void onBucketFill(FillBucketEvent event) { ItemStack result = fillCustomBucket(event.world, event.target); if (result == null) return; event.result = result; event.setResult(Result.ALLOW); } public ItemStack fillCustomBucket(World world, MovingObjectPosition pos) { int blockID = world.getBlockId(pos.blockX, pos.blockY, pos.blockZ); if ((blockID == You.liquidStill.blockID || blockID == You.liquidFlowing.blockID) && world.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ) == 0) { world.setBlock(pos.blockX, pos.blockY, pos.blockZ, 0); return new ItemStack(You.bucketLiquid); } else return null; } } Of course, you would need to create your own bucketLiquid itemstack. Hope this helps
  5. I dont think its needed, but il post it. The NoDefCrash on the KeyHandler is because the KeyHandler is a client side class, not server, but even with the Side Annotations it still doesnt work. 2013-07-21 09:08:52 [sEVERE] [Minecraft-Server] Encountered an unexpected exception NoClassDefFoundError java.lang.NoClassDefFoundError: net/minecraft/client/settings/KeyBinding at wookiederk.AlchemiconKeyHandler.<clinit>(AlchemiconKeyHandler.java:20) at wookiederk.Alchemicon.<init>(Alchemicon.java:137) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:525) at java.lang.Class.newInstance0(Class.java:372) at java.lang.Class.newInstance(Class.java:325) at cpw.mods.fml.common.ILanguageAdapter$JavaAdapter.getNewInstance(ILanguageAdapter.java:36) at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:466) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98) at cpw.mods.fml.common.Loader.loadMods(Loader.java:503) at cpw.mods.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:85) at cpw.mods.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:350) at net.minecraft.server.dedicated.DedicatedServer.startServer(DedicatedServer.java:69) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:430) at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16) Caused by: java.lang.ClassNotFoundException: net.minecraft.client.settings.KeyBinding at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:238) at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) ... 36 more Caused by: java.lang.RuntimeException: Attempted to load class net/minecraft/client/settings/KeyBinding for invalid side SERVER at cpw.mods.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:50) at cpw.mods.fml.relauncher.RelaunchClassLoader.runTransformers(RelaunchClassLoader.java:352) at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:225) ... 38 more The line on the KeyHandler is the initilization of the binding, and the load in the main class is for the KeyBindingRegistry.
  6. Hi, I have a server crash problem due to my custom Key Handler class (NoDefFound). I have tried many things that dont seem to work: I tried registering it through KeyBindingRegistry and tried TickRegistry. I also added @SideOnly(Side.Client) annotations over the keyhandler. Here is the key handler code @SideOnly(Side.CLIENT) static KeyBinding binding = new KeyBinding("Aura Screen", Keyboard.KEY_R); public AlchemiconKeyHandler() { super(new KeyBinding[] { binding }, new boolean[] { false }); } @Override public String getLabel() { return "mykeybindings"; } @Override public void keyDown(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd, boolean isRepeat) { if (Minecraft.getMinecraft().currentScreen == null && tickEnd && Minecraft.getMinecraft().inGameHasFocus) { Packet250CustomPayload packet = new Packet250CustomPayload(); packet.channel = "aura"; PacketDispatcher.sendPacketToServer(packet); } } @Override public void keyUp(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd) { } @Override public EnumSet<TickType> ticks() { return EnumSet.of(TickType.CLIENT); } Thanks for any help
  7. try adding something like: if (item.stackSize <= 0) { item.stacksize =item.stacksize.getItem() .getContainerItemStack(item.stacksize); }
  8. if you use getUnlocalizedName2() youl crash everytime on the server...
  9. Just make a container but dont add any slots. It kinda acts like an interface for saving stuff to the tile entity.
  10. Hi, im making a custom workbench with tile entity. However, my container code is acting strange. I managed to get the blocks saving in the matrix, but the result is invisible although obtainable, and the result yields 1 less then what should be. Please let me know what I am doing wrong and how to fix it, and thanks for any help. Edit: Fixed it myself. Make a custom slot and assign your own properties to it etc... Relevant Container Code: public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3); public IInventory craftResult = new InventoryCraftResult(); private World worldObj; private int posX; private int posY; private int posZ; private TileEntityCounter counter; public ContainerCounter(InventoryPlayer par1InventoryPlayer, TileEntityCounter par2TileEntityCounter, World world, int x, int y, int z) { this.counter = par2TileEntityCounter; this.worldObj = world; this.posX = x; this.posY = y; this.posZ = z; this.addSlotToContainer(new SlotCrafting(par1InventoryPlayer.player, this.craftMatrix, this.craftResult, 0, 124, 35)); int l; int i1; for (l = 0; l < 3; ++l) { for (i1 = 0; i1 < 3; ++i1) { this.addSlotToContainer(new Slot(par2TileEntityCounter, i1 + l * 3, 30 + i1 * 18, 17 + l * 18)); } } for (l = 0; l < 3; ++l) { for (i1 = 0; i1 < 9; ++i1) { this.addSlotToContainer(new Slot(par1InventoryPlayer, i1 + l * 9 + 9, 8 + i1 * 18, 84 + l * 18)); } } for (l = 0; l < 9; ++l) { this.addSlotToContainer(new Slot(par1InventoryPlayer, l, 8 + l * 18, 142)); } } /** * Callback for when the crafting matrix is changed. */ public void onCraftMatrixChanged(IInventory par1IInventory) { this.craftResult.setInventorySlotContents( 0, CraftingManager.getInstance().findMatchingRecipe( this.craftMatrix, this.worldObj)); } public void detectAndSendChanges() { super.detectAndSendChanges(); for (int i = 0; i < 9; i++) { this.craftMatrix.setInventorySlotContents(i, this.counter.counterItemStacks[i]); } this.onCraftMatrixChanged(this.craftMatrix); this.counter.counterItemStacks[9] = this.craftResult.getStackInSlot(0); } [/code
  11. maybe try "texturename.png" without the slash, or just make it read inside the mod folder with "/mods/modid/textures/texturename.png"
  12. check if its a player with instanceof if ( entity instanceof EntityPlayer) { code here}
  13. you should register all of the blocks GameRegistry.registerBlock(fencePistonOff, "Fence Piston"); GameRegistry.registerBlock(killFencePistonOff, "Killer Fence Piston"); GameRegistry.registerBlock(fencePistonOn, "Fence Piston On"); GameRegistry.registerBlock(killFencePistonOn, "Killer Fence Piston On");
  14. Hi, I'm doing a little experimenting with NBT Tags. I'm trying to save and load data player specific but I do not know how to access it correctly. It just results in a crash when I try to save/load to the tag. The additional properties attach to the player in my main file. Here is my code for the extended properties and Item class that call it: Both Save and Load NBT arent working. Extended Properties Class: public static boolean[] recipes; public static String[] recipeNames; @Override public void saveNBTData(NBTTagCompound compound) { NBTTagList cookValues = new NBTTagList(); for (int i = 0; i < recipes.length; i++) { compound.setBoolean(recipeNames[i], recipes[i]); cookValues.appendTag(compound); } compound.setTag("Cookbook", cookValues); } @Override public void loadNBTData(NBTTagCompound compound) { NBTTagList cookValues = compound.getTagList("Cookbook"); for (int i = 0; i < cookValues.tagCount(); i++) { this.recipes[i] = compound.getBoolean(recipeNames[i]); System.out.println(recipes[i]); } } @Override public void init(Entity entity, World world) { } public void writeRecipe(boolean par1, int par2, String par3) { recipes[par2] = par1; this.recipeNames[par2] = par3; } Food Class: @Override public void onFoodEaten(ItemStack itemstack, World world, EntityPlayer player) { player.getFoodStats().addStats(this); world.playSoundAtEntity(player, "random.burp", 0.5F, world.rand.nextFloat() * 0.1F + 0.9F); this.addPotionEffects(itemstack, world, player); ((EventCookbook) player.getExtendedProperties("Cookbook")).writeRecipe( true, 0); } Any help appreciated Edit: Fixed it on my own
  15. yeah I just realized it. solution: @SideOnly(Side.CLIENT) public Icon getIcon(int par1, int par2) { return this.icons[par2]; } thanks for the help
  16. Ok, but the problem is that when it changes from 0 to 1 the picture doesnt update. Do you know why that is?
  17. par5 should be the metadata. according to the description im setting the metadata and 2 is the flag thingy that is best at 2 for client rendering. I'm not sure what your saying
  18. Doesn't setBlock say X,Y,Z, new BlockID, new metadata, flag?
  19. Hi, I'm trying to make a tomato plant. I have based much of it off the tutorial, but I have come across some problems. 1. I want to make it when the plant is right clicked with shears, it will drop tomato and go down a plant growth. When i implemented IShearable, it didnt work on right clicking, and I dont want the same effect with left clicking. 2. Pictures arent updating. The first growth upon planting is correct, but when it ticks to the next growth nothing happens. I'm guessing it is incorrect usage of world.setBlock? TomatoCrop.class: public class TomatoCrop extends Block implements IShearable { @SideOnly(Side.CLIENT) private Icon[] icons; public TomatoCrop(int id) { super(id, Material.plants); this.setStepSound(soundGrassFootstep); this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); this.setTickRandomly(true); } public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) { return null; } public int getRenderType() { return 6; // Magic number. } public boolean isOpaqueCube() { return false; } @Override public void updateTick(World world, int x, int y, int z, Random random) { System.out.println("TICK"); if (world.getBlockMetadata(x, y, z) == 1) { System.out.println("already"); return; } if (world.getBlockLightValue(x, y + 1, z) < 9) { System.out.println("light not good"); return; } if (random.nextInt(isFertile(world, x, y - 1, z) ? 12 : 25) != 0) { System.out.println("nope"); return; } world.setBlock(x, y, z, EatMe.tomatoCrop.blockID, 1, 2); System.out.println("yep"); } @Override public void onNeighborBlockChange(World world, int x, int y, int z, int neighborId) { if (!canBlockStay(world, x, y, z)) { dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0); world.setBlock(x, y, z, 0); } } @Override public boolean canBlockStay(World world, int x, int y, int z) { Block soil = blocksList[world.getBlockId(x, y - 1, z)]; return (world.getFullBlockLightValue(x, y, z) >= 8 || world .canBlockSeeTheSky(x, y, z)) && (soil != null && soil.canSustainPlant(world, x, y - 1, z, ForgeDirection.UP, (IPlantable) EatMe.tomatoSeeds)); } @Override public int idDropped(int metadata, Random random, int par2) { switch (metadata) { case 0: return EatMe.tomatoSeeds.itemID; case 1: return EatMe.tomato.itemID; default: // Error case! return -1; // no item } } @Override public int idPicked(World world, int x, int y, int z) { return EatMe.tomatoSeeds.itemID; } @Override @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister) { icons = new Icon[2]; for (int i = 0; i < icons.length; i++) { icons[i] = par1IconRegister.registerIcon("crops_" + i); blockIcon = icons[i]; } } @Override public boolean isShearable(ItemStack item, World world, int x, int y, int z) { return true; } @Override public ArrayList<ItemStack> onSheared(ItemStack item, World world, int x, int y, int z, int fortune) { Random random = new Random(); ArrayList<ItemStack> ret = new ArrayList<ItemStack>(); world.setBlock(x, y, z, EatMe.tomatoCrop.blockID, 0, 2); int i = 1 + random.nextInt(3); for (int j = 0; j < i; j++) { ret.add(new ItemStack(EatMe.tomato, 1)); } return ret; } }
  20. if (this.kegItemStacks[0].isItemEqual(new ItemStack(EatMe.yeast))) { System.out.println("yeast"); return false; Gives a null pointer.
  21. Hi, I have based my code from the furnace code. I have three specific inputs with one output. However, when I put those items in the proper slot nothing happens! Here is my Tile Entity Code: package wookiederk; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.common.ForgeDummyContainer; import net.minecraftforge.common.ISidedInventory; public class TileEntityKeg extends TileEntity implements ISidedInventory { private static final int[] field_102010_d = new int[] { 0 }; private static final int[] field_102011_e = new int[] { 2, 1 }; private static final int[] field_102009_f = new int[] { 1 }; /** * The ItemStacks that hold the items currently being used in the furnace */ private ItemStack[] kegItemStacks = new ItemStack[4]; /** The number of ticks that the furnace will keep burning */ public int kegFermentTime = 0; /** * The number of ticks that a fresh copy of the currently-burning item would * keep the furnace burning for */ public int currentItemFermentTime = 0; /** The number of ticks that the current item has been cooking for */ public int kegCookTime = 0; private String field_94130_e; /** * Returns the number of slots in the inventory. */ public int getSizeInventory() { return this.kegItemStacks.length; } /** * Returns the stack in slot i */ public ItemStack getStackInSlot(int par1) { return this.kegItemStacks[par1]; } /** * Removes from an inventory slot (first arg) up to a specified number * (second arg) of items and returns them in a new stack. */ public ItemStack decrStackSize(int par1, int par2) { if (this.kegItemStacks[par1] != null) { ItemStack itemstack; if (this.kegItemStacks[par1].stackSize <= par2) { itemstack = this.kegItemStacks[par1]; this.kegItemStacks[par1] = null; return itemstack; } else { itemstack = this.kegItemStacks[par1].splitStack(par2); if (this.kegItemStacks[par1].stackSize == 0) { this.kegItemStacks[par1] = null; } return itemstack; } } else { return null; } } /** * When some containers are closed they call this on each slot, then drop * whatever it returns as an EntityItem - like when you close a workbench * GUI. */ public ItemStack getStackInSlotOnClosing(int par1) { if (this.kegItemStacks[par1] != null) { ItemStack itemstack = this.kegItemStacks[par1]; this.kegItemStacks[par1] = null; return itemstack; } else { return null; } } /** * Sets the given item stack to the specified slot in the inventory (can be * crafting or armor sections). */ public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { this.kegItemStacks[par1] = par2ItemStack; if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit()) { par2ItemStack.stackSize = this.getInventoryStackLimit(); } } /** * Returns the name of the inventory. */ public String getInvName() { return this.isInvNameLocalized() ? this.field_94130_e : "container.keg"; } /** * If this returns false, the inventory name will be used as an unlocalized * name, and translated into the player's language. Otherwise it will be * used directly. */ public boolean isInvNameLocalized() { return this.field_94130_e != null && this.field_94130_e.length() > 0; } public void func_94129_a(String par1Str) { this.field_94130_e = par1Str; } /** * Reads a tile entity from NBT. */ public void readFromNBT(NBTTagCompound par1NBTTagCompound) { super.readFromNBT(par1NBTTagCompound); NBTTagList nbttaglist = par1NBTTagCompound.getTagList("Items"); this.kegItemStacks = new ItemStack[this.getSizeInventory()]; for (int i = 0; i < nbttaglist.tagCount(); ++i) { NBTTagCompound nbttagcompound1 = (NBTTagCompound) nbttaglist .tagAt(i); byte b0 = nbttagcompound1.getByte("Slot"); if (b0 >= 0 && b0 < this.kegItemStacks.length) { this.kegItemStacks[b0] = ItemStack .loadItemStackFromNBT(nbttagcompound1); } } this.kegFermentTime = par1NBTTagCompound.getShort("BurnTime"); this.kegCookTime = par1NBTTagCompound.getShort("CookTime"); this.currentItemFermentTime = getItemBurnTime(this.kegItemStacks[1]); if (par1NBTTagCompound.hasKey("CustomName")) { this.field_94130_e = par1NBTTagCompound.getString("CustomName"); } } /** * Writes a tile entity to NBT. */ public void writeToNBT(NBTTagCompound par1NBTTagCompound) { super.writeToNBT(par1NBTTagCompound); par1NBTTagCompound.setShort("BurnTime", (short) this.kegFermentTime); par1NBTTagCompound.setShort("CookTime", (short) this.kegCookTime); NBTTagList nbttaglist = new NBTTagList(); for (int i = 0; i < this.kegItemStacks.length; ++i) { if (this.kegItemStacks[i] != null) { NBTTagCompound nbttagcompound1 = new NBTTagCompound(); nbttagcompound1.setByte("Slot", (byte) i); this.kegItemStacks[i].writeToNBT(nbttagcompound1); nbttaglist.appendTag(nbttagcompound1); } } par1NBTTagCompound.setTag("Items", nbttaglist); if (this.isInvNameLocalized()) { par1NBTTagCompound.setString("CustomName", this.field_94130_e); } } /** * Returns the maximum stack size for a inventory slot. Seems to always be * 64, possibly will be extended. *Isn't this more of a set than a get?* */ public int getInventoryStackLimit() { return 64; } @SideOnly(Side.CLIENT) /** * Returns an integer between 0 and the passed value representing how close the current item is to being completely * cooked */ public int getCookProgressScaled(int par1) { return this.kegCookTime * par1 / 200; } @SideOnly(Side.CLIENT) /** * Returns an integer between 0 and the passed value representing how much burn time is left on the current fuel * item, where 0 means that the item is exhausted and the passed value means that the item is fresh */ public int getBurnTimeRemainingScaled(int par1) { if (this.currentItemFermentTime == 0) { this.currentItemFermentTime = this.kegFermentTime = getItemBurnTime(this.kegItemStacks[1]); } return this.kegFermentTime * par1 / this.currentItemFermentTime; } /** * Returns true if the furnace is currently burning */ public boolean isBurning() { return this.kegFermentTime > 0; } /** * Allows the entity to update its state. Overridden in most subclasses, * e.g. the mob spawner uses this to count ticks and creates a new spawn * inside its implementation. */ public void updateEntity() { boolean flag = this.kegFermentTime > 0; boolean flag1 = false; if (this.kegFermentTime > 0) { --this.kegFermentTime; } if (!this.worldObj.isRemote) { if (this.kegFermentTime == 0 && this.canSmelt()) { this.currentItemFermentTime = this.kegFermentTime = getItemBurnTime(this.kegItemStacks[1]); if (this.kegFermentTime > 0) { flag1 = true; if (this.kegItemStacks[1] != null) { // --this.kegItemStacks[1].stackSize; if (this.kegItemStacks[1].stackSize == 0) { this.kegItemStacks[1] = this.kegItemStacks[1] .getItem().getContainerItemStack( kegItemStacks[1]); } } } } if (this.isBurning() && this.canSmelt()) { ++this.kegCookTime; if (this.kegCookTime == getItemBurnTime(this.kegItemStacks[1])) { this.kegCookTime = 0; this.smeltItem(); flag1 = true; } } else { this.kegCookTime = 0; } if (flag != this.kegFermentTime > 0) { flag1 = true; BlockBeerKeg.updateFurnaceBlockState(this.kegFermentTime > 0, this.worldObj, this.xCoord, this.yCoord, this.zCoord); } } if (flag1) { this.onInventoryChanged(); } } /** * Returns true if the furnace can smelt an item, i.e. has a source item, * destination stack isn't full, etc. */ private boolean canSmelt() { if (this.kegItemStacks[0] != new ItemStack(EatMe.yeast)) { return false; } else if (this.kegItemStacks[2] != new ItemStack(EatMe.cupEmpty)) { return false; } else if (this.kegItemStacks[1] == new ItemStack(EatMe.grapes)) { return true; } else if (this.kegItemStacks[1] == new ItemStack(EatMe.barley)) { return true; } else { return false; } } /** * Turn one item from the furnace source stack into the appropriate smelted * item in the furnace result stack */ public void smeltItem() { if (this.canSmelt()) { ItemStack itemstack = new ItemStack(EatMe.cupEmpty); if (this.kegItemStacks[1] == new ItemStack(EatMe.grapes)) { itemstack = new ItemStack(EatMe.alcohol); } else if (this.kegItemStacks[1] == new ItemStack(EatMe.barley)) { itemstack = new ItemStack(EatMe.flour); } if (this.kegItemStacks[3] == null) { this.kegItemStacks[3] = itemstack.copy(); } else if (this.kegItemStacks[3].isItemEqual(itemstack)) { kegItemStacks[3].stackSize += itemstack.stackSize; } --this.kegItemStacks[0].stackSize; --this.kegItemStacks[1].stackSize; --this.kegItemStacks[2].stackSize; } } /** * Returns the number of ticks that the supplied fuel item will keep the * furnace burning, or 0 if the item isn't fuel */ public static int getItemBurnTime(ItemStack par0ItemStack) { if (par0ItemStack == null) { return 0; } else { int i = par0ItemStack.getItem().itemID; Item item = par0ItemStack.getItem(); if (i == EatMe.grapes.itemID) return 3000; if (i == EatMe.barley.itemID) return 2000; return GameRegistry.getFuelValue(par0ItemStack); } } /** * Return true if item is a fuel source (getItemBurnTime() > 0). */ public static boolean isItemFuel(ItemStack par0ItemStack) { return getItemBurnTime(par0ItemStack) > 0; } /** * Do not make give this method the name canInteractWith because it clashes * with Container */ public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { return this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : par1EntityPlayer.getDistanceSq( (double) this.xCoord + 0.5D, (double) this.yCoord + 0.5D, (double) this.zCoord + 0.5D) <= 64.0D; } public void openChest() { } public void closeChest() { } /** * Returns true if automation is allowed to insert the given stack (ignoring * stack size) into the given slot. */ public boolean isStackValidForSlot(int par1, ItemStack par2ItemStack) { return par1 == 2 ? false : (par1 == 1 ? isItemFuel(par2ItemStack) : true); } /** * Returns an array containing the indices of the slots that can be accessed * by automation on the given side of this block. */ public int[] getAccessibleSlotsFromSide(int par1) { return par1 == 0 ? field_102011_e : (par1 == 1 ? field_102010_d : field_102009_f); } /** * Returns true if automation can insert the given item in the given slot * from the given side. Args: Slot, item, side */ public boolean canInsertItem(int par1, ItemStack par2ItemStack, int par3) { return this.isStackValidForSlot(par1, par2ItemStack); } /** * Returns true if automation can extract the given item in the given slot * from the given side. Args: Slot, item, side */ public boolean canExtractItem(int par1, ItemStack par2ItemStack, int par3) { return par3 != 0 || par1 != 1 || par2ItemStack.itemID == Item.bucketEmpty.itemID; } /*********************************************************************************** * This function is here for compatibilities sake, Modders should Check for * Sided before ContainerWorldly, Vanilla Minecraft does not follow the * sided standard that Modding has for a while. * * In vanilla: * * Top: Ores Sides: Fuel Bottom: Output * * Standard Modding: Top: Ores Sides: Output Bottom: Fuel * * The Modding one is designed after the GUI, the vanilla one is designed * because its intended use is for the hopper, which logically would take * things in from the top. * * This will possibly be removed in future updates, and make vanilla the * definitive standard. */ @Override public int getStartInventorySide(ForgeDirection side) { if (ForgeDummyContainer.legacyFurnaceSides) { if (side == ForgeDirection.DOWN) return 2; if (side == ForgeDirection.UP) return 0; return 1; } else { if (side == ForgeDirection.DOWN) return 2; if (side == ForgeDirection.UP) return 0; return 1; } } @Override public int getSizeInventorySide(ForgeDirection side) { return 1; } } Edit: I think it is something wrong with the canSmelt() part.
  22. hm, but you would still have the vanilla keybinding in the options shown up (just set to an obscure value). Can't you "override" the keybindings for the inventory key with your own? So you wouldn't have to worry about setting the keybinding MC has to an obscure value. I have set my gui to "override" the screen. However, the vanilla inventory flashes up from time to time, and if I try to check if the screen is null, then my gui will never come up. And the check if the screen is null is important, because otherwise my gui will flash up during chat.... Maybe. Then I would need to make my inventory a specific key (which would work). This seems like the best solution, but how would I change the inventory key code at start up?
  23. Specifically I don't want the inventory screen to pop up when you hit the inventory binding....I dont think theres anything to overwrite without changing base files. Any ideas?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.