mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 08:27:45 +00:00
Added isGUIOpen() function, and setPosition function with a dimensionId parameter to ScriptPlayer.
This commit is contained in:
1 parent
27b88c1fce
commit
0d807b36d9
13 files changed
+84
-17
No files matched your search
@@ -24,6 +24,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.NpcAPI;
|
||||
import noppes.npcs.scripted.ScriptItemStack;
|
||||
import noppes.npcs.scripted.ScriptPixelmonPlayerData;
|
||||
import noppes.npcs.scripted.constants.EntityType;
|
||||
@@ -33,7 +34,6 @@ import noppes.npcs.util.ValueUtil;
|
||||
|
||||
public class ScriptPlayer<T extends EntityPlayerMP> extends ScriptLivingBase<T> implements IPlayer {
|
||||
public T player;
|
||||
private PlayerData data;
|
||||
public ScriptPlayer(T player){
|
||||
super(player);
|
||||
this.player = player;
|
||||
@@ -58,6 +58,13 @@ public class ScriptPlayer<T extends EntityPlayerMP> extends ScriptLivingBase<T>
|
||||
NoppesUtilPlayer.teleportPlayer(player, x, y, z, player.dimension);
|
||||
}
|
||||
|
||||
public void setPosition(double x, double y, double z, int dimensionId){
|
||||
if (NpcAPI.Instance().getIWorld(dimensionId) == null)
|
||||
return;
|
||||
|
||||
NoppesUtilPlayer.teleportPlayer(player, x, y, z, dimensionId);
|
||||
}
|
||||
|
||||
public int getDimension(){
|
||||
return player.dimension;
|
||||
}
|
||||
@@ -370,4 +377,10 @@ public class ScriptPlayer<T extends EntityPlayerMP> extends ScriptLivingBase<T>
|
||||
PlayerQuestData playerdata = PlayerDataController.instance.getPlayerData(player).questData;
|
||||
playerdata.checkQuestCompletion((EntityPlayer)this.entity, EnumQuestType.Item);
|
||||
}
|
||||
|
||||
public boolean checkGUIOpen() {
|
||||
NoppesUtilPlayer.isGUIOpen(player);
|
||||
PlayerData data = PlayerDataController.instance.getPlayerData(player);
|
||||
return data.getGUIOpen();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user