Failender
Forge Modder-
Posts
1091 -
Joined
-
Last visited
Everything posted by Failender
-
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"
-
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"
-
you need to send a packet to all player that have the gui open or they wont know about the update on server side
-
Then he shouldnt lie about us and tell us he is java experienced
-
EntityPlayer.inventory.addStackToInventory
-
player.inventory.addStackToInventory. or sth like that
-
http://lmgtfy.com/?q=minecraft+forge+remove+recipes
-
jup. changed that
-
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(); } } } }
-
aight will do so. any ideas for the check which block is my friend?
-
public static Item getItemFromBlock(Block blockIn) Ill just leave this here
-
public int getGrassColorAtPos(BlockPos p_180627_1_) Ill just leave this here.
-
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(); } } } } }
-
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?
-
Yeah.. Still thank you
-
Thats one idea, but has basically the same effect as the other way
-
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)
-
Should do the job, thank you. Although it would be GREAT to get a hook for that, just for future uses :b
-
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
-
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
-
Unable to move items while in custom furance gui.
Failender replied to Vladan899's topic in Modder Support
You are opening The gui on client side. Open The gui on Server side, The Server will Inform The client about it -
Trying to make wood be unbreakable by hand unless right tools
Failender replied to Mr.sKrabs's topic in Modder Support
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 -
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
-
Trying to make wood be unbreakable by hand unless right tools
Failender replied to Mr.sKrabs's topic in Modder Support
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