I have the same problem but "this.world.func_234853_a_(this.getBoundingBox()).noneMatch(AbstractBlock.AbstractBlockState::isAir)" dosnt really help me.
package com.rwtema.monkmod.abilities;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.MobEffects;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.DamageSource;
import javax.annotation.Nonnull;
public class MonkAbilitiyProtectionLava extends MonkAbilityProtection {
public MonkAbilitiyProtectionLava() {
super("lava_protection");
}
@Override
public float getAbsorbtion(DamageSource source, @Nonnull EntityPlayer player) {
if (!player.isBurning()) {
if (player.world.isMaterialInBB(player.getEntityBoundingBox(), Material.LAVA)) {
player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 20 * 4, 2));
player.extinguish();
return 0;
}
}
return 1;
}
@Override
public boolean canHandle(EntityPlayer player, @Nonnull DamageSource source) {
return source.isFireDamage();
}
}
this is the class that i want to update.
and this is what i have done so far. but the Material.LAVA is there wrong. it needs Predicate <net.minecraft.entity.Entity> and i provide a Material.
package com.rwtema.monkmod.abilities;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.potion.EffectInstance;
import net.minecraft.potion.Effects;
import net.minecraft.util.DamageSource;
import javax.annotation.Nonnull;
public class MonkAbilitiyProtectionLava extends MonkAbilityProtection {
public MonkAbilitiyProtectionLava() {
super("lava_protection");
}
@Override
public float getAbsorbtion(DamageSource source, @Nonnull PlayerEntity player) {
if (!player.isOnFire()) {
if (player.level.getCollisions(player, player.getBoundingBox(), Material.LAVA)) {
player.addEffect(new EffectInstance(Effects.FIRE_RESISTANCE, 20 * 4, 2));
player.extinguish();
return 0;
}
}
return 1;
}
@Override
public boolean canHandle(PlayerEntity player, @Nonnull DamageSource source) {
return source.isFire();
}
}