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

[1.17.1] Problem With Custom Fluid


furiusmax55
 Share

Recommended Posts

		public static final RegistryObject<CustomLiquidBlock> PURIFIEDWATERBLOCK = BLOCKS	
		           .register("purified_water", () -> new CustomLiquidBlock(ModFluids.PURIFIEDWATER, 			  BlockBehaviour.Properties.of(Material.WATER).noCollission().strength(100.0F).noDrops()));
Spoiler
public class CustomLiquidBlock extends LiquidBlock{
	   public static final IntegerProperty LEVEL = BlockStateProperties.LEVEL;
	   protected final FlowingFluid fluid;
	   private final List<FluidState> stateCache;
	   public static final VoxelShape STABLE_SHAPE = Block.box(0.0D, 0.0D, 0.0D, 16.0D, 8.0D, 16.0D);
	   public static final ImmutableList<Direction> POSSIBLE_FLOW_DIRECTIONS = ImmutableList.of(Direction.DOWN, Direction.SOUTH, Direction.NORTH, Direction.EAST, Direction.WEST);

	   @Deprecated  // Forge: Use the constructor that takes a supplier
	   public CustomLiquidBlock(FlowingFluid p_54694_, BlockBehaviour.Properties p_54695_) {
	      super(p_54694_, p_54695_);
	      this.fluid = p_54694_;
	      this.stateCache = Lists.newArrayList();
	      this.stateCache.add(p_54694_.getSource(false));

	      for(int i = 1; i < 8; ++i) {
	         this.stateCache.add(p_54694_.getFlowing(8 - i, false));
	      }

	      this.stateCache.add(p_54694_.getFlowing(8, true));
	      this.registerDefaultState(this.stateDefinition.any().setValue(LEVEL, Integer.valueOf(0)));
	      fluidStateCacheInitialized = true;
	      supplier = p_54694_.delegate;
	   }

	   /**
	    * @param supplier A fluid supplier such as {@link net.minecraftforge.fmllegacy.RegistryObject<Fluid>}
	    */
	   public CustomLiquidBlock(java.util.function.Supplier<? extends FlowingFluid> p_54694_, BlockBehaviour.Properties p_54695_) {
	      super(p_54694_, p_54695_);
	      this.fluid = null;
	      this.stateCache = Lists.newArrayList();
	      this.registerDefaultState(this.stateDefinition.any().setValue(LEVEL, Integer.valueOf(0)));
	      this.supplier = p_54694_;
	   }
       @Override
	   public VoxelShape getCollisionShape(BlockState p_54760_, BlockGetter p_54761_, BlockPos p_54762_, CollisionContext p_54763_) {
	      return p_54763_.isAbove(STABLE_SHAPE, p_54762_, true) && p_54760_.getValue(LEVEL) == 0 && p_54763_.canStandOnFluid(p_54761_.getFluidState(p_54762_.above()), getFluid()) ? STABLE_SHAPE : Shapes.empty();
	   }
       @Override
	   public boolean isRandomlyTicking(BlockState p_54732_) {
	      return p_54732_.getFluidState().isRandomlyTicking();
	   }
       @Override
	   public void randomTick(BlockState p_54740_, ServerLevel p_54741_, BlockPos p_54742_, Random p_54743_) {
	      p_54740_.getFluidState().randomTick(p_54741_, p_54742_, p_54743_);
	   }
       @Override
	   public boolean propagatesSkylightDown(BlockState p_54745_, BlockGetter p_54746_, BlockPos p_54747_) {
	      return false;
	   }
       @Override
	   public boolean isPathfindable(BlockState p_54704_, BlockGetter p_54705_, BlockPos p_54706_, PathComputationType p_54707_) {
	      return !getFluid().is(FluidTags.LAVA);
	   }
       @Override
	   public FluidState getFluidState(BlockState p_54765_) {
	      int i = p_54765_.getValue(LEVEL);
	      if (!fluidStateCacheInitialized) initFluidStateCache();
	      return this.stateCache.get(Math.min(i, 8));
	   }
       @Override
	   public boolean skipRendering(BlockState p_54716_, BlockState p_54717_, Direction p_54718_) {
	      return p_54717_.getFluidState().getType().isSame(getFluid());
	   }
       @Override
	   public RenderShape getRenderShape(BlockState p_54738_) {
	      return RenderShape.INVISIBLE;
	   }
       @Override
	   public List<ItemStack> getDrops(BlockState p_54720_, LootContext.Builder p_54721_) {
	      return Collections.emptyList();
	   }
       @Override
	   public VoxelShape getShape(BlockState p_54749_, BlockGetter p_54750_, BlockPos p_54751_, CollisionContext p_54752_) {
	      return Shapes.empty();
	   }
       @Override
	   public void onPlace(BlockState p_54754_, Level p_54755_, BlockPos p_54756_, BlockState p_54757_, boolean p_54758_) {
	      if (this.shouldSpreadLiquid(p_54755_, p_54756_, p_54754_)) {
	         p_54755_.getLiquidTicks().scheduleTick(p_54756_, p_54754_.getFluidState().getType(), getFluid().getTickDelay(p_54755_));
	      }

	   }
       @Override
	   public BlockState updateShape(BlockState p_54723_, Direction p_54724_, BlockState p_54725_, LevelAccessor p_54726_, BlockPos p_54727_, BlockPos p_54728_) {
	      if (p_54723_.getFluidState().isSource() || p_54725_.getFluidState().isSource()) {
	         p_54726_.getLiquidTicks().scheduleTick(p_54727_, p_54723_.getFluidState().getType(), getFluid().getTickDelay(p_54726_));
	      }

	      return null;
	   }
       @Override
	   public void neighborChanged(BlockState p_54709_, Level p_54710_, BlockPos p_54711_, Block p_54712_, BlockPos p_54713_, boolean p_54714_) {
	      if (this.shouldSpreadLiquid(p_54710_, p_54711_, p_54709_)) {
	         p_54710_.getLiquidTicks().scheduleTick(p_54711_, p_54709_.getFluidState().getType(), getFluid().getTickDelay(p_54710_));
	      }

	   }
       
