Fix fillupdates (#441)
* Add BlockStateArgument_fillUpdatesMixin * Create BlockStateArgument_fillUpdatesMixin.java
This commit is contained in:
1 parent
ee25246c87
commit
3429bb4b50
2 files changed
+31
No files matched your search
@@ -0,0 +1,30 @@
|
||||
package carpet.mixins;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
import carpet.CarpetSettings;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.command.argument.BlockStateArgument;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
|
||||
@Mixin(BlockStateArgument.class)
|
||||
public class BlockStateArgument_fillUpdatesMixin
|
||||
{
|
||||
@Redirect(method = "setBlockState", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/block/Block;postProcessState(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/block/BlockState;"
|
||||
))
|
||||
private BlockState postProcessStateProxy(BlockState state, WorldAccess serverWorld, BlockPos blockPos)
|
||||
{
|
||||
if (CarpetSettings.impendingFillSkipUpdates)
|
||||
{
|
||||
return state;
|
||||
}
|
||||
|
||||
return Block.postProcessState(state, serverWorld, blockPos);
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@
|
||||
"CloneCommandMixin",
|
||||
"SetBlockCommandMixin",
|
||||
"ForceLoadCommand_forceLoadLimitMixin",
|
||||
"BlockStateArgument_fillUpdatesMixin",
|
||||
"World_fillUpdatesMixin",
|
||||
"WorldChunk_fillUpdatesMixin",
|
||||
"StructureBlockBlockEntity_fillUpdatesMixin",
|
||||
|
||||
Reference in new issue
Block a user