mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 19:49:35 +01:00
Generic cleanup
By: Erik Broes <erikbroes@grum.nl>
This commit is contained in:
parent
da51cfa4b1
commit
c5408f1030
9 changed files with 142 additions and 134 deletions
|
@ -137,7 +137,7 @@ public final class SimpleCommandMap implements CommandMap {
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void clearCommands() {
|
public synchronized void clearCommands() {
|
||||||
for (Map.Entry<String,Command> entry : knownCommands.entrySet()) {
|
for (Map.Entry<String, Command> entry : knownCommands.entrySet()) {
|
||||||
entry.getValue().unregister(this);
|
entry.getValue().unregister(this);
|
||||||
}
|
}
|
||||||
knownCommands.clear();
|
knownCommands.clear();
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
package org.bukkit.event.entity;
|
package org.bukkit.event.entity;
|
||||||
|
|
||||||
|
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.event.Cancellable;
|
import org.bukkit.event.Cancellable;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores data for entities standing inside a portal block
|
* Stores data for entities standing inside a portal block
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
package org.bukkit.event.player;
|
package org.bukkit.event.player;
|
||||||
|
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when a player completes the portaling process by standing in a portal
|
* Called when a player completes the portaling process by standing in a portal
|
||||||
*/
|
*/
|
||||||
|
@ -13,10 +15,11 @@ public class PlayerPortalEvent extends PlayerTeleportEvent {
|
||||||
super(Type.PLAYER_PORTAL, player, from, to);
|
super(Type.PLAYER_PORTAL, player, from, to);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void useTravelAgent(boolean useTravelAgent){
|
public void useTravelAgent(boolean useTravelAgent) {
|
||||||
this.useTravelAgent = useTravelAgent;
|
this.useTravelAgent = useTravelAgent;
|
||||||
}
|
}
|
||||||
public boolean useTravelAgent(){
|
|
||||||
|
public boolean useTravelAgent() {
|
||||||
return useTravelAgent;
|
return useTravelAgent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
package org.bukkit.event.world;
|
package org.bukkit.event.world;
|
||||||
|
|
||||||
|
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.event.Cancellable;
|
import org.bukkit.event.Cancellable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the world attempts to create a matching end to a portal
|
* Called when the world attempts to create a matching end to a portal
|
||||||
*/
|
*/
|
||||||
|
@ -17,7 +19,7 @@ public class PortalCreateEvent extends WorldEvent implements Cancellable {
|
||||||
this.blocks = blocks;
|
this.blocks = blocks;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList<Block> getBlocks(){
|
public ArrayList<Block> getBlocks() {
|
||||||
return this.blocks;
|
return this.blocks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -93,8 +93,9 @@ public class MaterialData {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if(obj != null && obj instanceof MaterialData) {
|
if (obj != null && obj instanceof MaterialData) {
|
||||||
MaterialData md = (MaterialData)obj;
|
MaterialData md = (MaterialData) obj;
|
||||||
|
|
||||||
return (md.getItemTypeId() == getItemTypeId() && md.getData() == getData());
|
return (md.getItemTypeId() == getItemTypeId() && md.getData() == getData());
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -99,7 +99,7 @@ public class Configuration extends ConfigurationNode {
|
||||||
*
|
*
|
||||||
* @param headerLines header lines to prepend
|
* @param headerLines header lines to prepend
|
||||||
*/
|
*/
|
||||||
public void setHeader(String ... headerLines) {
|
public void setHeader(String... headerLines) {
|
||||||
StringBuilder header = new StringBuilder();
|
StringBuilder header = new StringBuilder();
|
||||||
|
|
||||||
for (String line : headerLines) {
|
for (String line : headerLines) {
|
||||||
|
|
Loading…
Reference in a new issue