Jump to content

Failender

Forge Modder
  • Posts

    1091
  • Joined

  • Last visited

Everything posted by Failender

  1. public EntityVehicle(World world) { super(world); this.isEmpty = true; this.preventEntitySpawning = true; this.ignoreFrustumCheck = true; this.setSize(0.9999F, 1.5f); } So. Where are u setting file?
  2. Well.. U should seriously clean up your workspace. Its like the first one hundred lines are errors that arent even related to this problem
  3. he told u to look how a chest works. now how BlockContainer works
  4. dont use SideOnly if u dont know what its doing.
  5. only lookup the field in the static block. everything else stays where it is
  6. Wrong forum sir. This forum is for ppl looking for help with coding their mod. I guess u want to be here http://www.minecraftforge.net/forum/index.php/board,15.0.html Also post ur log when u want help. we are no wizards
  7. ur error is printed there. google it and u will find results. why the hell are u calling get with a 0 as arg..
  8. RenderGlobal.class.getDeclaredField(fieldname)
  9. If ur question was how to get the value from a Field, u use Field#getValue and cast that
  10. wel thats strange and should not be happening. but since u want to change the hotbar anyway, I think u should consider triing to replace the player inventory. I have started to research on that but my results were not satisfacting. try looking inside EntityPlayer and finding out which variables need to be changed.. player.inventory for sure.
  11. what do you mean "keeps all the same"? Is the syso with "sucesfully rotated" not printing what u expect? or are u calling the value elsewhere and getting only 0 as value? if u are getting only 0 as value, u should think of the fact that u need to sync the values between client and server.
  12. Found an improvement! I got to a problem when I wanted to catch the opening of a Furnace opening. Since I need to access the furnace I need its position, which is not possible thorugh GuiOpenEvent. Got me to the point where I realized it is better to use PlayerInteractEvent to catch the opening of e.g. the furnace inventory and open my own @SubscribeEvent public void interact(PlayerInteractEvent event) { if(event.action == Action.RIGHT_CLICK_BLOCK) { if (event.entityPlayer.worldObj.getBlockState(event.pos).getBlock()==Blocks.furnace) { System.out.println("test"); event.setCanceled(true); } } } I am only at the point where i syso test of course i will open my own inventory there :b
  13. in 90% of the cases where u think u might need ASM u wont.
  14. seems like the method getEntityTexture is calling getEntityTexture, which is resulting in a StackOverFlow
  15. Failender

    APIs

    they are used to "communicate" or use features of other mods. RF Api e.g.
  16. I am sorry but.. If u are asking this u are most likely not able to pull it off.
  17. well. then u can just go on like @SubscribeEvent public void guiOpened(GuiOpenEvent event) { if(event.gui==null) return; if(event.gui instanceof GuiInventory) { if(Minecraft.getMinecraft().thePlayer.capabilities.isCreativeMode) return; //open custom GuiInventory } if(event.gui instanceof GuiFurnace) { //open custom GuiFurnace } } This solution might be a bit hacky and i am quite sure there are better.
  18. Failender

    APIs

    https://en.wikipedia.org/wiki/Application_programming_interface
  19. coremods allow u to change actual vanilla code. which can be a pain in the ass and should ONLY be done if u are seriously experienced in java
  20. Well. I am working on sth similar right now. My ideas might not be ideal but they work. If u find sth better please tell me. The problem is this WONT be compatible with other mods usiing GuiContainer. U can catch minecraft triing to open up a gui. E.g. Inventory. Then u need to open ur custom inventory using ur custom data. U can also try to replace player.inventory with a custom inventory, but I found this to be EXTREMLY hard because there was always one little place where minecraft somehow accessed the "original" inventory and not mine and I was unable to track that. @SubscribeEvent public void guiOpened(GuiOpenEvent event) { if(event.gui!=null && event.gui instanceof GuiInventory) { if(Minecraft.getMinecraft().thePlayer.capabilities.isCreativeMode) return; //open custom inventorygui here } }
  21. I think u need to do some custom rendering. use a custom gui, cancel minecraft RenderGameOverlayEvent with ElementType.JUMBAR (I think check it out urself) and then render it urself, just with the inventory u want
  22. Hey guys, I am experiencing problems with InventoryHelper.dropInventoryItems. I am using the variable inventoryLimit to limit the inventory a player can hold (using ItemPickUp event custom guis etc etc.) the following code is part of my IEEP. Basically I want the player to drop parts of his inventory if the newLimit is smaller then the old inventoryLimit, because he cant "hold it anymore". My problem is that sometimes the items dupe. I check the content of my toDrop inventory via for loop to be sure the problem isnt inside the filling of the inventory. I checked eveything with 1 stack of stone. Console output is: [20:13:29] [server thread/INFO] [sTDOUT]: [de.failender.shadowsrising.util.ExtendedPlayer:setInventoryLimit:90]: 0 64xtile.stone@0 But sometimes there is 64 Items dropped (the stack) sometimes more (biggest I had was 118) Am I doing something terribly wrong or is the InventoryHelper buggy? public void setInventoryLimit(int newLimit) { if(player.worldObj.isRemote) { inventoryLimit = newLimit; return; } if(newLimit<inventoryLimit) { InventoryPlayer inv = player.inventory; InventoryBasic toDrop = new InventoryBasic("", false, inventoryLimit-newLimit); for(int i=newLimit; i<inventoryLimit ; i++) { toDrop.setInventorySlotContents(i-newLimit, inv.getStackInSlot(i)); inv.setInventorySlotContents(i, null); } for(int i=0; i<toDrop.getSizeInventory(); i++) { if(toDrop.getStackInSlot(i)!=null) System.out.println(i+" "+toDrop.getStackInSlot(i)); } InventoryHelper.dropInventoryItems(player.worldObj, new BlockPos(player.posX, player.posY, player.posZ), toDrop); } inventoryLimit = newLimit; }
×
×
  • Create New...

Important Information

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