	   private boolean shouldSpreadLiquid(Level p_54697_, BlockPos p_54698_, BlockState p_54699_) {
	      if (getFluid().is(FluidTags.LAVA)) {
	         boolean flag = p_54697_.getBlockState(p_54698_.below()).is(Blocks.SOUL_SOIL);

	         for(Direction direction : POSSIBLE_FLOW_DIRECTIONS) {
	            BlockPos blockpos = p_54698_.relative(direction.getOpposite());
	            if (p_54697_.getFluidState(blockpos).is(FluidTags.WATER)) {
	               Block block = p_54697_.getFluidState(p_54698_).isSource() ? Blocks.OBSIDIAN : Blocks.COBBLESTONE;
	               p_54697_.setBlockAndUpdate(p_54698_, net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_54697_, p_54698_, p_54698_, block.defaultBlockState()));
	               this.fizz(p_54697_, p_54698_);
	               return false;
	            }

	            if (flag && p_54697_.getBlockState(blockpos).is(Blocks.BLUE_ICE)) {
	               p_54697_.setBlockAndUpdate(p_54698_, net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_54697_, p_54698_, p_54698_, Blocks.BASALT.defaultBlockState()));
	               this.fizz(p_54697_, p_54698_);
	               return false;
	            }
	         }
	      }

	      return true;
	   }

	   private void fizz(LevelAccessor p_54701_, BlockPos p_54702_) {
	      p_54701_.levelEvent(1501, p_54702_, 0);
	   }
       @Override
	   protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> p_54730_) {
	      p_54730_.add(LEVEL);
	   }
       @Override
	   public ItemStack pickupBlock(LevelAccessor p_153772_, BlockPos p_153773_, BlockState p_153774_) {
	      if (p_153774_.getValue(LEVEL) == 0) {
	         p_153772_.setBlock(p_153773_, Blocks.AIR.defaultBlockState(), 11);
	         return new ItemStack(getFluid().getBucket());
	      } else {
	         return ItemStack.EMPTY;
	      }
	   }

	   // Forge start
	   private final java.util.function.Supplier<? extends net.minecraft.world.level.material.Fluid> supplier;
	   @Override
	   public FlowingFluid getFluid() {
	      return (FlowingFluid)supplier.get();
	   }

	   private boolean fluidStateCacheInitialized = false;
	   @Override
	   protected synchronized void initFluidStateCache() {
	      if (fluidStateCacheInitialized == false) {
	         this.stateCache.add(getFluid().getSource(false));

	         for (int i = 1; i < 8; ++i)
	            this.stateCache.add(getFluid().getFlowing(8 - i, false));

	         this.stateCache.add(getFluid().getFlowing(8, true));
	         fluidStateCacheInitialized = true;
	      }
	   }
	   @Override
	   public Optional<SoundEvent> getPickupSound() {
	      return getFluid().getPickupSound();
	   }
}

 

	    public static final RegistryObject<FlowingFluid> PURIFIEDWATER = FLUIDS
	            .register("purified_water",
	                    () -> new FluidPurifiedWater.Source(FluidPurifiedWater.PURIFIED_WATER_PROPS));
	    public static final RegistryObject<FlowingFluid> PURIFIEDWATER_FLOW = FLUIDS
	            .register("purified_water_flow",
	                    () -> new FluidPurifiedWater.Flowing(FluidPurifiedWater.PURIFIED_WATER_PROPS));
Spoiler
public abstract class FluidPurifiedWater extends ForgeFlowingFluid{
	
	
   public static final ForgeFlowingFluid.Properties PURIFIED_WATER_PROPS =
            new ForgeFlowingFluid.Properties(
            		ModFluids.PURIFIEDWATER, ModFluids.PURIFIEDWATER_FLOW, FluidAttributes
                    .builder(new ResourceLocation(ArkaneMagicka.MOD_ID, "block/purified_water_still"),
                            new ResourceLocation(ArkaneMagicka.MOD_ID, "block/purified_water_flow"))
                    .color(0x3DDCFF).density(4).viscosity(1).rarity(Rarity.EPIC))
                    .bucket(ModItems.PURIFIEDWATER_BUCKET)
                    .block(ModBlocks.PURIFIEDWATERBLOCK);

    protected FluidPurifiedWater(Properties properties) {
        super(properties);
    }
    

    public static class Flowing extends FluidPurifiedWater {
    	
        protected Flowing(Properties properties) {
			super(properties);
            registerDefaultState(getStateDefinition().any().setValue(LEVEL, 7));

		}
        @Override
		protected void createFluidStateDefinition(StateDefinition.Builder<Fluid, FluidState> p_76476_) {
            super.createFluidStateDefinition(p_76476_);
            p_76476_.add(LEVEL);
         }
        @Override
         public int getAmount(FluidState p_76480_) {
            return p_76480_.getValue(LEVEL);
         }
        @Override
         public boolean isSource(FluidState p_76478_) {
            return false;
         }

    }
    public static class Source extends FluidPurifiedWater {

        public Source(Properties properties) {
            super(properties);
        }
        @Override
        public int getAmount(FluidState p_76485_) {
            return 8;
         }
        @Override
         public boolean isSource(FluidState p_76483_) {
            return true;
         }
    }
}

 

crash log 
 

Spoiler
---- Minecraft Crash Report ----
// I bet Cylons wouldn't have this problem.

Time: 15/9/21 12:05
Description: Exception while ticking

java.lang.NullPointerException: Cannot invoke "net.minecraft.world.level.block.state.BlockState.isAir()" because "p_49910_" is null
	at net.minecraft.world.level.block.Block.updateOrDestroy(Block.java:158) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.level.block.state.BlockBehaviour$BlockStateBase.updateNeighbourShapes(BlockBehaviour.java:611) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.world.level.Level.markAndNotifyBlock(Level.java:246) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.level.Level.setBlock(Level.java:213) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.level.Level.setBlock(Level.java:177) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.level.material.FlowingFluid.spreadTo(FlowingFluid.java:244) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.world.level.material.FlowingFluid.spreadToSides(FlowingFluid.java:146) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.world.level.material.FlowingFluid.spread(FlowingFluid.java:125) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.world.level.material.FlowingFluid.tick(FlowingFluid.java:410) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.world.level.material.FluidState.tick(FluidState.java:73) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.server.level.ServerLevel.tickLiquid(ServerLevel.java:602) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.level.ServerTickList.tick(ServerTickList.java:78) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.server.level.ServerLevel.tick(ServerLevel.java:341) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:882) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:818) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.client.server.IntegratedServer.tickServer(IntegratedServer.java:85) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:683) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:258) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at java.lang.Thread.run(Thread.java:831) [?:?] {}


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Server thread
Stacktrace:
	at net.minecraft.world.level.block.Block.updateOrDestroy(Block.java:158) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.level.block.state.BlockBehaviour$BlockStateBase.updateNeighbourShapes(BlockBehaviour.java:611) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.world.level.Level.markAndNotifyBlock(Level.java:246) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.level.Level.setBlock(Level.java:213) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.level.Level.setBlock(Level.java:177) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.level.material.FlowingFluid.spreadTo(FlowingFluid.java:244) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.world.level.material.FlowingFluid.spreadToSides(FlowingFluid.java:146) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.world.level.material.FlowingFluid.spread(FlowingFluid.java:125) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.world.level.material.FlowingFluid.tick(FlowingFluid.java:410) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.world.level.material.FluidState.tick(FluidState.java:73) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.server.level.ServerLevel.tickLiquid(ServerLevel.java:602) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
-- Block being ticked --
Details:
	Block location: World: (-48,4,63), Section: (at 0,4,15 in -3,0,3; chunk contains blocks -48,0,48 to -33,255,63), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
Stacktrace:
	at net.minecraft.world.level.ServerTickList.tick(ServerTickList.java:78) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.server.level.ServerLevel.tick(ServerLevel.java:341) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}


-- Affected level --
Details:
	All players: 1 total; [ServerPlayer['Dev'/99, l='ServerLevel[New World]', x=-48.50, y=4.00, z=61.50]]
	Chunk stats: 2209
	Level dimension: minecraft:overworld
	Level spawn location: World: (-48,4,64), Section: (at 0,4,0 in -3,0,4; chunk contains blocks -48,0,64 to -33,255,79), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
	Level time: 241 game time, 241 day time
	Level name: New World
	Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: true
	Level weather: Rain time: 27970 (now: false), thunder time: 15855 (now: false)
	Known server brands: forge
	Level was modded: true
	Level storage version: 0x04ABD - Anvil
