Jump to content

Recommended Posts

Posted (edited)
public class ModFluids {
    public static final ResourceLocation RUBBER_STILL_RL = new ResourceRocation(ReasureCraft.MOD_ID, "block/rubber_still"));
    public static final ResourceLocation RUBBER_FLOWING_RL = new ResourceRocation(ReasureCraft.MOD_ID, "block/rubber_flowing");
    public static final ResourceLocation RUBBER_OVERLAY_RL = new ResourceRocation(ReasureCraft.MOD_ID, "block/rubber_overlay");

    public static final ForgeFlowingFluid.Properties RUBBER_PROPERTIES = new ForgeFlowingFluid.Properties(ModFluids.RUBBER, ModFluids.RUBBER_FLOWING,
            FluidAttributes.builder(RUBBER_STILL_RL, RUBBER_FLOWING_RL).density(5).luminosity(10).rarity(Rarity.RARE).sound(SoundEvents.HONEY_DRINK)
                    .overlay(RUBBER_OVERLAY_RL)).block(ModBlocks.RUBBER).bucket(ModItems.RUBBER_BUCKET).explosionResistance(100.0f);

    public static final RegistryObject<FlowingFluid> RUBBER = register("rubber_fluid", () -> new ForgeFlowingFluid.Source(ModFluids.RUBBER_PROPERTIES));
    public static final RegistryObject<FlowingFluid> RUBBER_FLOWING = register("rubber_flowing", () -> new ForgeFlowingFluid.Flowing(ModFluids.RUBBER_PROPERTIES));

    private ModFluids() {
    }

    private static <T extends Fluid> RegistryObject<T> register(String name, Supplier<T> item) {
        return Registration.FLUIDS.register(name, item);
    }

    static void register() {
    }
}

and Registraion.FLUIDS: 

public static final DeferredRegister<Fluid> FLUIDS = DeferredRegister.create(ForgeRegistries.FLUIDS, ReasureCraft.MOD_ID);

and Rubber Block:

public static final RegistryObject<FlowingFluidBlock> RUBBER = register("rubber",
            () -> new FlowingFluidBlock(ModFluids.RUBBER, AbstractBlock.Properties.of(Material.WATER).noCollission().randomTicks().strength(100.0F).noDrops()));

and Rubber Bucket:

public static final RegistryObject<BucketItem> RUBBER_BUCKET = register("rubber_bucket", () ->
            new BucketItem(ModFluids.RUBBER, defaultProperties().stacksTo(1).craftRemainder(Items.BUCKET)));

 

and When I use Rubber Bucket, it throw error

Spoiler



