Beacon API - custom effect ranges

This commit is contained in:
Jake Potrebic
2020-06-24 12:39:08 -06:00
parent 2d042873d8
commit 5b1f73e2dc
2 changed files with 77 additions and 7 deletions

View File

@@ -42,7 +42,7 @@ public class CraftBeacon extends CraftBlockEntityState<BeaconBlockEntity> implem
if (tileEntity instanceof BeaconBlockEntity) {
BeaconBlockEntity beacon = (BeaconBlockEntity) tileEntity;
Collection<Player> nms = BeaconBlockEntity.getHumansInRange(beacon.getLevel(), beacon.getBlockPos(), beacon.levels);
Collection<Player> nms = BeaconBlockEntity.getHumansInRange(beacon.getLevel(), beacon.getBlockPos(), beacon.levels, beacon); // Paper - Custom beacon ranges
Collection<LivingEntity> bukkit = new ArrayList<LivingEntity>(nms.size());
for (Player human : nms) {
@@ -145,4 +145,21 @@ public class CraftBeacon extends CraftBlockEntityState<BeaconBlockEntity> implem
public CraftBeacon copy(Location location) {
return new CraftBeacon(this, location);
}
// Paper start
@Override
public double getEffectRange() {
return this.getSnapshot().getEffectRange();
}
@Override
public void setEffectRange(double range) {
this.getSnapshot().setEffectRange(range);
}
@Override
public void resetEffectRange() {
this.getSnapshot().resetEffectRange();
}
// Paper end
}