Stacktrace:
	at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:882) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:818) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.client.server.IntegratedServer.tickServer(IntegratedServer.java:85) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:683) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:258) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at java.lang.Thread.run(Thread.java:831) [?:?] {}


-- System Details --
Details:
	Minecraft Version: 1.17.1
	Minecraft Version ID: 1.17.1
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 16.0.1, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode, sharing), Oracle Corporation
	Memory: 1174793640 bytes (1120 MiB) / 1895825408 bytes (1808 MiB) up to 4276092928 bytes (4078 MiB)
	CPUs: 16
	Processor Vendor: AuthenticAMD
	Processor Name: AMD Ryzen 7 2700X Eight-Core Processor         
	Identifier: AuthenticAMD Family 23 Model 8 Stepping 2
	Microarchitecture: Zen+
	Frequency (GHz): 3,69
	Number of physical packages: 1
	Number of physical CPUs: 8
	Number of logical CPUs: 16
	Graphics card #0 name: NVIDIA GeForce GTX 1050 Ti
	Graphics card #0 vendor: NVIDIA (0x10de)
	Graphics card #0 VRAM (MB): 4095,00
	Graphics card #0 deviceId: 0x1c82
	Graphics card #0 versionInfo: DriverVersion=27.21.14.5671
	Memory slot #0 capacity (MB): 8192,00
	Memory slot #0 clockSpeed (GHz): 2,67
	Memory slot #0 type: DDR4
	Memory slot #1 capacity (MB): 8192,00
	Memory slot #1 clockSpeed (GHz): 2,67
	Memory slot #1 type: DDR4
	Virtual memory max (MB): 20912,76
	Virtual memory used (MB): 12187,51
	Swap memory total (MB): 4608,00
	Swap memory used (MB): 5,98
	JVM Flags: 2 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -XX:+ShowCodeDetailsInExceptionMessages
	Player Count: 1 / 8; [ServerPlayer['Dev'/99, l='ServerLevel[New World]', x=-48.50, y=4.00, z=61.50]]
	Data Packs: vanilla, mod:arkanemagicka (incompatible), mod:forge
	Type: Integrated Server (map_client.txt)
	Is Modded: Definitely; Client brand changed to 'forge'
	ModLauncher: 9.0.7+91+master.8569cdf
	ModLauncher launch target: forgeclientuserdev
	ModLauncher naming: mcp
	ModLauncher services: 
		 eventbus PLUGINSERVICE 
		 object_holder_definalize PLUGINSERVICE 
		 runtime_enum_extender PLUGINSERVICE 
		 capability_inject_definalize PLUGINSERVICE 
		 accesstransformer PLUGINSERVICE 
		 runtimedistcleaner PLUGINSERVICE 
		 fml TRANSFORMATIONSERVICE 
	FML Language Providers: 
		minecraft@1.0
		javafml@null
	Mod List: 
		forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp|Minecraft                     |minecraft                     |1.17.1              |DONE      |Manifest: a1:d4:5e:04:4f:d3:d6:e0:7b:37:97:cf:77:b0:de:ad:4a:47:ce:8c:96:49:5f:0a:cf:8c:ae:b2:6d:4b:8a:3f
		main                                              |Arkane Magicka                |arkanemagicka                 |0.0NONE             |DONE      |Manifest: NOSIGNATURE
		                                                  |Forge                         |forge                         |37.0.53             |DONE      |Manifest: NOSIGNATURE
	Crash Report UUID: affe95c1-583d-48a6-bdec-2b4868fdeb6a
	FML: 37.0
	Forge: net.minecraftforge:37.0.53

 

When I put the fluid with its bucket the game crashes giving that error.

The LiquidBlock class constructor is broken and I had to create CustomLiquidBlock to fix it by changing this.fluid to getFluid().

Thanks in advance.

Edited by furiusmax55
Link to comment
Share on other sites

  • furiusmax55 changed the title to [1.17.1] Problem With Custom Fluid
1 minute ago, diesieben07 said:

CustomLiquidBlock is not shown.

Spoiler
public class CustomLiquidBlock extends LiquidBlock{
	   public static final IntegerProperty LEVEL = BlockStateProperties.LEVEL;
	   protected final FlowingFluid fluid;
	   private final List<FluidState> stateCache;
	   public static final VoxelShape STABLE_SHAPE = Block.box(0.0D, 0.0D, 0.0D, 16.0D, 8.0D, 16.0D);
	   public static final ImmutableList<Direction> POSSIBLE_FLOW_DIRECTIONS = ImmutableList.of(Direction.DOWN, Direction.SOUTH, Direction.NORTH, Direction.EAST, Direction.WEST);

	   @Deprecated  // Forge: Use the constructor that takes a supplier
	   public CustomLiquidBlock(FlowingFluid p_54694_, BlockBehaviour.Properties p_54695_) {
	      super(p_54694_, p_54695_);
	      this.fluid = p_54694_;
	      this.stateCache = Lists.newArrayList();
	      this.stateCache.add(p_54694_.getSource(false));

	      for(int i = 1; i < 8; ++i) {
	         this.stateCache.add(p_54694_.getFlowing(8 - i, false));
	      }

	      this.stateCache.add(p_54694_.getFlowing(8, true));
	      this.registerDefaultState(this.stateDefinition.any().setValue(LEVEL, Integer.valueOf(0)));
	      fluidStateCacheInitialized = true;
	      supplier = p_54694_.delegate;
	   }

