Skip to content

Commit

Permalink
test update 20240628
Browse files Browse the repository at this point in the history
  • Loading branch information
PajangForever committed Jun 28, 2024
1 parent a26d91d commit 9defd4d
Showing 1 changed file with 0 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import name.synchro.Synchro;
import name.synchro.fluids.FluidUtil;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.FluidBlock;
import net.minecraft.block.ShapeContext;
import net.minecraft.fluid.FluidState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
Expand All @@ -21,20 +19,6 @@

@Mixin(FluidBlock.class)
public class FluidBlockMixin {
/**
* {@link FluidBlock#getFluidState} should not be called due to the new format of fluid storage in chunk.
* Fluid states are no longer stored in block states. If it's invoked by another mod, please report this to the developers.
* It's recommended to use {@link World#getFluidState} with BlockPos parameter instead or the game may not run as expected.
*/
@Inject(method = "getFluidState", at = @At("HEAD"))
private void warnsWhenGetFluidState(BlockState state, CallbackInfoReturnable<FluidState> cir) {
Synchro.LOGGER.warn("FluidBlock#getFluidState has been called unexpectedly.");
if (!Synchro.fluidStorageWarned){
Synchro.LOGGER.debug("FluidBlock#getFluidState should not be called due to the new format of fluid storage in chunk. Fluid states are no longer stored in block states. If it's invoked by another mod, please report this to the developers. It's recommended to use World#getFluidState with BlockPos parameter instead or the game may not run as expected.");
Synchro.fluidStorageWarned = true;
}
}

@Inject(method = "getOutlineShape", at = @At("RETURN"), cancellable = true)
private void debugGetOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context, CallbackInfoReturnable<VoxelShape> cir){
cir.setReturnValue(VoxelShapes.fullCube());
Expand Down

0 comments on commit 9defd4d

Please sign in to comment.