mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 01:29:05 +00:00
Added dialog events to scripted player events
This commit is contained in:
1 parent
b024f800ae
commit
04def38b63
11 files changed
+102
-18
No files matched your search
@@ -2,8 +2,13 @@ package noppes.npcs.controllers;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import noppes.npcs.EventHooks;
|
||||
import noppes.npcs.scripted.entity.ScriptPlayer;
|
||||
import noppes.npcs.scripted.event.FactionEvent;
|
||||
|
||||
public class PlayerFactionData {
|
||||
public HashMap<Integer,Integer> factionData = new HashMap<Integer,Integer>();
|
||||
@@ -45,7 +50,8 @@ public class PlayerFactionData {
|
||||
return factionData.get(id);
|
||||
}
|
||||
|
||||
public void increasePoints(int factionId, int points) {
|
||||
public void increasePoints(int factionId, int points, EntityPlayer player) {
|
||||
EventHooks.onFactionPoints(new FactionEvent.FactionPoints(new ScriptPlayer((EntityPlayerMP) player), FactionController.getInstance().get(factionId), points < 0, points));
|
||||
if(!factionData.containsKey(factionId)){
|
||||
Faction faction = FactionController.getInstance().get(factionId);
|
||||
factionData.put(factionId, faction == null? -1 : faction.defaultPoints);
|
||||
|
||||
Reference in new issue
Block a user