	   /**
	    * @param supplier A fluid supplier such as {@link net.minecraftforge.fmllegacy.RegistryObject<Fluid>}
	    */
	   public CustomLiquidBlock(java.util.function.Supplier<? extends FlowingFluid> p_54694_, BlockBehaviour.Properties p_54695_) {
	      super(p_54694_, p_54695_);
	      this.fluid = null;
	      this.stateCache = Lists.newArrayList();
	      this.registerDefaultState(this.stateDefinition.any().setValue(LEVEL, Integer.valueOf(0)));
	      this.supplier = p_54694_;
	   }
       @Override
	   public VoxelShape getCollisionShape(BlockState p_54760_, BlockGetter p_54761_, BlockPos p_54762_, CollisionContext p_54763_) {
	      return p_54763_.isAbove(STABLE_SHAPE, p_54762_, true) && p_54760_.getValue(LEVEL) == 0 && p_54763_.canStandOnFluid(p_54761_.getFluidState(p_54762_.above()), getFluid()) ? STABLE_SHAPE : Shapes.empty();
	   }
       @Override
	   public boolean isRandomlyTicking(BlockState p_54732_) {
	      return p_54732_.getFluidState().isRandomlyTicking();
	   }
       @Override
	   public void randomTick(BlockState p_54740_, ServerLevel p_54741_, BlockPos p_54742_, Random p_54743_) {
	      p_54740_.getFluidState().randomTick(p_54741_, p_54742_, p_54743_);
	   }
       @Override
	   public boolean propagatesSkylightDown(BlockState p_54745_, BlockGetter p_54746_, BlockPos p_54747_) {
	      return false;
	   }
       @Override
	   public boolean isPathfindable(BlockState p_54704_, BlockGetter p_54705_, BlockPos p_54706_, PathComputationType p_54707_) {
	      return !getFluid().is(FluidTags.LAVA);
	   }
       @Override
	   public FluidState getFluidState(BlockState p_54765_) {
	      int i = p_54765_.getValue(LEVEL);
	      if (!fluidStateCacheInitialized) initFluidStateCache();
	      return this.stateCache.get(Math.min(i, 8));
	   }
       @Override
	   public boolean skipRendering(BlockState p_54716_, BlockState p_54717_, Direction p_54718_) {
	      return p_54717_.getFluidState().getType().isSame(getFluid());
	   }
       @Override
	   public RenderShape getRenderShape(BlockState p_54738_) {
	      return RenderShape.INVISIBLE;
	   }
       @Override
	   public List<ItemStack> getDrops(BlockState p_54720_, LootContext.Builder p_54721_) {
	      return Collections.emptyList();
	   }
       @Override
	   public VoxelShape getShape(BlockState p_54749_, BlockGetter p_54750_, BlockPos p_54751_, CollisionContext p_54752_) {
	      return Shapes.empty();
	   }
       @Override
	   public void onPlace(BlockState p_54754_, Level p_54755_, BlockPos p_54756_, BlockState p_54757_, boolean p_54758_) {
	      if (this.shouldSpreadLiquid(p_54755_, p_54756_, p_54754_)) {
	         p_54755_.getLiquidTicks().scheduleTick(p_54756_, p_54754_.getFluidState().getType(), getFluid().getTickDelay(p_54755_));
	      }

	   }
       @Override
	   public BlockState updateShape(BlockState p_54723_, Direction p_54724_, BlockState p_54725_, LevelAccessor p_54726_, BlockPos p_54727_, BlockPos p_54728_) {
	      if (p_54723_.getFluidState().isSource() || p_54725_.getFluidState().isSource()) {
	         p_54726_.getLiquidTicks().scheduleTick(p_54727_, p_54723_.getFluidState().getType(), getFluid().getTickDelay(p_54726_));
	      }

	      return null;
	   }
       @Override
	   public void neighborChanged(BlockState p_54709_, Level p_54710_, BlockPos p_54711_, Block p_54712_, BlockPos p_54713_, boolean p_54714_) {
	      if (this.shouldSpreadLiquid(p_54710_, p_54711_, p_54709_)) {
	         p_54710_.getLiquidTicks().scheduleTick(p_54711_, p_54709_.getFluidState().getType(), getFluid().getTickDelay(p_54710_));
	      }

	   }
       
	   private boolean shouldSpreadLiquid(Level p_54697_, BlockPos p_54698_, BlockState p_54699_) {
	      if (getFluid().is(FluidTags.LAVA)) {
	         boolean flag = p_54697_.getBlockState(p_54698_.below()).is(Blocks.SOUL_SOIL);

	         for(Direction direction : POSSIBLE_FLOW_DIRECTIONS) {
	            BlockPos blockpos = p_54698_.relative(direction.getOpposite());
	            if (p_54697_.getFluidState(blockpos).is(FluidTags.WATER)) {
	               Block block = p_54697_.getFluidState(p_54698_).isSource() ? Blocks.OBSIDIAN : Blocks.COBBLESTONE;
	               p_54697_.setBlockAndUpdate(p_54698_, net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_54697_, p_54698_, p_54698_, block.defaultBlockState()));
	               this.fizz(p_54697_, p_54698_);
	               return false;
	            }

	            if (flag && p_54697_.getBlockState(blockpos).is(Blocks.BLUE_ICE)) {
	               p_54697_.setBlockAndUpdate(p_54698_, net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_54697_, p_54698_, p_54698_, Blocks.BASALT.defaultBlockState()));
	               this.fizz(p_54697_, p_54698_);
	               return false;
	            }
	         }
	      }

	      return true;
	   }

	   private void fizz(LevelAccessor p_54701_, BlockPos p_54702_) {
	      p_54701_.levelEvent(1501, p_54702_, 0);
	   }
       @Override
	   protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> p_54730_) {
	      p_54730_.add(LEVEL);
	   }
       @Override
	   public ItemStack pickupBlock(LevelAccessor p_153772_, BlockPos p_153773_, BlockState p_153774_) {
	      if (p_153774_.getValue(LEVEL) == 0) {
	         p_153772_.setBlock(p_153773_, Blocks.AIR.defaultBlockState(), 11);
	         return new ItemStack(getFluid().getBucket());
	      } else {
	         return ItemStack.EMPTY;
	      }
	   }

	   // Forge start
	   private final java.util.function.Supplier<? extends net.minecraft.world.level.material.Fluid> supplier;
	   @Override
	   public FlowingFluid getFluid() {
	      return (FlowingFluid)supplier.get();
	   }

	   private boolean fluidStateCacheInitialized = false;
	   @Override
	   protected synchronized void initFluidStateCache() {
	      if (fluidStateCacheInitialized == false) {
	         this.stateCache.add(getFluid().getSource(false));

	         for (int i = 1; i < 8; ++i)
	            this.stateCache.add(getFluid().getFlowing(8 - i, false));

	         this.stateCache.add(getFluid().getFlowing(8, true));
	         fluidStateCacheInitialized = true;
	      }
	   }
	   @Override
	   public Optional<SoundEvent> getPickupSound() {
	      return getFluid().getPickupSound();
	   }
}

 

 

Link to comment
Share on other sites

8 minutes ago, furiusmax55 said:
  Reveal hidden contents
public class CustomLiquidBlock extends LiquidBlock{
	   public static final IntegerProperty LEVEL = BlockStateProperties.LEVEL;
	   protected final FlowingFluid fluid;
	   private final List<FluidState> stateCache;
	   public static final VoxelShape STABLE_SHAPE = Block.box(0.0D, 0.0D, 0.0D, 16.0D, 8.0D, 16.0D);
	   public static final ImmutableList<Direction> POSSIBLE_FLOW_DIRECTIONS = ImmutableList.of(Direction.DOWN, Direction.SOUTH, Direction.NORTH, Direction.EAST, Direction.WEST);

	   @Deprecated  // Forge: Use the constructor that takes a supplier
	   public CustomLiquidBlock(FlowingFluid p_54694_, BlockBehaviour.Properties p_54695_) {
	      super(p_54694_, p_54695_);
	      this.fluid = p_54694_;
	      this.stateCache = Lists.newArrayList();
	      this.stateCache.add(p_54694_.getSource(false));

	      for(int i = 1; i < 8; ++i) {
	         this.stateCache.add(p_54694_.getFlowing(8 - i, false));
	      }

	      this.stateCache.add(p_54694_.getFlowing(8, true));
	      this.registerDefaultState(this.stateDefinition.any().setValue(LEVEL, Integer.valueOf(0)));
	      fluidStateCacheInitialized = true;
	      supplier = p_54694_.delegate;
	   }

