Jump to content

Thornack

Members
  • Posts

    629
  • Joined

  • Last visited

Everything posted by Thornack

  1. Ok Ill have to update thanks for the tip
  2. Hey I cant find the LivingHealEvent. Im in forge version 1.7.10-10.13.2.1230.jar Is this event a new one?
  3. Hmm Im looking for a better solution than that. Thats a bit too hacky for my liking
  4. Awesome.... That kind of sucks actually...
  5. Hi everyone, I was wondering if anyone would happen to know how to disable hp regeneration for the player. I want it disabled when a condition is true for my player. Since peaceful mode makes it so that your hp regens over time i want this disabled for my player when he is morphed into one of his party members. Any ideas? [EDIT] This has been Solved see the solution in http://www.minecraftforge.net/forum/index.php/topic,34056.0.html
  6. Any other ideas to try and make this a bit smoother, jumps around a bit still and is a bit jaggedy
  7. @SubscribeEvent public void renderTick(RenderTickEvent event){ ExtendedPlayerProperties epp = ExtendedPlayerProperties.get(this.mc.thePlayer); if(epp.isMorphed() && this.mc.thePlayer.inventory.currentItem > 3){ this.mc.thePlayer.inventory.currentItem = 3; } } This smooths it out but its still not perfect. oh well
  8. This works but it is glitchy. @SubscribeEvent public void playerTick(PlayerTickEvent event) { ExtendedPlayerProperties epp = ExtendedPlayerProperties.get(event.player); if(epp.isMorphed() && event.player.inventory.currentItem > 3){ event.player.inventory.currentItem = 3; } }
  9. I tried the following but it didnt work it sometimes makes it past the 4th item and it is very very glitchy public void mouseEvent(MouseEvent event) { ExtendedPlayerProperties epp = ExtendedPlayerProperties.get(this.mc.thePlayer); if(epp.isMorphed() && event.dwheel !=0){ if(this.mc.thePlayer.inventory.currentItem > 3){ this.mc.thePlayer.inventory.currentItem = 0; } } }
  10. Ya that is what I was worried about. Ive been messing with @SubscribeEvent public void mouseEvent(MouseEvent event) { ExtendedPlayerProperties epp = ExtendedPlayerProperties.get(this.mc.thePlayer); if(epp.isMorphed()){ int dwheel = event.dwheel; System.out.println(dwheel);// always -120, 120 or 0 } } why is dwheel -120,120, or 0
  11. I wonder if it is possible to remap the scroll wheel to only select the slots that I want slots 0-3 and 5 in the main player inventory. Ive been trying to find out where vanilla does this but am stumped atm
  12. Hi everyone, If you have been following along I am trying to disable vanilla inventory functionality based on a condition completely so that I may implement my own. Thansk to coolAlias I have disabled the hotbar buttons 1-9 and the E key but the scroll wheel still allows you to select all of the HUD slots (rather than the custom 4 that I want to select) Does anyone know how to disable the scroll wheel from selecting itemslots in the main Inventory hud?
  13. Hi everyone, So I figured out how to get it to show up. But there is a problem, whenever I resize the window the gui doesnt stay in the spot I place it. Not sure why. protected void renderHotbar(int width, int height, float partialTicks) { mc.mcProfiler.startSection("actionBar"); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(itemHUDTexture); InventoryPlayer inv = mc.thePlayer.inventory; drawTexturedModalRect(width/2 + 140, height/2 + 200, 0, 0, 182, 22); <--- draws the custom hotbar I made drawTexturedModalRect(width/2 +140 +inv.currentItem * 20, height/2 + 200, 0, 22, 24, 22); <--- draws the gui overlay that shows which item is selected GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL12.GL_RESCALE_NORMAL); RenderHelper.enableGUIStandardItemLighting(); for (int i = 0; i < 9; ++i) { int x = width / 2 + i * 20 + 2; int z = height; renderInventorySlot(i, x, z, partialTicks); } RenderHelper.disableStandardItemLighting(); GL11.glDisable(GL12.GL_RESCALE_NORMAL); mc.mcProfiler.endSection(); } But whenever I resize the window the gui jumps around. Any idea why? I call this method in the public void RenderBattleGUI(RenderGameOverlayEvent.Post event) if(myCondition){ int width = event.resolution.getScaledWidth(); int height = event.resolution.getScaledHeight(); renderHotbar(width, height, 1); }
  14. Ive been looking for the code and I have no idea where the vanilla HUD inventory renders
  15. Hi everyone, I want to change the HUD inventory Rendering by replacing the gui temporarily to simulate swapping of inventories. If your ead my other post I successfully manipulated the vanilla hud inventory to essentially be a different inventory that is triggered based on a condition. I was wondering about the HUD rendering, how would I replace the GUI of the inventory HUD with my own custom one based on a condition that is set in my players IEEP class. if condition is true -> render my custom HUD inventory if condition is false -> render default vanilla inventory hud
  16. This worked if(getHeldItem(player) != null){ ItemStack myItemStack = new ItemStack(getHeldItem(player).getItem(), 1); EntityItem entityitem = new EntityItem(player.worldObj, player.posX, player.posY+1, player.posZ, myItemStack); entityitem.delayBeforeCanPickup = 10; player.worldObj.spawnEntityInWorld(entityitem); }
  17. Ya I am using eclipse but it isnt there. ctrl + shift T and Inventory in search bar returns InventoryPlayer, InventoryBasic, InventoryCrafting, InventoryCraftResuld, InventoryEffectRenderer, InventoryEnderChest, InventoryLargeChest, InventoryMerchant
  18. hmm I cant seem to find the Inventory Helper where is it located
  19. Hi Everyone, I have access to the itemstack. How do you force an itemstack to be dropped from the players inventory? I have this function that returns the itemstack from the specified slot in the hud inventory. I need to force this item to be dropepd on the ground. any ideas? public ItemStack getHeldItem(EntityPlayer player){ if(player.inventory.mainInventory[5] != null){ heldItem[0] = player.inventory.mainInventory[5]; return heldItem[0]; } return null; }
  20. I have a question. How would I alter the rendering of the vanilla HUD inventory. Ive been looking into it and Im not sure where to even begin. onRenderOverlayEvent?
  21. So I suspect I still need a custom inventory to accomplish all of that as I dont think vanilla will let me do the discrimination bit. The items will still get added to the players main inventory even if I run a check for the HUD slots since the way I disable the main inventory just stops the gui from opening but still preserve all of the regular item pickup mechanics for the player.
  22. So basically inside my IEEP class how would I ensure that they are saved correctly. I dont think Ive ever saved an Itemstack array to NBT In My IEEP class I have the NBT methods but how do you save an itemstack to NBT properly @Override public final void saveNBTData(NBTTagCompound compound) { NBTTagCompound properties = new NBTTagCompound(); compound.setTag("ExtendedPlayerProperties", properties); } @Override public final void loadNBTData(NBTTagCompound compound) { NBTTagCompound properties = (NBTTagCompound) compound.getTag("ExtendedPlayerProperties"); Also, im not sure if this will work as I need to be able to discriminate what kinds of items can go into my custom hotbar inventory. And when a player picks up an item while the custom condition is true I need the item to remain unpicked up so as to not add it to player storage or to the HUD as I want to only allow special items to be placed into the custom HUD.
  23. Ya Im unsure what the issue is, If anyone knows what im missing id appreciate your input. As a side note, Thanks to coolAlias I got the cancellation of hotbar key input to work based on my condition. So to cancel the vanilla hotbar completely this is what you need. I use 2 events, KeyInputEvent -> it is a EventsFMLCommon event so register it properly-> (Also to get the instance of the player for my IEEP properties I needed to set up a method in Client proxy to get the player (I believe this was necessary) seems to work on dedicated and integrated server so thats sweet). Please note that-> "Setting the keybinding state to false is not, in itself, sufficient - you MUST call #isPressed() to decrement the 'pressed' counter in the keybinding or #isPressed will still return true once even after the key state is set to false." - coolAlias Then you should cancel the rendering of the hotbar by using RenderGameOverlayEvent.Pre event -> This is an event that needs to be fired client side only so again register it properly And that is it for cancelling Vanilla Hotbar Inventory. Note* I Still dont know how to unhook the currently selected item from the hotbar so that when you transfer inventories you dont "bring it with you". The above will intercept the 1,2,3,4,5,6,7,8,and 9 key presses and cancel them. To disable the main inventory from use I used Which cancels the opening of the inventory GUI for most cases -> for some reason I get a crash when cancelling the container, chest, enderchest, and crafting table Now I need to implement my custom storage and this is where I am stuck. I know I have to register it and I know I have to somehow have it show up in the player HUD and then remap the 1,2,3,4,5,6,7,8,9 and E keys to work with/open my inventory. But the getting it to show up in HUD is a problem. Im not sure how to do that.
  24. Ya I think this method might work for me though. My main question atm is how do I get my custom inventory to show up in the player HUD. I think I am missing something. Ive never worked with the container class and I followed a tutorial but I dont think it was exactly complete.
  25. I have some of this figured out but I have a few questions. 1) I have no idea how to override vanilla keybinding to temporarily disable the 1,2,3,4,5,6,7,8,9 and E keys from allowing access to the default vanilla inventory when my custom one is enabled. 2) I need a way to unhook the currently held item from the player so that it is "left" behind in the vanilla inventory when the new custom inventory replaces the default one 3) I have my Inventory Class, Container Class and Gui Class As follows and am not sure where to go from this point to achieve the above goals. I dont know how to get my inventory to be linked to my player and am currently stuck at this point. Here are my classes -> The inventory does not work atm it doesnt show up. Any and all help is greatly appreciated
×
×
  • Create New...

Important Information

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