Fixed API interface errors, added casts for custom item script handlers in EventHooks, and added some event interfaces.

This commit is contained in:
Luis C.M committed 2022-11-23 23:59:01 -06:00
1 parent be9ae94163
commit aa02e5dcc3
41 files changed
+181 -66

No files matched your search

@@ -0,0 +1,10 @@
package noppes.npcs.api;
import noppes.npcs.api.entity.IPixelmon;
public interface IPixelmonPlayerData {
IPixelmon getPartySlot(int slot);
int countPCPixelmon();
}
@@ -1,33 +0,0 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package noppes.npcs.api;
import java.util.List;
import java.util.Map;
import cpw.mods.fml.common.eventhandler.Event;
import noppes.npcs.constants.EnumScriptType;
public interface IScriptHandler {
void callScript(EnumScriptType var1, Event var2);
boolean isClient();
boolean getEnabled();
void setEnabled(boolean var1);
String getLanguage();
void setLanguage(String var1);
List<ScriptContainer> getScripts();
String noticeString();
Map<Long, String> getConsoleText();
void clearConsole();
}
+2 -2
View File
@@ -1,7 +1,7 @@
package noppes.npcs.api;
import net.minecraft.world.WorldServer;
import noppes.npcs.scripted.scoreboard.ScriptScoreboard;
import noppes.npcs.api.scoreboard.IScoreboard;
import noppes.npcs.api.entity.IEntity;
import noppes.npcs.api.entity.IPlayer;
import noppes.npcs.api.handler.data.ISound;
@@ -408,7 +408,7 @@ public interface IWorld {
IEntity spawnClone(int x, int y, int z, int tab, String name);
IEntity spawnClone(IPos pos, int tab, String name);
ScriptScoreboard getScoreboard();
IScoreboard getScoreboard();
/**
* @since 1.7.10c
@@ -11,8 +11,8 @@ import noppes.npcs.api.ITimers;
import noppes.npcs.api.handler.IOverlayHandler;
import noppes.npcs.api.handler.data.IFaction;
import noppes.npcs.api.item.IItemStack;
import noppes.npcs.scripted.roles.ScriptJobInterface;
import noppes.npcs.scripted.roles.ScriptRoleInterface;
import noppes.npcs.api.jobs.IJob;
import noppes.npcs.api.roles.IRole;
public interface ICustomNpc<T extends EntityCreature> extends IEntityLiving<T> {
/**
@@ -201,14 +201,14 @@ public interface ICustomNpc<T extends EntityCreature> extends IEntityLiving<T> {
/**
* @return Returns the npcs current role
*/
ScriptRoleInterface getRole();
IRole getRole();
void setRole(int role);
/**
* @return Returns the npcs current job
*/
ScriptJobInterface getJob();
IJob getJob();
void setJob(int job);
@@ -2,9 +2,9 @@ package noppes.npcs.api.entity;
import net.minecraft.entity.EntityLivingBase;
import noppes.npcs.api.IBlock;
import noppes.npcs.api.IDamageSource;
import noppes.npcs.api.IPos;
import noppes.npcs.api.item.IItemStack;
import noppes.npcs.scripted.ScriptDamageSource;
public interface IEntityLivingBase<T extends EntityLivingBase> extends IEntity<T> {
/**
@@ -21,7 +21,7 @@ public interface IEntityLivingBase<T extends EntityLivingBase> extends IEntity<T
void hurt(float damage, IEntity source);
void hurt(float damage, ScriptDamageSource damageSource);
void hurt(float damage, IDamageSource damageSource);
/**
* @return Entity's max health
@@ -3,7 +3,6 @@ package noppes.npcs.api.entity;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayerMP;
import noppes.npcs.api.*;
import noppes.npcs.scripted.entity.ScriptDBCPlayer;
import noppes.npcs.api.handler.IOverlayHandler;
import noppes.npcs.api.handler.IPlayerData;
import noppes.npcs.api.handler.data.IDialog;
@@ -12,7 +11,6 @@ import noppes.npcs.api.gui.ICustomGui;
import noppes.npcs.api.handler.data.ISound;
import noppes.npcs.api.item.IItemStack;
import noppes.npcs.api.overlay.ICustomOverlay;
import noppes.npcs.scripted.ScriptPixelmonPlayerData;
public interface IPlayer<T extends EntityPlayerMP> extends IEntityLivingBase<T> {
/**
@@ -277,13 +275,13 @@ public interface IPlayer<T extends EntityPlayerMP> extends IEntityLivingBase<T>
* Requires pixelmon to be installed
* @since 1.7.10d
*/
ScriptPixelmonPlayerData getPixelmonData();
IPixelmonPlayerData getPixelmonData();
ITimers getTimers();
void updatePlayerInventory();
ScriptDBCPlayer<T> getDBCPlayer();
IDBCPlayer getDBCPlayer();
boolean blocking();
@@ -0,0 +1,29 @@
package noppes.npcs.api.event;
import noppes.npcs.api.entity.IPlayer;
import noppes.npcs.api.gui.ICustomGui;
public interface CustomGuiEvent {
IPlayer getPlayer();
ICustomGui getGui();
interface ButtonEvent {
}
interface UnfocusedEvent {
}
interface CloseEvent {
}
interface ScrollEvent {
}
interface SlotEvent {
}
interface SlotClickEvent {
}
}
@@ -0,0 +1,20 @@
package noppes.npcs.api.event;
import noppes.npcs.api.IPos;
import noppes.npcs.api.handler.data.INaturalSpawn;
public interface CustomNPCsEvent {
interface CNPCNaturalSpawnEvent {
INaturalSpawn getNaturalSpawn();
IPos getAttemptPosition();
boolean animalSpawnPassed();
boolean monsterSpawnPassed();
boolean liquidSpawnPassed();
boolean airSpawnPassed();
}
}
@@ -0,0 +1,4 @@
package noppes.npcs.api.event;
public interface DialogEvent {
}
@@ -0,0 +1,4 @@
package noppes.npcs.api.event;
public interface FactionEvent {
}
@@ -0,0 +1,4 @@
package noppes.npcs.api.event;
public interface ForgeEvent {
}
@@ -0,0 +1,4 @@
package noppes.npcs.api.event;
public interface ItemEvent {
}
@@ -0,0 +1,4 @@
package noppes.npcs.api.event;
public interface NpcEvent {
}
@@ -0,0 +1,4 @@
package noppes.npcs.api.event;
public interface PlayerEvent {
}
@@ -0,0 +1,4 @@
package noppes.npcs.api.event;
public interface QuestEvent {
}
@@ -6,7 +6,6 @@
package noppes.npcs.api.gui;
import net.minecraft.nbt.NBTTagCompound;
import noppes.npcs.scripted.gui.ScriptGuiComponent;
public interface ICustomGuiComponent {
int getID();
@@ -41,5 +40,5 @@ public interface ICustomGuiComponent {
NBTTagCompound toNBT(NBTTagCompound nbt);
ScriptGuiComponent fromNBT(NBTTagCompound nbt);
ICustomGuiComponent fromNBT(NBTTagCompound nbt);
}
@@ -1,7 +1,6 @@
package noppes.npcs.api.item;
import noppes.npcs.controllers.IScriptHandler;
public interface IItemCustom extends IItemStack, IScriptHandler {
public interface IItemCustom extends IItemStack {
boolean getEnabled();
@@ -1,13 +1,10 @@
package noppes.npcs.api.jobs;
import noppes.npcs.roles.JobInterface;
import noppes.npcs.api.entity.ICustomNpc;
public interface IJob {
int getType();
JobInterface getJobInterface();
ICustomNpc getNpc();
}
@@ -1,7 +1,6 @@
package noppes.npcs.api.overlay;
import net.minecraft.nbt.NBTTagCompound;
import noppes.npcs.scripted.overlay.ScriptOverlayComponent;
public interface ICustomOverlayComponent {
int getID();
@@ -32,5 +31,5 @@ public interface ICustomOverlayComponent {
NBTTagCompound toNBT(NBTTagCompound nbt);
ScriptOverlayComponent fromNBT(NBTTagCompound nbt);
ICustomOverlayComponent fromNBT(NBTTagCompound nbt);
}
@@ -1,4 +1,4 @@
package noppes.npcs.api.scoreboard;
public interface IScriptScoreboard {
public interface IScoreboard {
}