	   /**
	    * @param supplier A fluid supplier such as {@link net.minecraftforge.fmllegacy.RegistryObject<Fluid>}
	    */
	   public CustomLiquidBlock(java.util.function.Supplier<? extends FlowingFluid> p_54694_, BlockBehaviour.Properties p_54695_) {
	      super(p_54694_, p_54695_);
	      this.fluid = null;
	      this.stateCache = Lists.newArrayList();
	      this.registerDefaultState(this.stateDefinition.any().setValue(LEVEL, Integer.valueOf(0)));
	      this.supplier = p_54694_;
	   }
       @Override
	   public VoxelShape getCollisionShape(BlockState p_54760_, BlockGetter p_54761_, BlockPos p_54762_, CollisionContext p_54763_) {
	      return p_54763_.isAbove(STABLE_SHAPE, p_54762_, true) && p_54760_.getValue(LEVEL) == 0 && p_54763_.canStandOnFluid(p_54761_.getFluidState(p_54762_.above()), getFluid()) ? STABLE_SHAPE : Shapes.empty();
	   }
       @Override
	   public boolean isRandomlyTicking(BlockState p_54732_) {
	      return p_54732_.getFluidState().isRandomlyTicking();
	   }
       @Override
	   public void randomTick(BlockState p_54740_, ServerLevel p_54741_, BlockPos p_54742_, Random p_54743_) {
	      p_54740_.getFluidState().randomTick(p_54741_, p_54742_, p_54743_);
	   }
       @Override
	   public boolean propagatesSkylightDown(BlockState p_54745_, BlockGetter p_54746_, BlockPos p_54747_) {
	      return false;
	   }
       @Override
	   public boolean isPathfindable(BlockState p_54704_, BlockGetter p_54705_, BlockPos p_54706_, PathComputationType p_54707_) {
	      return !getFluid().is(FluidTags.LAVA);
	   }
       @Override
	   public FluidState getFluidState(BlockState p_54765_) {
	      int i = p_54765_.getValue(LEVEL);
	      if (!fluidStateCacheInitialized) initFluidStateCache();
	      return this.stateCache.get(Math.min(i, 8));
	   }
       @Override
	   public boolean skipRendering(BlockState p_54716_, BlockState p_54717_, Direction p_54718_) {
	      return p_54717_.getFluidState().getType().isSame(getFluid());
	   }
       @Override
	   public RenderShape getRenderShape(BlockState p_54738_) {
	      return RenderShape.INVISIBLE;
	   }
       @Override
	   public List<ItemStack> getDrops(BlockState p_54720_, LootContext.Builder p_54721_) {
	      return Collections.emptyList();
	   }
       @Override
	   public VoxelShape getShape(BlockState p_54749_, BlockGetter p_54750_, BlockPos p_54751_, CollisionContext p_54752_) {
	      return Shapes.empty();
	   }
       @Override
	   public void onPlace(BlockState p_54754_, Level p_54755_, BlockPos p_54756_, BlockState p_54757_, boolean p_54758_) {
	      if (this.shouldSpreadLiquid(p_54755_, p_54756_, p_54754_)) {
	         p_54755_.getLiquidTicks().scheduleTick(p_54756_, p_54754_.getFluidState().getType(), getFluid().getTickDelay(p_54755_));
	      }

	   }
       @Override
	   public BlockState updateShape(BlockState p_54723_, Direction p_54724_, BlockState p_54725_, LevelAccessor p_54726_, BlockPos p_54727_, BlockPos p_54728_) {
	      if (p_54723_.getFluidState().isSource() || p_54725_.getFluidState().isSource()) {
	         p_54726_.getLiquidTicks().scheduleTick(p_54727_, p_54723_.getFluidState().getType(), getFluid().getTickDelay(p_54726_));
	      }

	      return null;
	   }
       @Override
	   public void neighborChanged(BlockState p_54709_, Level p_54710_, BlockPos p_54711_, Block p_54712_, BlockPos p_54713_, boolean p_54714_) {
	      if (this.shouldSpreadLiquid(p_54710_, p_54711_, p_54709_)) {
	         p_54710_.getLiquidTicks().scheduleTick(p_54711_, p_54709_.getFluidState().getType(), getFluid().getTickDelay(p_54710_));
	      }

	   }
       
	   private boolean shouldSpreadLiquid(Level p_54697_, BlockPos p_54698_, BlockState p_54699_) {
	      if (getFluid().is(FluidTags.LAVA)) {
	         boolean flag = p_54697_.getBlockState(p_54698_.below()).is(Blocks.SOUL_SOIL);

	         for(Direction direction : POSSIBLE_FLOW_DIRECTIONS) {
	            BlockPos blockpos = p_54698_.relative(direction.getOpposite());
	            if (p_54697_.getFluidState(blockpos).is(FluidTags.WATER)) {
	               Block block = p_54697_.getFluidState(p_54698_).isSource() ? Blocks.OBSIDIAN : Blocks.COBBLESTONE;
	               p_54697_.setBlockAndUpdate(p_54698_, net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_54697_, p_54698_, p_54698_, block.defaultBlockState()));
	               this.fizz(p_54697_, p_54698_);
	               return false;
	            }

	            if (flag && p_54697_.getBlockState(blockpos).is(Blocks.BLUE_ICE)) {
	               p_54697_.setBlockAndUpdate(p_54698_, net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_54697_, p_54698_, p_54698_, Blocks.BASALT.defaultBlockState()));
	               this.fizz(p_54697_, p_54698_);
	               return false;
	            }
	         }
	      }

	      return true;
	   }

	   private void fizz(LevelAccessor p_54701_, BlockPos p_54702_) {
	      p_54701_.levelEvent(1501, p_54702_, 0);
	   }
       @Override
	   protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> p_54730_) {
	      p_54730_.add(LEVEL);
	   }
       @Override
	   public ItemStack pickupBlock(LevelAccessor p_153772_, BlockPos p_153773_, BlockState p_153774_) {
	      if (p_153774_.getValue(LEVEL) == 0) {
	         p_153772_.setBlock(p_153773_, Blocks.AIR.defaultBlockState(), 11);
	         return new ItemStack(getFluid().getBucket());
	      } else {
	         return ItemStack.EMPTY;
	      }
	   }

	   // Forge start
	   private final java.util.function.Supplier<? extends net.minecraft.world.level.material.Fluid> supplier;
	   @Override
	   public FlowingFluid getFluid() {
	      return (FlowingFluid)supplier.get();
	   }

	   private boolean fluidStateCacheInitialized = false;
	   @Override
	   protected synchronized void initFluidStateCache() {
	      if (fluidStateCacheInitialized == false) {
	         this.stateCache.add(getFluid().getSource(false));

	         for (int i = 1; i < 8; ++i)
	            this.stateCache.add(getFluid().getFlowing(8 - i, false));

	         this.stateCache.add(getFluid().getFlowing(8, true));
	         fluidStateCacheInitialized = true;
	      }
	   }
	   @Override
	   public Optional<SoundEvent> getPickupSound() {
	      return getFluid().getPickupSound();
	   }
}

 

 

And the vanilla LiquidBlock

 

[removed vanilla code - diesieben07]

Edited by diesieben07
Link to comment
Share on other sites

5 minutes ago, furiusmax55 said:

If I use that, an error arises when putting the liquid on the ground

log using vanilla class with the not deprecated constructor 

 

Spoiler
---- Minecraft Crash Report ----
// There are four lights!

Time: 15/9/21 12:53
Description: Unexpected error