[13:35:51] [Server thread/FATAL] [minecraft/ThreadTaskExecutor]: Error executing task on Server
java.lang.NullPointerException: null
	at net.minecraftforge.fluids.ForgeFlowingFluid.getSource(ForgeFlowingFluid.java:81) ~[forge:?] {re:classloading}
	at net.minecraft.fluid.FlowingFluid.getSource(FlowingFluid.java:231) ~[forge:?] {re:classloading}
	at net.minecraft.block.FlowingFluidBlock.initFluidStateCache(FlowingFluidBlock.java:181) ~[forge:?] {re:classloading,pl:accesstransformer:B,xf:fml:forge:flowingfluidblock}
	at net.minecraft.block.FlowingFluidBlock.getFluidState(FlowingFluidBlock.java:86) ~[forge:?] {re:classloading,pl:accesstransformer:B,xf:fml:forge:flowingfluidblock}
	at net.minecraft.block.AbstractBlock$AbstractBlockState.getFluidState(AbstractBlock.java:698) ~[forge:?] {re:classloading}
	at net.minecraft.world.chunk.ChunkSection.setBlockState(SourceFile:66) ~[forge:?] {re:classloading}
	at net.minecraft.world.chunk.ChunkSection.setBlockState(SourceFile:55) ~[forge:?] {re:classloading}
	at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:251) ~[forge:?] {re:classloading}
	at net.minecraft.world.World.setBlock(World.java:199) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.World.setBlock(World.java:176) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.item.BucketItem.emptyBucket(BucketItem.java:146) ~[forge:?] {re:classloading,xf:fml:forge:bucketitem}
	at net.minecraft.item.BucketItem.use(BucketItem.java:90) ~[forge:?] {re:classloading,xf:fml:forge:bucketitem}
	at net.minecraft.item.ItemStack.use(ItemStack.java:217) ~[forge:?] {re:classloading,xf:fml:forge:filled_map.4,xf:fml:forge:itemstack}
	at net.minecraft.server.management.PlayerInteractionManager.useItem(PlayerInteractionManager.java:287) ~[forge:?] {re:classloading}
	at net.minecraft.network.play.ServerPlayNetHandler.handleUseItem(ServerPlayNetHandler.java:982) ~[forge:?] {re:classloading}
	at net.minecraft.network.play.client.CPlayerTryUseItemPacket.handle(SourceFile:31) ~[forge:?] {re:classloading}
	at net.minecraft.network.play.client.CPlayerTryUseItemPacket.handle(SourceFile:9) ~[forge:?] {re:classloading}
	at net.minecraft.network.PacketThreadUtil.lambda$ensureRunningOnSameThread$0(SourceFile:21) ~[forge:?] {re:classloading}
	at net.minecraft.util.concurrent.TickDelayedTask.run(SourceFile:18) ~[forge:?] {re:classloading}
	at net.minecraft.util.concurrent.ThreadTaskExecutor.doRunTask(SourceFile:144) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.util.concurrent.RecursiveEventLoop.doRunTask(SourceFile:23) ~[forge:?] {re:classloading}
	at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:734) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:159) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.util.concurrent.ThreadTaskExecutor.pollTask(SourceFile:118) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:717) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:711) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.util.concurrent.ThreadTaskExecutor.managedBlock(SourceFile:127) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:697) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:646) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:232) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_281] {}
