Merge branch 'master' into dev

# Conflicts:
#	src/main/java/noppes/npcs/scripted/ScriptFaction.java
#	src/main/java/noppes/npcs/scripted/ScriptWorld.java
#	src/main/java/noppes/npcs/scripted/entity/ScriptNpc.java
#	src/main/java/noppes/npcs/scripted/entity/ScriptPlayer.java
#	src/main/java/noppes/npcs/scripted/interfaces/IEntity.java
#	src/main/java/noppes/npcs/scripted/interfaces/IWorld.java
#	src/main/java/noppes/npcs/scripted/interfaces/entity/ICustomNpc.java
#	src/main/java/noppes/npcs/scripted/interfaces/entity/IPlayer.java
This commit is contained in:
Luis C.M committed 2022-05-27 15:31:02 -05:00
commit ec5fc71413
300 files changed
+9920 -2959

No files matched your search

@@ -0,0 +1,205 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package noppes.npcs.scripted.interfaces;
import java.io.File;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.eventhandler.EventBus;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.DamageSource;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import noppes.npcs.CustomNpcs;
import noppes.npcs.controllers.*;
import noppes.npcs.scripted.gui.ScriptGui;
import noppes.npcs.scripted.interfaces.entity.ICustomNpc;
import noppes.npcs.scripted.interfaces.entity.IEntity;
import noppes.npcs.scripted.interfaces.entity.IPlayer;
import noppes.npcs.scripted.interfaces.gui.ICustomGui;
import noppes.npcs.scripted.interfaces.handler.*;
import noppes.npcs.scripted.interfaces.item.IItemStack;
import noppes.npcs.scripted.interfaces.overlay.ICustomOverlay;
import noppes.npcs.scripted.overlay.ScriptOverlay;
/**
* This object stores functions available to all scripting handlers through the "API" keyword.
*
*/
public abstract class AbstractNpcAPI {
private static AbstractNpcAPI instance = null;
public AbstractNpcAPI() {
}
public abstract IFactionHandler getFactions();
public abstract IRecipeHandler getRecipes();
public abstract IQuestHandler getQuests();
public abstract IDialogHandler getDialogs();
public abstract ICloneHandler getClones();
public abstract ICustomNpc createNPC(World var1);
/**
*
* Spawns a new NPC in the world at the given coordinates and returns an ICustomNpc object of it.
*/
public abstract ICustomNpc spawnNPC(World var1, int var2, int var3, int var4);
public abstract IEntity getIEntity(Entity var1);
public abstract IBlock getIBlock(World var1, BlockPos var2);
public abstract IBlock getIBlock(World world, Block block, BlockPos pos);
public abstract IBlock getIBlock(World world, int x, int y, int z);
public abstract IContainer getIContainer(IInventory var1);
public abstract IContainer getIContainer(Container var1);
public abstract IItemStack getIItemStack(ItemStack var1);
public abstract IWorld getIWorld(WorldServer var1);
public abstract IWorld getIWorld(int var1);
public abstract IWorld[] getIWorlds();
public abstract IDamageSource getIDamageSource(DamageSource var1);
public abstract EventBus events();
public abstract File getGlobalDir();
public abstract File getWorldDir();
public static boolean IsAvailable() {
return Loader.isModLoaded("customnpcs");
}
public static AbstractNpcAPI Instance() {
if (instance != null) {
return instance;
} else if (!IsAvailable()) {
return null;
} else {
try {
Class c = Class.forName("noppes.npcs.scripted.NpcAPI");
instance = (AbstractNpcAPI) c.getMethod("Instance").invoke((Object) null);
} catch (Exception var1) {
var1.printStackTrace();
}
return instance;
}
}
public abstract void executeCommand(IWorld var1, String var2);
/**
* Generates a new name as a String using the Markov name generator.
*
* @param dictionary An integer representing which dictionary to use:
* 0: Roman
* 1: Japanese
* 2: Slavic
* 3: Welsh
* 4: Saami
* 5: Old Norse
* 6: Ancient Greek
* 7: Aztec
* 8: CustomNPCs Classic
* 9: Spanish
* @param gender The gender of the name:
* 0: Random
* 1: Male
* 2: Female
*/
public abstract String getRandomName(int dictionary, int gender);
public abstract INbt getINbt(NBTTagCompound nbtTagCompound);
public abstract IPlayer[] getAllServerPlayers();
public abstract IItemStack createItem(String id, int damage, int size);
public abstract void playSoundAtEntity(IEntity entity, String sound, float volume, float pitch);
public abstract void playSoundToNearExcept(IPlayer player, String sound, float volume, float pitch);
/**
*
* @return Returns the server's Message of The Day.
*/
public abstract String getMOTD();
/**
* @param motd The server's new Message of The Day.
*/
public abstract void setMOTD(String motd);
/**
*
* @return A new IParticle object initialized with the given texture.
*/
public abstract IParticle createParticle(String directory);
@Deprecated
public abstract IParticle createEntityParticle(String directory);
/**
*
* @return The uptime of the server in MC ticks.
*/
public abstract int getServerTime();
public abstract boolean arePlayerScriptsEnabled();
public abstract boolean areForgeScriptsEnabled();
public abstract boolean areGlobalNPCScriptsEnabled();
public abstract void enablePlayerScripts(boolean enable);
public abstract void enableForgeScripts(boolean enable);
public abstract void enableGlobalNPCScripts(boolean enable);
/**
*
* @param id The id of the custom GUI.
* @param width The width of the GUI in pixels.
* @param height The height of the GUI in pixels.
* @param pauseGame Whether the GUI pauses the game or not.
* @return A new ICustomGui object with the given attributes.
*/
public abstract ICustomGui createCustomGui(int id, int width, int height, boolean pauseGame);
/**
*
* @return A new ICustomOverlay overlay object with the given ID.
*/
public abstract ICustomOverlay createCustomOverlay(int id);
/**
*
* @return A new ISkinOverlay object initialized with the given texture.
*/
public abstract ISkinOverlay createSkinOverlay(String texture);
}
@@ -15,27 +15,92 @@ public interface IBlock {
int getZ();
/**
*
* @return An IPos object with the block's XYZ position.
*/
IPos getPos();
/**
*
* @return The block name as it appears in the block registry. Return example: "minecraft:stone"
*/
String getName();
/**
* Deletes the block, setting it to air.
*/
void remove();
boolean isAir();
IBlock setBlock(String var1);
/**
*
* @param blockName The name of the block to be set in place of this block.
* @return The new block set in place of this block as an IBlock object.
*/
IBlock setBlock(String blockName);
IBlock setBlock(IBlock var1);
/**
*
* @param block Input IBlock object to replace this block.
* @return The new block set in place of the previous block.
*/
IBlock setBlock(IBlock block);
/**
*
* @return True if the block can contain items like a chest does.
*/
boolean isContainer();
/**
*
* @return The container object of this block. If this block is not a container, an exception will be thrown.
*/
IContainer getContainer();
/**
*
* @return An IWorld object of the world this block is in.
*/
IWorld getWorld();
/**
*
* @return True if this block has a tile entity. Blocks with custom data like signs, player skulls, chests, etc. will have tile entities.
*/
boolean hasTileEntity();
/**
*
* @return An ITileEntity object which can modify this block's tile entity.
*/
ITileEntity getTileEntity();
/**
*
* @param tileEntity Replaces this block's tile entity based on the data given by this parameter.
*/
void setTileEntity(ITileEntity tileEntity);
/**
*
* @return An obfuscated MC object for the block's tile entity.
*/
TileEntity getMCTileEntity();
/**
*
* @return An obfuscated MC block object.
*/
Block getMCBlock();
String getDisplayName();
/**
*
* @return An INbt object which can modify the block's tile entity's NBT data.
*/
INbt getTileEntityNBT();
}
@@ -7,21 +7,58 @@ package noppes.npcs.scripted.interfaces;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import noppes.npcs.scripted.interfaces.entity.IPlayer;
import noppes.npcs.scripted.interfaces.item.IItemStack;
public interface IContainer {
int getSize();
IItemStack getSlot(int var1);
IItemStack getSlot(int slot);
/**
*
* @param slot The slot to be replaced
* @param item The item replacing the previous item in that slot, as an IItemStack object
*/
void setSlot(int slot, IItemStack item);
/**
*
* @return An obfuscated MC inventory object.
*/
IInventory getMCInventory();
/**
*
* @return An obfuscated MC container object.
*/
Container getMCContainer();
int count(IItemStack var1, boolean var2, boolean var3);
/**
*
* @param itemStack The item stack to be searched in the container
* @param ignoreDamage Whether damage should be ignored when searching
* @param ignoreNBT Whether NBT values should be ignored when searching
* @return The amount of the item stack found, based on the flags given above.
*/
int count(IItemStack itemStack, boolean ignoreDamage, boolean ignoreNBT);
/**
*
* @return A list of all item stacks in the container as a list of IItemStack objects.
*/
IItemStack[] getItems();
/**
*
* @return True if this container belongs to a Custom GUI.
*/
boolean isCustomGUI();
/**
* Sends changes to be reflected on the player's client.
*/
void detectAndSendChanges();
boolean isPlayerNotUsingContainer(IPlayer player);
}
@@ -1,4 +0,0 @@
package noppes.npcs.scripted.interfaces;
public interface ICustomOverlay {
}
@@ -6,15 +6,34 @@
package noppes.npcs.scripted.interfaces;
import net.minecraft.util.DamageSource;
import noppes.npcs.scripted.interfaces.entity.IEntity;
public interface IDamageSource {
/**
*
* @return The damage type of the damage source as a string. Ex: "lava", "explosion", "magic", "outOfWorld", etc.
*/
String getType();
boolean isUnblockable();
boolean isProjectile();
/**
*
* @return The entity source of where the damage source originated. If a player was shot by an arrow from a skeleton, this would return an IEntity object of the skeleton.
*/
IEntity getTrueSource();
/**
*
* @return The entity source of where the damage source originated. If a player was shot by an arrow from a skeleton, this would return an IEntity object of the arrow.
*/
IEntity getImmediateSource();
/**
*
* @return An obfuscated MC damage source object.
*/
DamageSource getMCDamageSource();
}
@@ -7,70 +7,136 @@ package noppes.npcs.scripted.interfaces;
import net.minecraft.nbt.NBTTagCompound;
/**
* A scripted data representation of an MC NBTTagCompound object. Using these functions modifies the compound tag
* associated with this object. Any changes made to the compound tag are made directly to its "tagMap" attribute,
* minimizing the impact of setting/getting NBT data with this object on performance.
*
* Compound tags, unlike list tags, can contain multiple types of NBT tag types. Compound tags can even
* contain compound tags inside them, and if that compound tag is accessed, an object like this one will also be returned!
*
* Every tag inside a compound tag has a -unique- "key". If you try to put another tag of the same key inside the
* compound tag, it will replace the previous tag.
*
* The types and their type as an integer are as follows:
* 1: Byte
* 2: Short
* 3: Int
* 4: Long
* 5: Float
* 6: Double
* 7: Byte array
* 8: String
* 9: Tag list
* 10: Compound
* 11: Integer array
*
*/
public interface INbt {
void remove(String var1);
/**
* Returns the tag with the given key from the compound tag.
*/
void remove(String key);
boolean has(String var1);
/**
* @return True if the compound tag has a tag with the given key.
*/
boolean has(String key);
boolean getBoolean(String var1);
boolean getBoolean(String key);
void setBoolean(String var1, boolean var2);
void setBoolean(String key, boolean value);
short getShort(String var1);
short getShort(String key);
void setShort(String var1, short var2);
void setShort(String key, short value);
int getInteger(String var1);
int getInteger(String key);
void setInteger(String var1, int var2);
void setInteger(String key, int value);
byte getByte(String var1);
byte getByte(String key);
void setByte(String var1, byte var2);
void setByte(String key, byte value);
long getLong(String var1);
long getLong(String key);
void setLong(String var1, long var2);
void setLong(String key, long value);
double getDouble(String var1);
double getDouble(String key);
void setDouble(String var1, double var2);
void setDouble(String key, double value);
float getFloat(String var1);
float getFloat(String key);
void setFloat(String var1, float var2);
void setFloat(String key, float value);
String getString(String var1);
String getString(String key);
void setString(String var1, String var2);
void setString(String key, String value);
byte[] getByteArray(String var1);
byte[] getByteArray(String key);
void setByteArray(String var1, byte[] var2);
void setByteArray(String key, byte[] value);
int[] getIntegerArray(String var1);
int[] getIntegerArray(String key);
void setIntegerArray(String var1, int[] var2);
void setIntegerArray(String key, int[] value);
Object[] getList(String var1, int var2);
/**
* Returns a tag list of objects with this key in the compound tag. All the objects in the list
* will always be of the same type.
*
* @return The tag list of objects, depending on the tag type.
*/
Object[] getList(String key, int value);
int getListType(String var1);
/**
* Returns the type of the tag list with this key, as an integer.
*/
int getListType(String key);
void setList(String var1, Object[] var2);
/**
* Adds a new tag list to the compound tag with the given key.
*
* @param key The key for the list tag
* @param value The list of objects to be in the list. The type of the first element in this list becomes the tag
* list's type, and if later objects are not of this type, they will not be added.
*/
void setList(String key, Object[] value);
INbt getCompound(String var1);
INbt getCompound(String key);
void setCompound(String var1, INbt var2);
void setCompound(String key, INbt value);
/**
*
* @return A list of all the compound tag's keys.
*/
String[] getKeys();
int getType(String var1);
/**
*
* @return The type of the tag with the input key as an integer.
*/
int getType(String key);
/**
*
* @return An obfuscated MC NBTTagCompound object.
*/
NBTTagCompound getMCNBT();
/**
*
* @return A curly-bracket formatted JSON string of all the compound tag.
*/
String toJsonString();
boolean isEqual(INbt var1);
boolean isEqual(INbt nbt);
/**
* Completely clears the compound tag of all tags inside it.
*/
void clear();
}
@@ -0,0 +1,214 @@
package noppes.npcs.scripted.interfaces;
import noppes.npcs.NoppesUtilServer;
import noppes.npcs.scripted.ScriptWorld;
import noppes.npcs.scripted.interfaces.entity.IEntity;
/**
* A particle that can be spawned in the world, complete with translation, scale, rotate, and color transformations.
* (CNPC+ original!)
*
* To create a particle object:
* API.createParticle(directory);
* Then modify its attributes as you please, and call the particle's spawn functions to see it in the world.
*
* Spawning this particle in the world sends a hefty packet with all its data to the client. The particle is then
* rendered with a custom renderer based on all the given attributes.
*
* If a particle appears to not appear at first, try increasing its scale or changing its position. The entity it's
* being spawned on or a block in the world may be blocking it.
*
*/
public interface IParticle {
/**
*
* @param entity Spawns this particle object on the given entity. When spawned this way, the particle will always have its origin at the entity.
*/
void spawnOnEntity(IEntity entity);
/**
*
* @param world Spawns the particle in the given world, at a position corresponding to this particle's position variables.
*/
void spawnInWorld(ScriptWorld world);
/**
*
* @param world Spawns the particle in the given world, at a position determined by the input parameters.
* @param x The X position the particle will spawn in the world.
* @param y The Y position the particle will spawn in the world.
* @param z The Z position the particle will spawn in the world.
*/
void spawnInWorld(ScriptWorld world, double x, double y, double z);
/**
*
* @param facePlayer Whether the particle is always facing the player's camera. If this is disabled, the particle will appear to be laying flat face down on the ground if its rotation is unchanged.
*/
void setFacePlayer(boolean facePlayer);
boolean getFacePlayer();
/**
*
* @param directory The directory of this particle's texture. This can be any texture in a resource pack or mod, and even a URL!
*/
void setDirectory(String directory);
String getDirectory();
/**
*
* @param amount The amount of multiples of this particle to spawn in the world. Not too good looking if used, but has some edge cases where it's alright.
*/
void setAmount(int amount);
int getAmount();
/**
*
* @param maxAge The maximum age this particle will be around for, in MC ticks.
*/
void setMaxAge(int maxAge);
int getMaxAge();
/**
* The width and height of the particle's texture you want to render in pixels. Anything more gets cut off.
* @param width The width of the particle's texture, in pixels.
* @param height The height of the particle's texture, in pixels.
*/
void setSize(int width, int height);
int getWidth();
int getHeight();
/**
* The horizontal and vertical offset of the particle's texture from the top-left, starts rendering the particle at this point.
* @param offsetX The horizontal offset, in pixels (u).
* @param offsetY The vertical offset, in pixels (v).
*/
void setOffset(int offsetX, int offsetY);
int getOffsetX();
int getOffsetY();
/**
* Enables animation on the particle. Must set a custom width and height first using the setSize(width,height) function.
* Every frame of animation the particle goes through should be saved on a single image file.
*
* The renderer will read the frames of animation based on the given width and height of the particle, starting from the given X & Y offsets.
* The renderer then goes rightwards (width) pixels for every frame. Once it can't go rightwards anymore,
* the animation goes down (height) pixels, and once again keeps going rightwards if it has to.
*
* If the animation loops, once there is nowhere downward to go, the animation will start over at the X & Y offset.
*
* @param animRate The frame rate of the particle's animation, in MC ticks. (20 ticks = 1 second)
* @param animLoop Whether the animation loops or not.
* @param animStart The amount of ticks before the particle starts animating.
* @param animEnd The amount of ticks the particle is around for before it stops animating.
*/
void setAnim(int animRate, boolean animLoop, int animStart, int animEnd);
int getAnimRate();
boolean getAnimLoop();
int getAnimStart();
int getAnimEnd();
/**
*
* @param x The X position from the particle's origin the particle will spawn at.
* @param y The Y position from the particle's origin the particle will spawn at.
* @param z The Z position from the particle's origin the particle will spawn at.
*/
void setPosition(double x, double y, double z);
double getX();
double getY();
double getZ();
void setMotion(double motionX, double motionY, double motionZ, float gravity);
double getMotionX();
double getMotionY();
double getMotionZ();
float getGravity();
/**
*
* @param HEXColor The starting HEX color of the particle.
* @param HEXColor2 The ending HEX color of the particle.
* @param HEXColorRate The rate of interpolation between the two HEX colors.
* @param HEXColorStart The amount of ticks the particle is around for before its colors begin interpolating between HEXColor and HEXColor2.
*/
void setHEXColor(int HEXColor, int HEXColor2, float HEXColorRate, int HEXColorStart);
int getHEXColor1();
int getHEXColor2();
float getHEXColorRate();
int getHEXColorStart();
/**
*
* @param alpha1 The starting transparency of the particle.
* @param alpha2 The ending transparency of the particle.
* @param alphaRate The rate of interpolation between the two transparency values.
* @param alphaRateStart The amount of ticks the particle is around for before its colors begin interpolating between alpha1 and alpha2.
*/
void setAlpha(float alpha1, float alpha2, float alphaRate, int alphaRateStart);
float getAlpha1();
float getAlpha2();
float getAlphaRate();
int getAlphaRateStart();
/**
*
* @param scale1 The starting scale/size of the particle.
* @param scale2 The ending scale/size of the particle.
* @param scaleRate The rate of interpolation between the two scale values.
* @param scaleRateStart The amount of ticks the particle is around for before its colors begin interpolating between scale1 and scale2.
*/
void setScale(float scale1, float scale2, float scaleRate, int scaleRateStart);
float getScale1();
float getScale2();
float getScaleRate();
int getScaleRateStart();
/**
* Enables rotation about the X axis.
* If the particle is set to always face the player, this axis is a constant horizontal line on the player's camera.
*
* @param rotationX1 The starting X rotation of the particle.
* @param rotationX2 The ending X rotation of the particle.
* @param rotationXRate The rate of interpolation between the two X rotation values.
* @param rotationXRateStart The amount of ticks the particle is around for before its colors begin interpolating between rotationX1 and rotationX2.
*/
void setRotationX(float rotationX1, float rotationX2, float rotationXRate, int rotationXRateStart);
float getRotationX1();
float getRotationX2();
float getRotationXRate();
int getRotationXRateStart();
/**
* Enables rotation about the Y axis.
* If the particle is set to always face the player, this axis is a constant vertical line on the player's camera.
*
* @param rotationY1 The starting Y rotation of the particle.
* @param rotationY2 The ending Y rotation of the particle.
* @param rotationYRate The rate of interpolation between the two Y rotation values.
* @param rotationYRateStart The amount of ticks the particle is around for before its colors begin interpolating between rotationY1 and rotationY2.
*/
void setRotationY(float rotationY1, float rotationY2, float rotationYRate, int rotationYRateStart);
float getRotationY1();
float getRotationY2();
float getRotationYRate();
int getRotationYRateStart();
/**
* Enables rotation about the Y axis.
* If the particle is set to always face the player, this axis is a constant line going into the player's camera.
* You'll be using this one most often if the particle is set to face the player.
*
* @param rotationZ1 The starting Z rotation of the particle.
* @param rotationZ2 The ending Z rotation of the particle.
* @param rotationZRate The rate of interpolation between the two Z rotation values.
* @param rotationZRateStart The amount of ticks the particle is around for before its colors begin interpolating between rotationZ1 and rotationZ2.
*/
void setRotationZ(float rotationZ1, float rotationZ2, float rotationZRate, int rotationZRateStart);
float getRotationZ1();
float getRotationZ2();
float getRotationZRate();
int getRotationZRateStart();
}
@@ -1,11 +0,0 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package noppes.npcs.scripted.interfaces;
import net.minecraft.entity.passive.EntityTameable;
public interface IPixelmon<T extends EntityTameable> extends IAnimal<T> {
}
@@ -14,45 +14,154 @@ public interface IPos {
int getZ();
/**
* Shifts the IPos up by 1 block and returns the new object.
*
*/
IPos up();
IPos up(int var1);
/**
*
* @param n The number of blocks to move the position up by.
* @return The new IPos object.
*/
IPos up(int n);
/**
* Shifts the IPos down by 1 block and returns the new object.
*
*/
IPos down();
IPos down(int var1);
/**
*
* @param n The number of blocks to move the position down by.
* @return The new IPos object.
*/
IPos down(int n);
/**
* Shifts the IPos north by 1 block and returns the new object.
*
*/
IPos north();
IPos north(int var1);
/**
*
* @param n The number of blocks to move the position north by.
* @return The new IPos object.
*/
IPos north(int n);
/**
* Shifts the IPos east by 1 block and returns the new object.
*
*/
IPos east();
IPos east(int var1);
/**
*
* @param n The number of blocks to move the position east by.
* @return The new IPos object.
*/
IPos east(int n);
/**
* Shifts the IPos south by 1 block and returns the new object.
*
*/
IPos south();
IPos south(int var1);
/**
*
* @param n The number of blocks to move the position south by.
* @return The new IPos object.
*/
IPos south(int n);
/**
* Shifts the IPos west by 1 block and returns the new object.
*
*/
IPos west();
IPos west(int var1);
/**
*
* @param n The number of blocks to move the position west by.
* @return The new IPos object.
*/
IPos west(int n);
IPos add(int var1, int var2, int var3);
/**
* Adds the IPos' coordinates by each of the parameters given.
*
* @param x X coordinate amount to be added
* @param y Y coordinate amount to be added
* @param z Z coordinate amount to be added
* @return The resulting IPos from the addition.
*/
IPos add(int x, int y, int z);
IPos add(IPos var1);
/**
* Directly adds the coordinates of two IPos objects and returns the resulting IPos sum.
* For example, if one IPos was represented by the coordinates (0,60,5), and another by (-10,-30,25),
* the resulting object's coordinates are (0 - 10,60 - 30,5 + 25) = (-10,30,30).
*
* @param pos The position to be added to this IPos object.
* @return The sum of the two IPos objects as a new IPos object.
*/
IPos add(IPos pos);
IPos subtract(int var1, int var2, int var3);
/**
* Subtracts the IPos' coordinates by each of the parameters given.
*
* @param x X coordinate amount to be subtracted
* @param y Y coordinate amount to be subtracted
* @param z Z coordinate amount to be subtracted
* @return The resulting IPos from the subtraction.
*/
IPos subtract(int x, int y, int z);
IPos subtract(IPos var1);
/**
* Directly subtracts the coordinates of two IPos objects and returns the resulting IPos difference.
* For example, if one IPos was represented by the coordinates (0,60,5), and another by (-10,-30,25),
* the resulting object's coordinates are (0 + 10,60 + 30,5 - 25) = (10,90,-20).
*
* @param pos The position to be subtracted from this IPos object.
* @return The difference of the two IPos objects as a new IPos object.
*/
IPos subtract(IPos pos);
/**
* Returns a normalized vector of this block's position, calculated by:
*
*
* @return The normalized vector of this block position.
*/
double[] normalize();
/**
*
* @return An obfuscated MC BlockPos object.
*/
BlockPos getMCBlockPos();
IPos offset(int var1);
/**
* Offsets the block by 1 block in the given direction and returns the resulting IPos object
*
*/
IPos offset(int direction);
IPos offset(int var1, int var2);
/**
* Offsets the block by n blocks in the given direction and returns the resulting IPos object
*
*/
IPos offset(int direction, int n);
double distanceTo(IPos var1);
/**
*
* @param pos The IPos object to calculate the distance to
* @return The distance between this IPos object and the other.
*/
double distanceTo(IPos pos);
}
@@ -0,0 +1,66 @@
package noppes.npcs.scripted.interfaces;
import net.minecraft.util.ResourceLocation;
/**
* A skin overlay object for both NPCs and players. Several skin overlays at a time can be layered on top of each other.
* In an NPC's case, the old overlay texture is now the skin overlay with ID 0.
*
* Modifying these attributes, an overlay can be made to look like a powered creeper effect, just a new skin, or both!
*/
public interface ISkinOverlay {
/**
* Sets the directory texture of the overlay. Does not support URLs.
*/
void setTexture(String texture);
String getTexture();
/**
* Sets whether this overlay glows in the dark or not.
*/
void setGlow(boolean glow);
boolean getGlow();
/**
* Sets the transparency of the overlay, from 0 to 1.
*/
void setAlpha(float alpha);
float getAlpha();
/**
* Sets the size of the entire overlay when rendered on the entity. By default, overlays render slightly on top of
* the entity's model.
*/
void setSize(float size);
float getSize();
/**
* Sets the texture scale of the overlay. Higher values will "zoom in" to the texture more.
*/
void setScale(float scaleX, float scaleY);
float getScaleX();
float getScaleY();
/**
* Sets the "texture speed" by which the texture shifts on each render tick. Used to create a powered creeper effect!
* This does not move the entire overlay, it just moves the position at which the texture begins rendering.
*/
void setSpeed(float speedX, float speedY);
float getSpeedX();
float getSpeedY();
/**
* Sets the amount in each direction by which the overlay will be offset from the entity.
*/
void setOffset(float offsetX, float offsetY, float offsetZ);
float getOffsetX();
float getOffsetY();
float getOffsetZ();
/**
*
* @return The MC resource location object used to bind the overlay's texture.
*/
ResourceLocation getLocation();
void setLocation(ResourceLocation location);
}
@@ -0,0 +1,68 @@
package noppes.npcs.scripted.interfaces;
import net.minecraft.tileentity.TileEntity;
import noppes.npcs.scripted.ScriptBlock;
import noppes.npcs.scripted.ScriptWorld;
public interface ITileEntity {
/**
*
* @return An integer representing the metadata of this block. Blocks with different states will
* return different values. For example, each stage of growth for a wheat crop will return a different value, each
* orientation of a stair block will return a different value, etc.
*/
int getBlockMetadata();
/**
*
* @return The world this tile entity is in.
*/
ScriptWorld getWorld();
/**
*
* @return An obfuscated MC tile entity object.
*/
TileEntity getMCTileEntity();
/**
* Reads an INbt compound tag, creates a tile entity based on the data, and replaces this entity with the new one.
*/
void readFromNBT(INbt nbt);
/**
* @return The distance of this tile entity from the point given by the x, y, and z parameters.
*/
double getDistanceFrom(double x, double y, double z);
/**
* @return A new IBlock object based on this tile entity's type.
*/
IBlock getBlockType();
/**
*
* @return True if the tile entity is invalid, false otherwise.
*/
boolean isInvalid();
/**
* Invalidates the tile entity.
*/
void invalidate();
/**
* Validates the tile entity for use.
*/
void validate();
/**
* Updates the block's tile entity to the values set in this object.
*/
void updateContainingBlockInfo();
/**
* Writes the tile entity to NBT and returns the compound tag.
*/
INbt getNBT();
}
@@ -6,29 +6,84 @@
package noppes.npcs.scripted.interfaces;
public interface ITimers {
void start(int var1, int var2, boolean var3);
/**
* Adds a timer to the NPC or player with the given attributes. If this function is used and there is already a
* timer with the given ID, an exception will be thrown.
*
* @param id The id of the timer.
* @param ticks The amount of ticks before the timer ends.
* @param repeat Whether this timer repeats when it reaches its maximum amount of ticks.
*/
void start(int id, int ticks, boolean repeat);
void forceStart(int var1, int var2, boolean var3);
/**
* Adds a timer to the NPC or player with the given attributes. No exception will be thrown if there is already a
* timer with the given ID when using this function.
*
* @param id The id of the timer.
* @param ticks The amount of ticks before the timer ends.
* @param repeat Whether this timer repeats when it reaches its maximum amount of ticks.
*/
void forceStart(int id, int ticks, boolean repeat);
boolean has(int var1);
/**
*
* @return True if the set of timers contains a timer with the given id, false otherwise.
*/
boolean has(int id);
boolean stop(int var1);
/**
* Stops the timer with the given id
*
* @return True if there was a timer with the given id.
*/
boolean stop(int id);
void reset(int var1);
/**
* Resets the ticks elapsed in the timer with the given id to 0.
*/
void reset(int id);
/**
* Removes all timers.
*/
void clear();
/**
* @return The amount of ticks elapsed in the timer.
*/
int ticks(int id);
/**
* Sets the amount of ticks elapsed in the timer with the given id to a different value.
*
* @param ticks The new ticks elapsed by the timer.
*/
void setTicks(int id, int ticks);
/**
* @return The maximum amount of ticks the timer with the given id runs for before it stops.
*/
int maxTicks(int id);
/**
* Sets the maximum amount of ticks the timer with the given id can run for before it stops.
*/
void setMaxTicks(int id, int maxTicks);
/**
* @return True if the timer with the given id repeats, false otherwise.
*/
boolean repeats(int id);
/**
* Sets whether the timer with the given id repeats or not.
*/
void setRepeats(int id, boolean repeat);
/**
*
* @return The amount of timers in the set of timers.
*/
int size();
}
@@ -7,17 +7,23 @@ import noppes.npcs.scripted.ScriptItemStack;
import noppes.npcs.scripted.ScriptScoreboard;
import noppes.npcs.scripted.entity.ScriptEntity;
import noppes.npcs.scripted.entity.ScriptPlayer;
import noppes.npcs.scripted.*;
import noppes.npcs.scripted.interfaces.entity.IEntity;
import noppes.npcs.scripted.interfaces.entity.IPlayer;
import noppes.npcs.scripted.interfaces.item.IItemStack;
public interface IWorld {
/**
* @return The worlds time
*/
public long getTime();
long getTime();
/**
* @return The total world time
*/
public long getTotalTime();
long getTotalTime();
boolean areAllPlayersAsleep();
/**
* @param x World position x
@@ -26,13 +32,101 @@ public interface IWorld {
* @return The block at the given position. Returns null if there isn't a block
*/
public IBlock getBlock(int x, int y, int z);
/**
* @param pos
* @return The block at the given position. Returns null if there isn't a block
*/
public IBlock getBlock(IPos pos);
/**
*
* @return The top-most block in the world as an IBlock object.
*/
IBlock getTopBlock(int x, int z);
boolean isBlockFreezable(int x, int y, int z);
boolean isBlockFreezableNaturally(int x, int y, int z);
boolean canBlockFreeze(int x, int y, int z, boolean adjacentToWater);
boolean canBlockFreezeBody(int x, int y, int z, boolean adjacentToWater);
boolean canSnowAt(int x, int y, int z, boolean checkLight);
boolean canSnowAtBody(int x, int y, int z, boolean checkLight);
/**
* @return The Y-value of the world at this x & z value based on the height map of the world.
*/
int getHeightValue(int x, int z);
/**
* @return The minimum Y-value of the world at this x & z value based on the height map of the world.
*/
int getChunkHeightMapMinimum(int x, int z);
/**
* @return The metadata of the block at this position.
*/
int getBlockMetadata(int x, int y, int z);
boolean setBlockMetadataWithNotify(int x, int y, int z, int metadata, int flag);
boolean canBlockSeeTheSky(int x, int y, int z);
int getFullBlockLightValue(int x, int y, int z);
int getBlockLightValue(int x, int y, int z);
void playSoundAtEntity(IEntity entity, String sound, float volume, float pitch);
void playSoundToNearExcept(IPlayer player, String sound, float volume, float pitch);
IEntity getEntityByID(int id);
boolean spawnEntityInWorld(IEntity entity);
IPlayer getClosestPlayerToEntity(IEntity entity, double range);
IPlayer getClosestPlayer(double x, double y, double z, double range);
IPlayer getClosestVulnerablePlayerToEntity(IEntity entity, double range);
IPlayer getClosestVulnerablePlayer(double x, double y, double z, double range);
/**
*
* @param entity The entity whose type will be used as a parameter
* @return The amount of entities of the given type in the world.
*/
int countEntities(IEntity entity);
/**
* Sets the block's tile entity at the given position.
*/
void setTileEntity(int x, int y, int z, ITileEntity tileEntity);
/**
* Removes the block's tile entity at the given position.
*/
void removeTileEntity(int x, int y, int z);
/**
*
* @return True if the block at this position is of cubic shape. (Not a stair, slab, etc.)
*/
boolean isBlockFullCube(int x, int y, int z);
long getSeed();
void setSpawnLocation(int x, int y, int z);
boolean canLightningStrikeAt(int x, int y, int z);
boolean isBlockHighHumidity(int x, int y, int z);
/**
* @param x World position x
* @param y World position y
@@ -40,7 +134,7 @@ public interface IWorld {
* @return Text from signs
* @since 1.7.10d
*/
public String getSignText(int x, int y, int z);
String getSignText(int x, int y, int z);
/**
* @param x World position x
@@ -48,8 +142,8 @@ public interface IWorld {
* @param z World position z
* @param item The block to be set
*/
public void setBlock(int x, int y, int z, ScriptItemStack item);
public void setBlock(int x, int y, int z, IItemStack item);
/**
* @param x World position x
* @param y World position y
@@ -57,39 +151,39 @@ public interface IWorld {
* @param block The block to be set
*/
public void setBlock(int x, int y, int z, IBlock block);
/**
* @param x World position x
* @param y World position y
* @param z World position z
*/
public void removeBlock(int x, int y, int z);
/**
* starting at the start position, draw a line in the lookVector direction until a block is detected
* @param startPos
* @param startPos
* @param lookVector should be a normalized direction vector
* @param maxDistance
* @param maxDistance
* @return the first detected block but null if maxDistance is reached
*/
public IBlock rayCastBlock(double[] startPos, double[] lookVector, int maxDistance);
/**
* starting at the start position, draw a line in the lookVector direction until a block is detected
* @param startPos
* @param startPos
* @param lookVector will normalize x, y, z to get a direction vector
* @param maxDistance
* @param maxDistance
* @return the first detected block but null if maxDistance is reached
*/
public IBlock rayCastBlock(IPos startPos, IPos lookVector, int maxDistance);
/**
* @param startPos
* @param maxHeight
* @return the position of the closest block of air to startPos
* @return the position of the closest block of air to startPos
*/
public IPos getNearestAir(IPos startPos, int maxHeight);
/**
* @param x
* @param y
@@ -97,7 +191,7 @@ public interface IWorld {
* @return can the block at this position see the sky or are there no blocks above this one
*/
public boolean canSeeSky(int x, int y, int z);
/**
* @param pos
* @return can the block at this position see the sky or are there no blocks above this one
@@ -108,34 +202,36 @@ public interface IWorld {
* @param name The name of the player to be returned
* @return The Player with name. Null is returned when the player isnt found
*/
public ScriptPlayer getPlayer(String name);
IPlayer getPlayer(String name);
IPlayer getPlayerByUUID(String uuid);
/**
* @param time The world time to be set
*/
public void setTime(long time);
void setTime(long time);
/**
* @return Whether or not its daytime
*/
public boolean isDay();
boolean isDay();
/**
* @return Whether or not its currently raining
*/
public boolean isRaining();
boolean isRaining();
/**
* @param bo Set if it's raining
*/
public void setRaining(boolean bo);
void setRaining(boolean bo);
/**
* @param x The x position
* @param y The y position
* @param z The z position
*/
public void thunderStrike(double x, double y, double z);
void thunderStrike(double x, double y, double z);
/**
* Sends a packet from the server to the client everytime its called. Probably should not use this too much.
@@ -149,7 +245,7 @@ public interface IWorld {
* @param speed Speed of the particles, usually between 0 and 1
* @param count Particle count
*/
public void spawnParticle(String particle, double x, double y, double z, double dx, double dy, double dz, double speed, int count);
void spawnParticle(String particle, double x, double y, double z, double dx, double dy, double dz, double speed, int count);
/**
* @param id The items name
@@ -157,71 +253,72 @@ public interface IWorld {
* @param size The number of items in the item
* @return Returns the item
*/
public ScriptItemStack createItem(String id, int damage, int size);
IItemStack createItem(String id, int damage, int size);
/**
* @param directory The particle's texture directory. Use only forward slashes when writing a directory. Example: "customnpcs:textures/particle/tail.png"
* @return Returns ScriptEntityParticle object
* @return Returns IEntityParticle object
*/
public ScriptEntityParticle createEntityParticle(String directory);
@Deprecated
IParticle createEntityParticle(String directory);
/**
* @param key Get temp data for this key
* @return Returns the stored temp data
*/
public Object getTempData(String key);
Object getTempData(String key);
/**
* Tempdata gets cleared when the server restarts. All worlds share the same temp data.
* @param key The key for the data stored
* @param value The data stored
*/
public void setTempData(String key, Object value);
void setTempData(String key, Object value);
/**
* @param key The key thats going to be tested against the temp data
* @return Whether or not temp data containes the key
*/
public boolean hasTempData(String key);
boolean hasTempData(String key);
/**
* @param key The key for the temp data to be removed
*/
public void removeTempData(String key);
void removeTempData(String key);
/**
* Removes all tempdata
*/
public void clearTempData();
void clearTempData();
/**
* @param key The key of the data to be returned
* @return Returns the stored data
*/
public Object getStoredData(String key);
Object getStoredData(String key);
/**
* Stored data persists through world restart. Unlike tempdata only Strings and Numbers can be saved
* @param key The key for the data stored
* @param value The data stored. This data can be either a Number or a String. Other data is not stored
*/
public void setStoredData(String key, Object value);
void setStoredData(String key, Object value);
/**
* @param key The key of the data to be checked
* @return Returns whether or not the stored data contains the key
*/
public boolean hasStoredData(String key);
boolean hasStoredData(String key);
/**
* @param key The key of the data to be removed
*/
public void removeStoredData(String key);
void removeStoredData(String key);
/**
* Remove all stored data
*/
public void clearStoredData();
void clearStoredData();
/**
* @param x Position x
@@ -231,10 +328,10 @@ public interface IWorld {
* @param fire Whether or not the explosion does fire damage
* @param grief Whether or not the explosion does damage to blocks
*/
public void explode(double x, double y, double z, float range, boolean fire, boolean grief);
void explode(double x, double y, double z, float range, boolean fire, boolean grief);
IPlayer[] getAllServerPlayers();
public ScriptPlayer[] getAllServerPlayers();
public String[] getPlayerNames();
/**
@@ -243,7 +340,7 @@ public interface IWorld {
* @param z Position z
* @return Returns the name of the biome
*/
public String getBiomeName(int x, int z);
String getBiomeName(int x, int z);
/**
* Lets you spawn a server side cloned entity
@@ -254,10 +351,14 @@ public interface IWorld {
* @param name Name of the cloned entity
* @return Returns the entity which was spawned
*/
public ScriptEntity spawnClone(int x, int y, int z, int tab, String name);
public ScriptScoreboard getScoreboard();
IEntity spawnClone(int x, int y, int z, int tab, String name);
ScriptScoreboard getScoreboard();
/**
*
* @return An obfuscated MC BlockPos object.
*/
BlockPos getMCBlockPos(int x, int y, int z);
/**
@@ -265,7 +366,11 @@ public interface IWorld {
* Expert use only
* @return Returns minecraft world object
*/
public WorldServer getMCWorld();
WorldServer getMCWorld();
public int getDimensionID();
/**
*
* @return The ID of this world's dimension. 0 for overworld, 1 for End, -1 for Nether, etc.
*/
int getDimensionID();
}
@@ -3,7 +3,7 @@
// (powered by Fernflower decompiler)
//
package noppes.npcs.scripted.interfaces;
package noppes.npcs.scripted.interfaces.entity;
import net.minecraft.entity.passive.EntityAnimal;
@@ -3,359 +3,368 @@
// (powered by FernFlower decompiler)
//
package noppes.npcs.scripted.interfaces;
package noppes.npcs.scripted.interfaces.entity;
import net.minecraft.entity.EntityCreature;
import noppes.npcs.constants.EnumNavType;
import noppes.npcs.scripted.ScriptFaction;
import noppes.npcs.scripted.ScriptItemStack;
import noppes.npcs.scripted.entity.ScriptLivingBase;
import noppes.npcs.scripted.entity.ScriptPlayer;
import noppes.npcs.scripted.interfaces.ISkinOverlay;
import noppes.npcs.scripted.interfaces.handler.IOverlayHandler;
import noppes.npcs.scripted.interfaces.item.IItemStack;
import noppes.npcs.scripted.interfaces.ITimers;
import noppes.npcs.scripted.roles.*;
public interface ICustomNpc<T extends EntityCreature> extends IEntityLiving<T> {
/**
* @return Returns the current npcs size 1-30
*/
public int getSize();
int getSize();
/**
* @param size The size of the npc (1-30) default is 5
*/
public void setSize(int size);
void setSize(int size);
/**
* @return Returns the current npcs modelType of the NPC
*/
public int getModelType();
int getModelType();
/**
* @param modelType The modelType of the NPC. 0: Steve, 1: Steve64, 2: Alex
*/
public void setModelType(int modelType);
void setModelType(int modelType);
/**
* @return The npcs name
*/
public String getName();
String getName();
void setRotation(float rotation);
void setRotationType(int rotationType);
int getRotationType();
public void setRotation(float rotation);
/**
* @param name The name of the npc
*/
public void setName(String name);
void setName(String name);
/**
* @since 1.7.10
* @return The npcs title
*/
public String getTitle();
String getTitle();
/**
* @since 1.7.10
* @param title The title of the npc
*/
public void setTitle(String title);
void setTitle(String title);
/**
* @return The npcs texture
*/
public String getTexture();
String getTexture();
/**
* @param texture The texture of the npc
*/
public void setTexture(String texture);
void setTexture(String texture);
/**
* @return Home position x
*/
public int getHomeX();
int getHomeX();
/**
* @param x The home x position
*/
public void setHomeX(int x);
void setHomeX(int x);
/**
* @return Home position x
*/
public int getHomeY();
int getHomeY();
/**
* @param y The home y position
*/
public void setHomeY(int y);
void setHomeY(int y);
/**
* @return Home position x
*/
public int getHomeZ();
int getHomeZ();
/**
* @param z The home x position
*/
public void setHomeZ(int z);
void setHomeZ(int z);
/**
* @param x The home x position
* @param y The home y position
* @param z The home z position
*/
public void setHome(int x, int y, int z);
void setHome(int x, int y, int z);
/**
* @param health New max health
*/
public void setMaxHealth(double health);
void setMaxHealth(double health);
/**
* @param bo Whether or not the npc will try to return to his home position
*/
public void setReturnToHome(boolean bo);
void setReturnToHome(boolean bo);
/**
* @return Whether or not the npc returns home
*/
public boolean getReturnToHome();
boolean getReturnToHome();
/**
* @return The faction of the npc
*/
public ScriptFaction getFaction();
ScriptFaction getFaction();
/**
* @param id The id of the new faction
*/
public void setFaction(int id);
void setFaction(int id);
/**
*
* @param attackOtherFactions True if you want the NPC to attack other factions, false otherwise.
*/
public void setAttackFactions(boolean attackOtherFactions);
void setAttackFactions(boolean attackOtherFactions);
/**
*
* @return Returns true if the NPC attacks other factions, false otherwise.
*/
public boolean getAttackFactions();
boolean getAttackFactions();
/**
*
* @param defendFaction True if the NPC should defend faction members, false otherwise.
*/
public void setDefendFaction(boolean defendFaction);
void setDefendFaction(boolean defendFaction);
/**
*
* @return Returns true if the NPC should defend faction members, false otherwise.
*/
public boolean getDefendFaction();
boolean getDefendFaction();
public int getType();
int getType();
public boolean typeOf(int type);
boolean typeOf(int type);
/**
* @param target The targeted npc
* @param item The item you want to shoot
* @param accuracy Accuracy of the shot (0-100)
*/
public void shootItem(ScriptLivingBase target, ScriptItemStack item, int accuracy);
public void setProjectilesKeepTerrain(boolean b);
public boolean getProjectilesKeepTerrain();
void shootItem(IEntityLivingBase target, IItemStack item, int accuracy);
void setProjectilesKeepTerrain(boolean b);
boolean getProjectilesKeepTerrain();
/**
* @param message The message the npc will say
*/
public void say(String message);
void say(String message);
/**
* @param message The message the npc will say
*/
public void say(ScriptPlayer player, String message);
void say(IPlayer player, String message);
/**
* Kill the npc, doesnt't despawn it
*/
public void kill();
void kill();
/**
* Basically completely resets the npc. This will also call the Init script
*/
public void reset();
void reset();
/**
* @return Returns the npcs current role
*/
public ScriptRoleInterface getRole();
ScriptRoleInterface getRole();
void setRole(int role);
/**
* @return Returns the npcs current job
*/
public ScriptJobInterface getJob();
ScriptJobInterface getJob();
void setJob(int job);
/**
* @return The item held in the right hand
*/
public ScriptItemStack getRightItem();
IItemStack getRightItem();
/**
* @param item Item to be held in the right hand
*/
public void setRightItem(ScriptItemStack item);
void setRightItem(IItemStack item);
/**
* @return The item held in the left hand
*/
public ScriptItemStack getLefttItem();
IItemStack getLefttItem();
/**
* @param item Item to be held in the left hand
*/
public void setLeftItem(ScriptItemStack item);
void setLeftItem(IItemStack item);
/**
* @return Returns the projectile the npc uses
*/
public ScriptItemStack getProjectileItem();
IItemStack getProjectileItem();
/**
* @param item Item to be used as projectile
*/
public void setProjectileItem(ScriptItemStack item);
void setProjectileItem(IItemStack item);
/**
*
* @return Returns true if the NPC can aim while shooting.
*/
public boolean canAimWhileShooting();
boolean canAimWhileShooting();
/**
*
* @param aimWhileShooting Set to true if you want the NPC to aim while shooting, false otherwise.
*/
public void aimWhileShooting(boolean aimWhileShooting);
void aimWhileShooting(boolean aimWhileShooting);
public void setMinProjectileDelay(int minDelay);
public int getMinProjectileDelay();
void setMinProjectileDelay(int minDelay);
int getMinProjectileDelay();
public void setMaxProjectileDelay(int maxDelay);
public int getMaxProjectileDelay();
void setMaxProjectileDelay(int maxDelay);
int getMaxProjectileDelay();
public void setRangedRage(int rangedRange);
public int getRangedRage();
void setRangedRage(int rangedRange);
int getRangedRage();
public void setFireRate(int rate);
public int getFireRate();
void setFireRate(int rate);
int getFireRate();
public void setBurstCount(int burstCount);
public int getBurstCount();
void setBurstCount(int burstCount);
int getBurstCount();
public void setShotCount(int shotCount);
public int getShotCount();
void setShotCount(int shotCount);
int getShotCount();
public void setAccuracy(int accuracy);
public int getAccuracy();
void setAccuracy(int accuracy);
int getAccuracy();
/**
*
* @return The directory of the sound that plays when a projectile is shot
*/
public String getFireSound();
String getFireSound();
/**
*
* @param fireSound The new directory of the sound that plays when a projectile is shot
*/
public void setFireSound(String fireSound);
void setFireSound(String fireSound);
/**
* @param slot The armor slot to return. 0:head, 1:body, 2:legs, 3:boots
* @return Returns the worn armor in slot
*/
public ScriptItemStack getArmor(int slot);
IItemStack getArmor(int slot);
/**
* @param slot The armor slot to set. 0:head, 1:body, 2:legs, 3:boots
* @param item Item to be set as armor
*/
public void setArmor(int slot, ScriptItemStack item);
void setArmor(int slot, IItemStack item);
/**
*
* @param slot The slot from the NPC's drop list to return (0-8)
* @return The item in the NPC's drop list slot
*/
public ScriptItemStack getLootItem(int slot);
IItemStack getLootItem(int slot);
/**
*
* @param slot The slot from the NPC's drop list to change
* @param item The item the drop list slot will be changed to
*/
public void setLootItem(int slot, ScriptItemStack item);
void setLootItem(int slot, IItemStack item);
/**
*
* @param slot The slot from the NPC's drop list to return (0-8)
* @return The chance of dropping the item in this slot. Returns 100 if the slot is not found.
*/
public double getLootChance(int slot);
double getLootChance(int slot);
/**
*
* @param slot The slot from the NPC's drop list to change
* @param chance The new chance of dropping the item in this slot
*/
public void setLootChance(int slot, double chance);
void setLootChance(int slot, double chance);
/**
*
* @return The NPC's loot mode. 0 = Normal, 1 = Auto Pickup
*/
public int getLootMode();
int getLootMode();
/**
*
* @param lootMode The NPC's loot mode. 0 = Normal, 1 = Auto Pickup
*/
public void setLootMode(int lootMode);
void setLootMode(int lootMode);
/**
*
* @param lootXP The new minimum XP gained from killing the NPC. If greater than the max XP, it will be set to it.
*/
public void setMinLootXP(int lootXP);
void setMinLootXP(int lootXP);
/**
*
* @param lootXP The new maximum XP gained from killing the NPC. If less than the min XP, it will be set to it.
*/
public void setMaxLootXP(int lootXP);
void setMaxLootXP(int lootXP);
/**
*
* @return The minimum XP gained from killing the NPC.
*/
public int getMinLootXP();
int getMinLootXP();
/**
*
* @return The maximum XP gained from killing the NPC.
*/
public int getMaxLootXP();
public boolean getCanDrown();
public void setCanDrown(boolean b);
int getMaxLootXP();
boolean getCanDrown();
void setCanDrown(boolean b);
/**
* @param type The AnimationType
*/
public void setAnimation(int type);
void setAnimation(int type);
/**
*
@@ -369,7 +378,7 @@ public interface ICustomNpc<T extends EntityCreature> extends IEntityLiving<T> {
* 6 - None
*
*/
public void setTacticalVariant(int variant);
void setTacticalVariant(int variant);
/**
*
@@ -383,43 +392,43 @@ public interface ICustomNpc<T extends EntityCreature> extends IEntityLiving<T> {
* 6 - None
*
*/
public int getTacticalVariant();
int getTacticalVariant();
/**
*
* @param variant Sets the NPC's tactical variant by name.
*/
public void setTacticalVariant(String variant);
void setTacticalVariant(String variant);
/**
*
* @return Returns the name of the NPc's tactical variant.
*/
public String getTacticalVariantName();
String getTacticalVariantName();
/**
*
* @param tacticalRadius Sets the radius in which the tactical variant is affected, if any. Effective for all tactical variants except Rush and None.
*/
public void setTacticalRadius(int tacticalRadius);
void setTacticalRadius(int tacticalRadius);
/**
*
* @return Gets the radius in which the tactical variant is affected, if any. Effective for all tactical variants except Rush and None.
*/
public int getTacticalRadius();
int getTacticalRadius();
/**
*
* @param ignore True if the NPC goes through cobwebs
*/
public void setIgnoreCobweb(boolean ignore);
void setIgnoreCobweb(boolean ignore);
/**
*
* @return True if the NPC goes through cobwebs
*/
public boolean getIgnoreCobweb();
boolean getIgnoreCobweb();
/**
*
@@ -429,7 +438,7 @@ public interface ICustomNpc<T extends EntityCreature> extends IEntityLiving<T> {
* 2 - Retreat
* 3 - Nothing
*/
public void setOnFoundEnemy(int onAttack);
void setOnFoundEnemy(int onAttack);
/**
*
@@ -439,7 +448,7 @@ public interface ICustomNpc<T extends EntityCreature> extends IEntityLiving<T> {
* 2 - Retreat
* 3 - Nothing
*/
public int onFoundEnemy();
int onFoundEnemy();
/**
*
@@ -448,7 +457,7 @@ public interface ICustomNpc<T extends EntityCreature> extends IEntityLiving<T> {
* 1 - Sunlight
* 2 - Disabled
*/
public void setShelterFrom(int shelterFrom);
void setShelterFrom(int shelterFrom);
/**
*
@@ -457,36 +466,36 @@ public interface ICustomNpc<T extends EntityCreature> extends IEntityLiving<T> {
* 1 - Sunlight
* 2 - Disabled
*/
public int getShelterFrom();
int getShelterFrom();
/**
*
* @return Whether the NPC has a living animation
*/
public boolean hasLivingAnimation();
boolean hasLivingAnimation();
/**
*
* @param livingAnimation True if you want the NPC to have a living animation, false otherwise
*/
public void setLivingAnimation(boolean livingAnimation);
void setLivingAnimation(boolean livingAnimation);
/**
* @param type The visibility type of the npc, 0:visible, 1:invisible, 2:semi-visible
*/
public void setVisibleType(int type);
void setVisibleType(int type);
/**
* @return The visibility type of the npc, 0:visible, 1:invisible, 2:semi-visible
*/
public int getVisibleType();
int getVisibleType();
/**
*
* @param player The player this NPC becomes visible/invisible to
* @param visible True if you want the NPC to be invisible to the player, false otherwise
*/
public void setVisibleTo(ScriptPlayer player, boolean visible);
void setVisibleTo(IPlayer player, boolean visible);
/**
*
@@ -495,251 +504,263 @@ public interface ICustomNpc<T extends EntityCreature> extends IEntityLiving<T> {
* If setVisibleTo(player,visible) was not called to make this NPC invisible to the player at any point
* in the NPC's life, this function will return true regardless of the value of isVisible().
*/
public boolean isVisibleTo(ScriptPlayer player);
boolean isVisibleTo(IPlayer player);
/**
* @param type The visibility type of the name, 0:visible, 1:invisible, 2:when-attacking
*/
public void setShowName(int type);
void setShowName(int type);
/**
* @return Returns the visibility type of the name, 0:visible, 1:invisible, 2:when-attacking
*/
public int getShowName();
int getShowName();
/**
* @return Returns the visiblity of the boss bar, 0:invisible, 1:visible, 2:when-attacking
*/
public int getShowBossBar();
int getShowBossBar();
/**
* @param type The visibility type of the boss bar, 0:invisible, 1:visible, 2:when-attacking
*/
public void setShowBossBar(int type);
void setShowBossBar(int type);
/**
* @return The melee strength
*/
public float getMeleeStrength();
float getMeleeStrength();
/**
* @param strength The melee strength
*/
public void setMeleeStrength(float strength);
void setMeleeStrength(float strength);
/**
* @return The melee speed
*/
public int getMeleeSpeed();
int getMeleeSpeed();
/**
* @param speed The melee speed
*/
public void setMeleeSpeed(int speed);
void setMeleeSpeed(int speed);
/**
* @return The ranged strength
*/
public float getRangedStrength();
float getRangedStrength();
/**
* @param strength The ranged strength
*/
public void setRangedStrength(float strength);
void setRangedStrength(float strength);
/**
* @return The ranged speed
*/
public int getRangedSpeed();
int getRangedSpeed();
/**
* @param speed The ranged speed
*/
public void setRangedSpeed(int speed);
void setRangedSpeed(int speed);
/**
* @return The ranged burst count
*/
public int getRangedBurst();
int getRangedBurst();
/**
* @param count The ranged burst count
*/
public void setRangedBurst(int count);
void setRangedBurst(int count);
/**
*
* @return The amount of ticks before this entity respawns
*/
public int getRespawnTime();
int getRespawnTime();
/**
*
* @param time The new amount of ticks before this entity respawns
*/
public void setRespawnTime(int time);
void setRespawnTime(int time);
/**
*
* @return Respawn: 0 - Yes (Always), 1 - Day, 2 - Night, 3 - No (Dies permanently)
*/
public int getRespawnCycle();
int getRespawnCycle();
/**
*
* @param cycle Sets when the NPC respawns. Respawn: 0 - Yes (Always), 1 - Day, 2 - Night, 3 - No (Dies permanently)
*/
public void setRespawnCycle(int cycle);
void setRespawnCycle(int cycle);
/**
*
* @return Whether the NPC is hidden when it dies
*/
public boolean getHideKilledBody();
boolean getHideKilledBody();
/**
*
* @param hide True if the NPC is hidden when it dies. False otherwise.
*/
public void hideKilledBody(boolean hide);
void hideKilledBody(boolean hide);
/**
*
* @return Returns true if the NPC naturally despawns.
*/
public boolean naturallyDespawns();
boolean naturallyDespawns();
/**
*
* @param canDespawn True if the NPC should naturally despawn. False otherwise.
*/
public void setNaturallyDespawns(boolean canDespawn);
void setNaturallyDespawns(boolean canDespawn);
/**
* @param player The player to give the item to
* @param item The item given to the player
*/
public void giveItem(ScriptPlayer player, ScriptItemStack item);
void giveItem(IPlayer player, IItemStack item);
/**
* On servers the enable-command-block option in the server.properties needs to be set to true
* @param command The command to be executed
*/
public void executeCommand(String command);
void executeCommand(String command);
public void setHeadScale(float x, float y, float z);
void setHeadScale(float x, float y, float z);
public void setBodyScale(float x, float y, float z);
void setBodyScale(float x, float y, float z);
public void setArmsScale(float x, float y, float z);
void setArmsScale(float x, float y, float z);
public void setLegsScale(float x, float y, float z);
void setLegsScale(float x, float y, float z);
/**
* @since 1.7.10c
* @param resistance Explosion resistance (0-2) default is 1
*/
public void setExplosionResistance(float resistance);
void setExplosionResistance(float resistance);
/**
* @since 1.7.10c
* @return Returns Explosion Resistance
*/
public float getExplosionResistance();
float getExplosionResistance();
/**
* @param resistance Melee resistance (0-2) default is 1
*/
public void setMeleeResistance(float resistance);
void setMeleeResistance(float resistance);
/**
* @return Returns Melee Resistance
*/
public float getMeleeResistance();
float getMeleeResistance();
/**
* @param resistance Arrow resistance (0-2) default is 1
*/
public void setArrowResistance(float resistance);
void setArrowResistance(float resistance);
/**
* @return Returns Arrow Resistance
*/
public float getArrowResistance();
float getArrowResistance();
/**
* @param resistance Knockback resistance (0-2) default is 1
*/
public void setKnockbackResistance(float resistance);
void setKnockbackResistance(float resistance);
/**
* @return Returns Knockback Resistance
*/
public float getKnockbackResistance();
float getKnockbackResistance();
/**
* @param type Retaliation type. 0:normal, 1:panic, 2:retreat, 3:nothing
*/
public void setRetaliateType(int type);
void setRetaliateType(int type);
/**
* @return Returns the combat health regen per second
*/
public float getCombatRegen();
float getCombatRegen();
/**
* @param regen The combat health regen per second
*/
public void setCombatRegen(float regen);
void setCombatRegen(float regen);
/**
* @return Returns the health regen per second when not in combat
*/
public float getHealthRegen();
float getHealthRegen();
/**
* @param regen The health regen per second when not in combat
*/
public void setHealthRegen(float regen);
void setHealthRegen(float regen);
public long getAge();
long getAge();
public void setFly(int fly);
ITimers getTimers();
public boolean canFly();
void setFly(int fly);
public void setFlySpeed(double flySpeed);
boolean canFly();
public double getFlySpeed(double flySpeed);
void setFlySpeed(double flySpeed);
public void setFlyGravity(double flyGravity);
double getFlySpeed(double flySpeed);
public double getFlyGravity(double flyGravity);
void setFlyGravity(double flyGravity);
public void setSpeed(int speed);
double getFlyGravity(double flyGravity);
public int getSpeed();
void setFlyHeightLimit(int flyHeightLimit);
public void setSkinType(byte type);
int getFlyHeightLimit(int flyHeightLimit);
public byte getSkinType();
void limitFlyHeight(boolean limit);
public void setSkinUrl(String url);
boolean isFlyHeightLimited(boolean limit);
public String getSkinUrl();
void setSpeed(int speed);
public void setCloakTexture(String cloakTexture);
int getSpeed();
public String getCloakTexture();
void setSkinType(byte type);
public void setOverlayTexture(String overlayTexture);
byte getSkinType();
public String getOverlayTexture();
void setSkinUrl(String url);
public void setCollisionType(int type);
String getSkinUrl();
public int getCollisionType();
void setCloakTexture(String cloakTexture);
public void updateClient();
String getCloakTexture();
void setOverlayTexture(String overlayTexture);
String getOverlayTexture();
IOverlayHandler getOverlays();
void setCollisionType(int type);
int getCollisionType();
void updateClient();
}
@@ -0,0 +1,346 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package noppes.npcs.scripted.interfaces.entity;
import net.minecraft.entity.Entity;
import noppes.npcs.scripted.ScriptParticle;
import noppes.npcs.scripted.ScriptWorld;
import noppes.npcs.scripted.interfaces.INbt;
import noppes.npcs.scripted.interfaces.IPos;
import noppes.npcs.scripted.interfaces.item.IItemStack;
public interface IEntity<T extends Entity> {
void spawnParticle(ScriptParticle entityParticle);
int getEntityId();
String getUniqueID();
double getYOffset();
/**
* @return The entities width
*/
double getWidth();
/**
* @return The entities height
*/
double getHeight();
/**
* @return The entities x position
*/
double getX();
/**
* @param x The entities x position
*/
void setX(double x);
/**
* @return The entities y position
*/
double getY();
/**
* @param y The entities y position
*/
void setY(double y);
/**
* @return The entities x position
*/
double getZ();
/**
* @param z The entities x position
*/
void setZ(double z);
/**
* @return The entities z motion
*/
double getMotionX();
/**
* @param x The entities x motion
*/
void setMotionX(double x);
/**
* @return The entities x motion
*/
double getMotionY();
/**
* @param y The entities y motion
*/
void setMotionY(double y);
/**
* @return The entities y motion
*/
double getMotionZ();
/**
* @param z The entities z motion
*/
void setMotionZ(double z);
void setMotion(double x, double y, double z);
boolean isAirborne();
/**
* @return The block x position
*/
int getBlockX();
/**
* @return The block y position
*/
int getBlockY();
/**
* @return The block z position
*/
int getBlockZ();
/**
* @param x The x position
* @param y The y position
* @param z The z position
*/
void setPosition(double x, double y, double z);
IPos getPos();
void setPos(IPos pos);
int getDimension();
/**
* @param range The search range for entities around this entity
* @return Array of entities within range
*/
IEntity[] getSurroundingEntities(int range);
/**
* @param range The search range for entities around this entity
* @param type The EntityType you want to find
* @return Array of entities within range
*/
IEntity[] getSurroundingEntities(int range, int type);
/**
* @return Whether the entity is alive or not
*/
boolean isAlive();
/**
* @param key Get temp data for this key
* @return Returns the stored temp data
*/
Object getTempData(String key);
/**
* Tempdata gets cleared when the entity gets unloaded or the world restarts
* @param key The key for the data stored
* @param value The data stored
*/
void setTempData(String key, Object value);
/**
* @param key The key thats going to be tested against the temp data
* @return Whether or not temp data containes the key
*/
boolean hasTempData(String key);
/**
* @param key The key for the temp data to be removed
*/
void removeTempData(String key);
/**
* Remove all tempdata
*/
void clearTempData();
/**
* @param key The key of the data to be returned
* @return Returns the stored data
*/
Object getStoredData(String key);
/**
* Stored data persists through world restart. Unlike tempdata only Strings and Numbers can be saved
* @param key The key for the data stored
* @param value The data stored. This data can be either a Number or a String. Other data is not stored
*/
void setStoredData(String key, Object value);
/**
* @param key The key of the data to be checked
* @return Returns whether or not the stored data contains the key
*/
boolean hasStoredData(String key);
/**
* @param key The key of the data to be removed
*/
void removeStoredData(String key);
/**
* Remove all stored data
*/
void clearStoredData();
/**
* @return The age of this entity in ticks
*/
long getAge();
/**
* Despawns this entity. Removes it permanently
*/
void despawn();
/**
* @return Return whether or not this entity is standing in water
*/
boolean inWater();
/**
* @return Return whether or not this entity is standing in lava
*/
boolean inLava();
/**
* @return Return whether or not this entity is standing in fire
*/
boolean inFire();
/**
* @return Return whether or not this entity is on fire
*/
boolean isBurning();
/**
* @param ticks Amount of world ticks this entity will burn. 20 ticks equals 1 second
*/
void setBurning(int ticks);
/**
* Removes fire from this entity
*/
void extinguish();
/**
* @return Name as which it's registered in minecraft
*/
String getTypeName();
/**
* @param item Item to be dropped
*/
void dropItem(IItemStack item);
/**
* @return Return the rider
*/
IEntity getRider();
/**
* @param entity The entity to ride this entity
*/
void setRider(IEntity entity);
/**
* @return Return the entity, this entity is riding
*/
IEntity getMount();
/**
* @param entity The entity this entity will mount
*/
void setMount(IEntity entity);
/**
* @see noppes.npcs.scripted.constants.EntityType
* @return Returns the EntityType of this entity
*/
int getType();
/**
* @since 1.7.10c
* @param type @EntityType to check
* @return Returns whether the entity is type of the given @EntityType
*/
boolean typeOf(int type);
/**
* @param rotation The rotation to be set (0-360)
*/
void setRotation(float rotation);
/**
* @return Current rotation of the npc
*/
float getRotation();
public void setPitch(float pitch);
public float getPitch();
/**
* @param power How strong the knockback is
* @param direction The direction in which he flies back (0-360). Usually based on getRotation()
*/
void knockback(int power, float direction);
void knockback(int xpower, int ypower, int zpower, float direction);
void setImmune(int ticks);
public void setInvisible(boolean invisible);
public void setSneaking(boolean sneaking);
public void setSprinting(boolean sprinting);
boolean hasCollided();
/**
* @since 1.7.10c
* @return Returns whether or not this entity is sneaking
*/
boolean isSneaking();
/**
* @since 1.7.10c
* @return Returns whether or not this entity is sprinting
*/
boolean isSprinting();
/**
* @since 1.7.10c
* Expert users only
* @return Returns minecrafts entity
*/
T getMCEntity();
public INbt getNbt();
public INbt getAllNbt();
public void setNbt(INbt nbt);
void storeAsClone(int tab, String name);
ScriptWorld getWorld();
}
@@ -3,7 +3,7 @@
// (powered by Fernflower decompiler)
//
package noppes.npcs.scripted.interfaces;
package noppes.npcs.scripted.interfaces.entity;
import net.minecraft.entity.EntityLiving;
@@ -1,60 +1,65 @@
package noppes.npcs.scripted.interfaces;
package noppes.npcs.scripted.interfaces.entity;
import net.minecraft.entity.EntityLivingBase;
import noppes.npcs.scripted.entity.ScriptEntity;
import noppes.npcs.scripted.ScriptItemStack;
import noppes.npcs.scripted.entity.ScriptLivingBase;
import noppes.npcs.scripted.interfaces.item.IItemStack;
import noppes.npcs.scripted.ScriptDamageSource;
public interface IEntityLivingBase<T extends EntityLivingBase> extends IEntity<T> {
/**
* @return The entity's current health
*/
public float getHealth();
float getHealth();
/**
* @param health The new health of this entity
*/
public void setHealth(float health);
void setHealth(float health);
void hurt(float damage);
void hurt(float damage, IEntity source);
void hurt(float damage, ScriptDamageSource damageSource);
/**
* @return Entity's max health
*/
public double getMaxHealth();
double getMaxHealth();
/**
* @return Whether or not this entity is attacking something
*/
public boolean isAttacking();
boolean isAttacking();
/**
* @param living Entity which this entity will attack
*/
public void setAttackTarget(ScriptLivingBase living);
void setAttackTarget(IEntityLivingBase living);
/**
* @return The entity which this entity is attacking
*/
public ScriptLivingBase getAttackTarget();
IEntityLivingBase getAttackTarget();
public int getType();
int getType();
public boolean typeOf(int type);
boolean typeOf(int type);
/**
* @param entity Entity to check
* @return Whether or not this entity can see the given entity
*/
public boolean canSeeEntity(ScriptEntity entity);
boolean canSeeEntity(IEntity entity);
/**
* Expert use only
* @return Returns the minecraft entity object
*/
public T getMCEntity();
T getMCEntity();
/**
* Makes the entity swing its hand
*/
public void swingHand();
void swingHand();
/**
* Works the same as the <a href="http://minecraft.gamepedia.com/Commands#effect">/effect command</a>
@@ -63,40 +68,40 @@ public interface IEntityLivingBase<T extends EntityLivingBase> extends IEntity<T
* @param strength The amplifier of the potion effect
* @param hideParticles Whether or not you want to hide potion particles
*/
public void addPotionEffect(int effect, int duration, int strength, boolean hideParticles);
void addPotionEffect(int effect, int duration, int strength, boolean hideParticles);
/**
* Clears all potion effects
*/
public void clearPotionEffects();
void clearPotionEffects();
/**
* @since 1.7.10c
* @param effect Potion effect to check
* @return Returns -1 if its not active. Otherwise returns the strenght of the potion
*/
public int getPotionEffect(int effect);
int getPotionEffect(int effect);
/**
* Note not all Living Entities support this
* @since 1.7.10c
* @return The item the entity is holding
*/
public ScriptItemStack getHeldItem();
IItemStack getHeldItem();
/**
* Note not all Living Entities support this
* @since 1.7.10c
* @param item The item to be set
*/
public void setHeldItem(ScriptItemStack item);
void setHeldItem(IItemStack item);
/**
* Note not all Living Entities support this
* @param slot Slot of what armor piece to get, 0:boots, 1:pants, 2:body, 3:head
* @return The item in the given slot
*/
public ScriptItemStack getArmor(int slot);
IItemStack getArmor(int slot);
/**
* Note not all Living Entities support this
@@ -104,5 +109,5 @@ public interface IEntityLivingBase<T extends EntityLivingBase> extends IEntity<T
* @param slot Slot of what armor piece to set, 0:boots, 1:pants, 2:body, 3:head
* @param item Item to be set
*/
public void setArmor(int slot, ScriptItemStack item);
void setArmor(int slot, IItemStack item);
}
@@ -3,7 +3,7 @@
// (powered by Fernflower decompiler)
//
package noppes.npcs.scripted.interfaces;
package noppes.npcs.scripted.interfaces.entity;
import net.minecraft.entity.monster.EntityMob;
@@ -0,0 +1,101 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package noppes.npcs.scripted.interfaces.entity;
import net.minecraft.entity.passive.EntityTameable;
public interface IPixelmon<T extends EntityTameable> extends IAnimal<T> {
boolean getIsShiny();
void setIsShiny(boolean bo);
int getLevel();
void setLevel(int level);
/**
* @param type 0:HP, 1:Attack, 2:Defense, 3:SpAttack, 4:SpDefense, 5:Speed
*/
int getIV(int type);
/**
* @param type 0:HP, 1:Attack, 2:Defense, 3:SpAttack, 4:SpDefense, 5:Speed
*/
void setIV(int type, int value);
/**
* @param type 0:HP, 1:Attack, 2:Defense, 3:SpAttack, 4:SpDefense, 5:Speed
*/
int getEV(int type);
/**
* @param type 0:HP, 1:Attack, 2:Defense, 3:SpAttack, 4:SpDefense, 5:Speed
*/
void setEV(int type, int value);
/**
* @param type 0:HP, 1:Attack, 2:Defense, 3:SpAttack, 4:SpDefense, 5:Speed
*/
int getStat(int type);
/**
* @param type 0:HP, 1:Attack, 2:Defense, 3:SpAttack, 4:SpDefense, 5:Speed
*/
void setStat(int type, int value);
/**
* @return type 0:Pygmy, 1:Runt, 2:Small, 3:Normal, 4:Huge, 5:Giant, 6:Enormous, 7:Ginormous, 8:Microscopic
*/
int getSize();
/**
* @param type 0:Pygmy, 1:Runt, 2:Small, 3:Normal, 4:Huge, 5:Giant, 6:Enormous, 7:Ginormous, 8:Microscopic
*/
void setSize(int type);
/**
* @return 0-255
*/
int getHapiness();
/**
* @param value 0-255
*/
void setHapiness(int value);
/**
* @return 0:Hardy, 1:Serious, 2:Docile, 3:Bashful, 4:Quirky, 5:Lonely, 6:Brave, 7:Adamant, 8:Naughty, 9:Bold, 10:Relaxed, 11:Impish, 12:Lax, 13:Timid, 14:Hasty, 15:Jolly, 16:Naive, 17:Modest, 18:Mild, 19:Quiet, 20:Rash, 21:Calm, 22:Gentle, 23:Sassy, 24:Careful
*/
int getNature();
/**
* @param type 0:Hardy, 1:Serious, 2:Docile, 3:Bashful, 4:Quirky, 5:Lonely, 6:Brave, 7:Adamant, 8:Naughty, 9:Bold, 10:Relaxed, 11:Impish, 12:Lax, 13:Timid, 14:Hasty, 15:Jolly, 16:Naive, 17:Modest, 18:Mild, 19:Quiet, 20:Rash, 21:Calm, 22:Gentle, 23:Sassy, 24:Careful
*/
void setNature(int type);
/**
* @return -1:Uncaught, 0:Pokeball, 1:GreatBall, 2:UltraBall, 3:MasterBall, 4:LevelBall, 5:MoonBall, 6:FriendBall, 7:LoveBall, 8:SafariBall, 9:HeavyBall, 10:FastBall, 11:RepeatBall, 12:TimerBall, 13:NestBall, 14:NetBall, 15:DiveBall, 16:LuxuryBall, 17:HealBall, 18:DuskBall, 19:PremierBall, 20:SportBall, 21:QuickBall, 22:ParkBall, 23:LureBall, 24:CherishBall, 25:GSBall
*/
int getPokeball();
/**
* @param type -1:Uncaught, 0:Pokeball, 1:GreatBall, 2:UltraBall, 3:MasterBall, 4:LevelBall, 5:MoonBall, 6:FriendBall, 7:LoveBall, 8:SafariBall, 9:HeavyBall, 10:FastBall, 11:RepeatBall, 12:TimerBall, 13:NestBall, 14:NetBall, 15:DiveBall, 16:LuxuryBall, 17:HealBall, 18:DuskBall, 19:PremierBall, 20:SportBall, 21:QuickBall, 22:ParkBall, 23:LureBall, 24:CherishBall, 25:GSBall
*/
void setPokeball(int type);
String getNickname();
boolean hasNickname();
void setNickname(String name);
String getMove(int slot);
void setMove(int slot, String move);
}
@@ -1,117 +1,138 @@
package noppes.npcs.scripted.interfaces;
package noppes.npcs.scripted.interfaces.entity;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.Vec3;
import noppes.npcs.scripted.ScriptItemStack;
import noppes.npcs.scripted.ScriptBlock;
import noppes.npcs.scripted.entity.ScriptDBCPlayer;
import noppes.npcs.scripted.interfaces.handler.IOverlayHandler;
import noppes.npcs.scripted.interfaces.handler.data.IQuest;
import noppes.npcs.scripted.interfaces.*;
import noppes.npcs.scripted.interfaces.gui.ICustomGui;
import noppes.npcs.scripted.interfaces.item.IItemStack;
import noppes.npcs.scripted.interfaces.overlay.ICustomOverlay;
import noppes.npcs.scripted.ScriptPixelmonPlayerData;
public interface IPlayer<T extends EntityPlayerMP> extends IEntityLivingBase<T> {
/**
* @return Returns the displayed name of the player
*/
public String getDisplayName();
String getDisplayName();
/**
* @return Returns the players name
*/
public String getName();
String getName();
public void setPosition(double x, double y, double z);
void setPosition(double x, double y, double z);
public void setPosition(double x, double y, double z, int dimensionId);
void setPosition(double x, double y, double z, int dimensionId);
public boolean hasFinishedQuest(int id);
int getHunger();
public boolean hasActiveQuest(int id);
void setHunger(int hunger);
public void showDialog(int id);
float getSaturation();
void setSaturation(float saturation);
public boolean hasReadDialog(int id);
public void readDialog(int id);
public void unreadDialog(int id);
boolean hasFinishedQuest(int id);
boolean hasActiveQuest(int id);
/**
* Add the quest from active quest list
* @param id The Quest ID
*/
public void startQuest(int id);
void startQuest(int id);
/**
* Add the quest from finished quest list
* @param id The Quest ID
*/
public void finishQuest(int id);
void finishQuest(int id);
/**
* Removes the quest from active quest list
* @param id The Quest ID
*/
public void stopQuest(int id);
void stopQuest(int id);
/**
* Removes the quest from active and finished quest list
* @param id The Quest ID
*/
public void removeQuest(int id);
void removeQuest(int id);
public int getType();
IQuest[] getFinishedQuests();
public boolean typeOf(int type);
int getType();
boolean typeOf(int type);
/**
* @param faction The faction id
* @param points The points to increase. Use negative values to decrease
*/
public void addFactionPoints(int faction, int points);
void addFactionPoints(int faction, int points);
/**
* @param faction The faction id
* @param points The new point value for this faction
*/
public void setFactionPoints(int faction, int points);
void setFactionPoints(int faction, int points);
/**
* @param faction The faction id
* @return points
*/
public int getFactionPoints(int faction);
int getFactionPoints(int faction);
/**
* @param message The message you want to send
*/
void sendMessage(String message);
public void sendMessage(String message);
public void sendMessage(String message, EnumChatFormatting color, boolean bold, boolean italic, boolean underlined);
public void sendMessage(String message, EnumChatFormatting color, boolean bold, boolean italic, boolean obfuscated, boolean strikethrough, boolean underlined);
/**
* @return Return gamemode. 0: Survival, 1: Creative, 2: Adventure
*/
public int getMode();
int getMode();
/**
* @param type The gamemode type. 0:SURVIVAL, 1:CREATIVE, 2:ADVENTURE
*/
public void setMode(int type);
void setMode(int type);
/**
* @param item The item to be checked
* @return How many of this item the player has
*/
public int inventoryItemCount(ScriptItemStack item);
int inventoryItemCount(IItemStack item);
/**
* @since 1.7.10d
* @return Returns a IItemStack array size 36
*/
public ScriptItemStack[] getInventory();
IItemStack[] getInventory();
/**
* @param item The Item type to be removed
* @param amount How many will be removed
* @return Returns true if the items were removed succesfully. Returns false incase a bigger amount than what the player has was given
*/
public boolean removeItem(ScriptItemStack item, int amount);
boolean removeItem(IItemStack item, int amount);
/**
* @since 1.7.10c
@@ -120,7 +141,7 @@ public interface IPlayer<T extends EntityPlayerMP> extends IEntityLivingBase<T>
* @param amount How many will be removed
* @return Returns true if the items were removed succesfully. Returns false incase a bigger amount than what the player has was given or item doesnt exist
*/
public boolean removeItem(String id, int damage, int amount);
boolean removeItem(String id, int damage, int amount);
/**
* @since 1.7.10c
@@ -128,7 +149,7 @@ public interface IPlayer<T extends EntityPlayerMP> extends IEntityLivingBase<T>
* @param amount The amount of the item to be added
* @return Returns whether or not it gave the item succesfully
*/
public boolean giveItem(ScriptItemStack item, int amount);
boolean giveItem(IItemStack item, int amount);
/**
* @since 1.7.10c
@@ -137,7 +158,7 @@ public interface IPlayer<T extends EntityPlayerMP> extends IEntityLivingBase<T>
* @param amount The amount of the item to be added
* @return Returns whether or not it gave the item succesfully
*/
public boolean giveItem(String id, int damage, int amount);
boolean giveItem(String id, int damage, int amount);
/**
* Same as the /spawnpoint command
@@ -145,53 +166,86 @@ public interface IPlayer<T extends EntityPlayerMP> extends IEntityLivingBase<T>
* @param y The y position
* @param z The z position
*/
public void setSpawnpoint(int x, int y, int z);
void setSpawnpoint(int x, int y, int z);
public void resetSpawnpoint();
void resetSpawnpoint();
/**
* @param item The item to be removed from the players inventory
*/
public void removeAllItems(ScriptItemStack item);
void removeAllItems(IItemStack item);
void setRotation(float rotationYaw, float rotationPitch);
void stopUsingItem();
void clearItemInUse();
public void clearInventory();
void playSound(String name, float volume, float pitch);
void mountEntity(Entity ridingEntity);
IEntity dropOneItem(boolean dropStack);
boolean canHarvestBlock(IBlock block);
boolean interactWith(IEntity entity);
/**
* @param achievement The achievement id. For a complete list see http://minecraft.gamepedia.com/Achievements
* @return Returns whether or not the player has this achievement
*/
public boolean hasAchievement(String achievement);
boolean hasAchievement(String achievement);
/**
* @param permission Bukkit/Cauldron permission
* @return Returns whether or not the player has the permission
*/
public boolean hasBukkitPermission(String permission);
boolean hasBukkitPermission(String permission);
/**
* @since 1.7.10c
* @return Returns the exp level
*/
public int getExpLevel();
int getExpLevel();
/**
* @since 1.7.10c
* @param level The new exp level you want to set
*/
public void setExpLevel(int level);
void setExpLevel(int level);
/**
* Requires pixelmon to be installed
* @since 1.7.10d
*/
public ScriptPixelmonPlayerData getPixelmonData();
public IBlock getLookingAtBlock(int maxDistance);
ScriptPixelmonPlayerData getPixelmonData();
public ITimers getTimers();
IBlock getLookingAtBlock(int maxDistance);
public void updatePlayerInventory();
ITimers getTimers();
public boolean checkGUIOpen();
void updatePlayerInventory();
ScriptDBCPlayer<T> getDBCPlayer();
boolean blocking();
IQuest[] getActiveQuests();
IContainer getOpenContainer();
void showCustomGui(ICustomGui gui);
ICustomGui getCustomGui();
void closeGui();
void showCustomOverlay(ICustomOverlay overlay);
void closeOverlay(int id);
IOverlayHandler getOverlays();
}
@@ -3,7 +3,7 @@
// (powered by FernFlower decompiler)
//
package noppes.npcs.scripted.interfaces;
package noppes.npcs.scripted.interfaces.gui;
public interface IButton extends ICustomGuiComponent {
int getWidth();
@@ -3,7 +3,11 @@
// (powered by FernFlower decompiler)
//
package noppes.npcs.scripted.interfaces;
package noppes.npcs.scripted.interfaces.gui;
import net.minecraft.nbt.NBTTagCompound;
import noppes.npcs.scripted.interfaces.item.IItemStack;
import noppes.npcs.scripted.interfaces.entity.IPlayer;
import java.util.List;
@@ -61,4 +65,14 @@ public interface ICustomGui {
void updateComponent(ICustomGuiComponent var1);
void update(IPlayer var1);
boolean getShowPlayerInv();
int getPlayerInvX();
int getPlayerInvY();
ICustomGui fromNBT(NBTTagCompound tag);
NBTTagCompound toNBT();
}
@@ -3,7 +3,10 @@
// (powered by FernFlower decompiler)
//
package noppes.npcs.scripted.interfaces;
package noppes.npcs.scripted.interfaces.gui;
import net.minecraft.nbt.NBTTagCompound;
import noppes.npcs.scripted.gui.ScriptGuiComponent;
public interface ICustomGuiComponent {
int getID();
@@ -23,4 +26,20 @@ public interface ICustomGuiComponent {
ICustomGuiComponent setHoverText(String var1);
ICustomGuiComponent setHoverText(String[] var1);
int getColor();
ICustomGuiComponent setColor(int color);
float getAlpha();
void setAlpha(float alpha);
float getRotation();
void setRotation(float rotation);
NBTTagCompound toNBT(NBTTagCompound nbt);
ScriptGuiComponent fromNBT(NBTTagCompound nbt);
}
@@ -3,9 +3,10 @@
// (powered by FernFlower decompiler)
//
package noppes.npcs.scripted.interfaces;
package noppes.npcs.scripted.interfaces.gui;
import net.minecraft.inventory.Slot;
import noppes.npcs.scripted.interfaces.item.IItemStack;
public interface IItemSlot extends ICustomGuiComponent {
boolean hasStack();
@@ -3,7 +3,7 @@
// (powered by FernFlower decompiler)
//
package noppes.npcs.scripted.interfaces;
package noppes.npcs.scripted.interfaces.gui;
public interface ILabel extends ICustomGuiComponent {
String getText();
@@ -19,4 +19,8 @@ public interface ILabel extends ICustomGuiComponent {
float getScale();
ILabel setScale(float var1);
boolean getShadow();
void setShadow(boolean shadow);
}
@@ -1,4 +1,4 @@
package noppes.npcs.scripted.interfaces;
package noppes.npcs.scripted.interfaces.gui;
public interface ILine extends ICustomGuiComponent {
int getX1();
@@ -3,7 +3,7 @@
// (powered by FernFlower decompiler)
//
package noppes.npcs.scripted.interfaces;
package noppes.npcs.scripted.interfaces.gui;
public interface IScroll extends ICustomGuiComponent {
int getWidth();
@@ -3,7 +3,7 @@
// (powered by FernFlower decompiler)
//
package noppes.npcs.scripted.interfaces;
package noppes.npcs.scripted.interfaces.gui;
public interface ITextField extends ICustomGuiComponent {
int getWidth();
@@ -3,7 +3,7 @@
// (powered by FernFlower decompiler)
//
package noppes.npcs.scripted.interfaces;
package noppes.npcs.scripted.interfaces.gui;
public interface ITexturedRect extends ICustomGuiComponent {
String getTexture();
@@ -0,0 +1,19 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package noppes.npcs.scripted.interfaces.handler;
import noppes.npcs.scripted.interfaces.IWorld;
import noppes.npcs.scripted.interfaces.entity.IEntity;
public interface ICloneHandler {
IEntity spawn(double var1, double var3, double var5, int var7, String var8, IWorld var9);
IEntity get(int var1, String var2, IWorld var3);
void set(int var1, String var2, IEntity var3);
void remove(int var1, String var2);
}
@@ -0,0 +1,17 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package noppes.npcs.scripted.interfaces.handler;
import noppes.npcs.scripted.interfaces.handler.data.IDialog;
import noppes.npcs.scripted.interfaces.handler.data.IDialogCategory;
import java.util.List;
public interface IDialogHandler {
List<IDialogCategory> categories();
IDialog get(int var1);
}
@@ -0,0 +1,20 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package noppes.npcs.scripted.interfaces.handler;
import noppes.npcs.scripted.interfaces.handler.data.IFaction;
import java.util.List;
public interface IFactionHandler {
List<IFaction> list();
IFaction delete(int var1);
IFaction create(String var1, int var2);
IFaction get(int var1);
}
@@ -0,0 +1,18 @@
package noppes.npcs.scripted.interfaces.handler;
import noppes.npcs.scripted.interfaces.ISkinOverlay;
public interface IOverlayHandler {
void add(int id, ISkinOverlay overlay);
ISkinOverlay get(int id);
boolean has(int id);
boolean remove(int id);
int size();
void clear();
}
@@ -0,0 +1,17 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package noppes.npcs.scripted.interfaces.handler;
import noppes.npcs.scripted.interfaces.handler.data.IQuest;
import noppes.npcs.scripted.interfaces.handler.data.IQuestCategory;
import java.util.List;
public interface IQuestHandler {
List<IQuestCategory> categories();
IQuest get(int var1);
}
@@ -0,0 +1,22 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package noppes.npcs.scripted.interfaces.handler;
import java.util.List;
import net.minecraft.item.ItemStack;
import noppes.npcs.scripted.interfaces.handler.data.IRecipe;
public interface IRecipeHandler {
List<IRecipe> getGlobalList();
List<IRecipe> getCarpentryList();
void addRecipe(String var1, boolean var2, ItemStack var3, Object... var4);
void addRecipe(String var1, boolean var2, ItemStack var3, int var4, int var5, ItemStack... var6);
IRecipe delete(int var1);
}
@@ -0,0 +1,36 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package noppes.npcs.scripted.interfaces.handler.data;
import noppes.npcs.scripted.interfaces.entity.IPlayer;
public interface IAvailability {
boolean isAvailable(IPlayer var1);
int getDaytime();
void setDaytime(int var1);
int getMinPlayerLevel();
void setMinPlayerLevel(int var1);
int getDialog(int var1);
void setDialog(int var1, int var2, int var3);
void removeDialog(int var1);
int getQuest(int var1);
void setQuest(int var1, int var2, int var3);
void removeQuest(int var1);
void setFaction(int var1, int var2, int var3, int var4);
void removeFaction(int var1);
}
@@ -0,0 +1,53 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package noppes.npcs.scripted.interfaces.handler.data;
import java.util.List;
public interface IDialog {
int getId();
String getName();
void setName(String var1);
String getText();
void setText(String var1);
IQuest getQuest();
void setQuest(IQuest var1);
String getCommand();
void setCommand(String var1);
List<IDialogOption> getOptions();
IDialogOption getOption(int var1);
IAvailability getAvailability();
IDialogCategory getCategory();
void setDarkenScreen(boolean darkenScreen);
boolean getDarkenScreen();
void setDisableEsc(boolean disableEsc);
boolean getDisableEsc();
void setShowWheel(boolean showWheel);
boolean getShowWheel();
void setHideNPC(boolean hideNPC);
boolean getHideNPC();
void setSound(String sound);
String getSound();
void save();
}
@@ -0,0 +1,16 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package noppes.npcs.scripted.interfaces.handler.data;
import java.util.List;
public interface IDialogCategory {
List<IDialog> dialogs();
String getName();
IDialog create();
}
@@ -0,0 +1,14 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package noppes.npcs.scripted.interfaces.handler.data;
public interface IDialogOption {
int getSlot();
String getName();
int getType();
}
@@ -0,0 +1,45 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package noppes.npcs.scripted.interfaces.handler.data;
import noppes.npcs.scripted.interfaces.entity.ICustomNpc;
import noppes.npcs.scripted.interfaces.entity.IPlayer;
public interface IFaction {
int getId();
String getName();
int getDefaultPoints();
void setDefaultPoints(int var1);
int getColor();
int playerStatus(IPlayer var1);
boolean hostileToNpc(ICustomNpc var1);
boolean hostileToFaction(int var1);
int[] getHostileList();
void addHostile(int var1);
void removeHostile(int var1);
boolean hasHostile(int var1);
boolean getIsHidden();
void setIsHidden(boolean var1);
boolean getAttackedByMobs();
void setAttackedByMobs(boolean var1);
void save();
}
@@ -0,0 +1,49 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package noppes.npcs.scripted.interfaces.handler.data;
import noppes.npcs.scripted.interfaces.IContainer;
import noppes.npcs.scripted.interfaces.entity.IPlayer;
public interface IQuest {
int getId();
String getName();
void setName(String var1);
int getType();
void setType(int var1);
String getLogText();
void setLogText(String var1);
String getCompleteText();
void setCompleteText(String var1);
IQuest getNextQuest();
void setNextQuest(IQuest var1);
IQuestObjective[] getObjectives(IPlayer var1);
IQuestCategory getCategory();
IContainer getRewards();
String getNpcName();
void setNpcName(String var1);
void save();
boolean getIsRepeatable();
IQuestInterface getQuestInterface();
}
@@ -0,0 +1,16 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package noppes.npcs.scripted.interfaces.handler.data;
import java.util.List;
public interface IQuestCategory {
List<IQuest> quests();
String getName();
IQuest create();
}
@@ -0,0 +1,4 @@
package noppes.npcs.scripted.interfaces.handler.data;
public interface IQuestDialog extends IQuestInterface {
}
@@ -0,0 +1,4 @@
package noppes.npcs.scripted.interfaces.handler.data;
public interface IQuestInterface {
}
@@ -0,0 +1,12 @@
package noppes.npcs.scripted.interfaces.handler.data;
public interface IQuestItem extends IQuestInterface {
void setLeaveItems(boolean leaveItems);
boolean getLeaveItems();
void setIgnoreDamage(boolean ignoreDamage);
boolean getIgnoreDamage();
void setIgnoreNbt(boolean ignoreNbt);
boolean getIgnoreNbt();
}
@@ -0,0 +1,6 @@
package noppes.npcs.scripted.interfaces.handler.data;
public interface IQuestKill extends IQuestInterface {
void setTargetType(int type);
int getTargetType();
}
@@ -0,0 +1,12 @@
package noppes.npcs.scripted.interfaces.handler.data;
public interface IQuestLocation extends IQuestInterface {
void setLocation1(String loc1);
String getLocation1();
void setLocation2(String loc2);
String getLocation2();
void setLocation3(String loc3);
String getLocation3();
}
@@ -0,0 +1,18 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package noppes.npcs.scripted.interfaces.handler.data;
public interface IQuestObjective {
int getProgress();
void setProgress(int var1);
int getMaxProgress();
boolean isCompleted();
String getText();
}
@@ -0,0 +1,36 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package noppes.npcs.scripted.interfaces.handler.data;
import net.minecraft.item.ItemStack;
public interface IRecipe {
String getName();
boolean isGlobal();
void setIsGlobal(boolean var1);
boolean getIgnoreNBT();
void setIgnoreNBT(boolean var1);
boolean getIgnoreDamage();
void setIgnoreDamage(boolean var1);
int getWidth();
int getHeight();
ItemStack getResult();
ItemStack[] getRecipe();
void delete();
int getId();
}
@@ -0,0 +1,7 @@
package noppes.npcs.scripted.interfaces.item;
public interface IItemArmor {
int getArmorSlot();
String getArmorMaterial();
}
@@ -0,0 +1,5 @@
package noppes.npcs.scripted.interfaces.item;
public interface IItemBlock {
String getBlockName();
}
@@ -0,0 +1,15 @@
package noppes.npcs.scripted.interfaces.item;
public interface IItemBook {
String[] getText();
void setText(String[] var1);
String getAuthor();
void setAuthor(String var1);
String getTitle();
void setTitle(String var1);
}
@@ -0,0 +1,133 @@
package noppes.npcs.scripted.interfaces.item;
import cpw.mods.fml.common.eventhandler.Event;
import noppes.npcs.constants.EnumScriptType;
import noppes.npcs.controllers.ScriptContainer;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
public interface IItemCustom extends IItemStack {
void callScript(EnumScriptType type, Event event);
boolean isClient();
boolean getEnabled();
void setEnabled(boolean bo);
String getLanguage();
void setLanguage(String lang);
List<ScriptContainer> getScripts();
String noticeString();
Map<Long, String> getConsoleText();
void clearConsole();
String getTexture();
void setTexture(String var2);
int getArmorType();
void setIsTool(boolean isTool);
boolean isTool();
void setDigSpeed(int digSpeed);
int getDigSpeed();
void setMaxStackSize(int var1);
double getDurabilityValue();
void setDurabilityValue(float var1);
boolean getDurabilityShow();
void setDurabilityShow(boolean var1);
int getDurabilityColor();
void setDurabilityColor(int var1);
int getColor();
void setColor(int var1);
int getMaxItemUseDuration();
void setMaxItemUseDuration(int duration);
void setItemUseAction(int action);
int getItemUseAction();
int getEnchantability();
void setEnchantability(int enchantability);
void setRotation(float rotationX, float rotationY, float rotationZ);
void setRotationRate(float rotationXRate, float rotationYRate, float rotationZRate);
void setScale(float scaleX, float scaleY, float scaleZ);
void setTranslate(float translateX, float translateY, float translateZ);
void setRotationX(float rotationX);
void setRotationY(float rotationY);
void setRotationZ(float rotationZ);
void setRotationXRate(float rotationXRate);
void setRotationYRate(float rotationYRate);
void setRotationZRate(float rotationZRate);
void setScaleX(float scaleX);
void setScaleY(float scaleY);
void setScaleZ(float scaleZ);
void setTranslateX(float translateX);
void setTranslateY(float translateY);
void setTranslateZ(float translateZ);
float getRotationX();
float getRotationY();
float getRotationZ();
float getRotationXRate();
float getRotationYRate();
float getRotationZRate();
float getScaleX();
float getScaleY();
float getScaleZ();
float getTranslateX();
float getTranslateY();
float getTranslateZ();
}
@@ -1,115 +1,146 @@
package noppes.npcs.scripted.interfaces;
package noppes.npcs.scripted.interfaces.item;
import com.google.common.collect.Multimap;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.nbt.NBTTagString;
import noppes.npcs.scripted.interfaces.INbt;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
public interface IItemStack {
public String getName();
String getName();
/**
* @return Returns the stacksize
*/
public int getStackSize();
int getStackSize();
/**
* @return Return whether or not the item has a custom name
*/
public boolean hasCustomName();
boolean hasCustomName();
/**
* @param name The custom name this item will get
*/
public void setCustomName(String name);
void setCustomName(String name);
/**
* @return Return the ingame displayed name. This is either the item name or the custom name if it has one.
*/
public String getDisplayName();
String getDisplayName();
/**
* @return Get the items ingame name. Use this incase the item ingame has custom name and you want the original name.
*/
public String getItemName();
String getItemName();
/**
* @param size The size of the itemstack. A number between 1 and 64
*/
public void setStackSize(int size);
void setStackSize(int size);
int getMaxStackSize();
/**
* @return Returns the item damage of this item. For tools this is the durability for other items the color and more.
*/
public int getItemDamage();
int getItemDamage();
/**
* @param value The value to be set as item damage. For tools this is the durability for other items the color and more.
*/
public void setItemDamage(int value);
void setItemDamage(int value);
/**
* @param key The key of this NBTTag
* @param value The value to be stored. Can be a Number or String
*/
public void setTag(String key, Object value);
void setTag(String key, Object value);
/**
* @param key The key of the NBTTag
* @return Returns whether or not the key exists
*/
public boolean hasTag(String key);
boolean hasTag(String key);
/**
* @param key The key of the NBTTag
* @return Returns the value associated with the key. Returns null of it doesnt exist
*/
public Object getTag(String key);
Object getTag(String key);
public INbt removeTags();
INbt removeTags();
public boolean isEnchanted();
boolean isEnchanted();
/**
* @since 1.7.10d
* @param id The enchantment id
* @return
*/
public boolean hasEnchant(int id);
boolean hasEnchant(int id);
void addEnchant(int id, int strength);
void setAttribute(String name, double value);
double getAttribute(String name);
String[] getLore();
boolean hasLore();
void setLore(String[] lore);
boolean hasAttribute(String name);
/**
* @since 1.7.10d
* @return Returns whether this item is a book
*/
public boolean isWrittenBook();
boolean isWrittenBook();
/**
* @since 1.7.10d
* @return Returns the books title
*/
public String getBookTitle();
String getBookTitle();
/**
* @since 1.7.10d
* @return Returns the books author
*/
public String getBookAuthor();
String getBookAuthor();
/**
* @since 1.7.10d
* @return If the item is a book, returns a string array with book pages
*/
public String[] getBookText();
String[] getBookText();
/**
* @return Returns whether or not this item is a block
*/
public boolean isBlock();
boolean isBlock();
public INbt getNbt();
INbt getNbt();
public INbt getItemNbt();
INbt getItemNbt();
/**
* No support is given for this method. Dont use if you dont know what you are doing.
* @return Minecraft ItemStack
*/
public ItemStack getMCItemStack();
ItemStack getMCItemStack();
NBTTagCompound getMCNbt();
void setMCNbt(NBTTagCompound compound);
}
@@ -0,0 +1,40 @@
package noppes.npcs.scripted.interfaces.overlay;
import net.minecraft.nbt.NBTTagCompound;
import noppes.npcs.scripted.interfaces.entity.IPlayer;
import java.util.List;
public interface ICustomOverlay {
int getID();
List<ICustomOverlayComponent> getComponents();
int getDefaultAlignment();
void setDefaultAlignment(int defaultAlignment);
IOverlayTexturedRect addTexturedRect(int id, String texture, int x, int y, int width, int height);
IOverlayTexturedRect addTexturedRect(int id, String texture, int x, int y, int width, int height, int textureX, int textureY);
IOverlayLabel addLabel(int id, String label, int x, int y, int width, int height);
IOverlayLabel addLabel(int id, String label, int x, int y, int width, int height, int color);
IOverlayLine addLine(int id, int x1, int y1, int x2, int y2, int color, int thickness);
IOverlayLine addLine(int id, int x1, int y1, int x2, int y2);
ICustomOverlayComponent getComponent(int componentID);
void removeComponent(int componentID);
void updateComponent(ICustomOverlayComponent component);
void update(IPlayer player);
ICustomOverlay fromNBT(NBTTagCompound tag);
NBTTagCompound toNBT();
}
@@ -1,4 +1,7 @@
package noppes.npcs.scripted.interfaces;
package noppes.npcs.scripted.interfaces.overlay;
import net.minecraft.nbt.NBTTagCompound;
import noppes.npcs.scripted.overlay.ScriptOverlayComponent;
public interface ICustomOverlayComponent {
int getID();
@@ -26,4 +29,8 @@ public interface ICustomOverlayComponent {
float getRotation();
void setRotation(float rotation);
NBTTagCompound toNBT(NBTTagCompound nbt);
ScriptOverlayComponent fromNBT(NBTTagCompound nbt);
}
@@ -1,4 +1,4 @@
package noppes.npcs.scripted.interfaces;
package noppes.npcs.scripted.interfaces.overlay;
public interface IOverlayLabel extends ICustomOverlayComponent {
String getText();
@@ -14,4 +14,8 @@ public interface IOverlayLabel extends ICustomOverlayComponent {
float getScale();
IOverlayLabel setScale(float var1);
boolean getShadow();
void setShadow(boolean shadow);
}
@@ -1,6 +1,4 @@
package noppes.npcs.scripted.interfaces;
import noppes.npcs.scripted.overlay.ScriptOverlayLine;
package noppes.npcs.scripted.interfaces.overlay;
public interface IOverlayLine extends ICustomOverlayComponent {
int getX1();
@@ -1,4 +1,4 @@
package noppes.npcs.scripted.interfaces;
package noppes.npcs.scripted.interfaces.overlay;
public interface IOverlayTexturedRect extends ICustomOverlayComponent {
String getTexture();