79 lines
1.8 KiB
Markdown
79 lines
1.8 KiB
Markdown
# IScriptBlockState.isSameBlock
|
|
|
|
[← IScriptBlockState](index.md) · [← Master](../../wiki.md)
|
|
|
|
Parça 1/2 · [sonraki](isSameBlock-2.md)
|
|
|
|
isSameBlock(IScriptBlockState state)
|
|
boolean Check whether given block state has the same block, but not necessarily the same meta
|
|
|
|
value.
|
|
|
|
Method Detail
|
|
getMinecraftBlockState
|
|
|
|
IBlockState getMinecraftBlockState()
|
|
|
|
Get Minecraft block state instance. BEWARE: you need to know the MCP mappings in order to directly
|
|
call methods on this instance!
|
|
|
|
getBlockId
|
|
|
|
java.lang.String getBlockId()
|
|
|
|
Get block's ID like minecraft:stone.
|
|
|
|
var block = c.getWorld().getBlock(214, 3, 511);
|
|
|
|
c.getSubject().send("Block at (214, 3, 511) is " + block.getBlockId());
|
|
|
|
|
|
getMeta
|
|
|
|
int getMeta()
|
|
|
|
Get meta value of this state (it will always be between 0 and 15).
|
|
|
|
var andesite = mappet.createBlockState("minecraft:stone", 5);
|
|
|
|
// This will print "Andesite's meta is 5"
|
|
c.getSubject().send("Andesite's meta is " + andesite.getMeta());
|
|
|
|
|
|
isSame
|
|
|
|
boolean isSame(IScriptBlockState state)
|
|
|
|
Check whether this block state is same as given block state.
|
|
|
|
var andesite = mappet.createBlockState("minecraft:stone", 5);
|
|
|
|
if (c.getWorld().getBlock(214, 3, 511).isSame(andesite))
|
|
{
|
|
c.getSubject().send("Block at (214, 3, 511) is indeed andesite!");
|
|
}
|
|
|
|
|
|
isSameBlock
|
|
|
|
boolean isSameBlock(IScriptBlockState state)
|
|
|
|
Check whether given block state has the same block, but not necessarily the same meta value.
|
|
|
|
var andesite = mappet.createBlockState("minecraft:stone", 5);
|
|
var stone = mappet.createBlockState("minecraft:stone", 0);
|
|
|
|
// This will print true
|
|
c.getSubject().send(stone.isSameBlock(andesite));
|
|
|
|
|
|
isOpaque
|
|
|
|
boolean isOpaque()
|
|
|
|
Check whether given block state is occupying a full block entirely, rather than being see through or not
|
|
full (1, 1, 1) block space.
|
|
|
|
hasCollision
|
|
|