java.lang.NullPointerException: Cannot invoke "net.minecraft.world.level.material.FlowingFluid.getTickDelay(net.minecraft.world.level.LevelReader)" because "this.fluid" is null
	at net.minecraft.world.level.block.LiquidBlock.updateShape(LiquidBlock.java:117) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.level.block.state.BlockBehaviour$BlockStateBase.updateShape(BlockBehaviour.java:669) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.world.level.block.state.BlockBehaviour$BlockStateBase.updateNeighbourShapes(BlockBehaviour.java:610) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.world.level.Level.markAndNotifyBlock(Level.java:246) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.level.Level.setBlock(Level.java:213) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.level.Level.setBlock(Level.java:177) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.item.BucketItem.emptyContents(BucketItem.java:146) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,xf:fml:forge:bucketitem}
	at net.minecraft.world.item.BucketItem.use(BucketItem.java:90) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,xf:fml:forge:bucketitem}
	at net.minecraft.world.item.ItemStack.use(ItemStack.java:243) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,xf:fml:forge:itemstack}
	at net.minecraft.client.multiplayer.MultiPlayerGameMode.useItem(MultiPlayerGameMode.java:337) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.startUseItem(Minecraft.java:1576) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.handleKeybinds(Minecraft.java:1829) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.tick(Minecraft.java:1647) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.runTick(Minecraft.java:1015) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.run(Minecraft.java:660) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.main.Main.main(Main.java:186) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:runtimedistcleaner:A}
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) ~[?:?] {}
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}
	at java.lang.reflect.Method.invoke(Method.java:567) ~[?:?] {}
	at net.minecraftforge.fml.loading.targets.ForgeClientUserdevLaunchHandler.lambda$launchService$0(ForgeClientUserdevLaunchHandler.java:38) ~[fmlloader-1.17.1-37.0.53.jar%233!:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-9.0.7.jar%238!:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-9.0.7.jar%238!:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-9.0.7.jar%238!:?] {}
	at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) [modlauncher-9.0.7.jar%238!:?] {}
	at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) [modlauncher-9.0.7.jar%238!:?] {}
	at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-9.0.7.jar%238!:?] {}
	at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-9.0.7.jar%238!:?] {}
	at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:90) [bootstraplauncher-0.1.17.jar:?] {}


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Render thread
Stacktrace:
	at net.minecraft.world.level.block.LiquidBlock.updateShape(LiquidBlock.java:117) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.level.block.state.BlockBehaviour$BlockStateBase.updateShape(BlockBehaviour.java:669) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.world.level.block.state.BlockBehaviour$BlockStateBase.updateNeighbourShapes(BlockBehaviour.java:610) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.world.level.Level.markAndNotifyBlock(Level.java:246) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.level.Level.setBlock(Level.java:213) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.level.Level.setBlock(Level.java:177) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.item.BucketItem.emptyContents(BucketItem.java:146) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,xf:fml:forge:bucketitem}
	at net.minecraft.world.item.BucketItem.use(BucketItem.java:90) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,xf:fml:forge:bucketitem}
	at net.minecraft.world.item.ItemStack.use(ItemStack.java:243) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,xf:fml:forge:itemstack}
	at net.minecraft.client.multiplayer.MultiPlayerGameMode.useItem(MultiPlayerGameMode.java:337) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.startUseItem(Minecraft.java:1576) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.handleKeybinds(Minecraft.java:1829) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
-- Affected level --
Details:
	All players: 1 total; [LocalPlayer['Dev'/43, l='ClientLevel', x=-35.50, y=4.00, z=132.50]]
	Chunk stats: 841, 529
	Level dimension: minecraft:overworld
	Level spawn location: World: (-32,4,128), Section: (at 0,4,0 in -2,0,8; chunk contains blocks -32,0,128 to -17,255,143), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
	Level time: 222 game time, 222 day time
	Server brand: forge
	Server type: Integrated singleplayer server
Stacktrace:
	at net.minecraft.client.multiplayer.ClientLevel.fillReportDetails(ClientLevel.java:364) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.fillReport(Minecraft.java:2245) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.run(Minecraft.java:682) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.main.Main.main(Main.java:186) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:runtimedistcleaner:A}
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) ~[?:?] {}
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}
	at java.lang.reflect.Method.invoke(Method.java:567) ~[?:?] {}
	at net.minecraftforge.fml.loading.targets.ForgeClientUserdevLaunchHandler.lambda$launchService$0(ForgeClientUserdevLaunchHandler.java:38) ~[fmlloader-1.17.1-37.0.53.jar%233!:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-9.0.7.jar%238!:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-9.0.7.jar%238!:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-9.0.7.jar%238!:?] {}
	at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) [modlauncher-9.0.7.jar%238!:?] {}
	at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) [modlauncher-9.0.7.jar%238!:?] {}
	at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-9.0.7.jar%238!:?] {}
	at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-9.0.7.jar%238!:?] {}
	at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:90) [bootstraplauncher-0.1.17.jar:?] {}


-- Last reload --
Details:
	Reload number: 1
	Reload reason: initial
	Finished: Yes
	Packs: Default, Mod Resources

-- System Details --
Details:
	Minecraft Version: 1.17.1
	Minecraft Version ID: 1.17.1
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 16.0.1, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode, sharing), Oracle Corporation
	Memory: 396807240 bytes (378 MiB) / 1749024768 bytes (1668 MiB) up to 4276092928 bytes (4078 MiB)
	CPUs: 16
	Processor Vendor: AuthenticAMD
	Processor Name: AMD Ryzen 7 2700X Eight-Core Processor         
	Identifier: AuthenticAMD Family 23 Model 8 Stepping 2
	Microarchitecture: Zen+
	Frequency (GHz): 3,69
	Number of physical packages: 1
	Number of physical CPUs: 8
	Number of logical CPUs: 16
	Graphics card #0 name: NVIDIA GeForce GTX 1050 Ti
	Graphics card #0 vendor: NVIDIA (0x10de)
	Graphics card #0 VRAM (MB): 4095,00
	Graphics card #0 deviceId: 0x1c82
	Graphics card #0 versionInfo: DriverVersion=27.21.14.5671
	Memory slot #0 capacity (MB): 8192,00
	Memory slot #0 clockSpeed (GHz): 2,67
	Memory slot #0 type: DDR4
	Memory slot #1 capacity (MB): 8192,00
	Memory slot #1 clockSpeed (GHz): 2,67
	Memory slot #1 type: DDR4
	Virtual memory max (MB): 20912,76
	Virtual memory used (MB): 12202,20
	Swap memory total (MB): 4608,00
	Swap memory used (MB): 5,98
	JVM Flags: 2 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -XX:+ShowCodeDetailsInExceptionMessages
	Launched Version: MOD_DEV
	Backend library: LWJGL version 3.2.2 SNAPSHOT
	Backend API: GeForce GTX 1050 Ti/PCIe/SSE2 GL version 3.2.0 NVIDIA 456.71, NVIDIA Corporation
	Window size: 854x480
	GL Caps: Using framebuffer using OpenGL 3.2
	GL debug messages: 
	Using VBOs: Yes
	Is Modded: Definitely; Client brand changed to 'forge'
	Type: Integrated Server (map_client.txt)
	Graphics mode: fast
	Resource Packs: 
	Current Language: English (US)
	CPU: 16x AMD Ryzen 7 2700X Eight-Core Processor 
	Player Count: 1 / 8; [ServerPlayer['Dev'/43, l='ServerLevel[New World]', x=-35.50, y=4.00, z=132.50]]
	Data Packs: vanilla, mod:arkanemagicka (incompatible), mod:forge
	ModLauncher: 9.0.7+91+master.8569cdf
	ModLauncher launch target: forgeclientuserdev
	ModLauncher naming: mcp
	ModLauncher services: 
		 eventbus PLUGINSERVICE 
		 object_holder_definalize PLUGINSERVICE 
		 runtime_enum_extender PLUGINSERVICE 
		 capability_inject_definalize PLUGINSERVICE 
		 accesstransformer PLUGINSERVICE 
		 runtimedistcleaner PLUGINSERVICE 
		 fml TRANSFORMATIONSERVICE 
	FML Language Providers: 
		minecraft@1.0
		javafml@null
	Mod List: 
		forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp|Minecraft                     |minecraft                     |1.17.1              |DONE      |Manifest: a1:d4:5e:04:4f:d3:d6:e0:7b:37:97:cf:77:b0:de:ad:4a:47:ce:8c:96:49:5f:0a:cf:8c:ae:b2:6d:4b:8a:3f
		main                                              |Arkane Magicka                |arkanemagicka                 |0.0NONE             |DONE      |Manifest: NOSIGNATURE
		                                                  |Forge                         |forge                         |37.0.53             |DONE      |Manifest: NOSIGNATURE
	Crash Report UUID: a7bb91a3-332c-41d5-b6ce-429328998f4d
	FML: 37.0
	Forge: net.minecraftforge:37.0.53

 

 

