mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-11 21:57:40 +00:00
Implemented scripted timers for players and NPCs.
This commit is contained in:
1 parent
a993c8feff
commit
4de969f6c9
15 files changed
+327
-16
No files matched your search
@@ -1,5 +1,6 @@
|
||||
package noppes.npcs.scripted.entity;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -26,10 +27,12 @@ import noppes.npcs.scripted.ScriptItemStack;
|
||||
import noppes.npcs.scripted.ScriptPixelmonPlayerData;
|
||||
import noppes.npcs.scripted.constants.EntityType;
|
||||
import noppes.npcs.scripted.interfaces.IPlayer;
|
||||
import noppes.npcs.scripted.interfaces.ITimers;
|
||||
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;
|
||||
@@ -350,4 +353,16 @@ public class ScriptPlayer<T extends EntityPlayerMP> extends ScriptLivingBase<T>
|
||||
return null;
|
||||
return new ScriptPixelmonPlayerData(player);
|
||||
}
|
||||
|
||||
private PlayerData getData() {
|
||||
if (this.data == null) {
|
||||
this.data = PlayerData.get(player);
|
||||
}
|
||||
|
||||
return this.data;
|
||||
}
|
||||
|
||||
public ITimers getTimers() {
|
||||
return this.getData().timers;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user