Package de.ellpeck.rockbottom.api.tile
Class Tile
java.lang.Object
de.ellpeck.rockbottom.api.tile.Tile
- Direct Known Subclasses:
BasicTile
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BoundingBoxstatic final BoundingBoxstatic final BoundingBox[]static final BoundingBoxprotected Map<ToolProperty,Integer> protected booleanprotected floatprotected booleanprotected final ResourceNamestatic final BoundingBoxstatic final BoundingBox -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddEffectiveTool(ToolProperty property, int level) booleancanBreak(IWorld world, int x, int y, TileLayer layer, AbstractPlayerEntity player, boolean isRightTool) booleancanClimb(IWorld world, int x, int y, TileLayer layer, TileState state, BoundingBox entityBox, BoundingBox entityBoxMotion, List<BoundingBox> tileBoxes, Entity entity) booleancanGrassSpreadTo(IWorld world, int x, int y, TileLayer layer) booleancanKeepFarmablePlants(IWorld world, int x, int y, TileLayer layer) booleancanKeepPlants(IWorld world, int x, int y, TileLayer layer) booleancanLiquidSpread(IWorld world, int x, int y, LiquidTile liquid, Direction dir) booleancanPlace(IWorld world, int x, int y, TileLayer layer, AbstractPlayerEntity player) booleancanPlaceInLayer(TileLayer layer) booleanbooleancanReplace(IWorld world, int x, int y, TileLayer layer) booleancanStay(IWorld world, int x, int y, TileLayer layer, int changedX, int changedY, TileLayer changedLayer) booleanbooleanAttempts to chisel a corner of the tile based on the cursor position.protected TileItemvoiddescribeItem(IAssetManager manager, ItemInstance instance, List<String> desc, boolean isAdvanced) voiddoBreak(IWorld world, int x, int y, TileLayer layer, AbstractPlayerEntity breaker, boolean isRightTool, boolean allowDrop) booleandoesSustainLeaves(IWorld world, int x, int y, TileLayer layer) voiddoPlace(IWorld world, int x, int y, TileLayer layer, ItemInstance instance, AbstractPlayerEntity placer) booleanfactorsIntoHeightMap(IWorld world, int x, int y, TileLayer layer) getActualBoundBox(IWorld world, TileState state, int x, int y, TileLayer layer) getBoundBox(IWorld world, int x, int y, TileLayer layer) Deprecated.getBoundBox(IWorld world, TileState state, int x, int y, TileLayer layer) getBoundBoxes(IWorld world, int x, int y, TileLayer layer, MovableWorldObject object, BoundingBox objectBox, BoundingBox objectBoxMotion) Deprecated.getBoundBoxes(IWorld world, TileState state, int x, int y, TileLayer layer, MovableWorldObject object, BoundingBox objectBox, BoundingBox objectBoxMotion) getBreakSound(IWorld world, int x, int y, TileLayer layer, Entity destroyer) protected List<BoundingBox>getChiselBoundBoxes(IWorld world, int x, int y) floatgetHardness(IWorld world, int x, int y, TileLayer layer) intgetInteractionPriority(IWorld world, int x, int y, TileLayer layer, double mouseX, double mouseY, AbstractPlayerEntity player) getItem()intdoublegetMaxInteractionDistance(IWorld world, int x, int y, TileLayer layer, double mouseX, double mouseY, AbstractPlayerEntity player) getName()getPlacementState(IWorld world, int x, int y, TileLayer layer, ItemInstance instance, AbstractPlayerEntity placer) getPlaceSound(IWorld world, int x, int y, TileLayer layer, Entity placer, TileState state) getPlatformBounds(IWorld world, int x, int y, TileLayer layer, TileState state, MovableWorldObject object, BoundingBox objectBox, BoundingBox objectBoxMotion) getProps()floatgetTranslucentModifier(IWorld world, int x, int y, TileLayer layer, boolean skylight) protected booleanhasItem()booleanbooleanhasSolidSurface(IWorld world, int x, int y, TileLayer layer) booleanhasState(ResourceName name, Map<String, Comparable> props) booleanisAir()booleanbooleanisChiseled(IWorld world, int x, int y, TileLayer layer, TileState state) booleanbooleanisLiquid()booleanbooleanisToolEffective(IWorld world, int x, int y, TileLayer layer, ToolProperty property, int level) booleanmakesGrassSnowy(IWorld world, int x, int y, TileLayer layer) booleanobscuresBackground(IWorld world, int x, int y, TileLayer layer) voidvoidonChangeAround(IWorld world, int x, int y, TileLayer layer, int changedX, int changedY, TileLayer changedLayer) voidonCollideWithEntity(IWorld world, int x, int y, TileLayer layer, TileState state, BoundingBox entityBox, BoundingBox entityBoxMotion, List<BoundingBox> tileBoxes, Entity entity) voidonDestroyed(IWorld world, int x, int y, Entity destroyer, TileLayer layer, boolean shouldDrop) booleanonInteractWith(IWorld world, int x, int y, TileLayer layer, double mouseX, double mouseY, AbstractPlayerEntity player) booleanonInteractWithBreakKey(IWorld world, int x, int y, TileLayer layer, double mouseX, double mouseY, AbstractPlayerEntity player) voidonIntersectWithEntity(IWorld world, int x, int y, TileLayer layer, TileState state, BoundingBox entityBox, BoundingBox entityBoxMotion, List<BoundingBox> tileBoxes, Entity entity) voidvoidonScheduledUpdate(IWorld world, int x, int y, TileLayer layer, int scheduledMeta) provideTileEntity(IWorld world, int x, int y, TileLayer layer) register()Call this to make your tile chiselable.setHardness(float hardness) setMaxAmount(int amount) toString()voidupdateRandomly(IWorld world, int x, int y, TileLayer layer) voidupdateRandomlyInPlayerView(IWorld world, int x, int y, TileLayer layer, TileState state, IParticleManager manager)
-
Field Details
-
DEFAULT_BOUNDS
-
TOP_LEFT
-
TOP_RIGHT
-
BOTTOM_LEFT
-
BOTTOM_RIGHT
-
CHISEL_BOUNDS
-
name
-
effectiveToolProps
-
forceDrop
protected boolean forceDrop -
hardness
protected float hardness -
isChiselable
protected boolean isChiselable
-
-
Constructor Details
-
Tile
-
-
Method Details
-
getRenderer
-
getActualBoundBox
-
getBoundBox
-
getBoundBox
Deprecated. -
getBoundBoxes
public List<BoundingBox> getBoundBoxes(IWorld world, TileState state, int x, int y, TileLayer layer, MovableWorldObject object, BoundingBox objectBox, BoundingBox objectBoxMotion) -
getBoundBoxes
@Deprecated public List<BoundingBox> getBoundBoxes(IWorld world, int x, int y, TileLayer layer, MovableWorldObject object, BoundingBox objectBox, BoundingBox objectBoxMotion) Deprecated. -
isPlatform
public boolean isPlatform() -
getPlatformBounds
public List<BoundingBox> getPlatformBounds(IWorld world, int x, int y, TileLayer layer, TileState state, MovableWorldObject object, BoundingBox objectBox, BoundingBox objectBoxMotion) -
getChiselBoundBoxes
-
canBreak
public boolean canBreak(IWorld world, int x, int y, TileLayer layer, AbstractPlayerEntity player, boolean isRightTool) -
canPlace
-
canPlaceInLayer
-
register
-
createItemTile
-
hasItem
protected boolean hasItem() -
getItem
-
onRemoved
-
onAdded
-
onInteractWith
public boolean onInteractWith(IWorld world, int x, int y, TileLayer layer, double mouseX, double mouseY, AbstractPlayerEntity player) -
onInteractWithBreakKey
public boolean onInteractWithBreakKey(IWorld world, int x, int y, TileLayer layer, double mouseX, double mouseY, AbstractPlayerEntity player) -
getInteractionPriority
public int getInteractionPriority(IWorld world, int x, int y, TileLayer layer, double mouseX, double mouseY, AbstractPlayerEntity player) -
canReplace
-
doesSustainLeaves
-
chisel
Attempts to chisel a corner of the tile based on the cursor position. Only works if the tile isisChiselable() -
onDestroyed
-
getDrops
-
provideTileEntity
-
canProvideTileEntity
public boolean canProvideTileEntity() -
onChangeAround
-
canStay
-
isFullTile
public boolean isFullTile() -
obscuresBackground
-
updateRandomly
-
updateRandomlyInPlayerView
public void updateRandomlyInPlayerView(IWorld world, int x, int y, TileLayer layer, TileState state, IParticleManager manager) -
doBreak
public void doBreak(IWorld world, int x, int y, TileLayer layer, AbstractPlayerEntity breaker, boolean isRightTool, boolean allowDrop) -
doPlace
public void doPlace(IWorld world, int x, int y, TileLayer layer, ItemInstance instance, AbstractPlayerEntity placer) -
getPlacementState
public TileState getPlacementState(IWorld world, int x, int y, TileLayer layer, ItemInstance instance, AbstractPlayerEntity placer) -
getHardness
-
setHardness
-
setForceDrop
-
isChiselable
public boolean isChiselable() -
setChiselable
Call this to make your tile chiselable. Make sure you do this before you call theregister()method.- Returns:
- The tile
-
isChiseled
-
isToolEffective
public boolean isToolEffective(IWorld world, int x, int y, TileLayer layer, ToolProperty property, int level) -
addEffectiveTool
-
getLight
-
getTranslucentModifier
-
isAir
public boolean isAir() -
getName
-
toString
-
onScheduledUpdate
-
canClimb
public boolean canClimb(IWorld world, int x, int y, TileLayer layer, TileState state, BoundingBox entityBox, BoundingBox entityBoxMotion, List<BoundingBox> tileBoxes, Entity entity) -
onCollideWithEntity
public void onCollideWithEntity(IWorld world, int x, int y, TileLayer layer, TileState state, BoundingBox entityBox, BoundingBox entityBoxMotion, List<BoundingBox> tileBoxes, Entity entity) -
onIntersectWithEntity
public void onIntersectWithEntity(IWorld world, int x, int y, TileLayer layer, TileState state, BoundingBox entityBox, BoundingBox entityBoxMotion, List<BoundingBox> tileBoxes, Entity entity) -
describeItem
public void describeItem(IAssetManager manager, ItemInstance instance, List<String> desc, boolean isAdvanced) -
canGrassSpreadTo
-
canKeepPlants
-
canKeepFarmablePlants
-
getDefState
-
addProps
-
getProps
-
hasProp
-
hasState
-
getBreakSound
-
getPlaceSound
public ResourceName getPlaceSound(IWorld world, int x, int y, TileLayer layer, Entity placer, TileState state) -
getMaxInteractionDistance
public double getMaxInteractionDistance(IWorld world, int x, int y, TileLayer layer, double mouseX, double mouseY, AbstractPlayerEntity player) -
hasSolidSurface
-
canLiquidSpread
-
isLiquid
public boolean isLiquid() -
canSwim
-
setMaxAmount
-
factorsIntoHeightMap
-
makesGrassSnowy
-