mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 17:01:56 +01:00
Check the values passed into the constructor as well
By: Thinkofdeath <thinkofdeath@spigotmc.org>
This commit is contained in:
parent
0380d405c5
commit
c666e9b025
1 changed files with 17 additions and 4 deletions
|
@ -1,11 +1,11 @@
|
||||||
From 30c208e767b0d5912ed4302f40bfbb258b314bf6 Mon Sep 17 00:00:00 2001
|
From 6d80b52489761c3d29e23d3ad6a8c3e9d17d8a55 Mon Sep 17 00:00:00 2001
|
||||||
From: Thinkofdeath <thinkofdeath@spigotmc.org>
|
From: Thinkofdeath <thinkofdeath@spigotmc.org>
|
||||||
Date: Sun, 11 May 2014 10:03:12 +0100
|
Date: Sun, 11 May 2014 10:03:12 +0100
|
||||||
Subject: [PATCH] Check for plugins setting null locations/worlds
|
Subject: [PATCH] Check for plugins setting null locations/worlds
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java b/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java
|
diff --git a/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java b/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java
|
||||||
index fa3b340..8908b68 100644
|
index fa3b340..12b2250 100644
|
||||||
--- a/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java
|
--- a/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java
|
||||||
+++ b/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java
|
+++ b/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java
|
||||||
@@ -5,6 +5,8 @@ import org.bukkit.entity.Player;
|
@@ -5,6 +5,8 @@ import org.bukkit.entity.Player;
|
||||||
|
@ -17,7 +17,20 @@ index fa3b340..8908b68 100644
|
||||||
/**
|
/**
|
||||||
* Holds information for player movement events
|
* Holds information for player movement events
|
||||||
*/
|
*/
|
||||||
@@ -63,6 +65,10 @@ public class PlayerMoveEvent extends PlayerEvent implements Cancellable {
|
@@ -16,8 +18,10 @@ public class PlayerMoveEvent extends PlayerEvent implements Cancellable {
|
||||||
|
|
||||||
|
public PlayerMoveEvent(final Player player, final Location from, final Location to) {
|
||||||
|
super(player);
|
||||||
|
- this.from = from;
|
||||||
|
- this.to = to;
|
||||||
|
+ // Spigot start
|
||||||
|
+ setFrom( from );
|
||||||
|
+ setTo( to );
|
||||||
|
+ // Spigot end
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@@ -63,6 +67,10 @@ public class PlayerMoveEvent extends PlayerEvent implements Cancellable {
|
||||||
* @param from New location to mark as the players previous location
|
* @param from New location to mark as the players previous location
|
||||||
*/
|
*/
|
||||||
public void setFrom(Location from) {
|
public void setFrom(Location from) {
|
||||||
|
@ -28,7 +41,7 @@ index fa3b340..8908b68 100644
|
||||||
this.from = from;
|
this.from = from;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,6 +87,10 @@ public class PlayerMoveEvent extends PlayerEvent implements Cancellable {
|
@@ -81,6 +89,10 @@ public class PlayerMoveEvent extends PlayerEvent implements Cancellable {
|
||||||
* @param to New Location this player will move to
|
* @param to New Location this player will move to
|
||||||
*/
|
*/
|
||||||
public void setTo(Location to) {
|
public void setTo(Location to) {
|
||||||
|
|
Loading…
Reference in a new issue