fill stuff

This commit is contained in:
gnembon committed 2019-05-18 14:24:51 -03:00
1 parent 38d01bdffb
commit d35b6bde36
11 files changed
+193 -13

No files matched your search

@@ -0,0 +1,34 @@
package carpet.mixins;
import carpet.CarpetSettings;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.chunk.WorldChunk;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(WorldChunk.class)
public class WorldChunk_fillUpdatesMixin
{
@Redirect(method = "setBlockState", at = @At(
value = "INVOKE",
target = "Lnet/minecraft/block/BlockState;onBlockAdded(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Z)V"
))
private void onAdded(BlockState blockState, World world_1, BlockPos blockPos_1, BlockState blockState_1, boolean boolean_1)
{
if (!CarpetSettings.impendingFillSkipUpdates)
blockState.onBlockAdded(world_1, blockPos_1, blockState_1, boolean_1);
}
@Redirect(method = "setBlockState", at = @At(
value = "INVOKE",
target = "Lnet/minecraft/block/BlockState;onBlockRemoved(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Z)V"
))
private void onRemoved(BlockState blockState, World world_1, BlockPos blockPos_1, BlockState blockState_1, boolean boolean_1)
{
if (!CarpetSettings.impendingFillSkipUpdates)
blockState.onBlockRemoved(world_1, blockPos_1, blockState_1, boolean_1);
}
}