
airpodjoch_
Members-
Posts
14 -
Joined
-
Last visited
airpodjoch_'s Achievements

Tree Puncher (2/8)
0
Reputation
-
Help needed with DeferredRegister error
airpodjoch_ replied to airpodjoch_'s topic in Modder Support
That did the trick, thanks! -
Help needed with DeferredRegister error
airpodjoch_ replied to airpodjoch_'s topic in Modder Support
All errors have been resolved, thanks for the help! However, now my game crashes when I place the liquid. This is the error it gives: Cannot set property IntegerProperty{name=level, clazz=class java.lang.Integer, values=[1, 2, 3, 4, 5, 6, 7, 8]} as it does not exist in net.minecraftforge.fluids.ForgeFlowingFluid$Source@203e705e Here the full log: -
Help needed with DeferredRegister error
airpodjoch_ replied to airpodjoch_'s topic in Modder Support
I guess I have to use the one that is not depracted. Thanks, this worked. EDIT: I changed my line to this: public static final RegistryObject<LiquidBlock> SALT_WATER_BLOCK = Registration.BLOCKS.register("salt_water_block", () -> new LiquidBlock(() -> SALT_WATER_FLUID.get(), LiquidBlock.Properties.of(Material.WATER).noCollission().strength(100.0F).noDrops())); -
Help needed with DeferredRegister error
airpodjoch_ replied to airpodjoch_'s topic in Modder Support
I kinda know what a constructor is, but I am not really understanding the term depracted. I know how to look at the source code. -
Help needed with DeferredRegister error
airpodjoch_ replied to airpodjoch_'s topic in Modder Support
I am not that familiar with depracted classes. How can I find in my code what I could replace this with? -
Help needed with DeferredRegister error
airpodjoch_ replied to airpodjoch_'s topic in Modder Support
-
Help needed with DeferredRegister error
airpodjoch_ replied to airpodjoch_'s topic in Modder Support
How would you fix this? If I remove the () -> it just tells me it suspects a Supplier, which it doesn't get. What would be the new constructer? -
Help needed with DeferredRegister error
airpodjoch_ replied to airpodjoch_'s topic in Modder Support
This is my ModFluids.java: package nl.airpodjoch.betterfireworks.setup; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.block.LiquidBlock; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.material.FlowingFluid; import net.minecraft.world.level.material.Material; import net.minecraftforge.fluids.FluidAttributes; import net.minecraftforge.fluids.ForgeFlowingFluid; import net.minecraftforge.registries.RegistryObject; import static nl.airpodjoch.betterfireworks.setup.Registration.FLUIDS; public class ModFluids { public static final ResourceLocation WATER_STILL_RL = new ResourceLocation("block/water_still"); public static final ResourceLocation WATER_FLOWING_RL = new ResourceLocation("block/water_flow"); public static final ResourceLocation WATER_OVERLAY_RL = new ResourceLocation("block/water_overlay"); public static final RegistryObject<FlowingFluid> SALT_WATER_FLUID = FLUIDS.register("salt_water_fluid", () -> new ForgeFlowingFluid.Source(ModFluids.SALT_WATER_PROPERTIES)); public static final RegistryObject<FlowingFluid> SALT_WATER_FOWING_FLUID = FLUIDS.register("salt_water_flowing_fluid", () -> new ForgeFlowingFluid.Source(ModFluids.SALT_WATER_PROPERTIES)); public static final ForgeFlowingFluid.Properties SALT_WATER_PROPERTIES = new ForgeFlowingFluid.Properties( () -> SALT_WATER_FLUID.get(), () -> SALT_WATER_FOWING_FLUID.get(), FluidAttributes.builder(WATER_STILL_RL, WATER_FLOWING_RL) .overlay(WATER_OVERLAY_RL)) .block(() -> ModFluids.SALT_WATER_BLOCK.get()).bucket(() -> ModItems.SALT_WATER_BUCKET.get()); public static final RegistryObject<LiquidBlock> SALT_WATER_BLOCK = Registration.BLOCKS.register("salt_water_block", () -> new LiquidBlock(ModFluids.SALT_WATER_FLUID.get(), BlockBehaviour.Properties.of(Material.WATER).noCollission().strength(100.0F).noDrops())); public static void register() {} } This is my Registration.java: package nl.airpodjoch.betterfireworks.setup; import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.material.Fluid; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; import nl.airpodjoch.betterfireworks.BetterFireworksMod; import nl.airpodjoch.betterfireworks.eventhandlers.BucketFillHandler; public class Registration { public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, BetterFireworksMod.MOD_ID); public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, BetterFireworksMod.MOD_ID); public static final DeferredRegister<Fluid> FLUIDS = DeferredRegister.create(ForgeRegistries.FLUIDS, BetterFireworksMod.MOD_ID); public static void register() { IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); BLOCKS.register(modEventBus); ITEMS.register(modEventBus); FLUIDS.register(modEventBus); ModItems.register(); ModBlocks.register(); ModFluids.register(); MinecraftForge.EVENT_BUS.register(BucketFillHandler.class); } } -
Help needed with DeferredRegister error
airpodjoch_ replied to airpodjoch_'s topic in Modder Support
Here is my full log: [22Feb2022 17:26:21.054] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--launchTarget, forgedatauserdev, --assetIndex, 1.18, --assetsDir, C:\Users\niels\.gradle\caches\forge_gradle\assets, --gameDir, ., --fml.forgeVersion, 39.0.79, --fml.mcVersion, 1.18.1, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20211210.034407, --mod, betterfireworks, --all, --output, E:\MinecraftModsMCP\MODS\1.18.1\FireworksMod\src\generated\resources, --existing, E:\MinecraftModsMCP\MODS\1.18.1\FireworksMod\src\main\resources] [22Feb2022 17:26:21.063] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 9.1.0+9.1.0+main.6690ee51 starting: java version 17.0.2 by Eclipse Adoptium [22Feb2022 17:26:21.386] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=union:/C:/Users/niels/.gradle/caches/modules-2/files-2.1/org.spongepowered/mixin/0.8.5/9d1c0c3a304ae6697ecd477218fa61b850bf57fc/mixin-0.8.5.jar%2327!/ Service=ModLauncher Env=CLIENT [22Feb2022 17:26:24.501] [main/INFO] [cpw.mods.modlauncher.LaunchServiceHandler/MODLAUNCHER]: Launching target 'forgedatauserdev' with arguments [--gameDir, ., --assetsDir, C:\Users\niels\.gradle\caches\forge_gradle\assets, --assetIndex, 1.18, --mod, betterfireworks, --all, --output, E:\MinecraftModsMCP\MODS\1.18.1\FireworksMod\src\generated\resources, --existing, E:\MinecraftModsMCP\MODS\1.18.1\FireworksMod\src\main\resources] [17:26:24] [main/INFO]: Initializing Data Gatherer for mods [betterfireworks] [17:26:33] [modloading-worker-0/INFO]: Forge mod loading, version 39.0.79, for MC 1.18.1 with MCP 20211210.034407 [17:26:33] [modloading-worker-0/INFO]: MinecraftForge v39.0.79 Initialized [17:26:34] [modloading-worker-0/ERROR]: Null comment for config option server, this is invalid and may be disallowed in the future. [22Feb2022 17:26:34.877] [main/ERROR] [net.minecraftforge.fml.javafmlmod.FMLModContainer/]: Exception caught during firing event: Registry Object not present: betterfireworks:salt_water_fluid Index: 1 Listeners: 0: NORMAL 1: ASM: net.minecraftforge.registries.DeferredRegister$EventDispatcher@83a9817 handleEvent(Lnet/minecraftforge/event/RegistryEvent$Register;)V 2: ASM: net.minecraftforge.registries.DeferredRegister$EventDispatcher@6903cbf0 handleEvent(Lnet/minecraftforge/event/RegistryEvent$Register;)V 3: ASM: net.minecraftforge.registries.DeferredRegister$EventDispatcher@3da2f79f handleEvent(Lnet/minecraftforge/event/RegistryEvent$Register;)V java.lang.NullPointerException: Registry Object not present: betterfireworks:salt_water_fluid at java.base/java.util.Objects.requireNonNull(Objects.java:334) at TRANSFORMER/[email protected]/net.minecraftforge.registries.RegistryObject.get(RegistryObject.java:123) at TRANSFORMER/[email protected]/nl.airpodjoch.betterfireworks.setup.ModFluids.lambda$static$6(ModFluids.java:33) at TRANSFORMER/[email protected]/net.minecraftforge.registries.DeferredRegister.lambda$register$0(DeferredRegister.java:120) at TRANSFORMER/[email protected]/net.minecraftforge.registries.DeferredRegister.addEntries(DeferredRegister.java:196) at TRANSFORMER/[email protected]/net.minecraftforge.registries.DeferredRegister$EventDispatcher.handleEvent(DeferredRegister.java:168) at net.minecraftforge.eventbus.ASMEventHandler_0_EventDispatcher_handleEvent_Register.invoke(.dynamic) at MC-BOOTSTRAP/[email protected]/net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) at MC-BOOTSTRAP/[email protected]/net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) at MC-BOOTSTRAP/[email protected]/net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) at LAYER PLUGIN/[email protected]/net.minecraftforge.fml.javafmlmod.FMLModContainer.acceptEvent(FMLModContainer.java:120) at LAYER PLUGIN/[email protected]/net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$4(ModContainer.java:121) at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) at LAYER PLUGIN/[email protected]/net.minecraftforge.fml.ModWorkManager$SyncExecutor.driveOne(ModWorkManager.java:56) at LAYER PLUGIN/[email protected]/net.minecraftforge.fml.ModWorkManager$DrivenExecutor.drive(ModWorkManager.java:40) at LAYER PLUGIN/[email protected]/net.minecraftforge.fml.ModLoader.waitForTransition(ModLoader.java:215) at LAYER PLUGIN/[email protected]/net.minecraftforge.fml.ModLoader.lambda$dispatchAndHandleError$21(ModLoader.java:200) at java.base/java.util.Optional.ifPresent(Optional.java:178) at LAYER PLUGIN/[email protected]/net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:200) at LAYER PLUGIN/[email protected]/net.minecraftforge.fml.ModLoader.lambda$gatherAndInitializeMods$11(ModLoader.java:177) at java.base/java.lang.Iterable.forEach(Iterable.java:75) at LAYER PLUGIN/[email protected]/net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:177) at TRANSFORMER/[email protected]/net.minecraftforge.data.loading.DatagenModLoader.begin(DatagenModLoader.java:52) at TRANSFORMER/[email protected]/net.minecraft.data.Main.main(Main.java:65) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at MC-BOOTSTRAP/[email protected]/net.minecraftforge.fml.loading.targets.ForgeDataUserdevLaunchHandler.lambda$launchService$0(ForgeDataUserdevLaunchHandler.java:41) at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.run(Launcher.java:106) at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.main(Launcher.java:77) at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) at [email protected]/cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:149) [22Feb2022 17:26:34.880] [main/ERROR] [net.minecraftforge.fml.javafmlmod.FMLModContainer/LOADING]: Caught exception during event RegistryEvent.Register<minecraft:block> dispatch for modid betterfireworks java.lang.NullPointerException: Registry Object not present: betterfireworks:salt_water_fluid at java.util.Objects.requireNonNull(Objects.java:334) ~[?:?] at net.minecraftforge.registries.RegistryObject.get(RegistryObject.java:123) ~[forge-1.18.1-39.0.79_mapped_official_1.18.1-recomp.jar%2376%2382!/:?] at nl.airpodjoch.betterfireworks.setup.ModFluids.lambda$static$6(ModFluids.java:33) ~[%2381!/:?] at net.minecraftforge.registries.DeferredRegister.lambda$register$0(DeferredRegister.java:120) ~[forge-1.18.1-39.0.79_mapped_official_1.18.1-recomp.jar%2376%2382!/:?] at net.minecraftforge.registries.DeferredRegister.addEntries(DeferredRegister.java:196) ~[forge-1.18.1-39.0.79_mapped_official_1.18.1-recomp.jar%2376%2382!/:?] at net.minecraftforge.registries.DeferredRegister$EventDispatcher.handleEvent(DeferredRegister.java:168) ~[forge-1.18.1-39.0.79_mapped_official_1.18.1-recomp.jar%2376%2382!/:?] at net.minecraftforge.eventbus.ASMEventHandler_0_EventDispatcher_handleEvent_Register.invoke(.dynamic) ~[?:?] at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-5.0.7.jar%239!/:?] at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-5.0.7.jar%239!/:?] at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-5.0.7.jar%239!/:?] at net.minecraftforge.fml.javafmlmod.FMLModContainer.acceptEvent(FMLModContainer.java:120) ~[javafmllanguage-1.18.1-39.0.79.jar%2378!/:?] at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$4(ModContainer.java:121) ~[fmlcore-1.18.1-39.0.79.jar%2380!/:?] at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) ~[?:?] at net.minecraftforge.fml.ModWorkManager$SyncExecutor.driveOne(ModWorkManager.java:56) ~[fmlcore-1.18.1-39.0.79.jar%2380!/:?] at net.minecraftforge.fml.ModWorkManager$DrivenExecutor.drive(ModWorkManager.java:40) ~[fmlcore-1.18.1-39.0.79.jar%2380!/:?] at net.minecraftforge.fml.ModLoader.waitForTransition(ModLoader.java:215) ~[fmlcore-1.18.1-39.0.79.jar%2380!/:?] at net.minecraftforge.fml.ModLoader.lambda$dispatchAndHandleError$21(ModLoader.java:200) ~[fmlcore-1.18.1-39.0.79.jar%2380!/:?] at java.util.Optional.ifPresent(Optional.java:178) ~[?:?] at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:200) ~[fmlcore-1.18.1-39.0.79.jar%2380!/:?] at net.minecraftforge.fml.ModLoader.lambda$gatherAndInitializeMods$11(ModLoader.java:177) ~[fmlcore-1.18.1-39.0.79.jar%2380!/:?] at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?] at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:177) ~[fmlcore-1.18.1-39.0.79.jar%2380!/:?] at net.minecraftforge.data.loading.DatagenModLoader.begin(DatagenModLoader.java:52) ~[forge-1.18.1-39.0.79_mapped_official_1.18.1-recomp.jar%2376%2382!/:?] at net.minecraft.data.Main.main(Main.java:65) ~[forge-1.18.1-39.0.79_mapped_official_1.18.1-recomp.jar%2377!/:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] at net.minecraftforge.fml.loading.targets.ForgeDataUserdevLaunchHandler.lambda$launchService$0(ForgeDataUserdevLaunchHandler.java:41) ~[fmlloader-1.18.1-39.0.79.jar%230!/:?] at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-9.1.0.jar%2310!/:?] at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-9.1.0.jar%2310!/:?] at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-9.1.0.jar%2310!/:?] at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) [modlauncher-9.1.0.jar%2310!/:?] at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) [modlauncher-9.1.0.jar%2310!/:?] at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-9.1.0.jar%2310!/:?] at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-9.1.0.jar%2310!/:?] at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:149) [bootstraplauncher-1.0.0.jar:?] [17:26:35] [main/FATAL]: Detected errors during registry event dispatch, rolling back to VANILLA state [17:26:37] [main/FATAL]: Detected errors during registry event dispatch, roll back to VANILLA complete [22Feb2022 17:26:37.088] [main/FATAL] [net.minecraftforge.fml.ModLoader/LOADING]: Failed to complete lifecycle event LOAD_REGISTRIES, 1 errors found -
I get this error, but don't know where it's coming from. Caused by: java.lang.IllegalStateException: Cannot register new entries to DeferredRegister after RegistryEvent.Register has been fired. EDIT: I fixed it myself, only now I get this error: Caused by: net.minecraftforge.fml.LoadingFailedException: Loading errors encountered: [ fml.modloading.errorduringevent ] I don't know which event this could be, as I am not using events.
-
Ah ok. So the goal is to give the player the bucket from the server side, and not the client side? I thought it was the other way around.
-
Wow. It was that simple. I actually scrapped that off my list if possible fixes, when my game crashed last time I used the if statement with that condition. However, before I made this forum post I changed the script around a little, not checking if this would actually work. I got to say that, it's kinda weird isClientSide() basically means "are you a server". Anyway, I got it fixed by making it: if (!event.getWorld().isClientSide()) {}
-
Hello everyone, I am trying to check wether a player is at an ocean/beach, and then gives the player a Salty Water Bucket instead of a normal Water Bucket. I got it kinda working, up until the point it's not giving me the Salty Water Bucket. This is what I have now: public class BucketFillHandler { @SubscribeEvent public static void onBucketFill(@NotNull FillBucketEvent event) { Player player = event.getPlayer(); BlockPos pos = new BlockPos(player.getX(), player.getY(), player.getZ()); if (event.getWorld().isClientSide()) { if (event.getWorld().getBiomeManager().getBiome(pos).getRegistryName().toString().equals("minecraft:beach")) { if (event.getPlayer() != null) { HitResult target = event.getTarget(); if (target != null && target.getType() == HitResult.Type.BLOCK) { BlockState state = event.getWorld().getBlockState(new BlockPos(target.getLocation())); Material material = state.getMaterial(); if (material == Material.WATER && (Integer) state.getValue(LiquidBlock.LEVEL) == 0) { event.setResult(Event.Result.ALLOW); System.out.println("YES"); // This is just for testing purposes. event.setFilledBucket(new ItemStack(ModItems.SALTY_WATER_BUCKET.get(), 1)); // This is what doesn't work } } } } } } }