I now found another way to change the Block.
What I did for that was to create a new event called UseHoe and recoded the part where the dirt block is swapped with the farmland but I had to do that without par7 (so I did "int par7 =1") from onItemUse (net.minecraft.item.ItemHoe).
Inside that event I swapped the Line
Block block1 = Block.farmland;
with
Block block1 = (Block)Block.blockRegistry.getObject("BetterFarmLand:BlockFarmLandNew");
Does anybody know what par7 is used for?
__________________________
What I have also tryed was a reflektion of
public static final Block farmland = (Block)Block.blockRegistry.getObject("farmland");
to
public static final Block farmland = (Block)Block.blockRegistry.getObject("BetterFarmLand:BlockFarmLandNew");
Then I was seeing, that the blocks were swapped but there was no difference in the game, but (System.out.println showed me that the Block farmland was BlockFarmLandNew)
Does anybody have any idea?
I want to change the behavior of the farmland block. So I've made a simple block, that extends it.
Bevore 1.7 I've used
Block.blocksList[FarmlandBlockID] = null;
Block newfarmland = (new BlockFarmlandNew(FarmlandBlockID)).setUnlocalizedName("farmland").setTextureName("farmland");
GameRegistry.registerBlock(newfarmland, "farmland");
but blocksList was removed, does anybody know another way to remove an registred block?
3 replies
Important Information
By using this site, you agree to our Terms of Use.