mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 21:35:10 +00:00
Fixed API interface errors, added casts for custom item script handlers in EventHooks, and added some event interfaces.
This commit is contained in:
1 parent
be9ae94163
commit
aa02e5dcc3
41 files changed
+181
-66
No files matched your search
@@ -7,6 +7,7 @@ import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EntityDamageSource;
|
||||
import net.minecraft.util.Vec3;
|
||||
import noppes.npcs.api.IDamageSource;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.scripted.ScriptDamageSource;
|
||||
import noppes.npcs.scripted.constants.EntityType;
|
||||
@@ -49,7 +50,7 @@ public class ScriptLivingBase<T extends EntityLivingBase> extends ScriptEntity<T
|
||||
entity.attackEntityFrom(new EntityDamageSource(source.getTypeName(),source.getMCEntity()),damage);
|
||||
}
|
||||
|
||||
public void hurt(float damage, ScriptDamageSource damageSource) {
|
||||
public void hurt(float damage, IDamageSource damageSource) {
|
||||
entity.attackEntityFrom(damageSource.getMCDamageSource(),damage);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@ import java.util.UUID;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.api.jobs.IJob;
|
||||
import noppes.npcs.api.roles.IRole;
|
||||
import noppes.npcs.constants.EnumAnimation;
|
||||
import noppes.npcs.constants.EnumJobType;
|
||||
import noppes.npcs.constants.EnumNavType;
|
||||
@@ -331,7 +333,7 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
|
||||
/**
|
||||
* @return Returns the npcs current role
|
||||
*/
|
||||
public ScriptRoleInterface getRole(){
|
||||
public IRole getRole(){
|
||||
if(npc.advanced.role == EnumRoleType.Bank)
|
||||
return new ScriptRoleBank(npc);
|
||||
else if(npc.advanced.role == EnumRoleType.Follower)
|
||||
@@ -357,7 +359,7 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
|
||||
/**
|
||||
* @return Returns the npcs current job
|
||||
*/
|
||||
public ScriptJobInterface getJob(){
|
||||
public IJob getJob(){
|
||||
if(npc.advanced.job == EnumJobType.Bard)
|
||||
return new ScriptJobBard(npc);
|
||||
else if(npc.advanced.job == EnumJobType.Conversation)
|
||||
|
||||
@@ -663,7 +663,7 @@ public class ScriptPlayer<T extends EntityPlayerMP> extends ScriptLivingBase<T>
|
||||
* Requires pixelmon to be installed
|
||||
* @since 1.7.10d
|
||||
*/
|
||||
public ScriptPixelmonPlayerData getPixelmonData(){
|
||||
public IPixelmonPlayerData getPixelmonData(){
|
||||
if(!PixelmonHelper.Enabled)
|
||||
return null;
|
||||
return new ScriptPixelmonPlayerData(player);
|
||||
|
||||
Reference in new issue
Block a user