Updated interfaces to have the proper functions. Documentation will focus around them, so they'll be better organized from now on.

This commit is contained in:
Luis C.M committed 2022-05-11 16:31:14 -05:00
1 parent aab550cdca
commit c2546c3f82
22 files changed
+801 -355

No files matched your search

@@ -11,12 +11,12 @@ public interface IWorld {
/**
* @return The worlds time
*/
public long getTime();
long getTime();
/**
* @return The total world time
*/
public long getTotalTime();
long getTotalTime();
boolean areAllPlayersAsleep();
@@ -26,65 +26,65 @@ public interface IWorld {
* @param z World position z
* @return The block at the given position. Returns null if there isn't a block
*/
public IBlock getBlock(int x, int y, int z);
IBlock getBlock(int x, int y, int z);
IBlock getTopBlock(int x, int z);
public boolean isBlockFreezable(int x, int y, int z);
boolean isBlockFreezable(int x, int y, int z);
public boolean isBlockFreezableNaturally(int x, int y, int z);
boolean isBlockFreezableNaturally(int x, int y, int z);
public boolean canBlockFreeze(int x, int y, int z, boolean adjacentToWater);
boolean canBlockFreeze(int x, int y, int z, boolean adjacentToWater);
public boolean canBlockFreezeBody(int x, int y, int z, boolean adjacentToWater);
boolean canBlockFreezeBody(int x, int y, int z, boolean adjacentToWater);
public boolean canSnowAt(int x, int y, int z, boolean checkLight);
boolean canSnowAt(int x, int y, int z, boolean checkLight);
public boolean canSnowAtBody(int x, int y, int z, boolean checkLight);
boolean canSnowAtBody(int x, int y, int z, boolean checkLight);
public int getHeightValue(int x, int z);
int getHeightValue(int x, int z);
public int getChunkHeightMapMinimum(int x, int z);
int getChunkHeightMapMinimum(int x, int z);
public int getBlockMetadata(int x, int y, int z);
int getBlockMetadata(int x, int y, int z);
public boolean setBlockMetadataWithNotify(int x, int y, int z, int metadata, int flag);
boolean setBlockMetadataWithNotify(int x, int y, int z, int metadata, int flag);
public boolean canBlockSeeTheSky(int x, int y, int z);
boolean canBlockSeeTheSky(int x, int y, int z);
public int getFullBlockLightValue(int x, int y, int z);
int getFullBlockLightValue(int x, int y, int z);
public int getBlockLightValue(int x, int y, int z);
int getBlockLightValue(int x, int y, int z);
public void playSoundAtEntity(ScriptEntity entity, String sound, float volume, float pitch);
void playSoundAtEntity(ScriptEntity entity, String sound, float volume, float pitch);
public void playSoundToNearExcept(ScriptPlayer player, String sound, float volume, float pitch);
void playSoundToNearExcept(ScriptPlayer player, String sound, float volume, float pitch);
public IEntity getEntityByID(int id);
IEntity getEntityByID(int id);
public boolean spawnEntityInWorld(ScriptEntity entity);
boolean spawnEntityInWorld(ScriptEntity entity);
public ScriptPlayer getClosestPlayerToEntity(ScriptEntity entity, double range);
ScriptPlayer getClosestPlayerToEntity(ScriptEntity entity, double range);
public ScriptPlayer getClosestPlayer(double x, double y, double z, double range);
ScriptPlayer getClosestPlayer(double x, double y, double z, double range);
public ScriptPlayer getClosestVulnerablePlayerToEntity(ScriptEntity entity, double range);
ScriptPlayer getClosestVulnerablePlayerToEntity(ScriptEntity entity, double range);
public ScriptPlayer getClosestVulnerablePlayer(double x, double y, double z, double range);
ScriptPlayer getClosestVulnerablePlayer(double x, double y, double z, double range);
public int countEntities(ScriptEntity entity);
int countEntities(ScriptEntity entity);
public void setTileEntity(int x, int y, int z, ScriptTileEntity tileEntity);
void setTileEntity(int x, int y, int z, ScriptTileEntity tileEntity);
public void removeTileEntity(int x, int y, int z);
void removeTileEntity(int x, int y, int z);
public boolean isBlockFullCube(int x, int y, int z);
boolean isBlockFullCube(int x, int y, int z);
public long getSeed();
long getSeed();
public void setSpawnLocation(int x, int y, int z);
void setSpawnLocation(int x, int y, int z);
public boolean canLightningStrikeAt(int x, int y, int z);
boolean canLightningStrikeAt(int x, int y, int z);
boolean isBlockHighHumidity(int x, int y, int z);
@@ -95,7 +95,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
@@ -103,49 +103,49 @@ 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);
void setBlock(int x, int y, int z, ScriptItemStack item);
/**
* @param x World position x
* @param y World position y
* @param z World position z
*/
public void removeBlock(int x, int y, int z);
void removeBlock(int x, int y, int z);
/**
* @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);
ScriptPlayer getPlayer(String name);
ScriptPlayer 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.
@@ -159,7 +159,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
@@ -167,71 +167,71 @@ public interface IWorld {
* @param size The number of items in the item
* @return Returns the item
*/
public IItemStack 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
*/
public ScriptParticle createEntityParticle(String directory);
ScriptParticle 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
@@ -241,9 +241,9 @@ 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);
public ScriptPlayer[] getAllServerPlayers();
ScriptPlayer[] getAllServerPlayers();
/**
* @since 1.7.10c
@@ -251,7 +251,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
@@ -262,9 +262,9 @@ 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);
ScriptEntity spawnClone(int x, int y, int z, int tab, String name);
public ScriptScoreboard getScoreboard();
ScriptScoreboard getScoreboard();
BlockPos getMCBlockPos(int x, int y, int z);
@@ -273,7 +273,7 @@ public interface IWorld {
* Expert use only
* @return Returns minecraft world object
*/
public WorldServer getMCWorld();
WorldServer getMCWorld();
public int getDimensionID();
int getDimensionID();
}