Jump to content

DracoDoes

Members
  • Posts

    12
  • Joined

  • Last visited

DracoDoes's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Now my package structure looks like this: But still it gives the same error: [24May2021 13:45:58.012] [Render thread/ERROR] [net.minecraftforge.fml.javafmlmod.FMLModContainer/LOADING]: Caught exception during event RegistryEvent.Register<minecraft:block> dispatch for modid mcexamples java.lang.NoSuchFieldError: field_151571_B at com.MacDax.mcexamples.lists.BlockList.lambda$static$0(BlockList.java:27) ~[main/:?] at net.minecraftforge.registries.DeferredRegister.lambda$register$0(DeferredRegister.java:124) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?]
  2. That's what I thought.. so what's the issue?
  3. so in .toml file, I added mcexamples with dependencies. (main folder under src/main/java) But modid is present in .toml file modId="mcexamples" line 18 If I add one more entry with modId= mcexamples, (name of the ModId) in .toml file, I get the same error. I have tried it earliar. But believe me, it gives the same error. [[dependencies.mcexamples]] #optional # the modid of the dependency modId="forge" #mandatory
  4. Ok, ya, updated now. Thanks
  5. updated the repo. However, it's the same line public static final RegistryObject<Block> SILVER_BLOCK = BLOCKS.register("silver_block", () -> new Block(Properties.of(Material.CLAY, MaterialColor.COLOR_CYAN))); that shows error for some field like "15**" :: Logs attached from latest run debug.log latest.log
  6. Please find attached logs. debug.log latest.log 2021-05-21-7.log.gz
  7. https://github.com/MacDax/McraftForge
  8. Why this gives error? Following gives error: java.lang.NoSuchFieldError: field_151573_f at com.mcexamples.lists.BlockList.lambda$static$0(BlockList.java:19) ~[main/:?]
  9. Block with constructor :: public static BarrierBlock barrierBlock = new BarrierBlock(AbstractBlock.Properties.of(Material.FIRE, MaterialColor.METAL)); public static final RegistryObject<Block> BARRIER_BLOCK = BLOCKS.register("barrier_block", (Supplier<? extends I>) barrierBlock); //this needs supplier public class BarrierBlock extends Block { public BarrierBlock(Properties p_i48440_1_) { super(p_i48440_1_); } } //Following gives error: java.lang.NoSuchFieldError: field_151573_f at com.mcexamples.lists.BlockList.lambda$static$0(BlockList.java:19) ~[main/:?] public static final RegistryObject<Block> SILVER_BLOCK = BLOCKS.register("silver_block", () -> new Block(AbstractBlock.Properties.of(Material.METAL, MaterialColor.METAL).requiresCorrectToolForDrops() .strength(4.0f, 6.0f).sound(SoundType.METAL).harvestTool(ToolType.PICKAXE).harvestLevel(2))); Thanks
  10. Still getting the same error. Added items and block and used DeferredRegistry to register the same. Commented out method with "subscribeEvent" annotation in "main" type class. But still the same error: https://github.com/MacDax/McraftForge Thanks Sonal
  11. thanks for reply. I tried to use DeferredRegister to register blocks. Now, I get this error: https://github.com/MacDax/McraftForge Details: Mod File: mcexamples-1.0.jar Failure message: CrazyBoys Mod (mcexamples) encountered an error during the error event phase java.lang.NullPointerException: Registry Object not present: mcexamples:silver_block Mod Version: 1.0 Mod Issue URL: NOT PROVIDED Exception message: java.lang.NullPointerException: Registry Object not present: mcexamples:silver_block build.gradle build.gradle
  12. I'm trying to add a simple block for the first time in MineCraft Forge. I get following error: Stacktrace: at com.mcexamples.examplemod.BlockSimple.<init>(BlockSimple.java:22) ~[mcexamples:1.0] {re:classloading} -- MOD mcexamples -- Details: Mod File: mcexamples-1.0.jar Failure message: CrazyBoys Mod (mcexamples) encountered an error during the load_registries event phase java.lang.NoSuchFieldError: field_151573_f Mod Version: 1.0 Mod Issue URL: NOT PROVIDED Exception message: java.lang.NoSuchFieldError: field_151573_f Stacktrace: at com.mcexamples.examplemod.BlockSimple.<init>(BlockSimple.java:22) ~[main/:?] {re:classloading} at com.mcexamples.examplemod.StartupCommon.registerBlocks(StartupCommon.java:34) ~[main/:?] {re:classloading} at net.minecraftforge.eventbus.ASMEventHandler_1_StartupCommon_registerBlocks_Register.invoke(.dynamic) ~[?:?] {} -- System Details -- Details: Minecraft Version: 1.16.5 Minecraft Version ID: 1.16.5 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_291, Oracle Corporation FML: 36.1 Forge: net.minecraftforge:36.1.0 FML Language Providers: javafml@36.1 minecraft@1 Block class :: I'm trying to simplify the Block as much as I can. public class BlockSimple extends Block { private static final String REGISTRY_NAME = "block_simple_registry_name.json"; public BlockSimple() { super(AbstractBlock.Properties.of(Material.METAL)); //.sound(SoundType.METAL) //.strength(2.0f)); //.lightLevel(state -> state.getValue(BlockStateProperties.POWERED) ? 14 : 0) //); } @Nullable @Override public BlockState getStateForPlacement(BlockItemUseContext context) { return defaultBlockState().setValue(BlockStateProperties.FACING, context.getNearestLookingDirection().getOpposite()); } //in other class calling this Block as follows:: @SubscribeEvent public static void registerBlocks(RegistryEvent.Register<Block> event) { System.out.println("in register block of sc : " + event.getName() + " reg name : " + event.getRegistry().getRegistryName()); blockSimple1 = (BlockSimple) new BlockSimple().setRegistryName("mcexamples", "block_simple_registry_name"); //this line gives above error System.out.println("block registered :" + blockSimple1); event.getRegistry().register(blockSimple1);
×
×
  • Create New...

Important Information

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