Jump to content

Failender

Forge Modder
  • Posts

    1091
  • Joined

  • Last visited

Everything posted by Failender

  1. there are several worldobjects that exist while playing minecraft. so u cant just take any worldobj and say thats the one i need. it depends on why u need it
  2. so. there are two ways. tell us why u need an worldobj. or we cant help.
  3. how do u call getCoolDown and why do u need an worldObj there.
  4. show the methods where u need it, nad most likely we will be able to show u where u get the worldObj from.
  5. because everywhere where u dont got an access to an worldObj u will most likely not need it.
  6. Alright. Managed to do a lot. (Apparently strg v code messes up the formatting a bit) Created my own class, which does nothing but reduce the inventory size. Applied the inventory every time the player joiins the world. Two problems I got right now. 1. The player picks up items, even though his inventory is already full. I am confused, this shouldnt happen since the important methods of InventoryPlayer seem to always iterate over mainInventory.length 2. The hotbar only updates after opening the custom gui public class InventoryPlayerCustom extends InventoryPlayer{ public InventoryPlayerCustom(EntityPlayer playerIn) { super(playerIn); mainInventory = new ItemStack[18]; } } @SubscribeEvent public void joining(EntityJoinWorldEvent event) { if(event.entity instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) event.entity; player.inventory = new InventoryPlayerCustom(player); } } EDIT: I guess I could be fixxing the 2nd problem by rendering it on my own, but I dont understand it. Normally the hotbar renderer should access the first 9 slots in the InventoryPlayer, where InveotryPlayer is my class and the first 9 slots shouldnt be out of sync
  7. Look how vanilla synchronizes the furnace.. ContainerFurnace
  8. http://i.imgur.com/IppKJ.jpg%3Ffb[/img]
  9. This post is getting out of control.
  10. Hello guys, I am triing to change the size of the player inventory. He can upgrade it later so it gets bigger again. I would render the inventory gui on myself later. My problem is the setting of the inventory size. I thought using the entity construct event would allow me to do so, but im wrong. First problem is, that at the time the event is fired the player.inventory is null (which makes no sense to me, since it is initialized via public InventoryPlayer inventory = new InventoryPlayer(this) If I set the inventory myself via player.inventory = new InventoryPlayer(player); it gets overriden by vanilla. So my question is: How can I change the size of the inventory of the player? Do I need to create a custom class, overriding the inventory? Where do I need to apply my changes? Mfg Failender
  11. only do changes on important stuff on server side (!worldObj.isRemote) . if u need those values on client side sync them. (packets or Containers got an additional way of syncing when they are opened)
  12. dont mod when in a rush. saying "I only got five minutes left" will bring you nowhere. send the packet. when receiving the packet send the value to the opened gui.
  13. u can. but u dont. because thats total bs.
  14. http://www.minecraftforge.net/forum/index.php/topic,20135.0.html
  15. dont know about that error, but why are u taytracing three times thats waste of processing time. raytrace once, save the result, read x/y/z from it
  16. guess u should be searching more.
  17. You need this in a gui right? U dont need packets then. use detect and send changes. there u can use crafter.sendProgressBarUpdate. look at vanilla furnace for example
  18. bump after less then 3 hours? seriously?
  19. you need to use a raycast
  20. you dont need to store an entire object to know of the spawner. just save the x/y/z of the spawner in the attributes and access the spawner when you need it (when the mob despawns)
×
×
  • Create New...

Important Information

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