mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 08:29:05 +00:00
Merged local and global NPC events, deleting old unused event classes.
This commit is contained in:
1 parent
8f16e6b20f
commit
9c29aabea8
11 files changed
+132
-350
No files matched your search
@@ -116,6 +116,36 @@ public class NpcEvent extends CustomNPCsEvent {
|
||||
this.target = (IEntityLivingBase)NpcAPI.Instance().getIEntity(target);
|
||||
this.damage = damage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The source of the damage
|
||||
* @deprecated
|
||||
*/
|
||||
public IEntityLivingBase getTarget(){
|
||||
return target;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return Returns the damage value
|
||||
*/
|
||||
public float getDamage(){
|
||||
return damage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param damage The new damage value
|
||||
*/
|
||||
public void setDamage(float damage){
|
||||
this.damage = damage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the damage type
|
||||
*/
|
||||
public boolean isRange(){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
@@ -128,6 +158,36 @@ public class NpcEvent extends CustomNPCsEvent {
|
||||
this.target = (IEntityLivingBase)NpcAPI.Instance().getIEntity(target);
|
||||
this.damage = damage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The source of the damage
|
||||
* @deprecated
|
||||
*/
|
||||
public IEntityLivingBase getTarget(){
|
||||
return target;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return Returns the damage value
|
||||
*/
|
||||
public float getDamage(){
|
||||
return damage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param damage The new damage value
|
||||
*/
|
||||
public void setDamage(float damage){
|
||||
this.damage = damage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the damage type
|
||||
*/
|
||||
public boolean isRange(){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static class KilledEntityEvent extends NpcEvent {
|
||||
@@ -236,14 +296,43 @@ public class NpcEvent extends CustomNPCsEvent {
|
||||
public final IPlayer player;
|
||||
public final int id;
|
||||
public final int optionId;
|
||||
public final Dialog dialog;
|
||||
public final Dialog dialogObj;
|
||||
|
||||
public final int dialog;
|
||||
public final int option;
|
||||
|
||||
public DialogClosedEvent(ICustomNpc npc, EntityPlayer player, int id, int optionId, Dialog dialog) {
|
||||
super(npc);
|
||||
this.player = (IPlayer)NpcAPI.Instance().getIEntity(player);
|
||||
this.id = id;
|
||||
this.optionId = optionId;
|
||||
this.dialog = dialog;
|
||||
this.dialogObj = dialog;
|
||||
|
||||
this.dialog = id;
|
||||
this.option = optionId;
|
||||
}
|
||||
|
||||
public IPlayer getPlayer() {
|
||||
return player;
|
||||
}
|
||||
|
||||
public Dialog getDialog() {
|
||||
return dialogObj;
|
||||
}
|
||||
|
||||
public int getDialogId() {
|
||||
return option;
|
||||
}
|
||||
|
||||
public int getOptionId() {
|
||||
return option;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public boolean isClosing(){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -289,47 +378,4 @@ public class NpcEvent extends CustomNPCsEvent {
|
||||
super(npc);
|
||||
}
|
||||
}
|
||||
|
||||
public static class AttackEvent extends NpcEvent{
|
||||
private float damage;
|
||||
private IEntityLivingBase target;
|
||||
private boolean isRanged;
|
||||
|
||||
public AttackEvent(ICustomNpc npc, float damage, EntityLivingBase target, boolean isRanged){
|
||||
super(npc);
|
||||
this.damage = damage;
|
||||
this.isRanged = isRanged;
|
||||
this.target = (IEntityLivingBase) NpcAPI.Instance().getIEntity(target);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The source of the damage
|
||||
* @deprecated
|
||||
*/
|
||||
public IEntityLivingBase getTarget(){
|
||||
return target;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return Returns the damage value
|
||||
*/
|
||||
public float getDamage(){
|
||||
return damage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param damage The new damage value
|
||||
*/
|
||||
public void setDamage(float damage){
|
||||
this.damage = damage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the damage type
|
||||
*/
|
||||
public boolean isRange(){
|
||||
return isRanged;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package noppes.npcs.scripted.event;
|
||||
|
||||
public
|
||||
class ScriptEvent{
|
||||
private boolean isCancelled = false;
|
||||
|
||||
public void setCancelled(boolean bo){
|
||||
isCancelled = bo;
|
||||
}
|
||||
|
||||
public boolean isCancelled(){
|
||||
return isCancelled;
|
||||
}
|
||||
|
||||
public void setCanceled(boolean bo){
|
||||
isCancelled = bo;
|
||||
}
|
||||
|
||||
public boolean isCanceled(){
|
||||
return isCancelled;
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package noppes.npcs.scripted.event;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.scripted.interfaces.entity.IEntityLivingBase;
|
||||
|
||||
public class ScriptEventAttack extends ScriptEvent{
|
||||
|
||||
private float damage;
|
||||
private IEntityLivingBase target;
|
||||
private boolean isRanged;
|
||||
|
||||
public ScriptEventAttack(float damage, EntityLivingBase target, boolean isRanged){
|
||||
this.damage = damage;
|
||||
this.isRanged = isRanged;
|
||||
this.target = (IEntityLivingBase) NpcAPI.Instance().getIEntity(target);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The source of the damage
|
||||
* @deprecated
|
||||
*/
|
||||
public IEntityLivingBase getTarget(){
|
||||
return target;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return Returns the damage value
|
||||
*/
|
||||
public float getDamage(){
|
||||
return damage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param damage The new damage value
|
||||
*/
|
||||
public void setDamage(float damage){
|
||||
this.damage = damage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the damage type
|
||||
*/
|
||||
public boolean isRange(){
|
||||
return isRanged;
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
package noppes.npcs.scripted.event;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.scripted.interfaces.entity.IEntityLivingBase;
|
||||
|
||||
public class ScriptEventDamaged extends ScriptEvent{
|
||||
|
||||
private float damage;
|
||||
private boolean clear = false;
|
||||
private IEntityLivingBase source;
|
||||
private DamageSource damagesource;
|
||||
|
||||
public ScriptEventDamaged(float damage, EntityLivingBase attackingEntity, DamageSource damagesource){
|
||||
this.damage = damage;
|
||||
this.damagesource = damagesource;
|
||||
this.source = (IEntityLivingBase) NpcAPI.Instance().getIEntity(attackingEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The source of the damage
|
||||
*/
|
||||
public IEntityLivingBase getSource(){
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setClearTarget(boolean bo){
|
||||
this.clear = bo;
|
||||
}
|
||||
|
||||
public boolean getClearTarget(){
|
||||
return clear;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the damage value
|
||||
*/
|
||||
public float getDamage(){
|
||||
return damage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param damage The new damage value
|
||||
*/
|
||||
public void setDamage(float damage){
|
||||
this.damage = damage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the damage type
|
||||
*/
|
||||
public String getType(){
|
||||
return damagesource.damageType;
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package noppes.npcs.scripted.event;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import noppes.npcs.controllers.data.Dialog;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.scripted.interfaces.entity.IPlayer;
|
||||
|
||||
public class ScriptEventDialog extends ScriptEvent{
|
||||
public IPlayer player;
|
||||
public int dialog;
|
||||
public int option;
|
||||
public Dialog dialogObj;
|
||||
|
||||
public ScriptEventDialog(EntityPlayer player, int dialog, int option, Dialog dialogObj){
|
||||
this.player = (IPlayer) NpcAPI.Instance().getIEntity(player);
|
||||
this.dialog = dialog;
|
||||
this.option = option;
|
||||
this.dialogObj = dialogObj;
|
||||
}
|
||||
|
||||
public IPlayer getPlayer() {
|
||||
return player;
|
||||
}
|
||||
|
||||
public Dialog getDialog() {
|
||||
return dialogObj;
|
||||
}
|
||||
|
||||
public int getDialogId() {
|
||||
return dialog;
|
||||
}
|
||||
|
||||
public int getOptionId() {
|
||||
return option;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public boolean isClosing(){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package noppes.npcs.scripted.event;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.scripted.interfaces.IDamageSource;
|
||||
import noppes.npcs.scripted.interfaces.entity.IEntityLivingBase;
|
||||
|
||||
public class ScriptEventKilled extends ScriptEvent{
|
||||
private IEntityLivingBase source;
|
||||
private DamageSource damagesource;
|
||||
|
||||
public ScriptEventKilled(EntityLivingBase target, DamageSource damagesource){
|
||||
this.damagesource = damagesource;
|
||||
this.source = (IEntityLivingBase) NpcAPI.Instance().getIEntity(target);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The source of the damage
|
||||
*/
|
||||
public IEntityLivingBase getSource(){
|
||||
return source;
|
||||
}
|
||||
|
||||
public IDamageSource getDamageSource() { return NpcAPI.Instance().getIDamageSource(damagesource); }
|
||||
|
||||
/**
|
||||
* @return Returns the damage type
|
||||
*/
|
||||
public String getType(){
|
||||
return damagesource.damageType;
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package noppes.npcs.scripted.event;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.scripted.interfaces.entity.IEntityLivingBase;
|
||||
|
||||
public class ScriptEventTarget extends ScriptEvent {
|
||||
|
||||
private IEntityLivingBase target;
|
||||
|
||||
public ScriptEventTarget(EntityLivingBase target){
|
||||
if(target != null)
|
||||
this.target = (IEntityLivingBase) NpcAPI.Instance().getIEntity(target);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The source of the damage
|
||||
*/
|
||||
public IEntityLivingBase getTarget(){
|
||||
return target;
|
||||
}
|
||||
|
||||
public void setTarget(IEntityLivingBase target){
|
||||
this.target = target;
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package noppes.npcs.scripted.event;
|
||||
|
||||
public class ScriptEventTimer extends ScriptEvent {
|
||||
private int id;
|
||||
|
||||
public ScriptEventTimer(int id){
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getId(){
|
||||
return id;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user