Fix ProtocolLib related errors with some plugins

This commit is contained in:
filoghost 2020-04-11 23:42:03 +02:00
parent 269a4bec72
commit db949bcfd1
11 changed files with 121 additions and 3 deletions

View File

@ -38,8 +38,6 @@ public interface NMSManager {
public NMSEntityBase getNMSEntityBase(org.bukkit.entity.Entity bukkitEntity);
default org.bukkit.entity.Entity getEntityFromID(org.bukkit.World bukkitWorld, int entityID) {
throw new IllegalStateException("Not implemented");
}
public org.bukkit.entity.Entity getEntityFromID(org.bukkit.World bukkitWorld, int entityID);
}

View File

@ -134,5 +134,17 @@ public class NmsManagerImpl implements NMSManager {
return null;
}
@Override
public org.bukkit.entity.Entity getEntityFromID(org.bukkit.World bukkitWorld, int entityID) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
Entity nmsEntity = nmsWorld.getEntity(entityID);
if (nmsEntity == null) {
return null;
}
return nmsEntity.getBukkitEntity();
}
}

View File

@ -143,5 +143,17 @@ public class NmsManagerImpl implements NMSManager {
return null;
}
@Override
public org.bukkit.entity.Entity getEntityFromID(org.bukkit.World bukkitWorld, int entityID) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
Entity nmsEntity = nmsWorld.getEntity(entityID);
if (nmsEntity == null) {
return null;
}
return nmsEntity.getBukkitEntity();
}
}

View File

@ -144,4 +144,16 @@ public class NmsManagerImpl implements NMSManager {
return null;
}
@Override
public org.bukkit.entity.Entity getEntityFromID(org.bukkit.World bukkitWorld, int entityID) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
Entity nmsEntity = nmsWorld.getEntity(entityID);
if (nmsEntity == null) {
return null;
}
return nmsEntity.getBukkitEntity();
}
}

View File

@ -156,4 +156,16 @@ public class NmsManagerImpl implements NMSManager {
return null;
}
@Override
public org.bukkit.entity.Entity getEntityFromID(org.bukkit.World bukkitWorld, int entityID) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
Entity nmsEntity = nmsWorld.getEntity(entityID);
if (nmsEntity == null) {
return null;
}
return nmsEntity.getBukkitEntity();
}
}

View File

@ -157,4 +157,16 @@ public class NmsManagerImpl implements NMSManager {
return null;
}
@Override
public org.bukkit.entity.Entity getEntityFromID(org.bukkit.World bukkitWorld, int entityID) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
Entity nmsEntity = nmsWorld.getEntity(entityID);
if (nmsEntity == null) {
return null;
}
return nmsEntity.getBukkitEntity();
}
}

View File

@ -141,4 +141,16 @@ public class NmsManagerImpl implements NMSManager {
return null;
}
@Override
public org.bukkit.entity.Entity getEntityFromID(org.bukkit.World bukkitWorld, int entityID) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
Entity nmsEntity = nmsWorld.a(entityID);
if (nmsEntity == null) {
return null;
}
return nmsEntity.getBukkitEntity();
}
}

View File

@ -140,4 +140,16 @@ public class NmsManagerImpl implements NMSManager {
return null;
}
@Override
public org.bukkit.entity.Entity getEntityFromID(org.bukkit.World bukkitWorld, int entityID) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
Entity nmsEntity = nmsWorld.a(entityID);
if (nmsEntity == null) {
return null;
}
return nmsEntity.getBukkitEntity();
}
}

View File

@ -139,5 +139,17 @@ public class NmsManagerImpl implements NMSManager {
return null;
}
@Override
public org.bukkit.entity.Entity getEntityFromID(org.bukkit.World bukkitWorld, int entityID) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
Entity nmsEntity = nmsWorld.a(entityID);
if (nmsEntity == null) {
return null;
}
return nmsEntity.getBukkitEntity();
}
}

View File

@ -135,4 +135,16 @@ public class NmsManagerImpl implements NMSManager {
return null;
}
@Override
public org.bukkit.entity.Entity getEntityFromID(org.bukkit.World bukkitWorld, int entityID) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
Entity nmsEntity = nmsWorld.getEntity(entityID);
if (nmsEntity == null) {
return null;
}
return nmsEntity.getBukkitEntity();
}
}

View File

@ -135,4 +135,16 @@ public class NmsManagerImpl implements NMSManager {
return null;
}
@Override
public org.bukkit.entity.Entity getEntityFromID(org.bukkit.World bukkitWorld, int entityID) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
Entity nmsEntity = nmsWorld.getEntity(entityID);
if (nmsEntity == null) {
return null;
}
return nmsEntity.getBukkitEntity();
}
}