Merge branch 'master' into 1.17
This commit is contained in:
commit
b96a1b1216
23 files changed
+111
-81
No files matched your search
@@ -20,7 +20,7 @@ public class BlockStateArgument_fillUpdatesMixin
|
||||
))
|
||||
private BlockState postProcessStateProxy(BlockState state, WorldAccess serverWorld, BlockPos blockPos)
|
||||
{
|
||||
if (CarpetSettings.impendingFillSkipUpdates)
|
||||
if (CarpetSettings.impendingFillSkipUpdates.get())
|
||||
{
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,6 @@ public abstract class ChunkMixin
|
||||
at =@At("HEAD"), cancellable = true)
|
||||
private void squashWarnings(BlockPos blockPos_1, CallbackInfo ci)
|
||||
{
|
||||
if (CarpetSettings.skipGenerationChecks) ci.cancel();
|
||||
if (CarpetSettings.skipGenerationChecks.get()) ci.cancel();
|
||||
}
|
||||
}
|
||||
@@ -11,9 +11,9 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
@Mixin(ChunkRegion.class)
|
||||
public class ChunkRegion_scarpetPlopMixin
|
||||
{
|
||||
@Inject(method = "markBlockForPostProcessing", at = @At("HEAD"))
|
||||
@Inject(method = "markBlockForPostProcessing", at = @At("HEAD"), cancellable = true)
|
||||
private void markOrNot(BlockPos blockPos, CallbackInfo ci)
|
||||
{
|
||||
if (CarpetSettings.skipGenerationChecks) ci.cancel();
|
||||
if (CarpetSettings.skipGenerationChecks.get()) ci.cancel();
|
||||
}
|
||||
}
|
||||
@@ -33,13 +33,13 @@ public abstract class CommandManagerMixin
|
||||
private void onExecuteBegin(ServerCommandSource serverCommandSource_1, String string_1, CallbackInfoReturnable<Integer> cir)
|
||||
{
|
||||
if (!CarpetSettings.fillUpdates)
|
||||
CarpetSettings.impendingFillSkipUpdates = true;
|
||||
CarpetSettings.impendingFillSkipUpdates.set(true);
|
||||
}
|
||||
|
||||
@Inject(method = "execute", at = @At("RETURN"))
|
||||
private void onExecuteEnd(ServerCommandSource serverCommandSource_1, String string_1, CallbackInfoReturnable<Integer> cir)
|
||||
{
|
||||
CarpetSettings.impendingFillSkipUpdates = false;
|
||||
CarpetSettings.impendingFillSkipUpdates.set(false);
|
||||
}
|
||||
|
||||
@SuppressWarnings("UnresolvedMixinReference")
|
||||
|
||||
@@ -21,7 +21,7 @@ public class ServerPlayNetworkHandler_interactionUpdatesMixin
|
||||
private void beforeBlockInteracted(PlayerInteractBlockC2SPacket playerInteractBlockC2SPacket_1, CallbackInfo ci)
|
||||
{
|
||||
if (!CarpetSettings.interactionUpdates)
|
||||
CarpetSettings.impendingFillSkipUpdates = true;
|
||||
CarpetSettings.impendingFillSkipUpdates.set(true);
|
||||
}
|
||||
|
||||
@Inject(method = "onPlayerInteractBlock", at = @At(
|
||||
@@ -32,7 +32,7 @@ public class ServerPlayNetworkHandler_interactionUpdatesMixin
|
||||
private void afterBlockInteracted(PlayerInteractBlockC2SPacket playerInteractBlockC2SPacket_1, CallbackInfo ci)
|
||||
{
|
||||
if (!CarpetSettings.interactionUpdates)
|
||||
CarpetSettings.impendingFillSkipUpdates = false;
|
||||
CarpetSettings.impendingFillSkipUpdates.set(false);
|
||||
}
|
||||
|
||||
@Inject(method = "onPlayerInteractItem", at = @At(
|
||||
@@ -43,7 +43,7 @@ public class ServerPlayNetworkHandler_interactionUpdatesMixin
|
||||
private void beforeItemInteracted(PlayerInteractItemC2SPacket packet, CallbackInfo ci)
|
||||
{
|
||||
if (!CarpetSettings.interactionUpdates)
|
||||
CarpetSettings.impendingFillSkipUpdates = true;
|
||||
CarpetSettings.impendingFillSkipUpdates.set(true);
|
||||
}
|
||||
|
||||
@Inject(method = "onPlayerInteractItem", at = @At(
|
||||
@@ -54,7 +54,7 @@ public class ServerPlayNetworkHandler_interactionUpdatesMixin
|
||||
private void afterItemInteracted(PlayerInteractItemC2SPacket packet, CallbackInfo ci)
|
||||
{
|
||||
if (!CarpetSettings.interactionUpdates)
|
||||
CarpetSettings.impendingFillSkipUpdates = false;
|
||||
CarpetSettings.impendingFillSkipUpdates.set(false);
|
||||
}
|
||||
@Inject(method = "onPlayerAction", at = @At(
|
||||
value = "INVOKE",
|
||||
@@ -64,7 +64,7 @@ public class ServerPlayNetworkHandler_interactionUpdatesMixin
|
||||
private void beforeBlockBroken(PlayerActionC2SPacket packet, CallbackInfo ci)
|
||||
{
|
||||
if (!CarpetSettings.interactionUpdates)
|
||||
CarpetSettings.impendingFillSkipUpdates = true;
|
||||
CarpetSettings.impendingFillSkipUpdates.set(true);
|
||||
}
|
||||
|
||||
@Inject(method = "onPlayerAction", at = @At(
|
||||
@@ -75,7 +75,7 @@ public class ServerPlayNetworkHandler_interactionUpdatesMixin
|
||||
private void afterBlockBroken(PlayerActionC2SPacket packet, CallbackInfo ci)
|
||||
{
|
||||
if (!CarpetSettings.interactionUpdates)
|
||||
CarpetSettings.impendingFillSkipUpdates = false;
|
||||
CarpetSettings.impendingFillSkipUpdates.set(false);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -22,14 +22,14 @@ public abstract class StructureBlockBlockEntity_fillUpdatesMixin
|
||||
private boolean onStructurePlacen(Structure structure, ServerWorldAccess serverWorldAccess, BlockPos pos, BlockPos blockPos, StructurePlacementData placementData, Random random, int i)
|
||||
{
|
||||
if(!CarpetSettings.fillUpdates)
|
||||
CarpetSettings.impendingFillSkipUpdates = true;
|
||||
CarpetSettings.impendingFillSkipUpdates.set(true);
|
||||
try
|
||||
{
|
||||
return structure.place(serverWorldAccess, pos, blockPos, placementData, random, i); // serverWorldAccess, pos, placementData, random);
|
||||
}
|
||||
finally
|
||||
{
|
||||
CarpetSettings.impendingFillSkipUpdates = false;
|
||||
CarpetSettings.impendingFillSkipUpdates.set(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,7 @@ public abstract class StructureFeatureMixin<C extends FeatureConfig> implements
|
||||
{
|
||||
if (world.isClient())
|
||||
return false;
|
||||
CarpetSettings.skipGenerationChecks = true;
|
||||
CarpetSettings.skipGenerationChecks.set(true);
|
||||
try
|
||||
{
|
||||
Random rand = new Random(world.getRandom().nextInt());
|
||||
@@ -80,7 +80,7 @@ public abstract class StructureFeatureMixin<C extends FeatureConfig> implements
|
||||
}
|
||||
finally
|
||||
{
|
||||
CarpetSettings.skipGenerationChecks = false;
|
||||
CarpetSettings.skipGenerationChecks.set(false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,6 @@ public class StructurePiece_scarpetPlopMixin
|
||||
))
|
||||
private void markOrNot(Chunk chunk, BlockPos pos)
|
||||
{
|
||||
if (!CarpetSettings.skipGenerationChecks) chunk.markBlockForPostProcessing(pos);
|
||||
if (!CarpetSettings.skipGenerationChecks.get()) chunk.markBlockForPostProcessing(pos);
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@ public class Structure_fillUpdatesMixin
|
||||
))
|
||||
private void skipUpdateNeighbours(ServerWorldAccess serverWorldAccess, BlockPos pos, Block block)
|
||||
{
|
||||
if (!CarpetSettings.impendingFillSkipUpdates)
|
||||
if (!CarpetSettings.impendingFillSkipUpdates.get())
|
||||
serverWorldAccess.updateNeighbors(pos, block);
|
||||
}
|
||||
|
||||
@@ -29,6 +29,6 @@ public class Structure_fillUpdatesMixin
|
||||
))
|
||||
private boolean skipPostprocess(StructurePlacementData structurePlacementData)
|
||||
{
|
||||
return structurePlacementData.shouldUpdateNeighbors() || CarpetSettings.impendingFillSkipUpdates;
|
||||
return structurePlacementData.shouldUpdateNeighbors() || CarpetSettings.impendingFillSkipUpdates.get();
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@ public class WorldChunk_fillUpdatesMixin
|
||||
))
|
||||
private void onAdded(BlockState blockState, World world_1, BlockPos blockPos_1, BlockState blockState_1, boolean boolean_1)
|
||||
{
|
||||
if (!CarpetSettings.impendingFillSkipUpdates)
|
||||
if (!CarpetSettings.impendingFillSkipUpdates.get())
|
||||
blockState.onBlockAdded(world_1, blockPos_1, blockState_1, boolean_1);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class WorldChunk_fillUpdatesMixin
|
||||
))
|
||||
private void onRemovedBlock(BlockState blockState, World world, BlockPos pos, BlockState state, boolean moved)
|
||||
{
|
||||
if (CarpetSettings.impendingFillSkipUpdates) // doing due dilligence from AbstractBlock onStateReplaced
|
||||
if (CarpetSettings.impendingFillSkipUpdates.get()) // doing due dilligence from AbstractBlock onStateReplaced
|
||||
{
|
||||
if (blockState.hasBlockEntity() && !blockState.isOf(state.getBlock()))
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@ public abstract class World_fillUpdatesMixin
|
||||
@ModifyConstant(method = "setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;II)Z", //setBlockState main
|
||||
constant = @Constant(intValue = 16))
|
||||
private int addFillUpdatesInt(int original) {
|
||||
if (CarpetSettings.impendingFillSkipUpdates)
|
||||
if (CarpetSettings.impendingFillSkipUpdates.get())
|
||||
return -1;
|
||||
return original;
|
||||
}
|
||||
@@ -27,7 +27,7 @@ public abstract class World_fillUpdatesMixin
|
||||
))
|
||||
private void updateNeighborsMaybe(World world, BlockPos blockPos, Block block)
|
||||
{
|
||||
if (!CarpetSettings.impendingFillSkipUpdates) world.updateNeighbors(blockPos, block);
|
||||
if (!CarpetSettings.impendingFillSkipUpdates.get()) world.updateNeighbors(blockPos, block);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,7 +18,7 @@ public class World_scarpetPlopMixin
|
||||
))
|
||||
private int fixSampleHeightmap(WorldChunk chunk, Heightmap.Type type, int x, int z)
|
||||
{
|
||||
if (CarpetSettings.skipGenerationChecks)
|
||||
if (CarpetSettings.skipGenerationChecks.get())
|
||||
{
|
||||
Heightmap.Type newType = type;
|
||||
if (type == Heightmap.Type.OCEAN_FLOOR_WG) newType = Heightmap.Type.OCEAN_FLOOR;
|
||||
|
||||
Reference in new issue
Block a user