Skip to content

Don't overwrite ChunkPrimer#setBlockState - compat for VSD#82

Merged
ZombieHDGaming merged 1 commit into
DimensionalDevelopment:masterfrom
sam-kirby:master
Aug 10, 2019
Merged

Don't overwrite ChunkPrimer#setBlockState - compat for VSD#82
ZombieHDGaming merged 1 commit into
DimensionalDevelopment:masterfrom
sam-kirby:master

Conversation

@sam-kirby
Copy link
Copy Markdown
Contributor

Closes #81

@sam-kirby
Copy link
Copy Markdown
Contributor Author

As described here: #81 (comment)

@ZombieHDGaming
Copy link
Copy Markdown
Contributor

@sk2048 Does the normal behavior still happen with this change? As for the release with these fixes, I need to finish up JEIDsI fixes included and appreciate if you could help out since you know your fixes better than I do lol

@sam-kirby
Copy link
Copy Markdown
Contributor Author

Yes, without any other mods present ChunkPrimer#setBlockState becomes

public  void setBlockState(int x, int y, int z, IBlockState state) {
  CallbackInfo ci = new CallbackInfo("setBlockState");
  setIntBlockState(x, y, z, state, ci);
  if (ci.isCancelled()) return;
  // Normal vanilla code (dead)
}

And setIntBlockState just

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();
}

It's ever so slightly more overhead, but far more resilient to other people making changes to it.

@ZombieHDGaming
Copy link
Copy Markdown
Contributor

If it makes mods more compatible, I'm all for it. And we can talk on Discord about what needs fixing with the included fixes of JEIDsI and what still needs to be ported.

@ZombieHDGaming ZombieHDGaming merged commit e4edfc1 into DimensionalDevelopment:master Aug 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Class Transformer collision in ChunkPrimer with mod Vertically Stacked Dimensions

2 participants