Jump to content

TLHPoE

Members
  • Posts

    638
  • Joined

  • Last visited

Everything posted by TLHPoE

  1. I just now tested my mod with multiplayer, but the server immediately crashes because it can't find a class. Not sure how to fix since I'm clueless on SMP-based modding. Crash My Code
  2. I linked this up to my PlayerTickHandler to try to do this, but no results. :I
  3. Is there a way to detect if an item has been removed/placed inside of a slot, and tell what was added to the slot and what was removed?
  4. Here's the whole IWorldGenerator: I'll go fix that.
  5. So I'm currently trying to spawn my custom dungeon in separate places, but they 100% of the time, spawn right next to each other and intersect. Segment of code from my IWorldGenerator: public void generateSurface(World world, Random random, int chunkX, int chunkZ) { for(int i = 0;i < 2;i++) { int x = chunkZ + random.nextInt(16) - random.nextInt(16); int y = random.nextInt(64); int z = chunkZ + random.nextInt(16) - random.nextInt(16); WorldGenGoldDungeons gen = new WorldGenGoldDungeons(); if(gen.generate(world, random, x, y, z)) { System.out.println("X: " + x + "Y: " + y + "Z: " + z); } } } And here is my WorldGenerator class:
  6. Aww. Well, I guess I'll be sticking with Minecraft's buffs then. Thanks anyways.
  7. I'm currently trying to make my own buff system, kind of like Terraria's.
  8. I was just trying to looking in on how to make the player fire proof, or give the player damage buffs without using potion effects. I've tried using the extinguish method on a tick. Doesn't stop lava damage though. :I
  9. So I've copied the Furnace's and Workbench's code for facing the right way, but in the inventory, it doesn't have the texture on front. It also rarely faces the right way when I place it. BlockTinkerWorkshop:
  10. I've been looking through the potion code, but I could only find their ID's and how healing and about 2 other potions work.
  11. So I've followed SoBiohazardous's tutorial on key binds, but my only problem now, is that my key bind is called whenever the player is typing something or in their inventory. Is there a way to detect if the player is typing or in another GUI?
  12. Because the code I need cannot be used. Let me explain.. try{ NBT compound = whatever; }catch{ //Exception Here } I cannot use compound anywhere else except for the try/catch statement. That was basic Java my friend...
  13. Nope. Also tried surrounding the if() with another one with the !world.isRemote.
  14. I thought hasKey would work, but apparently not. I have my code setup inside of a player tick handler, and it constantly spams "HI1" in the console. public static void playerTick(EntityPlayer player) { String playerName = player.username; NBTTagCompound worldNBT = player.worldObj.getWorldInfo().getNBTTagCompound(); if(!worldNBT.hasKey(playerName + "Gold")) { GloriaRPG.print("HI1"); worldNBT.setInteger(playerName + "Gold", 0); }
  15. Here it is:
  16. I'm currently making my own inventory, but whenever I try shift clicking in one of my custom slots, it crashes. Same thing with the inventory slots, but that is kind of expected. ContainerAccessories:
  17. You could always save it to the world's NBT tag compound.
  18. I'm adding in an accessory system, but I have no clue what to do when the player dies. So I made a PlayerTickHandler class and made it check if the player was dead and if the world was not remote. Everything works fine, except for the amount of items it drops. If I put in 2 blocks of wool into 2 slots, and I die, it drops 4 blocks of wool. It's like it just multiplies the amount of items I have and drops it. Here's a snippet of my code: if(player.isDead && !player.worldObj.isRemote) { NBTTagCompound playerNBT = player.getEntityData(); if(playerNBT != null) { NBTTagList nbtTag = playerNBT.getTagList("Accessories"); for(int i = 0;i < nbtTag.tagCount();i++) { NBTTagCompound nbt = (NBTTagCompound)nbtTag.tagAt(i); byte slot = nbt.getByte("Slot"); if(slot >= 0 && slot < 7); { player.dropPlayerItem(ItemStack.loadItemStackFromNBT(nbt)); } } } }
  19. I'm working on my inventory class, on the decrStackSize method. For some reason, when I take my item out and try to place it in a stack, it doesn't affect the stack at all. None of the numbers change, the item stack from the inventory just vanishes. @Override public ItemStack decrStackSize(int i, int j) { ItemStack itemStack = slots[i]; slots[i].stackSize = 0; return itemStack; }
  20. omg mazetar <3 IT WORKSSSSSSSSSSSSSS
  21. Haven't really looked into reeds, but I think you should be looking at this method instead. block.canSustainPlant
  22. For the writing part, how would I write that NBTTagList to the player's NBTTagCompound with a String?
  23. Am I doing this right? It doesn't save/load the item stacks at all.
  24. Is there a way to store an ItemStack into an NBTTagCompound with a String key?
  25. Well, if I did my math right, the next ID available would be 37. I tried 37, and went all the way up to 42. Crashed Crash ContainerAccessories:
×
×
  • Create New...

Important Information

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