mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-21 15:02:17 +00:00
MarkData to NPCs [1.12 Backport]
This commit is contained in:
1 parent
7f2a375323
commit
8ec795c98a
22 files changed
+473
-17
No files matched your search
@@ -23,6 +23,7 @@ import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.config.ConfigMain;
|
||||
import noppes.npcs.constants.EnumGuiType;
|
||||
@@ -40,6 +41,7 @@ import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.scripted.ScriptSound;
|
||||
import noppes.npcs.scripted.event.DialogEvent;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.File;
|
||||
@@ -862,6 +864,18 @@ public class NoppesUtilServer {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Entity getEntityFromUUID(World world, UUID uuid) {
|
||||
for (Object obj : world.loadedEntityList) {
|
||||
if (obj instanceof Entity) {
|
||||
Entity entity = (Entity) obj;
|
||||
if (entity.getUniqueID().equals(uuid)) {
|
||||
return entity;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static public EntityPlayer getPlayerByName(String playername){
|
||||
return MinecraftServer.getServer().getConfigurationManager().func_152612_a(playername);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user