Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
95 changed files
with
470 additions
and
358 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
src/main/java/net/aufdemrand/denizen/BukkitScriptEntryData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package net.aufdemrand.denizen; | ||
|
||
import net.aufdemrand.denizen.objects.dNPC; | ||
import net.aufdemrand.denizen.objects.dPlayer; | ||
import net.aufdemrand.denizen.utilities.depends.Depends; | ||
import net.aufdemrand.denizencore.scripts.ScriptEntryData; | ||
import net.citizensnpcs.api.CitizensAPI; | ||
|
||
public class BukkitScriptEntryData extends ScriptEntryData { | ||
private dPlayer player; | ||
private dNPC npc; | ||
|
||
public BukkitScriptEntryData(dPlayer player, dNPC npc) { | ||
this.player = player; | ||
this.npc = npc; | ||
} | ||
|
||
public dPlayer getPlayer() { | ||
return player; | ||
} | ||
|
||
public dNPC getNPC() { | ||
return npc; | ||
} | ||
|
||
public boolean hasNPC() { | ||
return npc != null; | ||
} | ||
|
||
public boolean hasPlayer() { | ||
return player != null; | ||
} | ||
|
||
public void setPlayer(dPlayer player) { | ||
if (player != null && player.isOnline() && Depends.citizens != null | ||
&& CitizensAPI.getNPCRegistry().isNPC(player.getPlayerEntity())) { | ||
dontFixMe = true; | ||
setNPC(new dNPC(CitizensAPI.getNPCRegistry().getNPC(player.getPlayerEntity()))); | ||
} | ||
else | ||
this.player = player; | ||
} | ||
|
||
private boolean dontFixMe = false; | ||
|
||
public void setNPC(dNPC npc) { | ||
if (npc == null && dontFixMe) { | ||
dontFixMe = false; | ||
} | ||
this.npc = npc; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.