don't spoof f3 menu in dev environment
@@ -14,17 +14,20 @@ import net.minecraft.world.level.material.FlowingFluid;
import net.minecraft.world.level.material.Fluid;
import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.material.Fluids;
+import net.minecraftforge.fml.loading.FMLEnvironment;
public class F3Spoofer {
public static BlockState spoofBlockState(BlockState originalState, BlockPos pos) {
Block originalBlock = originalState.getBlock();
+ if (FMLEnvironment.production) {
if (originalBlock instanceof DisguisableBlock disguisableBlock)
return disguisableBlock.getDisguisedStateOrDefault(originalState, Minecraft.getInstance().level, pos);
else if (originalBlock instanceof BaseFullMineBlock)
return ((BaseFullMineBlock) originalBlock).getBlockDisguisedAs().defaultBlockState();
else if (originalBlock instanceof FurnaceMineBlock)
return Blocks.FURNACE.defaultBlockState().setValue(BlockStateProperties.HORIZONTAL_FACING, originalState.getValue(BlockStateProperties.HORIZONTAL_FACING));
+ }
return originalState;
}
@@ -32,6 +35,7 @@ public class F3Spoofer {
public static FluidState spoofFluidState(FluidState originalState) {
Fluid originalFluid = originalState.getType();
+ if (FMLEnvironment.production) {
if (originalFluid == SCContent.FAKE_WATER.get())
return Fluids.WATER.defaultFluidState().setValue(FlowingFluid.FALLING, originalState.getValue(FlowingFluid.FALLING));
else if (originalFluid == SCContent.FLOWING_FAKE_WATER.get())
@@ -40,6 +44,7 @@ public class F3Spoofer {
return Fluids.LAVA.defaultFluidState().setValue(FlowingFluid.FALLING, originalState.getValue(FlowingFluid.FALLING));
else if (originalFluid == SCContent.FLOWING_FAKE_LAVA.get())
return Fluids.FLOWING_LAVA.defaultFluidState().setValue(FlowingFluid.FALLING, originalState.getValue(FlowingFluid.FALLING)).setValue(FlowingFluid.LEVEL, originalState.getValue(FlowingFluid.LEVEL));
+ }
return originalState;
}
