use of org.spongepowered.common.accessor.world.level.block.entity.BeaconBlockEntityAccessor in project SpongeCommon by SpongePowered.
the class BeaconData method delete.
private static boolean delete(final BeaconBlockEntity holder, final Function<BeaconBlockEntityAccessor, MobEffect> getter, final BiConsumer<BeaconBlockEntityAccessor, MobEffect> setter) {
final BeaconBlockEntityAccessor accessor = (BeaconBlockEntityAccessor) holder;
if (accessor.accessor$primaryPower() != null) {
setter.accept(accessor, null);
holder.setChanged();
}
return true;
}
use of org.spongepowered.common.accessor.world.level.block.entity.BeaconBlockEntityAccessor 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;
}
Aggregations