Fix a bunch more issues arising from mutable types (#11769)

This commit is contained in:
Jake Potrebic
2024-12-22 13:50:00 -08:00
committed by GitHub
parent 8ad15d64f0
commit 083c083188
19 changed files with 39 additions and 39 deletions

View File

@@ -55,7 +55,7 @@ public class BlockDestroyEvent extends BlockExpEvent implements Cancellable {
* @param effectBlock block effect
*/
public void setEffectBlock(final BlockData effectBlock) {
this.effectBlock = effectBlock;
this.effectBlock = effectBlock.clone();
}
/**

View File

@@ -79,7 +79,7 @@ public class PlayerJumpEvent extends PlayerEvent implements Cancellable {
public void setFrom(final Location from) {
Preconditions.checkArgument(from != null, "Cannot use null from location!");
Preconditions.checkArgument(from.getWorld() != null, "Cannot use from location with null world!");
this.from = from;
this.from = from.clone();
}
/**

View File

@@ -66,7 +66,7 @@ public class PlayerSetSpawnEvent extends PlayerEvent implements Cancellable {
* @param location the spawn location, or {@code null} to remove the spawn location
*/
public void setLocation(final @Nullable Location location) {
this.location = location;
this.location = location != null ? location.clone() : null;
}
/**