Fix a bunch more issues arising from mutable types (#11769)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user