Link to comment
Share on other sites

8 minutes ago, furiusmax55 said:

I'm going to try it

same error as at the beginning
 

Spoiler
---- Minecraft Crash Report ----
// You're mean.

Time: 15/9/21 13:07
Description: Exception while ticking

java.lang.NullPointerException: Cannot invoke "net.minecraft.world.level.block.state.BlockState.isAir()" because "p_49910_" is null
	at net.minecraft.world.level.block.Block.updateOrDestroy(Block.java:158) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.level.block.state.BlockBehaviour$BlockStateBase.updateNeighbourShapes(BlockBehaviour.java:611) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.world.level.Level.markAndNotifyBlock(Level.java:246) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.level.Level.setBlock(Level.java:213) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.level.Level.setBlock(Level.java:177) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.level.material.FlowingFluid.spreadTo(FlowingFluid.java:244) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.world.level.material.FlowingFluid.spreadToSides(FlowingFluid.java:146) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.world.level.material.FlowingFluid.spread(FlowingFluid.java:125) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.world.level.material.FlowingFluid.tick(FlowingFluid.java:410) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.world.level.material.FluidState.tick(FluidState.java:73) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.server.level.ServerLevel.tickLiquid(ServerLevel.java:602) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.level.ServerTickList.tick(ServerTickList.java:78) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.server.level.ServerLevel.tick(ServerLevel.java:341) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:882) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:818) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.client.server.IntegratedServer.tickServer(IntegratedServer.java:85) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:683) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:258) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at java.lang.Thread.run(Thread.java:831) [?:?] {}


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Server thread
Stacktrace:
	at net.minecraft.world.level.block.Block.updateOrDestroy(Block.java:158) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.level.block.state.BlockBehaviour$BlockStateBase.updateNeighbourShapes(BlockBehaviour.java:611) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.world.level.Level.markAndNotifyBlock(Level.java:246) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.level.Level.setBlock(Level.java:213) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.level.Level.setBlock(Level.java:177) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.level.material.FlowingFluid.spreadTo(FlowingFluid.java:244) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.world.level.material.FlowingFluid.spreadToSides(FlowingFluid.java:146) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.world.level.material.FlowingFluid.spread(FlowingFluid.java:125) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.world.level.material.FlowingFluid.tick(FlowingFluid.java:410) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.world.level.material.FluidState.tick(FluidState.java:73) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.server.level.ServerLevel.tickLiquid(ServerLevel.java:602) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
-- Block being ticked --
Details:
	Block location: World: (1,4,83), Section: (at 1,4,3 in 0,0,5; chunk contains blocks 0,0,80 to 15,255,95), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
Stacktrace:
	at net.minecraft.world.level.ServerTickList.tick(ServerTickList.java:78) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading}
	at net.minecraft.server.level.ServerLevel.tick(ServerLevel.java:341) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}


-- Affected level --
Details:
	All players: 1 total; [ServerPlayer['Dev'/1, l='ServerLevel[New World]', x=1.50, y=4.00, z=81.50]]
	Chunk stats: 2209
	Level dimension: minecraft:overworld
	Level spawn location: World: (0,4,80), Section: (at 0,4,0 in 0,0,5; chunk contains blocks 0,0,80 to 15,255,95), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
	Level time: 222 game time, 222 day time
	Level name: New World
	Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: true
	Level weather: Rain time: 55367 (now: false), thunder time: 96462 (now: false)
	Known server brands: forge
	Level was modded: true
	Level storage version: 0x04ABD - Anvil
Stacktrace:
	at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:882) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:818) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.client.server.IntegratedServer.tickServer(IntegratedServer.java:85) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:683) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:258) ~[forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B}
	at java.lang.Thread.run(Thread.java:831) [?:?] {}


