31 lines
809 B
Java
Executable file
31 lines
809 B
Java
Executable file
package game.item;
|
|
|
|
import game.block.Block;
|
|
import game.init.Blocks;
|
|
import game.renderer.blockmodel.ModelBlock;
|
|
|
|
public class ItemPiston extends ItemBlock
|
|
{
|
|
public ItemPiston(Block block)
|
|
{
|
|
super(block);
|
|
}
|
|
|
|
/**
|
|
* Converts the given ItemStack damage value into a metadata value to be placed in the world when this Item is
|
|
* placed as a Block (mostly used with ItemBlocks).
|
|
*/
|
|
public int getMetadata(int damage)
|
|
{
|
|
return 7;
|
|
}
|
|
|
|
public boolean isMagnetic() {
|
|
return true;
|
|
}
|
|
|
|
public ModelBlock getModel(String name, int meta) {
|
|
return new ModelBlock(new ModelBlock("piston_side").add().nswe().d("piston_bottom").u("piston_top" + (this.block ==
|
|
Blocks.sticky_piston ? "_sticky" : "")), this.getTransform());
|
|
}
|
|
}
|