Factory0 Resources - roidrole/Roids-Tweaker GitHub Wiki
Wraps F0R's API to make it accessible to CraftTweaker. Allows for modification of the world's ore data
Components :
IWorld Expansion
Used solely to get an F0RWorld. Only one method
Import :
import crafttweaker.world.IWorld;
IWorldObj.getF0RWorld();
Note that the associated getter uses F0RWorld and not f0RWorld
IF0RWorld
Used to get and set the F0R data in a world
Import :
import mods.roidtweaker.f0resources.F0RWorld;
| Method | Parameters | Description |
|---|---|---|
| getChunkData | IChunkPos pos | Gets the ChunkData of a chunk |
| setChunkData | IChunkPos pos, IChunkData data | Sets the ChunkData of a chunk |
| removeChunkData | @Optional IChunkPos pos | Removes this ChunkData from the map or all if unspecified |
| hasChunkData | IChunkPos pos | Check if this world has data for this chunk |
ChunkData
Contains all ore and fluid entries of a given chunk.
Import :
import mods.roidtweaker.f0resources.ChunkData;
Static method to create an empty ChunkData (to assign to chunks with no data) :
ChunkData.create();
| Method | Parameters | Description |
|---|---|---|
| addData | OreData or FluidData | Adds a vein to the chunk |
| getDataOre | int index | Gets the vein at this index. For ores |
| getDataFluid | int index | Gets the vein at this index. For fluids |
| removeData | OreData or FluidData | Removes the specified vein from the chunk |
FluidData
A vein containing fluids
Import :
import mods.roidtweaker.f0resources.FluidData;
You can create one via :
FluidData.create(fluid as ILiquidStack, amount as long);
| Method | Parameters | Description |
|---|---|---|
| getStack | int amount | Gets the ILiquidStack this vein contains |
| getAmount | [None] | Gets the amount left in this vein |
| setAmount | long amount | Sets the amount left in this vein |
| mine | long quantity | Mines the specified quantity from this vein. Returns the mined stack |
OreData
A vein containing ores (items, really)
Import :
import mods.roidtweaker.f0resources.OreData;
You can create one via :
OreData.create(ore as IItemStack, amount as long);
| Method | Parameters | Description |
|---|---|---|
| getStack | int amount | Gets the IItemStack this vein contains |
| getAmount | [None] | Gets the amount left in this vein |
| setAmount | long amount | Sets the amount left in this vein |
| mine | long quantity | Mines the specified quantity from this vein. Returns the mined stack |
| getRequiredTier | [None] | Gets the required mining level to mine this vein |
| setRequiredTier | int tier | Sets the required mining level to mine this vein |