Jump to content

Quarg

Members
  • Posts

    31
  • Joined

  • Last visited

Everything posted by Quarg

  1. With them swapped, clicking the leftmost slot of the player's main inventory it picks up an item 3 slots to the right of it, clicking the first slot of the tile appears to do nothing. The hotbar definately exists though (and all the positions are definately correct, that is fine), when I click on it it picks up the item for a split second but it gets pulled back. I have also updated the OP with the proxies and Gui Handler.
  2. (APPEARS TO BE) SOLVED: the tutorial I followed never mentioned that I needed to have an @NetworkMod annotation, if you have the same problem then add @NetworkMod after the @Mod annotation and it's parameters. I've followed a tutorial for how to make a simple inventory block but I cannot get the container class to work properly (I think it's an issue with the container class at the least) it appears that the slots for the tile/block are for some reason 'tangling' with those of the player's inventory with the same slot id (clicking on the slot for the tile entity will *appear* to take an item from the corresponding slot from the player's inv). Here is the code for the Container Class: public class ContainerCrystaliser extends Container { TileCrystaliser tile; InventoryPlayer player; public ContainerCrystaliser(TileCrystaliser _tile, InventoryPlayer _player) { tile = _tile; this.player = _player; //add player slots for (int i = 0; i < 9; i++) { addSlotToContainer(new Slot(player, i, 8 + i * 18, 142)); } for (int i = 0; i < 3; i++) { for (int j = 0; j < 9; j++) { addSlotToContainer(new Slot(player, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); } } //add tile slots addSlotToContainer(new Slot(tile,0,17,17)); addSlotToContainer(new Slot(tile,1,17,49)); addSlotToContainer(new Slot(tile,2,143,49)); } @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot) { ItemStack stack = null; Slot slotObject = (Slot) inventorySlots.get(slot); if (slotObject != null && slotObject.getHasStack()) { ItemStack stackInSlot = slotObject.getStack(); stack = stackInSlot.copy(); //merges the item into player inventory since its in the tileEntity if (slot >= 36) { if (!this.mergeItemStack(stackInSlot, 0, 35, false)) { return null; } } //places it into the tileEntity is possible since its in the player inventory else if (!this.mergeItemStack(stackInSlot, 36, 39, false)) { return null; } if (stackInSlot.stackSize == 0) {slotObject.putStack(null);} else slotObject.onSlotChanged(); if (stackInSlot.stackSize == stack.stackSize) { return null; } slotObject.onPickupFromSlot(player, stackInSlot); } return stack; } @Override public boolean canInteractWith(EntityPlayer player) { return tile.isUseableByPlayer(player); } } EDIT: Gui Handler public class GuiHandler implements IGuiHandler { @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { TileEntity tileEntity = world.getBlockTileEntity(x, y, z); if(tileEntity instanceof TileCrystaliser){ return new ContainerCrystaliser((TileCrystaliser) tileEntity, player.inventory); } return null; } @Override public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { TileEntity tileEntity = world.getBlockTileEntity(x, y, z); if(tileEntity instanceof TileCrystaliser){ return new GuiCrystaliser(player.inventory, (TileCrystaliser) tileEntity); } return null; } } Proxies public class CommonProxy { public void registerRendering() { } public int addArmour(String path) { return 0; } } public class CommonProxy { public void registerRendering() { } public int addArmour(String path) { return 0; } } and as a bit of a side note; if I swap the order of the code for the tile and player slots, clicking on a player inv slot will pick up an item from 6 slots to the left (though it wraps from hotbar to the end of the inventory, such that clicking from the leftmost hotbar slot will pick up an item 6 from the right of the bottom line of the main inv.) though it does also sometimes do other odd things, such as the hotbar being completely non-interactable, even if I comment out the adding of the tile's slots.
  3. I don't see how that would fix it, the issue is around setting up APIs with forge rather than setting up eclipse.
  4. that is where my eclipse workspace is already set to.
  5. I have been intending for a while to create an addon for thaumcraft, however I am having trouble properly setting up the development environment for use with eclipse, and the wiki has not been making things partictularly clear. I have managed to include the API files in the source, however the API files provided do not contain the full source, thus cannot be used to test using eclipse, and including the actual mod files in the mods folder results in errors due to using obfuscated names. Is there a way to set up a development environment using such a supplied API with eclipse? or will I have to reobfuscate and recompile etc to test each time?
  6. Quarg

    Ore standard

    Although the ore dictionary was a fantastic breakthrough; it hasn't achieved all that it should have done, configs still have to be changed to make mods that add the same ores to work particularly well together (ie: to prevent cases where there are 3 different kinds of copper ore, all with different textures (also a pain for texturepack makers!)); so I began thinking about ways to work around this, coming to something very simple; the Ore standard. It would be a mod that does little to nothing on it's own, however other mods can tell it to (for example) enable copper generation, and it would do as expected, it could also include other things that may not be worldgen, such as steel and bronze using the same sort of system, allowing mods to enable the item with no recipe, with the in-built recipe, or to force disable the recipe (eg: so railcraft could disable making steel using coal and iron, so players would have to use the blast furnace). however to allow for special cases, ore generation and recipes should be able to be enabled via a config file (eg: so you can have all metal generation for things that may not be enabled by any mods, eg; for thaumcraft aspects). Of course ore rarities could be set up to be dynamic, so the more mods requesting an ore, the more common it could be, but if a mod requests that it be more rare (eg: by passing a lower value into the ore request function) it may reduce the ore generated, (details obviously variable) And as an added bonus a small feature that I have been trying to push for for a while could be implemented to be enableable in the configs; metals being affected by fortune, (making it drop ore items rather than blocks obviously)
×
×
  • Create New...

Important Information

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