mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-15 14:13:56 +01:00
Merge branch 'master' of github.com:Bukkit/CraftBukkit
By: stevenh <steven.hartland@multiplay.co.uk>
This commit is contained in:
commit
785e22677c
4 changed files with 62 additions and 0 deletions
|
@ -49,6 +49,10 @@ public final class CraftServer implements Server {
|
|||
}
|
||||
}
|
||||
|
||||
public void disablePlugins() {
|
||||
pluginManager.disablePlugins();
|
||||
}
|
||||
|
||||
private void loadPlugin(Plugin plugin) {
|
||||
List<Command> pluginCommands = PluginCommandYamlParser.parse(plugin);
|
||||
if (!pluginCommands.isEmpty()) {
|
||||
|
@ -168,5 +172,9 @@ public final class CraftServer implements Server {
|
|||
|
||||
console.e.k = monsters ? 1 : 0;
|
||||
console.e.a(monsters, animals);
|
||||
|
||||
pluginManager.clearPlugins();
|
||||
commandMap.clearCommands();
|
||||
loadPlugins();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,8 +3,11 @@ package org.bukkit.craftbukkit;
|
|||
import org.bukkit.craftbukkit.block.CraftBlock;
|
||||
import org.bukkit.craftbukkit.entity.*;
|
||||
import org.bukkit.entity.*;
|
||||
import org.bukkit.entity.Entity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import net.minecraft.server.*;
|
||||
|
@ -316,4 +319,44 @@ public class CraftWorld implements World {
|
|||
return hash;
|
||||
}
|
||||
}
|
||||
|
||||
public List<Entity> getEntities() {
|
||||
List<Entity> list = new ArrayList<Entity>();
|
||||
|
||||
for (Object o : world.b) {
|
||||
if (o instanceof net.minecraft.server.Entity) {
|
||||
net.minecraft.server.Entity mcEnt
|
||||
= (net.minecraft.server.Entity)o;
|
||||
|
||||
Entity bukkitEntity = mcEnt.getBukkitEntity();
|
||||
|
||||
// Assuming that bukkitEntity isn't null
|
||||
if (bukkitEntity != null) {
|
||||
list.add(bukkitEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<LivingEntity> getLivingEntities() {
|
||||
List<LivingEntity> list = new ArrayList<LivingEntity>();
|
||||
|
||||
for (Object o : world.b) {
|
||||
if (o instanceof net.minecraft.server.Entity) {
|
||||
net.minecraft.server.Entity mcEnt
|
||||
= (net.minecraft.server.Entity)o;
|
||||
|
||||
Entity bukkitEntity = mcEnt.getBukkitEntity();
|
||||
|
||||
// Assuming that bukkitEntity isn't null
|
||||
if (bukkitEntity != null && bukkitEntity instanceof LivingEntity) {
|
||||
list.add((LivingEntity)bukkitEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -337,6 +337,14 @@ public class CraftBlock implements Block {
|
|||
return null;
|
||||
}
|
||||
|
||||
public boolean isBlockPowered() {
|
||||
return world.getHandle().o(x, y, z);
|
||||
}
|
||||
|
||||
public boolean isBlockIndirectlyPowered() {
|
||||
return world.getHandle().p(x, y, z);
|
||||
}
|
||||
|
||||
public void update() {
|
||||
type = world.getHandle().a(x, y, z);
|
||||
data = (byte)world.getHandle().b(x, y, z);
|
||||
|
|
|
@ -110,4 +110,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||
entity.a.b(((Packet) (new Packet6SpawnPosition(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()))));
|
||||
}
|
||||
|
||||
public boolean performCommand(String command) {
|
||||
return server.dispatchCommand(this, command);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue