Skip to content

Commit

Permalink
Merge pull request #82 from sk2048/master
Browse files Browse the repository at this point in the history
Don't overwrite ChunkPrimer#setBlockState - compat for VSD
  • Loading branch information
ZombieHDGaming authored Aug 10, 2019
2 parents 7b36529 + de80d3b commit e4edfc1
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(ChunkPrimer.class)
@SuppressWarnings("deprecation")
Expand All @@ -21,9 +24,10 @@ public IBlockState getBlockState(int x, int y, int z) {
return state == null ? DEFAULT_STATE : state;
}

@Overwrite
public void setBlockState(int x, int y, int z, IBlockState state) {
@Inject(method = "setBlockState", at = @At(value = "FIELD", target = "Lnet/minecraft/world/chunk/ChunkPrimer;data:[C"), cancellable = true)
private void setIntBlockState(int x, int y, int z, IBlockState state, CallbackInfo ci) {
intData[getBlockIndex(x, y, z)] = Block.BLOCK_STATE_IDS.get(state);
ci.cancel();
}

@Overwrite
Expand Down

0 comments on commit e4edfc1

Please sign in to comment.