[13:35:51] [Render thread/FATAL] [ne.mi.co.ForgeMod/]: Preparing crash report with UUID be8cc99f-7810-4a97-aa01-64f15a2034e2
[13:35:51] [Server thread/FATAL] [ne.mi.co.ForgeMod/]: Preparing crash report with UUID 188ee2e7-342c-44d5-b80b-333b0563c9a0
[13:35:51] [Render thread/FATAL] [minecraft/Minecraft]: Unreported exception thrown!
java.lang.NullPointerException: null
	at net.minecraftforge.fluids.ForgeFlowingFluid.getSource(ForgeFlowingFluid.java:81) ~[forge-1.16.5-36.2.2_mapped_official_1.16.5.jar:?] {re:classloading}
	at net.minecraft.fluid.FlowingFluid.getSource(FlowingFluid.java:231) ~[forge-1.16.5-36.2.2_mapped_official_1.16.5.jar:?] {re:classloading}
	at net.minecraft.block.FlowingFluidBlock.initFluidStateCache(FlowingFluidBlock.java:181) ~[forge-1.16.5-36.2.2_mapped_official_1.16.5.jar:?] {re:classloading,pl:accesstransformer:B,xf:fml:forge:flowingfluidblock}
	at net.minecraft.block.FlowingFluidBlock.getFluidState(FlowingFluidBlock.java:86) ~[forge-1.16.5-36.2.2_mapped_official_1.16.5.jar:?] {re:classloading,pl:accesstransformer:B,xf:fml:forge:flowingfluidblock}
	at net.minecraft.block.AbstractBlock$AbstractBlockState.getFluidState(AbstractBlock.java:698) ~[forge-1.16.5-36.2.2_mapped_official_1.16.5.jar:?] {re:classloading}
	at net.minecraft.world.chunk.ChunkSection.setBlockState(SourceFile:66) ~[forge-1.16.5-36.2.2_mapped_official_1.16.5.jar:?] {re:classloading}
	at net.minecraft.world.chunk.ChunkSection.setBlockState(SourceFile:55) ~[forge-1.16.5-36.2.2_mapped_official_1.16.5.jar:?] {re:classloading}
	at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:251) ~[forge-1.16.5-36.2.2_mapped_official_1.16.5.jar:?] {re:classloading}
	at net.minecraft.world.World.setBlock(World.java:199) ~[forge-1.16.5-36.2.2_mapped_official_1.16.5.jar:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.World.setBlock(World.java:176) ~[forge-1.16.5-36.2.2_mapped_official_1.16.5.jar:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.item.BucketItem.emptyBucket(BucketItem.java:146) ~[forge-1.16.5-36.2.2_mapped_official_1.16.5.jar:?] {re:classloading,xf:fml:forge:bucketitem}
	at net.minecraft.item.BucketItem.use(BucketItem.java:90) ~[forge-1.16.5-36.2.2_mapped_official_1.16.5.jar:?] {re:classloading,xf:fml:forge:bucketitem}
	at net.minecraft.item.ItemStack.use(ItemStack.java:217) ~[forge-1.16.5-36.2.2_mapped_official_1.16.5.jar:?] {re:classloading,xf:fml:forge:filled_map.4,xf:fml:forge:itemstack}
	at net.minecraft.client.multiplayer.PlayerController.useItem(PlayerController.java:328) ~[forge-1.16.5-36.2.2_mapped_official_1.16.5.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.startUseItem(Minecraft.java:1389) ~[forge-1.16.5-36.2.2_mapped_official_1.16.5.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.handleKeybinds(Minecraft.java:1645) ~[forge-1.16.5-36.2.2_mapped_official_1.16.5.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.tick(Minecraft.java:1460) ~[forge-1.16.5-36.2.2_mapped_official_1.16.5.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.runTick(Minecraft.java:953) ~[forge-1.16.5-36.2.2_mapped_official_1.16.5.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.run(Minecraft.java:607) ~[forge-1.16.5-36.2.2_mapped_official_1.16.5.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.main.Main.main(Main.java:184) ~[forge-1.16.5-36.2.2_mapped_official_1.16.5.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_281] {}
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_281] {}
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_281] {}
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_281] {}
	at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:52) ~[forge-1.16.5-36.2.2_mapped_official_1.16.5.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.9.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.9.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.9.jar:?] {}
	at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.0.9.jar:?] {}
	at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.0.9.jar:?] {}
	at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:108) [forge-1.16.5-36.2.2_mapped_official_1.16.5.jar:?] {}
[13:35:52] [Server thread/ERROR] [minecraft/MinecraftServer]: Encountered an unexpected exception
net.minecraft.crash.ReportedException: Getting fluid state
	at net.minecraft.network.NetworkSystem.tick(NetworkSystem.java:137) ~[forge:?] {re:classloading}
	at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:865) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:787) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.integrated.IntegratedServer.tickServer(IntegratedServer.java:78) ~[forge:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:642) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:232) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_281] {}
Caused by: java.lang.NullPointerException
	at net.minecraftforge.fluids.ForgeFlowingFluid.getSource(ForgeFlowingFluid.java:81) ~[forge:?] {re:classloading}
	at net.minecraft.fluid.FlowingFluid.getSource(FlowingFluid.java:231) ~[forge:?] {re:classloading}
	at net.minecraft.block.FlowingFluidBlock.initFluidStateCache(FlowingFluidBlock.java:181) ~[forge:?] {re:classloading,pl:accesstransformer:B,xf:fml:forge:flowingfluidblock}
	at net.minecraft.block.FlowingFluidBlock.getFluidState(FlowingFluidBlock.java:86) ~[forge:?] {re:classloading,pl:accesstransformer:B,xf:fml:forge:flowingfluidblock}
	at net.minecraft.block.AbstractBlock$AbstractBlockState.getFluidState(AbstractBlock.java:698) ~[forge:?] {re:classloading}
	at net.minecraft.world.chunk.ChunkSection.getFluidState(SourceFile:43) ~[forge:?] {re:classloading}
	at net.minecraft.world.chunk.Chunk.getFluidState(Chunk.java:220) ~[forge:?] {re:classloading}
	at net.minecraft.world.chunk.Chunk.getFluidState(Chunk.java:212) ~[forge:?] {re:classloading}
	at net.minecraft.world.World.getFluidState(World.java:389) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.entity.Entity.updateFluidHeightAndDoFluidPushing(Entity.java:2698) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.entity.Entity.updateInWaterStateAndDoWaterCurrentPushing(Entity.java:986) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.entity.Entity.updateInWaterStateAndDoFluidPushing(Entity.java:977) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.entity.Entity.baseTick(Entity.java:407) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.entity.LivingEntity.baseTick(LivingEntity.java:295) ~[forge:?] {re:classloading}
	at net.minecraft.entity.Entity.tick(Entity.java:386) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.entity.LivingEntity.tick(LivingEntity.java:2113) ~[forge:?] {re:classloading}
	at net.minecraft.entity.player.PlayerEntity.tick(PlayerEntity.java:223) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.entity.player.ServerPlayerEntity.doTick(ServerPlayerEntity.java:404) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.network.play.ServerPlayNetHandler.tick(ServerPlayNetHandler.java:207) ~[forge:?] {re:classloading}
	at net.minecraft.network.NetworkManager.tick(NetworkManager.java:226) ~[forge:?] {re:classloading}
	at net.minecraft.network.NetworkSystem.tick(NetworkSystem.java:134) ~[forge:?] {re:classloading}
	... 6 more

