Jump to content

ipsq

Members
  • Posts

    22
  • Joined

  • Last visited

Everything posted by ipsq

  1. Could you give an example of that? I'm not experienced with the reflection api..
  2. I'm creating a mod that is completely client side so modding the server side is not an option. I'm not altering the players health, I'm acting based on the current (nothing with the player itself).
  3. Is it possible to overwrite the standard packet handler from Minecraft? So I can alter the way the client handles stuff like health changes etc.?
  4. So those events are server side only? Is there a way to intercept the packets that the server sends to the client in case of stuff like health change etc?
  5. Do all events from Forge also work in multiplayer servers? @SubscribeEvent public void onHurt(LivingHurtEvent e) { System.out.println(e.entity.getClass()); } I find this doens't work in multiplayer servers. Is this correct?
  6. Ok, and does it matter if the account is migrated? Do I have to specify email or username?
  7. How do I debug in online mode? What steps do I have to take and what parameters do I have to add to my run configuration? I couldn't find anything on the wiki or the forum about this.
  8. Because my mod is mostly used on multiplayer servers I have to account for the fact that the item in question can sometimes have a different name etc.
  9. You don't need those parameters, this is the fixed code: @Override public TileEntity createNewTileEntity() { return new TileEntityDistillationChamberGag(); } @Override public TileEntity createNewTileEntity() { return new TileEntityDistillationChamberGag(new TileEntityDistillationChamberFrame()); }
  10. When you create the class, you could pass in the reference in the constructor and then assign it to a property. You could also create a method in the class that accepts the reference and does something with it. There are numerous ways to pass along reference to instances. ClassCastExceptions arise when one tries to cast an instance of an ObjectA to ObjectB when ObjectA doesn't extend or implement ObjectB. For example if you have an ArrayList, a ClassCastExceptions will be thrown when you try to cast this to a Map. A good way to prevent this is to check before you cast: if (ObjectA instanceof ObjectB) { /** Do your stuff **/ } NullPointers arise when one uses a variable or a property while it hasn't been assigned yet. So if you create a variable like `String foo;` or `String foo = null;` and you start calling methods on it like foo.equalsIgnoreCase("bar") it throws an exception because foo is used as a string while it's a null. When you come across this a lot, try assigning values in your constructors more or make sure a value has been set before using it: if (foo != null) { /** Do your stuff **/ } Hope this helps.
  11. So since stuff like iconString and unlocalizedName are protected and there isn't an easy way to get those (plus I'm not sure if Bukkit gives those items another name then default, then this value might differ), is there maybe a way to compare the itemIcon property?
  12. If the field is public and you have a reference to that class, it's pretty straightforward.
  13. I already found a working solution. Thanks for the help anyway!
  14. I just want to to trigger a right click action on this item. The server needs to know I pressed the right mouse button. There is nothing going on, on the client side.
  15. public ItemStack useItemRightClick(World p_77957_1_, EntityPlayer p_77957_2_) { return this.getItem().onItemRightClick(this, p_77957_1_, p_77957_2_); } public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { return p_77659_1_; } This doesn't appear to do a lot?
  16. How do I do it then?
  17. I want to trigger it and I already found it. For the peeps interested: minecraft.playerController.sendUseItem(player, player.getEntityWorld(), inventory.getCurrentItem());
  18. Is there a way to right click an item in the hotbar? I'm not talking about food, I want to right click a stick. Is this possible?
  19. I'm not trying to destroy an item. I'm trying to select a hotbar slot.
  20. Neither this: player.inventory.currentItem = 0; Nor this: player.inventory.changeCurrentItem(0); Appears to be working...
  21. But does this spawn a new item or does it just select it?
  22. I'm trying to select a hotbar slot with a certain item in it by first grabbing the inventory and scanning through the list of items to find a match. If I find a match, I want to select this slot but this is where I'm stuck. I can't find any method in the Inventory or Player API that let's me do that. Is this possible or did I overlook something?
×
×
  • Create New...

Important Information

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