Jump to content

TheOnlyTrueEnte

Members
  • Posts

    33
  • Joined

  • Last visited

Everything posted by TheOnlyTrueEnte

  1. I can recommend this playlist: This is the Tools Video
  2. That doesn't help. Even if I override the method to always return true, mushrooms can still only be placed there at a low light level. Like I said, BlockMushroom's method isValidPosition only ever checks the supporting Block's canSustainPlant if the light level is under 13.
  3. Solution: it's just not possible Hi there, my mod adds variations of Mycelium and Podzol but I don't know how to get mushrooms to be able to grow on them in direct sunlight. The BlockMushroom class' isValidPosition method directly checks the block below against Blocks.PODZOL and Blocks.MYCELIUM. Then it checks the light level and ONLY IF IT'S DARK ENOUGH, it checks the ground Block's canSustainPlant. So just overriding this method doesn't work. Is there some sort of Event that checks for a valid block position that I can't find or am I looking in an entirely wrong place. Thanks in advance.
  4. Just noticed this bug when making custom Farmland extending from BlockFarmland. This is what it looks like: private boolean hasCrops(IBlockReader p_176529_0_, BlockPos worldIn) { IBlockState state = p_176529_0_.getBlockState(worldIn.up()); return state.getBlock() instanceof net.minecraftforge.common.IPlantable && canSustainPlant(state, p_176529_0_, worldIn, EnumFacing.UP, (net.minecraftforge.common.IPlantable)state.getBlock()); } This is what it should look like imo: private boolean hasCrops(IBlockReader p_176529_0_, BlockPos worldIn) { IBlockState plantState = p_176529_0_.getBlockState(worldIn.up()); IBlockState blockState = p_176529_0_.getBlockState(worldIn); return plantState.getBlock() instanceof net.minecraftforge.common.IPlantable && canSustainPlant(blockState, p_176529_0_, worldIn, EnumFacing.UP, (net.minecraftforge.common.IPlantable)plantState.getBlock()); } The reason is that the first argument of canSustainPlant should be the blockState of the supporting block, here farmland. The method is being passed the state of the plant, however. For me, this caused a crash, because in my CustomFarmland's canSustainPlant method, I checked an IProperty from the passed state, however the plant state that was passed doesn't have that IProperty. Ended up just overriding tick() so I don't have a problem here anymore.
  5. Hi, I've been trying to get Forge's blockstates to work with my mod to save some time with the blockstate files. I added the file assets/minecraft/blockstates/acacia_slab.json to my mod resources but it doesn't work: the placed acacia slabs just display the standard purple/black cubes. acacia_slab.json: { "forge_marker": 1, "defaults": { "textures": { "top" : "minecraft:block/acacia_log_top", "side" : "minecraft:block/acacia_log", "bottom" : "minecraft:block/acacia_log_top", "end" : "minecraft:block/acacia_log_top" } }, "variants": { "type": { "bottom" : { "model": "minecraft:block/slab" }, "top" : { "model": "minecraft:block/slab_top" }, "double" : { "model": "minecraft:block/column" } } } } I tried a lot of stuff with this. Even if I just copy the default file and only add "forge_marker": 1, it still displays the broken model. Where did I go wrong? I have not found anything about these Blockstates not working at all on 1.13.
  6. Yeah, you mean this, right? @SubscribeEvent public static void registerBlockColors(final ColorHandlerEvent.Block event){ event.getBlockColors().register(MY_BLOCK_COLOR, MY_BLOCK); } This doesn't work either. The function is never called.
  7. SOLUTION: Extra class for the color registration event: public static class RegistryEvents { @SubscribeEvent public static void registerBlockColors(final ColorHandlerEvent.Block event) { BlockColors blockColors = event.getBlockColors().register(MY_BLOCK_COLOR, MY_BLOCK); } } Then, in the main mod method, register that class to the main event bus: MinecraftForge.EVENT_BUS.register(RegistryEvents.class); PROBLEM: I'm trying to create a block like grass that changes its color depending on the biome it's in. I know that I'm supposed to create an IBlockColor, then call Minecraft.getInstance().getBlockColors().register(IBlockColor, Block); However, everywhere that I've tried this, getBlockColors() returns null. I've tried creating an event "registerBlockColors" within my RegistryEvents class, but it never gets fired. @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD) public static class RegistryEvents { @SubscribeEvent public static void registerBlockColors(final ColorHandlerEvent.Block event){ //this event is never fired Minecraft.getInstance().getBlockColors().register(MY_BLOCK_COLOR, MY_BLOCK); //EDIT: This doesn't work either because the surrounding function is never called. event.getBlockColors().register(MY_BLOCK_COLOR, MY_BLOCK); } //other SubscribeEvents are in here } What am I doing wrong? I've tried adding the BlockColors via Minecraft.getInstance()... in an onBlockActivated function just to see if my colors work and they do. But this is very obviously the wrong place to register them.
×
×
  • Create New...

Important Information

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