Process finished with exit code -805306369 (0xCFFFFFFF)

 

What is problem?

Edited by reasure
  • reasure changed the title to [1.16.5] Custum Fluid null error (solved)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I've been trying to find a solution for this for the past few days and cant seem to find it anywhere.   What i want to do is basically set my player's head pitch without the server noticing it. Basically client-side change.   Is there a way to do this? With mixins or anything else?   Thanks in advance.
    • Did you ever find a solution to this
    • I have followed a tutorial on how to generate ores for my mod though the data files have not been generated despite me running data in my IDE.  I have looked over and compared my code multiple times and the only differences are either with the IDs or with unnecessary code because of what my mod is (The mod is for the End so I don't need the Overworld or Nether ores), my folders are all in the right structure and no warnings are present when ran. I have been trying to figure this out for a few days now so help would be much appreciated.  The tutorial I was following.  My code -  public class ModBiomeModifiers { public static final ResourceKey<BiomeModifier> ADD_GAZITE_ORE = registerKey("add_gazite_ore"); public static final ResourceKey<BiomeModifier> TRANSCENDINE_GAZITE_ORE = registerKey("add_transcendine_ore"); public static void bootstrap(BootstrapContext<BiomeModifier> context) { var placedFeature = context.lookup(Registries.PLACED_FEATURE); var biomes = context.lookup(Registries.BIOME); context.register(ADD_GAZITE_ORE, new ForgeBiomeModifiers.AddFeaturesBiomeModifier( biomes.getOrThrow(BiomeTags.IS_END), HolderSet.direct(placedFeature.getOrThrow(ModPlacedFeatures.GAZITE_ORE_PLACED_KEY)), GenerationStep.Decoration.UNDERGROUND_ORES)); context.register(TRANSCENDINE_GAZITE_ORE, new ForgeBiomeModifiers.AddFeaturesBiomeModifier( biomes.getOrThrow(BiomeTags.IS_END), HolderSet.direct(placedFeature.getOrThrow(ModPlacedFeatures.TRANSCENDINE_ORE_PLACED_KEY)), GenerationStep.Decoration.UNDERGROUND_ORES)); } private static ResourceKey<BiomeModifier> registerKey(String name) { return ResourceKey.create(ForgeRegistries.Keys.BIOME_MODIFIERS, ResourceLocation.fromNamespaceAndPath(EchoingEnd.MOD_ID, name)); } } The tutorial's code -  public class ModBiomeModifiers { public static final ResourceKey<BiomeModifier> ADD_ALEXANDRITE_ORE = registerKey("add_alexandrite_ore"); public static final ResourceKey<BiomeModifier> ADD_NETHER_ALEXANDRITE_ORE = registerKey("add_nether_alexandrite_ore"); public static final ResourceKey<BiomeModifier> ADD_END_ALEXANDRITE_ORE = registerKey("add_end_alexandrite_ore"); public static void bootstrap(BootstrapContext<BiomeModifier> context) { var placedFeature = context.lookup(Registries.PLACED_FEATURE); var biomes = context.lookup(Registries.BIOME); context.register(ADD_ALEXANDRITE_ORE, new ForgeBiomeModifiers.AddFeaturesBiomeModifier( biomes.getOrThrow(BiomeTags.IS_OVERWORLD), HolderSet.direct(placedFeature.getOrThrow(ModPlacedFeatures.ALEXANDRITE_ORE_PLACED_KEY)), GenerationStep.Decoration.UNDERGROUND_ORES)); // Individual Biomes // context.register(ADD_ALEXANDRITE_ORE, new ForgeBiomeModifiers.AddFeaturesBiomeModifier( // HolderSet.direct(biomes.getOrThrow(Biomes.PLAINS), biomes.getOrThrow(Biomes.BAMBOO_JUNGLE)), // HolderSet.direct(placedFeature.getOrThrow(ModPlacedFeatures.ALEXANDRITE_ORE_PLACED_KEY)), // GenerationStep.Decoration.UNDERGROUND_ORES)); context.register(ADD_NETHER_ALEXANDRITE_ORE, new ForgeBiomeModifiers.AddFeaturesBiomeModifier( biomes.getOrThrow(BiomeTags.IS_NETHER), HolderSet.direct(placedFeature.getOrThrow(ModPlacedFeatures.NETHER_ALEXANDRITE_ORE_PLACED_KEY)), GenerationStep.Decoration.UNDERGROUND_ORES)); context.register(ADD_END_ALEXANDRITE_ORE, new ForgeBiomeModifiers.AddFeaturesBiomeModifier( biomes.getOrThrow(BiomeTags.IS_END), HolderSet.direct(placedFeature.getOrThrow(ModPlacedFeatures.END_ALEXANDRITE_ORE_PLACED_KEY)), GenerationStep.Decoration.UNDERGROUND_ORES)); } private static ResourceKey<BiomeModifier> registerKey(String name) { return ResourceKey.create(ForgeRegistries.Keys.BIOME_MODIFIERS, ResourceLocation.fromNamespaceAndPath(TutorialMod.MOD_ID, name)); } }   ModConfiguredFeatures:   My code -  public class ModConfiguredFeatures { public static final ResourceKey<ConfiguredFeature<?, ?>> GAZITE_ORE_KEY = registerKey("gazite_ore"); public static final ResourceKey<ConfiguredFeature<?, ?>> TRANSCENDINE_ORE_KEY = registerKey("transcendine_ore"); public static void bootstrap(BootstrapContext<ConfiguredFeature<?, ?>> context) { RuleTest endReplaceables = new BlockMatchTest(Blocks.END_STONE); register(context, GAZITE_ORE_KEY, Feature.ORE, new OreConfiguration(endReplaceables, ModBlocks.GAZITE_ORE.get().defaultBlockState(), 4)); register(context, TRANSCENDINE_ORE_KEY, Feature.ORE, new OreConfiguration(endReplaceables, ModBlocks.TRANSCENDINE_ORE.get().defaultBlockState(), 8)); List<OreConfiguration.TargetBlockState> EndOres = List.of( OreConfiguration.target(endReplaceables, ModBlocks.GAZITE_ORE.get().defaultBlockState()), OreConfiguration.target(endReplaceables, ModBlocks.TRANSCENDINE_ORE.get().defaultBlockState())); } public static ResourceKey<ConfiguredFeature<?, ?>> registerKey(String name) { return ResourceKey.create(Registries.CONFIGURED_FEATURE, ResourceLocation.fromNamespaceAndPath(EchoingEnd.MOD_ID, name)); } private static <FC extends FeatureConfiguration, F extends Feature<FC>> void register(BootstrapContext<ConfiguredFeature<?, ?>> context, ResourceKey<ConfiguredFeature<?, ?>> key, F feature, FC configuration) { context.register(key, new ConfiguredFeature<>(feature, configuration)); } }   The tutorial's code - public class ModConfiguredFeatures { public static final ResourceKey<ConfiguredFeature<?, ?>> OVERWORLD_ALEXANDRITE_ORE_KEY = registerKey("alexandrite_ore"); public static final ResourceKey<ConfiguredFeature<?, ?>> NETHER_ALEXANDRITE_ORE_KEY = registerKey("nether_alexandrite_ore"); public static final ResourceKey<ConfiguredFeature<?, ?>> END_ALEXANDRITE_ORE_KEY = registerKey("end_alexandrite_ore"); public static void bootstrap(BootstrapContext<ConfiguredFeature<?, ?>> context) { RuleTest stoneReplaceables = new TagMatchTest(BlockTags.STONE_ORE_REPLACEABLES); RuleTest deepslateReplaceables = new TagMatchTest(BlockTags.DEEPSLATE_ORE_REPLACEABLES); RuleTest netherrackReplaceables = new BlockMatchTest(Blocks.NETHERRACK); RuleTest endReplaceables = new BlockMatchTest(Blocks.END_STONE); List<OreConfiguration.TargetBlockState> overworldAlexandriteOres = List.of( OreConfiguration.target(stoneReplaceables, ModBlocks.ALEXANDRITE_ORE.get().defaultBlockState()), OreConfiguration.target(deepslateReplaceables, ModBlocks.ALEXANDRITE_DEEPSLATE_ORE.get().defaultBlockState())); register(context, OVERWORLD_ALEXANDRITE_ORE_KEY, Feature.ORE, new OreConfiguration(overworldAlexandriteOres, 9)); register(context, NETHER_ALEXANDRITE_ORE_KEY, Feature.ORE, new OreConfiguration(netherrackReplaceables, ModBlocks.ALEXANDRITE_NETHER_ORE.get().defaultBlockState(), 9)); register(context, END_ALEXANDRITE_ORE_KEY, Feature.ORE, new OreConfiguration(endReplaceables, ModBlocks.ALEXANDRITE_END_ORE.get().defaultBlockState(), 9)); } public static ResourceKey<ConfiguredFeature<?, ?>> registerKey(String name) { return ResourceKey.create(Registries.CONFIGURED_FEATURE, ResourceLocation.fromNamespaceAndPath(TutorialMod.MOD_ID, name)); } private static <FC extends FeatureConfiguration, F extends Feature<FC>> void register(BootstrapContext<ConfiguredFeature<?, ?>> context, ResourceKey<ConfiguredFeature<?, ?>> key, F feature, FC configuration) { context.register(key, new ConfiguredFeature<>(feature, configuration)); } }   ModPlacedFeatures:   My code - public class ModPlacedFeatures { public static final ResourceKey<PlacedFeature> GAZITE_ORE_PLACED_KEY = registerKey("gazite_ore_placed"); public static final ResourceKey<PlacedFeature> TRANSCENDINE_ORE_PLACED_KEY = registerKey("transcendine_ore_placed"); public static void bootstrap(BootstrapContext<PlacedFeature> context) { var configuredFeatures = context.lookup(Registries.CONFIGURED_FEATURE); register(context, GAZITE_ORE_PLACED_KEY, configuredFeatures.getOrThrow(ModConfiguredFeatures.GAZITE_ORE_KEY), ModOrePlacement.commonOrePlacement(9, HeightRangePlacement.uniform(VerticalAnchor.absolute(-64), VerticalAnchor.absolute(71)))); register(context, TRANSCENDINE_ORE_PLACED_KEY, configuredFeatures.getOrThrow(ModConfiguredFeatures.GAZITE_ORE_KEY), ModOrePlacement.rareOrePlacement(6, HeightRangePlacement.uniform(VerticalAnchor.absolute(-32), VerticalAnchor.absolute(71)))); } private static ResourceKey<PlacedFeature> registerKey(String name) { return ResourceKey.create(Registries.PLACED_FEATURE, ResourceLocation.fromNamespaceAndPath(EchoingEnd.MOD_ID, name)); } private static void register(BootstrapContext<PlacedFeature> context, ResourceKey<PlacedFeature> key, Holder<ConfiguredFeature<?, ?>> configuration, List<PlacementModifier> modifiers) { context.register(key, new PlacedFeature(configuration, List.copyOf(modifiers))); } }   the tutorial's code -  public class ModPlacedFeatures { public static final ResourceKey<PlacedFeature> ALEXANDRITE_ORE_PLACED_KEY = registerKey("alexandrite_ore_placed"); public static final ResourceKey<PlacedFeature> NETHER_ALEXANDRITE_ORE_PLACED_KEY = registerKey("nether_alexandrite_ore_placed"); public static final ResourceKey<PlacedFeature> END_ALEXANDRITE_ORE_PLACED_KEY = registerKey("end_alexandrite_ore_placed"); public static void bootstrap(BootstrapContext<PlacedFeature> context) { var configuredFeatures = context.lookup(Registries.CONFIGURED_FEATURE); register(context, ALEXANDRITE_ORE_PLACED_KEY, configuredFeatures.getOrThrow(ModConfiguredFeatures.OVERWORLD_ALEXANDRITE_ORE_KEY), ModOrePlacement.commonOrePlacement(12, HeightRangePlacement.uniform(VerticalAnchor.absolute(-64), VerticalAnchor.absolute(80)))); register(context, NETHER_ALEXANDRITE_ORE_PLACED_KEY, configuredFeatures.getOrThrow(ModConfiguredFeatures.NETHER_ALEXANDRITE_ORE_KEY), ModOrePlacement.commonOrePlacement(12, HeightRangePlacement.uniform(VerticalAnchor.absolute(-64), VerticalAnchor.absolute(80)))); register(context, END_ALEXANDRITE_ORE_PLACED_KEY, configuredFeatures.getOrThrow(ModConfiguredFeatures.END_ALEXANDRITE_ORE_KEY), ModOrePlacement.commonOrePlacement(12, HeightRangePlacement.uniform(VerticalAnchor.absolute(-64), VerticalAnchor.absolute(80)))); } private static ResourceKey<PlacedFeature> registerKey(String name) { return ResourceKey.create(Registries.PLACED_FEATURE, ResourceLocation.fromNamespaceAndPath(TutorialMod.MOD_ID, name)); } private static void register(BootstrapContext<PlacedFeature> context, ResourceKey<PlacedFeature> key, Holder<ConfiguredFeature<?, ?>> configuration, List<PlacementModifier> modifiers) { context.register(key, new PlacedFeature(configuration, List.copyOf(modifiers))); } }   ModOrePlacement:   My code -  public class ModOrePlacement { public static List<PlacementModifier> orePlacement(PlacementModifier pCountPlacement, PlacementModifier pHeightRange) { return List.of(pCountPlacement, InSquarePlacement.spread(), pHeightRange, BiomeFilter.biome()); } public static List<PlacementModifier> commonOrePlacement(int pCount, PlacementModifier pHeightRange) { return orePlacement(CountPlacement.of(pCount), pHeightRange); } public static List<PlacementModifier> rareOrePlacement(int pChance, PlacementModifier pHeightRange) { return orePlacement(RarityFilter.onAverageOnceEvery(pChance), pHeightRange); } }   The tutorial's code -  public class ModOrePlacement { public static List<PlacementModifier> orePlacement(PlacementModifier pCountPlacement, PlacementModifier pHeightRange) { return List.of(pCountPlacement, InSquarePlacement.spread(), pHeightRange, BiomeFilter.biome()); } public static List<PlacementModifier> commonOrePlacement(int pCount, PlacementModifier pHeightRange) { return orePlacement(CountPlacement.of(pCount), pHeightRange); } public static List<PlacementModifier> rareOrePlacement(int pChance, PlacementModifier pHeightRange) { return orePlacement(RarityFilter.onAverageOnceEvery(pChance), pHeightRange); } }  
    • I'm creating a modpack, and i just discovered that if i try to connect to a server it gives the error: Internal Exception: io.netty.handler.codec.DecoderException: java.lang.negativearraysizeexception -1   The client log:  
    • You just need to run the updated installer like if you were installing a new server. You can overwrite an existing install with a new version.
  • Topics

×
×
  • Create New...

Important Information

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