Jump to content

Failender

Forge Modder
  • Posts

    1091
  • Joined

  • Last visited

Everything posted by Failender

  1. override getRenderType EDIT: Default for standard blocks is a RenderType of 3. If you take a closer look at BlockContainer you can see that minecraft overrides it with -1, which you need to change if you want a block to render "normal"
  2. If youre framerate drops that has NOTHING to do with "damn json parsing sux and is slow" because they arent parsing while you are playing to figure out "how do i render this"
  3. you need to send a packet to all player that have the gui open or they wont know about the update on server side
  4. Then he shouldnt lie about us and tell us he is java experienced
  5. EntityPlayer.inventory.addStackToInventory
  6. player.inventory.addStackToInventory. or sth like that
  7. http://lmgtfy.com/?q=minecraft+forge+remove+recipes
  8. jup. changed that
  9. nevermind. just found out what the tiles mean. For anyone who cares. The boolean flag is because setDead would make it tick one more time, so i set a checked flagg @SubscribeEvent public void worldTick(WorldTickEvent event) { for (Object obj : event.world.loadedEntityList) { if(obj instanceof EntityArrow) { EntityArrow arrow = (EntityArrow) obj; try { Field tileY = EntityArrow.class.getDeclaredField("yTile"); tileY.setAccessible(true); if(tileY.getInt(arrow)==-1) continue; NBTTagCompound compound = arrow.getEntityData(); if(!compound.getBoolean("checked")) { Field tileX = EntityArrow.class.getDeclaredField("xTile"); Field tileZ = EntityArrow.class.getDeclaredField("zTile"); tileX.setAccessible(true); tileZ.setAccessible(true); System.out.println(tileX.getInt(arrow)); System.out.println(tileZ.getInt(arrow)); System.out.println(tileY.getInt(arrow)); BlockPos pos = new BlockPos(tileX.getInt(arrow), tileY.getInt(arrow), tileZ.getInt(arrow)); event.world.setBlockState(pos ,Blocks.iron_ore.getDefaultState()); //compound.setBoolean("checked", true); arrow.setDead(); } } catch (Exception e) { e.printStackTrace(); } } } }
  10. aight will do so. any ideas for the check which block is my friend?
  11. public static Item getItemFromBlock(Block blockIn) Ill just leave this here
  12. public int getGrassColorAtPos(BlockPos p_180627_1_) Ill just leave this here.
  13. Hey guys, I managed to find the arrows I am looking for. My problem right now is that I am having problems to find the block the arrow is stuck to, from the EntityArrow. I got this right now, but my way of finding the correct BlockPos is.. total bullshit :'D @SubscribeEvent public void worldTick(WorldTickEvent event) { for (Object obj : event.world.loadedEntityList) { if(obj instanceof EntityArrow) { NBTTagCompound compound = new NBTTagCompound(); EntityArrow arrow = (EntityArrow) obj; arrow.writeToNBT(compound); if(compound.getByte("inGround")==(byte)1) { compound = arrow.getEntityData(); if(!compound.getBoolean("checked")) { BlockPos pos = new BlockPos(Math.floor(arrow.posX),Math.floor(arrow.posY),Math.floor(arrow.posZ)); event.world.setBlockState(pos ,Blocks.iron_ore.getDefaultState()); compound.setBoolean("checked", true); arrow.setDead(); } } } } }
  14. Everything works just fine. Problem right now is that I dont know how to get the block the block is stick to.. Any help given?
  15. Yeah.. Still thank you
  16. Thats one idea, but has basically the same effect as the other way
  17. Im doing a minigame where you can use diamond blocks as walls, so when they get hit they downgrade to iron and then vanish after another hit (I dont want to use a customblock even if I could just override the collide method there and have it done)
  18. Should do the job, thank you. Although it would be GREAT to get a hook for that, just for future uses :b
  19. Is there something like an ArrowCollideWithBlockEvent? I searched a lot, and only found events whenever the Player starts or Stop using the block, but noone indicating a hit on a block with an arrow
  20. Google Minecraft forge gui tutorial and you will find tons of them A 1.7/1.6 will also work for you, there were only minor changes
  21. You are opening The gui on client side. Open The gui on Server side, The Server will Inform The client about it
  22. if checkedBlock == Blocks.log (Not sure if it was Blocks.log , might need to replace that.
  23. no not in the vanilla class. use the events i told you http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571567-forge-1-6-4-1-8-eventhandler-and
  24. a small guide on how to be a forum moderator : presented by TGG 1. Show up way to late to the paty 2. Provide no helpful information 3. <3
  25. use break speed and harvestdrops event. in break speed divide the speed by a specific amount ( i think vanilla is using 5..?) in harvest drops clear the list if the block is wood and the equipped item isnt an axe
×
×
  • Create New...

Important Information

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