Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Content Count

  • Joined

  • Last visited

Community Reputation

1 Neutral

About xorinzor

  • Rank
    Tree Puncher
  1. I havent found any references to the ItemStackHandler yet though, and the examples and tutorials about Capabilities that I've seen on Capabilities are really confusing
  2. After multiple different attempts I haven't really gotten a single step further unfortunately. I did change my code where I extend the FakePlayerFactory, FakePlayer and it's PlayerInventory and InventoryContainer (with subsequent Slot's) classes, but overriding all methods relating to getting, setting and transferring ItemStacks didn't seem to prevent the shift+click either. Regular grabbing still gets prevented though, inserting items unfortunately is still possible too. EDIT: changed the title of the topic too, as I feel this may better reflect the goal. EDIT 2: The classes that I c
  3. Awesome. That's exactly the kind of method I was looking for.
  4. Interesting, haven't seen any of the resources I've read use such a class. I'll look into that. Thanks.
  5. No that's not required, you can use ItemStack.EMPTY safely.
  6. Like Kitten said, you will need to modify their AI Pathfinding since that code still assumes leaves are a solid block and as such won't stop to reach their PathPoint until achieved (resulting in the jumping behaviour).
  7. Should probably start with that I've read multiple posts and checked various github repos / tutorials about this, but most of them seem under the impression that a client-side plugin is involved too, which isn't for me the case. Since it's server-side, there simply has to be a way to prevent a user from grabbing the item, as the server stores the data and not the client (else you could just spawn in items with a hacked client too). Currently I have a custom IInventory with this method: @Override public ItemStack removeStackFromSlot(int i) { return ItemStack.EMPTY; } Assign
  8. No, I meant in the literal way Not counting the old-school beeping of the motherboard here
  9. Oh, right, I did read the documentation, but misinterpreted the client/server side way. Should've figured since servers can't play sounds. derp. I don't check client or server side, since my mod is just a customization for the experience on my server. Good feedback on the SoundEvent though, that definitely helps!
  10. I'm trying to play a sound-effect for a player, via server-side code. However, none of these seem to trigger the sound effect, leaving me wondering if vanilla sounds use a different notation: ResourceLocation location = new ResourceLocation("minecraft:block.note.hat"); ResourceLocation location = new ResourceLocation("minecraft", "block.note.hat"); ResourceLocation location = new ResourceLocation("block.note.hat"); and using them with: player.world.playSound(player, player.getPosition(), new SoundEvent(location), SoundCategory.MASTER, 1, 1); What's going wrong here?
  11. haha oh boy, I'd rather not This seems to work, so I'll just go with it. public void someMethod() { checkFreeSlot: { for(int i=0; i < 36; i++) { if(player.inventory.getStackInSlot(i).equals(ItemStack.EMPTY)) { break checkFreeSlot; } } //Failed check return; } //Check passed, do something. }
  12. Yea, all it needs to do is just check for a empty spot. Was hoping a iterator wouldn't be necessary, but I guess not haha.
  13. So, maybe I'm just trying to cut corners here, but none of these IF-statements seem to be returning true, despite the inventory definitely having empty slots. if(player.inventory.hasItemStack(ItemStack.EMPTY)) { //Do something } if(player.inventory.hasItemStack(new ItemStack(Items.AIR))) { //Do something } if(player.inventory.hasItemStack(new ItemStack(Blocks.AIR))) { //Do something } Am I really going to have to add the code to iterate over all slots in the inventory? or is there a much simpler way that I'm just not seeing here? (something along the lines of, less = more. E
  14. Hi, I've been trying to make a server-side mod to open up a regular chest inventory screen on a client and display some items, but for some reason the screen either flashes very briefly, or just doesnt open at all. I thought maybe it was something to do with setting Inventory slot contents, but after commenting out that code, the problem persisted. This is the class that opens up the inventory as well as updates it (haven't gotten to that part yet though.) public class RandOMat { private final EntityPlayerMP target; private final EntiyPlayerMP fakePlayer; private int ste
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.