Search in sources :

Example 1 with MobEffect

use of net.minecraft.world.effect.MobEffect in project SpongeCommon by SpongePowered.

the class BeaconData method set.

private static boolean set(final BeaconBlockEntity holder, final PotionEffectType value, final BiConsumer<BeaconBlockEntityAccessor, MobEffect> setter) {
    final BeaconBlockEntityAccessor accessor = (BeaconBlockEntityAccessor) holder;
    final MobEffect effect = (MobEffect) value;
    if (!BeaconBlockEntityAccessor.accessor$VALID_EFFECTS().contains(effect)) {
        return false;
    }
    setter.accept(accessor, (MobEffect) value);
    holder.setChanged();
    return true;
}
Also used : MobEffect(net.minecraft.world.effect.MobEffect) BeaconBlockEntityAccessor(org.spongepowered.common.accessor.world.level.block.entity.BeaconBlockEntityAccessor)

Aggregations

MobEffect (net.minecraft.world.effect.MobEffect)1 BeaconBlockEntityAccessor (org.spongepowered.common.accessor.world.level.block.entity.BeaconBlockEntityAccessor)1