Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-25 02:20:07 +01:00
Added an asPlayer method to LocalCommandSender, which casts the object to LocalPlayer if possible and throws an exception otherwise.
Dieser Commit ist enthalten in:
Ursprung
3960726d7a
Commit
87940c9eae
@ -114,4 +114,8 @@ public abstract class LocalCommandSender {
|
|||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return getName().hashCode();
|
return getName().hashCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LocalPlayer asPlayer() throws PlayerNeededException {
|
||||||
|
throw new PlayerNeededException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -549,4 +549,8 @@ public abstract class LocalPlayer extends LocalCommandSender {
|
|||||||
public void dispatchCUIHandshake() {
|
public void dispatchCUIHandshake() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LocalPlayer asPlayer() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
5
src/main/java/com/sk89q/worldedit/PlayerNeededException.java
Normale Datei
5
src/main/java/com/sk89q/worldedit/PlayerNeededException.java
Normale Datei
@ -0,0 +1,5 @@
|
|||||||
|
package com.sk89q.worldedit;
|
||||||
|
|
||||||
|
public class PlayerNeededException extends WorldEditException {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren