Jump to content

CaptainDoge

Members
  • Posts

    16
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

CaptainDoge's Achievements

Tree Puncher

Tree Puncher (2/8)

2

Reputation

  1. I am replacing stone and grass to change their hardness and resistance (I wouldn't be surprised if their was a better way). But I also wanted to change oak leaves to add my own features which I accomplished but I couldn't get trees to spawn my new leaves
  2. Just to be sure this is what is meant by either way didn't seem to make a difference I have removed the use of base classes, this \/ is what I have replaced it with I am not sure if this is correct but the items seem to behave properly Despite all these changes I am still getting the same behavior, after some experimentation I have found that some world gen works properly World gen that works: Lakes-Lava and water above and under ground Mine shafts normal stone world gen all ores dirt, gravel, andesite, diorite, granite patches World gen that doesn't work: caves in stone grass blocks sand Attached picture displays strange behavior
  3. I have been experimenting a bit and replaced grass_blocks an stone and it causes strange errors STONE: stone generates fine but caves don't spawn inside the stone GRASS: grass blocks don't generate instead there is just a lighting glitch and when updated spawns a non-textured block that behaves like grass yet the block still shows up in the creative tab and can be placed like normal LEAVES: behaves normally when placed by player but will not be generated by growing trees this is the method I am using to register these blocks @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD) public class RegistryEvents { @ObjectHolder("minecraft:stone") public static final Block STONE_BLOCK = null; @ObjectHolder("minecraft:grass_block") public static final Block GRASS_BLOCK = null; @SubscribeEvent public static void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent) { blockRegistryEvent.getRegistry().registerAll ( new Block(Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(5.0f, 6.0F).sound(SoundType.STONE)).setRegistryName("minecraft:stone"), new GrassBlock(Block.Properties.create(Material.ORGANIC).tickRandomly().hardnessAndResistance(1.5F).sound(SoundType.PLANT)).setRegistryName("minecraft:grass_block") ); } @ObjectHolder("minecraft:stone") public static final Item STONE_ITEM = null; @ObjectHolder("minecraft:grass_block") public static final Block GRASS_ITEM = null; @SubscribeEvent public static void registerItems(RegistryEvent.Register<Item> event) { event.getRegistry().registerAll ( new BlockItemBase(STONE_BLOCK, ItemGroup.BUILDING_BLOCKS).setRegistryName("minecraft:stone"), new BlockItemBase(GRASS_BLOCK, ItemGroup.BUILDING_BLOCKS).setRegistryName("minecraft:grass_block") ); } } This is the definition of BlockItemBase package com.Blocks; import net.minecraft.block.Block; import net.minecraft.item.BlockItem; import net.minecraft.item.Item; import net.minecraft.item.ItemGroup; public class BlockItemBase extends BlockItem { public BlockItemBase( Block blockIn, ItemGroup itemGroupIn) { super(blockIn, new Item.Properties().group(itemGroupIn)); } } It seems to me that there is another step in registration that I am missing, unless minecraft's generation code surrounding these blocks is inflexible which I hop isn't the case
  4. I have implemented these fixes and applied the same logic to registering items and everything seems to work fine until I grow a tree. This suggests to me that the Block is not fully overridden by this method, unless there is a strange exception in the Tree or foliage placer class.
  5. package com.dev.examplemod.util; import com.blocks.exampletest; import com.dev.examplemod.ExampleMod; import net.minecraft.block.Block; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; @Mod.EventBusSubscriber(modid = ExampleMod.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE) public class OverrideRegistryHandler { public Block OAK_LEAVES = new exampletest(Block.Properties.create(Material.ANVIL).hardnessAndResistance(0.2F).tickRandomly().sound(SoundType.ANVIL).notSolid()); @SubscribeEvent public void registerBlocks(RegistryEvent.Register<Block> event) { event.getRegistry().registerAll ( OAK_LEAVES.setRegistryName("minecraft","oak_leaves") ); } } I have read the docs and these posts as thoroughly as my reading comprehension will allow, this code is the result of that. Yet my leaves don't sound like anvils, my only guesses for what the issue might be is the EventBusSubscriber that I copied and pasted from another class. I am not sure what changes I would have to make to the event structure to fire off of the correct event. exampletest extends LeavesBlock and that is all it does I'm not sure if this is important information
  6. import com.blocks.exampletest; import net.minecraft.block.Block; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; @Mod.EventBusSubscriber(modid = "minecraft", bus = Mod.EventBusSubscriber.Bus.FORGE) public class OverrideRegistryHandler { @SubscribeEvent public void registerBlocks(RegistryEvent.Register<Block> event) { event.getRegistry().registerAll ( new exampletest(Block.Properties.create(Material.ANVIL).hardnessAndResistance(0.2F).tickRandomly().sound(SoundType.PLANT).notSolid()) ); } } I tried this syntax. this is what I interpret the docs to be saying is correct, but I don't see how to convey the name of the block I intend to replace
  7. I have registered the block like this public static final RegistryObject<Block> OAK_LEAVES = BLOCKS.register("oak_leaves", WildLeavesBlock::new); and it is not replacing the vanilla leaves do I have register the block differently?
  8. Does my block class have to share the same name as the vanilla class?
  9. Yes I do mean changing the functionality of a vanilla block by changing this \/ to my own block class "public static final Block STONE = register("stone", new Block(Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(1.5F, 6.0F)));"
  10. What is the best method for overriding a vanilla blocks class? Is there a way to modify a vanilla class to add or change functionality?
  11. In block properties you can set "tickRandomly()", I want to call a method when my block of choice is randomly ticked what means do I need to employ to do this? I want basiclly mimic the behaviors of a crop block not the growing part but the randomly ticking part
  12. Is there a way to subscribe to a random tick event for a specific block?
  13. This is useful, but how do I get a random block of a certain type? Or call a random tick on all blocks of the same type
  14. I would like to fire an event for random blocks in the world (in this case leaves). This would be similar behavior I assume to the functionality of grass spreading and crops growing but I am having a hard to accessing and understanding that code any insight into this would be priceless to me, thanks for your consideration!
×
×
  • Create New...

Important Information

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