Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Aug 10, 2019
Merged

Conversation

sam-kirby
Copy link
Contributor

Closes #81

@sam-kirby
Copy link
Contributor Author

As described here: #81 (comment)

@ZombieHDGaming
Copy link
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
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
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