level is a getter now

This commit is contained in:
Frank 2023-05-17 14:47:13 +02:00
parent 40ab94d4fe
commit 37e69ca6b2
4 changed files with 9 additions and 9 deletions

View file

@ -39,8 +39,8 @@ public class CustomFogRenderer {
}
Entity entity = camera.getEntity();
if (!isForcedDimension(entity.level) && shouldIgnoreArea(
entity.level,
if (!isForcedDimension(entity.level()) && shouldIgnoreArea(
entity.level(),
(int) entity.getX(),
(int) entity.getEyeY(),
(int) entity.getZ()
@ -50,14 +50,14 @@ public class CustomFogRenderer {
}
float fog = getFogDensity(
entity.level,
entity.level(),
entity.getX(),
entity.getEyeY(),
entity.getZ()
) * Configs.CLIENT_CONFIG.fogDensity();
BackgroundInfo.fogDensity = fog;
if (thickFog(thickFog, entity.level)) {
if (thickFog(thickFog, entity.level())) {
fogStart = viewDistance * 0.05F / fog;
fogEnd = Math.min(viewDistance, 192.0F) * 0.5F / fog;
} else {

View file

@ -20,7 +20,7 @@ public interface BCLElytraItem extends FabricElytraItem {
static void vanillaElytraTick(LivingEntity entity, ItemStack chestStack) {
int nextRoll = entity.getFallFlyingTicks() + 1;
if (!entity.level.isClientSide && nextRoll % 10 == 0) {
if (!entity.level().isClientSide && nextRoll % 10 == 0) {
if ((nextRoll / 10) % 2 == 0) {
chestStack.hurtAndBreak(1, entity, (e) -> BCLElytraUtils.onBreak.accept(e, chestStack));
}

View file

@ -124,8 +124,8 @@ public abstract class AnvilMenuMixin extends ItemCombinerMenu implements AnvilSc
@Inject(method = "createResult", at = @At("HEAD"), cancellable = true)
public void bcl_updateOutput(CallbackInfo info) {
RecipeManager recipeManager = this.player.level.getRecipeManager();
be_recipes = recipeManager.getRecipesFor(AnvilRecipe.TYPE, inputSlots, player.level);
RecipeManager recipeManager = this.player.level().getRecipeManager();
be_recipes = recipeManager.getRecipesFor(AnvilRecipe.TYPE, inputSlots, player.level());
if (be_recipes.size() > 0) {
int anvilLevel = this.anvilLevel.get();
be_recipes = be_recipes.stream()
@ -164,7 +164,7 @@ public abstract class AnvilMenuMixin extends ItemCombinerMenu implements AnvilSc
private void bcl_updateResult() {
if (bcl_currentRecipe == null) return;
resultSlots.setItem(0, bcl_currentRecipe.assemble(inputSlots, this.player.level.registryAccess()));
resultSlots.setItem(0, bcl_currentRecipe.assemble(inputSlots, this.player.level().registryAccess()));
broadcastChanges();
}

View file

@ -98,7 +98,7 @@ public abstract class BoatMixin extends Entity implements CustomBoatTypeOverride
void bcl_checkFallDamage(double d, boolean bl, BlockState blockState, BlockPos blockPos, CallbackInfo ci) {
BoatTypeOverride type = this.bcl_getCustomType();
if (type != null) {
if (this.level.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
if (this.level().getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
for (int i = 0; i < 3; ++i) {
this.spawnAtLocation(type.getPlanks());
}