-- System Details --
Details:
	Minecraft Version: 1.17.1
	Minecraft Version ID: 1.17.1
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 16.0.1, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode, sharing), Oracle Corporation
	Memory: 1601519504 bytes (1527 MiB) / 2080374784 bytes (1984 MiB) up to 4276092928 bytes (4078 MiB)
	CPUs: 16
	Processor Vendor: AuthenticAMD
	Processor Name: AMD Ryzen 7 2700X Eight-Core Processor         
	Identifier: AuthenticAMD Family 23 Model 8 Stepping 2
	Microarchitecture: Zen+
	Frequency (GHz): 3,69
	Number of physical packages: 1
	Number of physical CPUs: 8
	Number of logical CPUs: 16
	Graphics card #0 name: NVIDIA GeForce GTX 1050 Ti
	Graphics card #0 vendor: NVIDIA (0x10de)
	Graphics card #0 VRAM (MB): 4095,00
	Graphics card #0 deviceId: 0x1c82
	Graphics card #0 versionInfo: DriverVersion=27.21.14.5671
	Memory slot #0 capacity (MB): 8192,00
	Memory slot #0 clockSpeed (GHz): 2,67
	Memory slot #0 type: DDR4
	Memory slot #1 capacity (MB): 8192,00
	Memory slot #1 clockSpeed (GHz): 2,67
	Memory slot #1 type: DDR4
	Virtual memory max (MB): 20912,76
	Virtual memory used (MB): 12844,72
	Swap memory total (MB): 4608,00
	Swap memory used (MB): 31,44
	JVM Flags: 2 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -XX:+ShowCodeDetailsInExceptionMessages
	Player Count: 1 / 8; [ServerPlayer['Dev'/1, l='ServerLevel[New World]', x=1.50, y=4.00, z=81.50]]
	Data Packs: vanilla, mod:arkanemagicka (incompatible), mod:forge
	Type: Integrated Server (map_client.txt)
	Is Modded: Definitely; Client brand changed to 'forge'
	ModLauncher: 9.0.7+91+master.8569cdf
	ModLauncher launch target: forgeclientuserdev
	ModLauncher naming: mcp
	ModLauncher services: 
		 eventbus PLUGINSERVICE 
		 object_holder_definalize PLUGINSERVICE 
		 runtime_enum_extender PLUGINSERVICE 
		 capability_inject_definalize PLUGINSERVICE 
		 accesstransformer PLUGINSERVICE 
		 runtimedistcleaner PLUGINSERVICE 
		 fml TRANSFORMATIONSERVICE 
	FML Language Providers: 
		minecraft@1.0
		javafml@null
	Mod List: 
		forge-1.17.1-37.0.53_mapped_official_1.17.1-recomp|Minecraft                     |minecraft                     |1.17.1              |DONE      |Manifest: a1:d4:5e:04:4f:d3:d6:e0:7b:37:97:cf:77:b0:de:ad:4a:47:ce:8c:96:49:5f:0a:cf:8c:ae:b2:6d:4b:8a:3f
		main                                              |Arkane Magicka                |arkanemagicka                 |0.0NONE             |DONE      |Manifest: NOSIGNATURE
		                                                  |Forge                         |forge                         |37.0.53             |DONE      |Manifest: NOSIGNATURE
	Crash Report UUID: a564e65f-0b2e-4eba-b355-c1ac7008e8b5
	FML: 37.0
	Forge: net.minecraftforge:37.0.53

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
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.

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • I'm not sure how the change in platform is causing the error, but your best bet would be to create a fresh environment on your Mac and then copy all the class files over
    • Nevermind, I was able to wrap my mind around https://forge.gemwire.uk/wiki/Capabilities#Accessing_a_Capability , and currently have it working!
    • So I'm nearly finished with a version of my mod and, although I haven't done mapping changes in awhile, I'm confident that I have the correct method name so that an instance of reflection runs properly. However, the new method name isn't recognized during load in the real environment (I'm aware it needs to be changed back to run in dev). I cross-referenced both the output.srg as well as a Discord bot and they tell me that: func_221052_a    in     PointOfInterestType.class       should be       registerBlockStates Attached is the relevant class and log file. Any help is appreciated. Loading Output Log Villager Util class:  
    • Hey, I have an issue where I can't run the Minecraft client on a fresh project. The steps I took to set it up are as follows: - Downloaded the Forge 1.12.2 MDK (version 14.23.5.2855) - Extracted the .zip file to a folder - With a command prompt console within that directory, I ran "gradlew genEclipseRuns" then once that successfully completed, "gradlew eclipse". - Opened that root folder as a Gradle project in Eclipse - Under Gradle Tasks I ran "runClient" then received the following error specifically for ":runClient":   org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk-11.0.11\bin\java.exe'' finished with non-zero exit value 1 at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:395) at org.gradle.process.internal.DefaultJavaExecAction.execute(DefaultJavaExecAction.java:37) at org.gradle.api.tasks.JavaExec.exec(JavaExec.java:79) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:46) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26) at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:786) at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:753) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:131) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174) at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:120) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:99) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:77) at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51) at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59) at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59) at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101) at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44) at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91) at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54) at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.run(EventFiringTaskExecuter.java:51) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174) at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:46) at org.gradle.execution.taskgraph.LocalTaskInfoExecutor.execute(LocalTaskInfoExecutor.java:42) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:273) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:258) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:135) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:130) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.execute(DefaultTaskPlanExecutor.java:200) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.executeWithWork(DefaultTaskPlanExecutor.java:191) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.run(DefaultTaskPlanExecutor.java:130) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63) at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55) at java.base/java.lang.Thread.run(Thread.java:834) I'd appreciate any help, and please don't think I'm lazy by asking this, I've honestly been looking for a solution for the past ~6 hours haha. Thanks!
    • Hello! I'm trying to create a capability that reads a player's CompoundTag, and extracts some custom mod data from it to assemble an object, along with being given one of those mod objects and writing it to a Player's nbt. I've hopefully created the capability correctly, but I'm not sure how to go about having a `Player` read/write this data during a world save, and how I can go about retrieving the data from a given `Player` object on world join (I know I'd need to subscribe to the event, but I have no idea what I'd do from there). Additionally, this code results in "Invalid player data" whenever I join a world, and I don't know what's in here causes that (EDIT: Figured out this was due to my own bad serialization code. Does this mean that the NBT is automatically loaded on world join and saved on world leave?). My full repository can be found here: https://github.com/hammy3502/elementalism , and the relevant code snippets are below:   Object with Custom Mod Data (PlayerProgressionData.java): public class PlayerProgressionData implements INBTSerializable<CompoundTag> { public static final String outerTag = "elementalism_data"; public ProgressionInfo.ElementType type; public ProgressionInfo.ElementType type2; public List<ProgressionInfo> powersUnlocked; public PlayerProgressionData() { this.type = ProgressionInfo.ElementType.NONE; this.type2 = ProgressionInfo.ElementType.NONE; this.powersUnlocked = new ArrayList<>(); } @Override public CompoundTag serializeNBT() { CompoundTag toRet = new CompoundTag(); CompoundTag data = new CompoundTag(); StringBuilder powersList = new StringBuilder(); for (int i = 0; i < powersUnlocked.size(); i++) { powersList.append(powersUnlocked.get(i).id); if (i != powersUnlocked.size() - 1) { powersList.append(","); } } data.putString("unlockedPowers", powersList.toString()); data.putString("element1", this.type.id); data.putString("element2", this.type2.id); toRet.put(outerTag, data); return toRet; } @Override public void deserializeNBT(CompoundTag nbt) { if (!nbt.contains(outerTag)) return; this.powersUnlocked.clear(); CompoundTag data = nbt.getCompound(outerTag); this.type = ProgressionInfo.ElementType.getElementById(data.getString("element1")); this.type2 = ProgressionInfo.ElementType.getElementById(data.getString("element2")); String[] powerIds = data.getString("unlockedPowers").split(","); for (String id : powerIds) { ProgressionInfo info = Objects.requireNonNull(ProgressionInfoInit.ALL_PROGRESSION_INFOS.get(id)); this.powersUnlocked.add(info); } } } Capability Registration (Elementalism.java): public void registerCapabilities(RegisterCapabilitiesEvent event) { event.register(PlayerProgressionData.class); }   Capability Attaching (CommonSubscriber.java): @SubscribeEvent public void attachCapabilities(AttachCapabilitiesEvent<Entity> event) { if (!(event.getObject() instanceof Player)) return; PlayerProgressionData progressionData = new PlayerProgressionData(); LazyOptional<PlayerProgressionData> optionalProgressionData = LazyOptional.of(() -> progressionData); ICapabilityProvider provider = new ICapabilitySerializable<CompoundTag>() { @Override public CompoundTag serializeNBT() { return progressionData.serializeNBT(); } @Override public void deserializeNBT(CompoundTag nbt) { progressionData.deserializeNBT(nbt); } @Nonnull @Override public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> cap, @Nullable Direction side) { if (cap == DATA_STORAGE_CAPABILITY) { return optionalProgressionData.cast(); } return LazyOptional.empty(); } }; event.addCapability(new ResourceLocation(Elementalism.MOD_ID, "data_storage"), provider); event.addListener(optionalProgressionData::invalidate); }   Thank you so much for any help!
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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