Record Class BlockSnapshot
java.lang.Object
java.lang.Record
dev.despical.tntrun.blocks.BlockSnapshot
-
Constructor Summary
ConstructorsConstructorDescriptionBlockSnapshot(String key, String world, int x, int y, int z, String blockData) Creates an instance of aBlockSnapshotrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theblockDatarecord component.final booleanIndicates whether some other object is "equal to" this one.static BlockSnapshotfrom(org.bukkit.block.Block block) static BlockSnapshotfrom(org.bukkit.configuration.ConfigurationSection section) org.bukkit.block.BlockgetBlock()final inthashCode()Returns a hash code value for this object.key()Returns the value of thekeyrecord component.static Stringkey(org.bukkit.block.Block block) booleanmatches(org.bukkit.block.Block block) booleanrestore(boolean onlyIfAir) final StringtoString()Returns a string representation of this record class.world()Returns the value of theworldrecord component.voidwrite(org.bukkit.configuration.ConfigurationSection section) intx()Returns the value of thexrecord component.inty()Returns the value of theyrecord component.intz()Returns the value of thezrecord component.
-
Constructor Details
-
BlockSnapshot
Creates an instance of aBlockSnapshotrecord class.- Parameters:
key- the value for thekeyrecord componentworld- the value for theworldrecord componentx- the value for thexrecord componenty- the value for theyrecord componentz- the value for thezrecord componentblockData- the value for theblockDatarecord component
-
-
Method Details
-
from
-
from
-
key
-
getBlock
public org.bukkit.block.Block getBlock() -
matches
public boolean matches(org.bukkit.block.Block block) -
restore
public boolean restore(boolean onlyIfAir) -
write
public void write(org.bukkit.configuration.ConfigurationSection section) -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
world
Returns the value of theworldrecord component.- Returns:
- the value of the
worldrecord component
-
x
public int x()Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
y
public int y()Returns the value of theyrecord component.- Returns:
- the value of the
yrecord component
-
z
public int z()Returns the value of thezrecord component.- Returns:
- the value of the
zrecord component
-
blockData
Returns the value of theblockDatarecord component.- Returns:
- the value of the
blockDatarecord component
-