Failender
Forge Modder-
Posts
1091 -
Joined
-
Last visited
Everything posted by Failender
-
Spawning my entity causes gamecrash[STILL UNSOLVED]
Failender replied to ItsAMysteriousYT's topic in Modder Support
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? -
Spawning my entity causes gamecrash[STILL UNSOLVED]
Failender replied to ItsAMysteriousYT's topic in Modder Support
Well.. U should seriously clean up your workspace. Its like the first one hundred lines are errors that arent even related to this problem -
he told u to look how a chest works. now how BlockContainer works
-
[1.7.10]Client crashes when opened GUI on a server[SOLVED!]
Failender replied to TominoCZ's topic in Modder Support
dont use SideOnly if u dont know what its doing. -
only lookup the field in the static block. everything else stays where it is
-
-
[1.7.10]Client crashes when opened GUI on a server[SOLVED!]
Failender replied to TominoCZ's topic in Modder Support
show log. -
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
-
ur error is printed there. google it and u will find results. why the hell are u calling get with a 0 as arg..
-
RenderGlobal.class.getDeclaredField(fieldname)
-
If ur question was how to get the value from a Field, u use Field#getValue and cast that
-
[1.8] Dupe bug in InventoryHelper.dropInventoryItems
Failender replied to Failender's topic in Modder Support
bump -
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.
-
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
-
in 90% of the cases where u think u might need ASM u wont.
-
seems like the method getEntityTexture is calling getEntityTexture, which is resulting in a StackOverFlow
-
they are used to "communicate" or use features of other mods. RF Api e.g.
-
I am sorry but.. If u are asking this u are most likely not able to pull it off.
-
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.
-
https://en.wikipedia.org/wiki/Application_programming_interface
-
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
-
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 } }
-
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; }