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

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