Package org.bukkit.material
Class TripwireHook
java.lang.Object
org.bukkit.material.MaterialData
org.bukkit.material.SimpleAttachableMaterialData
org.bukkit.material.TripwireHook
- All Implemented Interfaces:
java.lang.Cloneable
,Attachable
,Directional
,Redstone
public class TripwireHook extends SimpleAttachableMaterialData implements Redstone
Represents the tripwire hook
-
Constructor Summary
Constructors Constructor Description TripwireHook()
TripwireHook(int type)
Deprecated.Magic valueTripwireHook(int type, byte data)
Deprecated.Magic valueTripwireHook(BlockFace dir)
-
Method Summary
Modifier and Type Method Description TripwireHook
clone()
BlockFace
getAttachedFace()
Gets the face that this block is attached onboolean
isActivated()
Test if hook is currently activatedboolean
isConnected()
Test if tripwire is connectedboolean
isPowered()
Gets the current state of this Material, indicating if it's powered or unpoweredvoid
setActivated(boolean act)
Set hook activated statevoid
setConnected(boolean connected)
Set tripwire connection statevoid
setFacingDirection(BlockFace face)
Sets the direction that this block is facing injava.lang.String
toString()
Methods inherited from class org.bukkit.material.MaterialData
equals, getData, getItemType, getItemTypeId, hashCode, setData, toItemStack, toItemStack
-
Constructor Details
-
TripwireHook
public TripwireHook() -
TripwireHook
@Deprecated public TripwireHook(int type)Deprecated.Magic value- Parameters:
type
- the raw type id
-
TripwireHook
@Deprecated public TripwireHook(int type, byte data)Deprecated.Magic value- Parameters:
type
- the raw type iddata
- the raw data value
-
TripwireHook
-
-
Method Details
-
isConnected
public boolean isConnected()Test if tripwire is connected- Returns:
- true if connected, false if not
-
setConnected
public void setConnected(boolean connected)Set tripwire connection state- Parameters:
connected
- - true if connected, false if not
-
isActivated
public boolean isActivated()Test if hook is currently activated- Returns:
- true if activated, false if not
-
setActivated
public void setActivated(boolean act)Set hook activated state- Parameters:
act
- - true if activated, false if not
-
setFacingDirection
Description copied from interface:Directional
Sets the direction that this block is facing in- Specified by:
setFacingDirection
in interfaceDirectional
- Parameters:
face
- The facing direction
-
getAttachedFace
Description copied from interface:Attachable
Gets the face that this block is attached on- Specified by:
getAttachedFace
in interfaceAttachable
- Returns:
- BlockFace attached to
-
isPowered
public boolean isPowered()Description copied from interface:Redstone
Gets the current state of this Material, indicating if it's powered or unpowered -
clone
- Overrides:
clone
in classSimpleAttachableMaterialData
-
toString
public java.lang.String toString()- Overrides:
toString
in classSimpleAttachableMaterialData
-