mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-03 13:42:25 -07:00
[ci skip] Add more identifying patch comments
This commit is contained in:
@@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
return (BeaconBlockEntity.hasSecondaryEffect(this.levels, this.primaryPower, this.secondaryPower)) ? CraftPotionUtil.toBukkit(new MobEffectInstance(this.secondaryPower, BeaconBlockEntity.getLevel(this.levels), BeaconBlockEntity.getAmplification(this.levels, this.primaryPower, this.secondaryPower), true, true)) : null;
|
||||
}
|
||||
// CraftBukkit end
|
||||
+ // Paper start - add field/methods for custom range
|
||||
+ // Paper start - Custom beacon ranges
|
||||
+ private final String PAPER_RANGE_TAG = "Paper.Range";
|
||||
+ private double effectRange = -1;
|
||||
+
|
||||
@@ -31,7 +31,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ public void resetEffectRange() {
|
||||
+ this.effectRange = -1;
|
||||
+ }
|
||||
+ // Paper end
|
||||
+ // Paper end - Custom beacon ranges
|
||||
|
||||
@Nullable
|
||||
static MobEffect filterEffect(@Nullable MobEffect effect) {
|
||||
@@ -40,7 +40,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
|
||||
if (blockEntity.levels > 0 && !blockEntity.beamSections.isEmpty()) {
|
||||
- BeaconBlockEntity.applyEffects(world, pos, blockEntity.levels, blockEntity.primaryPower, blockEntity.secondaryPower);
|
||||
+ BeaconBlockEntity.applyEffects(world, pos, blockEntity.levels, blockEntity.primaryPower, blockEntity.secondaryPower, blockEntity); // Paper
|
||||
+ BeaconBlockEntity.applyEffects(world, pos, blockEntity.levels, blockEntity.primaryPower, blockEntity.secondaryPower, blockEntity); // Paper - Custom beacon ranges
|
||||
BeaconBlockEntity.playSound(world, pos, SoundEvents.BEACON_AMBIENT);
|
||||
}
|
||||
}
|
||||
@@ -48,14 +48,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
|
||||
public static List getHumansInRange(Level world, BlockPos blockposition, int i) {
|
||||
+ // Paper start
|
||||
+ // Paper start - Custom beacon ranges
|
||||
+ return BeaconBlockEntity.getHumansInRange(world, blockposition, i, null);
|
||||
+ }
|
||||
+ public static List getHumansInRange(Level world, BlockPos blockposition, int i, @Nullable BeaconBlockEntity blockEntity) {
|
||||
+ // Paper end
|
||||
+ // Paper end - Custom beacon ranges
|
||||
{
|
||||
- double d0 = (double) (i * 10 + 10);
|
||||
+ double d0 = blockEntity != null ? blockEntity.getEffectRange() : (i * 10 + 10);// Paper - custom beacon ranges
|
||||
+ double d0 = blockEntity != null ? blockEntity.getEffectRange() : (i * 10 + 10);// Paper - Custom beacon ranges
|
||||
|
||||
AABB axisalignedbb = (new AABB(blockposition)).inflate(d0).expandTowards(0.0D, (double) world.getHeight(), 0.0D);
|
||||
List<Player> list = world.getEntitiesOfClass(Player.class, axisalignedbb);
|
||||
@@ -63,18 +63,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
|
||||
private static void applyEffects(Level world, BlockPos pos, int beaconLevel, @Nullable MobEffect primaryEffect, @Nullable MobEffect secondaryEffect) {
|
||||
+ // Paper start
|
||||
+ // Paper start - Custom beacon ranges
|
||||
+ BeaconBlockEntity.applyEffects(world, pos, beaconLevel, primaryEffect, secondaryEffect, null);
|
||||
+ }
|
||||
+ private static void applyEffects(Level world, BlockPos pos, int beaconLevel, @Nullable MobEffect primaryEffect, @Nullable MobEffect secondaryEffect, @Nullable BeaconBlockEntity blockEntity) {
|
||||
+ // Paper end
|
||||
+ // Paper end - Custom beacon ranges
|
||||
if (!world.isClientSide && primaryEffect != null) {
|
||||
double d0 = (double) (beaconLevel * 10 + 10);
|
||||
byte b0 = BeaconBlockEntity.getAmplification(beaconLevel, primaryEffect, secondaryEffect);
|
||||
|
||||
int j = BeaconBlockEntity.getLevel(beaconLevel);
|
||||
- List list = BeaconBlockEntity.getHumansInRange(world, pos, beaconLevel);
|
||||
+ List list = BeaconBlockEntity.getHumansInRange(world, pos, beaconLevel, blockEntity); // Paper
|
||||
+ List list = BeaconBlockEntity.getHumansInRange(world, pos, beaconLevel, blockEntity); // Paper - Custom beacon ranges
|
||||
|
||||
BeaconBlockEntity.applyEffect(list, primaryEffect, j, b0, true, pos); // Paper - BeaconEffectEvent
|
||||
|
||||
@@ -82,7 +82,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
|
||||
this.lockKey = LockCode.fromTag(nbt);
|
||||
+ this.effectRange = nbt.contains(PAPER_RANGE_TAG, 6) ? nbt.getDouble(PAPER_RANGE_TAG) : -1; // Paper
|
||||
+ this.effectRange = nbt.contains(PAPER_RANGE_TAG, 6) ? nbt.getDouble(PAPER_RANGE_TAG) : -1; // Paper - Custom beacon ranges
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -90,7 +90,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
|
||||
this.lockKey.addToTag(nbt);
|
||||
+ nbt.putDouble(PAPER_RANGE_TAG, this.effectRange); // Paper
|
||||
+ nbt.putDouble(PAPER_RANGE_TAG, this.effectRange); // Paper - Custom beacon ranges
|
||||
}
|
||||
|
||||
public void setCustomName(@Nullable Component customName) {
|
||||
@@ -103,7 +103,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
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
|
||||
+ 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) {
|
||||
|
Reference in New Issue
Block a user