use of net.minecraft.server.level.WorldServer in project Panilla by ds58.
the class PacketInspector method stripNbtFromItemEntity.
@Override
public void stripNbtFromItemEntity(UUID entityId) {
Entity entity = null;
for (WorldServer worldServer : MinecraftServer.getServer().F()) {
entity = worldServer.O.d().a(entityId);
if (entity != null)
break;
}
if (entity instanceof EntityItem) {
EntityItem item = (EntityItem) entity;
if (item.h() == null)
return;
if (!item.h().r())
return;
item.h().c((NBTTagCompound) null);
}
}
use of net.minecraft.server.level.WorldServer in project Nexus by ProjectEdenGG.
the class NMSUtils method createEntityPlayer.
public static EntityPlayer createEntityPlayer(UUID uuid, @NonNull Location location, String name) {
if (uuid == null)
uuid = UUID.randomUUID();
WorldServer world = getWorldServer(location);
GameProfile gameProfile = new GameProfile(uuid, name);
EntityPlayer entityPlayer = new EntityPlayer(NMSUtils.getServer(), world, gameProfile);
setLocation(entityPlayer, location);
return entityPlayer;
}
Aggregations