Fixed initial runtime crashes in BetterEnd

This commit is contained in:
Frank 2022-04-08 18:17:14 +02:00
parent defa88bbff
commit f59cf8bad2
3 changed files with 10 additions and 13 deletions

View file

@ -1,5 +1,5 @@
package ru.betterend.interfaces;
public interface TargetChecker {
boolean isTarget();
boolean be_isTarget();
}

View file

@ -31,25 +31,21 @@ public class NoiseChunkMixin implements TargetChecker {
}
@Override
public boolean isTarget() {
public boolean be_isTarget() {
return be_isEndGenerator;
}
@Final
@Shadow(aliases = "this$0")
private NoiseChunk this$0;
@Shadow @Final private List<NoiseChunk.NoiseInterpolator> interpolators;
@Inject(method = "fillSlice", at = @At("HEAD"), cancellable = true)
private void be_fillSlice(boolean primarySlice, int x, CallbackInfo info) {
if (!TargetChecker.class.cast(this$0).isTarget()) {
if (!TargetChecker.class.cast(this).be_isTarget()) {
return;
}
info.cancel();
NoiseChunkAccessor accessor = NoiseChunkAccessor.class.cast(this$0);
NoiseChunkAccessor accessor = NoiseChunkAccessor.class.cast(this);
NoiseSettings noiseSettings = accessor.bnv_getNoiseSettings();
final int sizeY = noiseSettings.getCellHeight();

View file

@ -326,10 +326,11 @@ public class EndFeatures {
BiomeAPI.addBiomeFeature(biome, CRASHED_SHIP);
BCLBiome bclbiome = BiomeAPI.getBiome(id);
BCLFeature feature = getBiomeStructures(bclbiome);
if (feature != null) {
BiomeAPI.addBiomeFeature(biome, feature);
}
//TODO: 1.18.2 - Not sure what this code is supposed to do....
// BCLFeature feature = getBiomeStructures(bclbiome);
// if (feature != null) {
// BiomeAPI.addBiomeFeature(biome, feature);
// }
if (id.getNamespace().equals(BetterEnd.MOD_ID)) {
return;