Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

reasure

Members
  • Posts

    17
  • Joined

  • Last visited

Posts posted by reasure

  1. public static final RegistryObject<Potion> EXPLOSIVE_POTION = POTIONS.register("explosive", () ->
                new Potion(new EffectInstance(EXPLOSIVE_EFFECT.get(), 1200, 0)));
        public static final RegistryObject<Potion> LONG_EXPLOSIVE_POTION = POTIONS.register("long_explosive", () ->
                new Potion(new EffectInstance(EXPLOSIVE_EFFECT.get(), 2400, 0)));
        public static final RegistryObject<Potion> STRONG_EXPLOSIVEPOTION = POTIONS.register("strong_explosive", () ->
                new Potion(new EffectInstance(EXPLOSIVE_EFFECT.get(), 600, 2)));

    It worked! Thank you!

  2. public class ModEffects {
        public static final DeferredRegister<Effect> EFFECTS = DeferredRegister.create(ForgeRegistries.POTIONS, ReasureCraft.MOD_ID);
        public static final DeferredRegister<Potion> POTIONS = DeferredRegister.create(ForgeRegistries.POTION_TYPES, ReasureCraft.MOD_ID);
    
        public static final RegistryObject<Effect> EXPLOSIVE_EFFECT = EFFECTS.register("explosive", ExplosiveEffect::new);
    
        public static final RegistryObject<Potion> EXPLOSIVE_POTION = register("explosive", new EffectInstance(EXPLOSIVE_EFFECT.get(), 1200, 0));
        public static final RegistryObject<Potion> LONG_EXPLOSIVE_POTION = register("long_explosive", new EffectInstance(EXPLOSIVE_EFFECT.get(), 2400, 0));
        public static final RegistryObject<Potion> STRONG_EXPLOSIVEPOTION = register("strong_explosive", new EffectInstance(EXPLOSIVE_EFFECT.get(), 600, 2));
    
        private static RegistryObject<Potion> register(String name, EffectInstance potion) {
            return POTIONS.register(name, () -> new Potion(potion));
        }
    }

    It has same error

  3. public class ModEffects {
        private ModEffects() {
        }
    
        static void register() {
            Effects.register();
          	//at reasure.reasurecraft.init.ModEffects.register(ModEffects.java:23) ~[?:?] {re:classloading}
            Potions.register();
        }
    
        public static class Effects {
            public static final RegistryObject<Effect> EXPLOSIVE = register("explosive", ExplosiveEffect::new);
    
            private Effects() {
            }
    
            static void register() {
            }
    
            private static <T extends Effect> RegistryObject<T> register(String name, Supplier<T> effect) {
                return Registration.EFFECTS.register(name, effect);
            }
        }
    
        public static class Potions {
            //at reasure.reasurecraft.init.ModEffects$Potions.<clinit>(ModEffects.java:47) ~[?:?] {re:classloading}
            public static final RegistryObject<Potion> EXPLOSIVE = register("explosive", new EffectInstance(Effects.EXPLOSIVE.get(), 1200, 0));
            public static final RegistryObject<Potion> LONG_EXPLOSIVE = register("long_explosive", new EffectInstance(Effects.EXPLOSIVE.get(), 2400, 0));
            public static final RegistryObject<Potion> STRONG_EXPLOSIVE = register("strong_explosive", new EffectInstance(Effects.EXPLOSIVE.get(), 600, 2));
    
    
            private Potions() {
            }
    
            static void register() {
            }
    
            private static RegistryObject<Potion> register(String name, EffectInstance potion) {
                return Registration.POTIONS.register(name, () -> new Potion(potion));
            }
        }
    }
    [21:48:59] [modloading-worker-6/ERROR] [ne.mi.fm.ja.FMLModContainer/LOADING]: Failed to create mod instance. ModID: reasurecraft, class reasure.reasurecraft.ReasureCraft
    java.lang.ExceptionInInitializerError: null
    	at reasure.reasurecraft.init.ModEffects.register(ModEffects.java:23) ~[?:?] {re:classloading}
    	at reasure.reasurecraft.init.Registration.register(Registration.java:47) ~[?:?] {re:classloading}
    	at reasure.reasurecraft.ReasureCraft.<init>(ReasureCraft.java:32) ~[?:?] {re:classloading}
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_281] {}
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_281] {}
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_281] {}
    	at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_281] {}
    	at java.lang.Class.newInstance(Class.java:442) ~[?:1.8.0_281] {}
    	at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:81) ~[forge:36.2] {re:classloading}
    	at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$4(ModContainer.java:120) ~[forge:?] {re:classloading}
    	at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1640) [?:1.8.0_281] {}
    	at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1632) [?:1.8.0_281] {}
    	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) [?:1.8.0_281] {}
    	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1067) [?:1.8.0_281] {}
    	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1703) [?:1.8.0_281] {}
    	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:172) [?:1.8.0_281] {}
    Caused by: java.lang.NullPointerException: Registry Object not present: reasurecraft:explosive
    	at java.util.Objects.requireNonNull(Objects.java:290) ~[?:1.8.0_281] {}
    	at net.minecraftforge.fml.RegistryObject.get(RegistryObject.java:120) ~[forge:?] {re:classloading}
    	at reasure.reasurecraft.init.ModEffects$Potions.<clinit>(ModEffects.java:47) ~[?:?] {re:classloading}
    	... 16 more
    [21:48:59] [main/FATAL] [ne.mi.fm.ModLoader/LOADING]: Failed to complete lifecycle event CONSTRUCT, 1 errors found
    [21:48:59] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    [21:48:59] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:39)
    [21:48:59] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54)
    [21:48:59] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72)
    [21:48:59] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.Launcher.run(Launcher.java:82)
    [21:48:59] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.Launcher.main(Launcher.java:66)
    [21:48:59] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:108)
    [21:48:59] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: Caused by: java.lang.reflect.InvocationTargetException
    [21:48:59] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [21:48:59] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    [21:48:59] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    [21:48:59] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: 	at java.lang.reflect.Method.invoke(Method.java:498)
    [21:48:59] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: 	at net.minecraftforge.userdev.FMLUserdevDataLaunchProvider.lambda$launchService$0(FMLUserdevDataLaunchProvider.java:51)
    [21:48:59] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: 	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37)
    [21:48:59] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: 	... 5 more
    [21:48:59] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: Caused by: net.minecraftforge.fml.LoadingFailedException: Loading errors encountered: [
    	fml.modloading.failedtoloadmod
    ]
    [21:48:59] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: 	at net.minecraftforge.fml.ModLoader.waitForTransition(ModLoader.java:269)
    [21:48:59] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: 	at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:236)
    [21:48:59] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: 	at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:194)
    [21:48:59] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: 	at net.minecraftforge.fml.DatagenModLoader.begin(DatagenModLoader.java:60)
    [21:48:59] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: 	at net.minecraft.data.Main.main(Main.java:45)
    [21:48:59] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: 	... 11 more
    Exception in thread "main" 
    Process finished with exit code 1

    It has error

  4. @SubscribeEvent
    public static void renderBlockOverlay(final RenderBlockOverlayEvent event) {
      if (event.getPlayer().level.getFluidState(event.getBlockPos()).is(ModTags.Fluids.RUBBER)) {
      ReasureCraft.LOGGER.info("render Event!");
      // Render Overlay
    
      }
    }

    What should I do?

  5. If I go into lava, the screen turns red, but if I go into custom fluid, the screen changes as if I went into water.

    (Custom fluid has water tag to act like water)

    Is there a way to render a different color (white) when I go into the custom fluid?

     

    +) Is there a way to act like water without having a water tag? (For example, when an entity goes into custom fluid, it slows down.)

    2021-08-21_15.34.23.png

    2021-08-21_15.34.29.png

  6. 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?

  7.  

    public class BlazeAndSteel extends FlintAndSteelItem {
        public BlazeAndSteel(Properties properties) {
            super(properties.fireResistant().stacksTo(1).durability(128));
        }
    
        @Override
        public ActionResult<ItemStack> use(World world, PlayerEntity player, Hand hand) {
            ItemStack item = player.getItemInHand(hand);
            if (!world.isClientSide()) {
                ActionResultType result = fireEntity(item, player, player, hand);
                return new ActionResult<>(result, item);
            }
            return super.use(world, player, hand);
        }
    
        @Override
        public ActionResultType interactLivingEntity(ItemStack item, PlayerEntity player, LivingEntity target, Hand hand) {
            if (!target.level.isClientSide()) {
                return fireEntity(item, player, target, hand);
            }
            return super.interactLivingEntity(item, player, target, hand);
        }
    
        protected ActionResultType fireEntity(ItemStack item, PlayerEntity player, LivingEntity target, Hand hand) {
            if (!target.fireImmune()) {
                item.hurtAndBreak(1, player, p -> p.broadcastBreakEvent(hand));
                player.playSound(SoundEvents.FLINTANDSTEEL_USE, 1.0f, random.nextFloat() * 0.4f + 0.8f);
                int fireTick = random.nextInt(10 * 20 + 1) + 20;
                if (fireTick > target.getRemainingFireTicks()) {
                    target.setSecondsOnFire(fireTick);
                }
                target.hurt(DamageSource.ON_FIRE, random.nextInt(4));
                return ActionResultType.CONSUME;
            }
            return ActionResultType.FAIL;
        }
    }

    It has three actions

    1. use on block -> act like flint and steel (useOn in FlintAndSteelItem.class)

    2. use on entity -> light entity on fire (interactLivingEntity)

    3. use on air -> light player on fire (use)

     

    When I use it on entity (case 2), it light both entity and player on fire.

    But I want to make it light only entity on fire.

    Give me help please.

  8. 27 minutes ago, Luis_ST said:

    the first parameter (ItemStack) is the item which is move
    the second parameter (int) is the min slot id where the item can move to
    the third parameter (int) is the max slot is where the item can move to
    and no idea what the boolean parameter does

     

    Thank you so much!!!!!!

  9. Spoiler

     

    
    @Override
    public ItemStack quickMoveStack(PlayerEntity playerIn, int index) {
        ItemStack stack = ItemStack.EMPTY;
        Slot slot = this.slots.get(index);
        if (slot != null && slot.hasItem()) {
            ItemStack stack1 = slot.getItem();
            stack = stack1.copy();
            if (index < 1 && !this.moveItemStackTo(stack1, 1, this.slots.size(), true)) {
                return ItemStack.EMPTY;
            }
            if (!this.moveItemStackTo(stack1, 0, 1, false)) {
                return ItemStack.EMPTY;
            }
            if (stack1.isEmpty()) {
                slot.mayPlace(ItemStack.EMPTY);
            }
            if (stack1.getCount() == stack.getCount()) {
                return ItemStack.EMPTY;
            } else {
                slot.setChanged();
            }
        }
        return stack;
    }

     

    This is part of the Tutorial Code for Tile Entities with one slot.

    I want to know the role of each parameter in moveItemStackTo().

    (or mergeItemStack() in other mappings.)

  10. How can I specify potions in recipes?

    ShapelessRecipeBuilder.shapeless(ModItems.POSION_APPLE.get())
                    .requires(Items.APPLE)
                    .requires(Ingredient.of(PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.POISON)))
                    .unlockedBy("has_item", has(Items.APPLE))
                    .save(consumer);

    It's not work
     

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.