mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-16 02:34:49 +00:00
Added new ScriptDBCPlayer class for manipulating Dragon Block C attributes.
Flying NPCs no longer chase you down if you're dead, or if they're dead.
This commit is contained in:
1 parent
3c1bc30e44
commit
3cd1410c19
3 files changed
+213
-29
No files matched your search
@@ -4,6 +4,8 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.stats.StatBase;
|
||||
import net.minecraft.stats.StatList;
|
||||
@@ -24,6 +26,7 @@ import noppes.npcs.controllers.PlayerQuestData;
|
||||
import noppes.npcs.controllers.Quest;
|
||||
import noppes.npcs.controllers.QuestController;
|
||||
import noppes.npcs.controllers.QuestData;
|
||||
import noppes.npcs.scripted.CustomNPCsException;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.scripted.ScriptItemStack;
|
||||
import noppes.npcs.scripted.ScriptPixelmonPlayerData;
|
||||
@@ -32,6 +35,9 @@ import noppes.npcs.scripted.interfaces.IPlayer;
|
||||
import noppes.npcs.scripted.interfaces.ITimers;
|
||||
import noppes.npcs.util.ValueUtil;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
|
||||
public class ScriptPlayer<T extends EntityPlayerMP> extends ScriptLivingBase<T> implements IPlayer {
|
||||
public T player;
|
||||
public ScriptPlayer(T player){
|
||||
@@ -383,4 +389,17 @@ public class ScriptPlayer<T extends EntityPlayerMP> extends ScriptLivingBase<T>
|
||||
PlayerData data = PlayerDataController.instance.getPlayerData(player);
|
||||
return data.getGUIOpen();
|
||||
}
|
||||
|
||||
public ScriptDBCPlayer<T> getDBCPlayer() {
|
||||
Set keySet = player.getEntityData().func_150296_c();
|
||||
Iterator iterator = keySet.iterator();
|
||||
|
||||
while (iterator.hasNext())
|
||||
{
|
||||
String s = (String)iterator.next();
|
||||
if(s.contains("jrmc"))
|
||||
return new ScriptDBCPlayer<>(this.player);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user