public class ScriptableMod
extends cubex2.mods.cs2.core.ScriptMod
| Constructor and Description |
|---|
ScriptableMod() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAlias(int id,
java.lang.String alias)
Adds an alias for an item with metadata -1, which will allow all metadata
items in a recipe
|
void |
addAliasWithMetadata(int id,
int dv,
java.lang.String alias)
Adds an alias for an item
|
void |
addBlock(java.lang.String blockFile,
java.lang.String blockType)
Adds a block with the given type to the game
|
void |
addChestItem(java.lang.String chest,
int id,
int dv,
int rarity)
Adds an item to a generated chest with a stack size of 1
|
void |
addChestItem(java.lang.String chest,
int id,
int dv,
int minCount,
int maxCount,
int rarity)
Adds an item to a generated chest.
|
void |
addCreativeTab(java.lang.String name,
int id,
int meta)
Adds a creative tab.
|
void |
addDungeonLoot(int id,
int dv,
int rarity)
Adds a item stack to the dungeon loot list with a stack size of 1.
|
void |
addDungeonLoot(int id,
int dv,
int minCount,
int maxCount,
int rarity)
Adds a item stack, with a range of sizes, to the dungeon loot list.
|
void |
addDungeonMob(java.lang.String name,
int rarity)
Adds a mob to the possible list of creatures the spawner will create.
|
void |
addFuel(java.lang.String item,
int duration)
Adds a fuel to the vanilla fuel list
|
void |
addFuelFor(java.lang.String fuelLists,
java.lang.String item,
int duration)
Adds a fuel to the given fuel lists
|
void |
addGrassPlant(int id,
int dv,
int prob)
Register a new plant to be planted when bonemeal is used on grass.
|
void |
addGrassSeed(int id,
int dv,
int quantity,
int prob)
Register a new seed to be dropped when breaking tall grass.
|
void |
addGui(java.lang.String guiFile,
java.lang.String guiType)
Adds a GUI with the given type to the game
|
void |
addItem(java.lang.String itemFile,
java.lang.String itemType)
Adds an item with the given type to the game
|
void |
addMobDrop(java.lang.String mob,
int id,
int meta,
int amount)
Adds an item to a mob's drops
|
void |
addMobDrop(java.lang.String mob,
int id,
int meta,
int amount,
float rate)
Adds an item to a mob's drops
|
void |
addRareMobDrop(java.lang.String mob,
int id,
int meta,
int amount)
Adds an item to a mob's rare drops.
|
void |
addRareMobDrop(java.lang.String mob,
int id,
int meta,
int amount,
float rate)
Adds an item to a mob's rare drops.
|
void |
addRecipe(java.lang.String result,
int width,
int height,
java.lang.String... recipeItems)
Adds a crafting recipe to the vanilla recipe list.
|
void |
addRecipeFor(java.lang.String recipeLists,
java.lang.String result,
int width,
int height,
java.lang.String... recipeItems)
Adds a crafting recipe to the given recipeLists.
|
void |
addShapelessRecipe(java.lang.String result,
java.lang.String... recipeItems)
Adds a shapeless crafting recipe to the vanilla recipe list.
|
void |
addShapelessRecipeFor(java.lang.String recipeLists,
java.lang.String result,
java.lang.String... recipeItems)
Adds a shapeless crafting recipe to the given recipe lists.
|
void |
addSmeltingRecipe(java.lang.String result,
java.lang.String input)
Adds a smelting recipe to the vanilla recipe list
|
void |
addSmeltingRecipeFor(java.lang.String recipeLists,
java.lang.String result,
java.lang.String input)
Adds a smelting recipe to the given recipe lists
|
void |
addSpawn(java.lang.String name,
int rate,
int min,
int max,
java.lang.String type)
Adds a mob to the spawn list for all biomes except hell
|
void |
addSpawn(java.lang.String name,
int rate,
int min,
int max,
java.lang.String type,
java.lang.String... biome)
Adds a mob to the spawn list for selected biomes
|
void |
addTileEntity(java.lang.String tileEntityFile,
java.lang.String tileEntityType)
Adds a tile entity with the given type to the game
|
void |
addToOreDictionary(java.lang.String oreClass,
int id,
int dv)
Adds an item to the ore dictionary
|
void |
addTradeRecipe(int profession,
java.lang.String itemToBuy,
java.lang.String itemToSell,
float chance)
Adds a trade recipe for villagers
|
void |
addTradeRecipe(int profession,
java.lang.String itemToBuy,
java.lang.String secondItemToBuy,
java.lang.String itemToSell,
float chance)
Adds a trade recipe for villagers
|
void |
addWorldGen(java.lang.String worldGenFile,
java.lang.String worldGenType)
Adds a world generator with the given type to the game
|
java.lang.String[] |
getOreDictClasses()
Gets all registered ore dictionary classes.
|
java.lang.String[] |
getOreDictClassItems(java.lang.String clazz)
Gets all items in a ore dictionary class.
|
boolean |
isItemInOreDictClass(int id,
int meta,
java.lang.String clazz)
Checks if the given item is registered for the given ore dictionary
class.
|
void |
loadScript(java.lang.String file)
Executes a script from a file
|
void |
printLine(java.lang.String s)
Prints a line in the console.
|
void |
registerBonemealHandler(java.lang.String file)
Registers a file for a bonemeal handler.
|
void |
registerCraftingHandler(java.lang.String file)
Registers a file for a crafting handler.
|
void |
registerDestroyItemHandler(java.lang.String file)
Registers a file for a destroyitem handler.
|
void |
registerPickupHandler(java.lang.String file)
Registers a file for a pickup handler.
|
void |
removeAllBiomesExcept(java.lang.String biome)
Removes all biomes except the selected one
|
void |
removeBiome(java.lang.String biome)
Remove a biome from the terrain generator
|
void |
removeChestItem(java.lang.String chest,
int id,
int dv)
Removes and item from the list of items in a generated chest.
|
void |
removeDungeonLoot(int id,
int dv)
Removes a item stack from the dungeon loot list, this will remove all
items as long as the item stack matches, it will not care about matching
the stack size ranges perfectly.
|
void |
removeDungeonLoot(int id,
int dv,
int minCount,
int maxCount)
Removes a item stack from the dungeon loot list.
|
void |
removeDungeonMob(java.lang.String name)
Will completely remove a Mob from the dungeon spawn list.
|
void |
removeRecipe(java.lang.String result,
int width,
int height,
java.lang.String... recipeItems)
Removes a crafting recipe from the vanilla recipe list.
|
void |
removeRecipeFrom(java.lang.String recipeLists,
java.lang.String result,
int width,
int height,
java.lang.String... recipeItems)
Removes a crafting recipe from the given recipe lists.
|
void |
removeShapelessRecipe(java.lang.String result,
java.lang.String... recipeItems)
Removes a shapeless crafting recipe from the vanilla recipe list
|
void |
removeShapelessRecipeFrom(java.lang.String recipeLists,
java.lang.String result,
java.lang.String... recipeItems)
Removes a shapeless crafting recipe from the given recipe lists.
|
void |
removeSpawn(java.lang.String name,
java.lang.String type)
Remove a mob from the spawn list for all biomes except hell
|
void |
removeSpawn(java.lang.String name,
java.lang.String type,
java.lang.String... biome)
Remove a mob from spawn list for selected biomes.
|
void |
removeTradeRecipe(int profession,
java.lang.String itemToBuy,
java.lang.String itemToSell)
Removes a trade recipe from villagers
|
void |
removeTradeRecipe(int profession,
java.lang.String itemToBuy,
java.lang.String secondItemToBuy,
java.lang.String itemToSell)
Removes a trade recipe from villagers
|
public void printLine(java.lang.String s)
s - The text to displaypublic void loadScript(java.lang.String file)
throws java.lang.Exception
file - The name of the file (for example aFile.js)java.lang.Exceptionpublic void addAlias(int id,
java.lang.String alias)
id - The item's idalias - The alias for the itempublic void addAliasWithMetadata(int id,
int dv,
java.lang.String alias)
id - The item's iddv - The item's damage valuealias - The alias for the itempublic void registerCraftingHandler(java.lang.String file)
throws java.io.FileNotFoundException,
java.io.IOException
file - The file to registerjava.io.FileNotFoundExceptionjava.io.IOExceptionpublic void registerPickupHandler(java.lang.String file)
throws java.io.FileNotFoundException,
java.io.IOException
file - The file to registerjava.io.FileNotFoundExceptionjava.io.IOExceptionpublic void registerBonemealHandler(java.lang.String file)
throws java.io.FileNotFoundException,
java.io.IOException
file - The file to registerjava.io.FileNotFoundExceptionjava.io.IOExceptionpublic void registerDestroyItemHandler(java.lang.String file)
throws java.io.FileNotFoundException,
java.io.IOException
file - The file to registerjava.io.FileNotFoundExceptionjava.io.IOExceptionpublic void addRecipe(java.lang.String result,
int width,
int height,
java.lang.String... recipeItems)
throws java.lang.Exception
result - The result itemwidth - The recipe's widthheight - The recipe's heightrecipeItems - The recipe itemsjava.lang.Exceptionpublic void addRecipeFor(java.lang.String recipeLists,
java.lang.String result,
int width,
int height,
java.lang.String... recipeItems)
throws java.lang.Exception
recipeLists - The recipe lists in which the recipe is added. For
example 'vanilla,myOwn' or 'myOwn'result - The result itemwidth - The recipe's widthheight - The recipe's heightrecipeItems - The recipe itemsjava.lang.Exceptionpublic void addShapelessRecipe(java.lang.String result,
java.lang.String... recipeItems)
throws java.lang.Exception
result - The result itemrecipeItems - The recipe itemsjava.lang.Exceptionpublic void addShapelessRecipeFor(java.lang.String recipeLists,
java.lang.String result,
java.lang.String... recipeItems)
throws java.lang.Exception
recipeLists - The recipe lists in which the recipe is added. For
example 'vanilla,myOwn' or 'myOwn'result - The result itemrecipeItems - The recipe itemsjava.lang.Exceptionpublic void removeRecipe(java.lang.String result,
int width,
int height,
java.lang.String... recipeItems)
throws java.lang.Exception
result - The result itemwidth - The recipe's widthheight - The recipe's heightrecipeItems - The recipe itemsjava.lang.Exceptionpublic void removeRecipeFrom(java.lang.String recipeLists,
java.lang.String result,
int width,
int height,
java.lang.String... recipeItems)
throws java.lang.Exception
recipeLists - The recipe lists to remove the recipe from. For
example 'vanilla,myOwn' or 'myOwn'result - The result itemwidth - The recipe's widthheight - The recipe's heightrecipeItems - The recipe itemsjava.lang.Exceptionpublic void removeShapelessRecipe(java.lang.String result,
java.lang.String... recipeItems)
throws java.lang.Exception
result - The result itemrecipeItems - The recipe itemsjava.lang.Exceptionpublic void removeShapelessRecipeFrom(java.lang.String recipeLists,
java.lang.String result,
java.lang.String... recipeItems)
throws java.lang.Exception
recipeLists - The recipe lists to remove the recipe from.result - The result itemrecipeItems - The recipe itemsjava.lang.Exceptionpublic void addSmeltingRecipe(java.lang.String result,
java.lang.String input)
throws java.lang.Exception
result - The result iteminput - The input itemjava.lang.Exceptionpublic void addSmeltingRecipeFor(java.lang.String recipeLists,
java.lang.String result,
java.lang.String input)
throws java.lang.Exception
recipeLists - The list to add the recipe for.result - The result iteminput - The input itemjava.lang.Exceptionpublic void addTradeRecipe(int profession,
java.lang.String itemToBuy,
java.lang.String itemToSell,
float chance)
throws java.lang.Exception
profession - The profession of the villageritemToBuy - The item that the villager buysitemToSell - The item that the villager sellschance - The chance of the recipe (0.0 to 1.0)java.lang.Exceptionpublic void addTradeRecipe(int profession,
java.lang.String itemToBuy,
java.lang.String secondItemToBuy,
java.lang.String itemToSell,
float chance)
throws java.lang.Exception
profession - The profession of the villageritemToBuy - The item that the villager buyssecondItemToBuy - The second item that the villager buysitemToSell - The item that the villager sellschance - The chance of the recipe (0.0 to 1.0)java.lang.Exceptionpublic void removeTradeRecipe(int profession,
java.lang.String itemToBuy,
java.lang.String itemToSell)
profession - The profession of the villageritemToBuy - The item that the villager buysitemToSell - The item that the villager sellspublic void removeTradeRecipe(int profession,
java.lang.String itemToBuy,
java.lang.String secondItemToBuy,
java.lang.String itemToSell)
profession - The profession of the villageritemToBuy - The item that the villager buyssecondItemToBuy - The second item that the villager buysitemToSell - The item that the villager sellspublic void addFuel(java.lang.String item,
int duration)
throws java.lang.Exception
item - The itemduration - The durationjava.lang.Exceptionpublic void addFuelFor(java.lang.String fuelLists,
java.lang.String item,
int duration)
throws java.lang.Exception
fuelLists - The fuel lists to add the fuel for.item - The itemduration - The durationjava.lang.Exceptionpublic void addSpawn(java.lang.String name,
int rate,
int min,
int max,
java.lang.String type)
throws java.lang.Exception
name - The name of the mobrate - The rate (higher rate -> mob is more common)min - The minimum count of the mob for one spawnmax - The maximum count of the mob for one spawntype - The type of the spawn (monster, creature or water)java.lang.Exceptionpublic void addSpawn(java.lang.String name,
int rate,
int min,
int max,
java.lang.String type,
java.lang.String... biome)
throws java.lang.Exception
name - The name of the mobrate - The rate (higher rate -> mob is more common)min - The minimum count of the mob for one spawnmax - The maximum count of the mob for one spawntype - The type of the spawn (monster, creature or water)biome - The biomes where the mob is spawnedjava.lang.Exceptionpublic void removeSpawn(java.lang.String name,
java.lang.String type)
throws java.lang.Exception
name - The name of the mobtype - The type of the spawn (monster, creature or water)java.lang.Exceptionpublic void removeSpawn(java.lang.String name,
java.lang.String type,
java.lang.String... biome)
throws java.lang.Exception
name - The name of the mobtype - The type of the spawn (monster, creature or water)biome - The biomes to remove the mob from.java.lang.Exceptionpublic void removeBiome(java.lang.String biome)
throws java.lang.Exception
biome - The biome to removejava.lang.Exceptionpublic void removeAllBiomesExcept(java.lang.String biome)
throws java.lang.Exception
biome - The biome to removejava.lang.Exceptionpublic void addToOreDictionary(java.lang.String oreClass,
int id,
int dv)
throws java.lang.Exception
oreClass - The ore classid - The item's iddv - The item'S damage valuejava.lang.Exceptionpublic void addGrassPlant(int id,
int dv,
int prob)
throws java.lang.Exception
id - The block's iddv - The block's damage valueprob - The relative probability of the plant, where red flowers are
10 and yellow flowers are 20.java.lang.Exceptionpublic void addGrassSeed(int id,
int dv,
int quantity,
int prob)
throws java.lang.Exception
id - The item's iddv - The item's damage valuequantity - The quantity of seeds to drop.prob - The relative probability of the seeds, where wheat seeds are
10.java.lang.Exceptionpublic void addDungeonMob(java.lang.String name,
int rarity)
throws java.lang.Exception
name - The name of the mobrarity - The rarity of selecting this mob over others. Must be
greater then 0.java.lang.Exceptionpublic void removeDungeonMob(java.lang.String name)
throws java.lang.Exception
name - The name of the mobjava.lang.Exceptionpublic void addDungeonLoot(int id,
int dv,
int rarity)
throws java.lang.Exception
id - The item's iddv - The item's damage valuerarity - The relative chance that this item will spawnjava.lang.Exceptionpublic void addDungeonLoot(int id,
int dv,
int minCount,
int maxCount,
int rarity)
throws java.lang.Exception
id - The item's iddv - The item's damage valueminCount - When this item does generate, the minimum number that is
in the stackmaxCount - When this item does generate, the maximum number that can
bein the stackrarity - The relative chance that this item will spawn.java.lang.Exceptionpublic void addChestItem(java.lang.String chest,
int id,
int dv,
int rarity)
chest - The name of the chest. Possible values are
mineshaftCorridor, pyramidDesertyChest, pyramidJungleChest,
pyramidJungleDispenser, strongholdCorridor, strongholdLibrary,
strongholdCrossing, villageBlacksmith, bonusChest,
dungeonChestid - The item's iddv - The item's damage valuerarity - The rarity of the item. Higher rarity means higher chance
that the item is added to the chest.public void addChestItem(java.lang.String chest,
int id,
int dv,
int minCount,
int maxCount,
int rarity)
chest - The name of the chest. Possible values are
mineshaftCorridor, pyramidDesertyChest, pyramidJungleChest,
pyramidJungleDispenser, strongholdCorridor, strongholdLibrary,
strongholdCrossing, villageBlacksmith, bonusChest,
dungeonChestid - The item's iddv - The item's damage valueminCount - When this item does generate, the minimum number that is
in the stackmaxCount - When this item does generate, the maximum number that can
bein the stackrarity - The rarity of the item. Higher rarity means higher chance
that the item is added to the chest.public void removeChestItem(java.lang.String chest,
int id,
int dv)
chest - The name of the chest. Possible values are
mineshaftCorridor, pyramidDesertyChest, pyramidJungleChest,
pyramidJungleDispenser, strongholdCorridor, strongholdLibrary,
strongholdCrossing, villageBlacksmith, bonusChest,
dungeonChestid - The item's iddv - The item's damage valuepublic void removeDungeonLoot(int id,
int dv)
throws java.lang.Exception
id - The item's iddv - The item's damage valuejava.lang.Exceptionpublic void removeDungeonLoot(int id,
int dv,
int minCount,
int maxCount)
throws java.lang.Exception
id - The item's iddv - The item's damage valueminCount - The minimum count for the match check, if less then 0,
the size check is skippedmaxCount - The max count used in match check when 'minCount' is >= 0java.lang.Exceptionpublic void addItem(java.lang.String itemFile,
java.lang.String itemType)
throws java.lang.Exception
itemFile - The item's fileitemType - The item's typejava.lang.Exceptionpublic void addBlock(java.lang.String blockFile,
java.lang.String blockType)
throws java.lang.Exception
blockFile - The block's fileblockType - The block's typejava.lang.Exceptionpublic void addTileEntity(java.lang.String tileEntityFile,
java.lang.String tileEntityType)
throws java.lang.Exception
tileEntityFile - The tileentity's filetileEntityType - The tileentity's typejava.lang.Exceptionpublic void addGui(java.lang.String guiFile,
java.lang.String guiType)
throws java.lang.Exception
guiFile - The GUI's fileguiType - The GUI's typejava.lang.Exceptionpublic void addWorldGen(java.lang.String worldGenFile,
java.lang.String worldGenType)
throws java.lang.Exception
worldGenFile - The world generator's fileworldGenType - The world generator's typejava.lang.Exceptionpublic java.lang.String[] getOreDictClasses()
public java.lang.String[] getOreDictClassItems(java.lang.String clazz)
clazz - The ore dictionary class.public boolean isItemInOreDictClass(int id,
int meta,
java.lang.String clazz)
id - The id of the itemmeta - The metadata of the itemclazz - The ore dictionary classpublic void addMobDrop(java.lang.String mob,
int id,
int meta,
int amount)
mob - The id or name of the mobid - The id of the itemmeta - The metadata of the itemamount - The amount of the itempublic void addMobDrop(java.lang.String mob,
int id,
int meta,
int amount,
float rate)
mob - The id or name of the mobid - The id of the itemmeta - The metadata of the itemamount - The amount of the itemrate - The rate of the drop where 0.0 is 0% and 1.0 is 100%public void addRareMobDrop(java.lang.String mob,
int id,
int meta,
int amount)
mob - The id or name of the mobid - The id of the itemmeta - The metadata of the itemamount - The amount of the itempublic void addRareMobDrop(java.lang.String mob,
int id,
int meta,
int amount,
float rate)
mob - The id or name of the mobid - The id of the itemmeta - The metadata of the itemamount - The amount of the itemrate - The rate of the drop where 0.0 is 0% and 1.0 is 100%public void addCreativeTab(java.lang.String name,
int id,
int meta)
name - The name of the tabid - The id of the tab icon itemmeta - The metadata of the tab icon item