Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,16 @@ default NativeBlockState placementBaseState() {
*/
boolean isTreeBlock();

/**
* Whether this is tagged as a log, including a log of a plugin's custom block.
*/
boolean isLog();

/**
* Whether this is tagged as leaves, including leaves of a plugin's custom block.
*/
boolean isLeaves();

/**
* Whether foliage can be planted on top of this block.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,22 @@ public boolean isFoliage() {
public boolean isTreeBlock() {
Boolean cached = treeBlock;
if (cached == null) {
cached = state.is(BlockTags.LOGS) || state.is(BlockTags.LEAVES);
cached = isLog() || isLeaves();
treeBlock = cached;
}
return cached;
}

@Override
public boolean isLog() {
return state.is(BlockTags.LOGS);
}

@Override
public boolean isLeaves() {
return state.is(BlockTags.LEAVES);
}

@Override
public boolean isFoliagePlantable() {
return NativeBlockProperties.isFoliagePlantable(state);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,22 @@ public boolean isFoliage() {
public boolean isTreeBlock() {
Boolean cached = treeBlock;
if (cached == null) {
cached = state.is(BlockTags.LOGS) || state.is(BlockTags.LEAVES);
cached = isLog() || isLeaves();
treeBlock = cached;
}
return cached;
}

@Override
public boolean isLog() {
return state.is(BlockTags.LOGS);
}

@Override
public boolean isLeaves() {
return state.is(BlockTags.LEAVES);
}

@Override
public boolean isFoliagePlantable() {
return NativeBlockProperties.isFoliagePlantable(state);
Expand Down
Loading