public static class Definitions.HitDamageDefinition
extends java.lang.Object
Constructor and Description |
---|
HitDamageDefinition(java.lang.String name,
float range,
boolean cutsGrass,
short damageTerrain,
short damagePlants,
short damageTrees,
short damageObjects,
short damageStone,
short damageWood,
short damageMetal,
short damageSoil,
short damagePlayers,
short damageItems,
byte info,
byte toolSound)
Creates a new custom HitDamageDefinition.
|
Modifier and Type | Method and Description |
---|---|
static Definitions.HitDamageDefinition |
deserialize(byte[] bytes) |
byte |
getDamageInfo() |
commons.definitions.Picking.PickingInfo |
getInternalDef()
For internal use only.
|
int |
getItemDamage() |
java.lang.String |
getItemName() |
short |
getMetalDamage() |
short |
getObjectDamage() |
short |
getPlantDamage() |
short |
getPlayerDamage() |
float |
getRange() |
short |
getSoilDamage() |
byte |
getSoundParameterID() |
short |
getStoneDamage() |
short |
getTerrainDamage() |
short |
getTreeDamage() |
short |
getWoodDamage() |
boolean |
isCuttingGrass() |
byte[] |
serialize()
Serializes this hit definition, i.e. turn all information into a byte array.
|
public HitDamageDefinition(java.lang.String name, float range, boolean cutsGrass, short damageTerrain, short damagePlants, short damageTrees, short damageObjects, short damageStone, short damageWood, short damageMetal, short damageSoil, short damagePlayers, short damageItems, byte info, byte toolSound)
name
- the item / damage definition name.range
- the max range of the tool / weapon.cutsGrass
- true if this tool is able to cut grass.damageTerrain
- amount of terrain damage.damagePlants
- plant damage.damageTrees
- tree damage.damageObjects
- object (e.g. furniture, doors etc) damage.damageStone
- stone (blocks) damage.damageWood
- wood (blocks) damage.damageMetal
- metal (blocks) damage.damageSoil
- soil damage.damagePlayers
- damage dealt to players.damageItems
- damage dealt to items (i.e. world items laying on the ground).info
- additional tool behaviour (0 == default, 1 == smoothing, 2 == creates farmland)toolSound
- the tool sound id (e.g. 0 == pickaxe sound, 1 == axe sound, 2 == sickle, 3 == scythe, 4 == rake etc).public java.lang.String getItemName()
public float getRange()
public short getTerrainDamage()
public short getPlantDamage()
public short getTreeDamage()
public short getStoneDamage()
public short getWoodDamage()
public short getMetalDamage()
public short getSoilDamage()
public short getPlayerDamage()
public short getObjectDamage()
public int getItemDamage()
public byte getDamageInfo()
public boolean isCuttingGrass()
public byte getSoundParameterID()
public byte[] serialize()
deserialize(byte[])
public commons.definitions.Picking.PickingInfo getInternalDef()
public static Definitions.HitDamageDefinition deserialize(byte[] bytes)