Palm trees are recognised as trees by the buck ability now

This commit is contained in:
Sollace 2023-05-25 13:10:18 +01:00
parent 86c569127a
commit 1e043af154
3 changed files with 15 additions and 3 deletions

View file

@ -156,10 +156,10 @@ public class EarthPonyKickAbility implements Ability<Pos> {
if (tree == TreeType.NONE) { if (tree == TreeType.NONE) {
return; return;
} else {
ParticleUtils.spawnParticle(iplayer.asWorld(), UParticles.GROUND_POUND, data.vec(), Vec3d.ZERO);
} }
ParticleUtils.spawnParticle(iplayer.asWorld(), UParticles.GROUND_POUND, data.vec(), Vec3d.ZERO);
PlayerEntity player = iplayer.asEntity(); PlayerEntity player = iplayer.asEntity();
if (BlockDestructionManager.of(player.world).getBlockDestruction(pos) + 4 >= BlockDestructionManager.MAX_DAMAGE) { if (BlockDestructionManager.of(player.world).getBlockDestruction(pos) + 4 >= BlockDestructionManager.MAX_DAMAGE) {
@ -245,6 +245,10 @@ public class EarthPonyKickAbility implements Ability<Pos> {
return Stream.of(tree.pickRandomStack(world.random, treeState)); return Stream.of(tree.pickRandomStack(world.random, treeState));
} }
if (below.getBlock() instanceof Buckable buckable) {
return buckable.onBucked((ServerWorld)world, below, down).stream();
}
return Stream.empty(); return Stream.empty();
} }

View file

@ -120,7 +120,9 @@ public interface TreeType {
traverseInner(logs, leaves, w, findCanopy(w, pos), 0, 50, null, null); traverseInner(logs, leaves, w, findCanopy(w, pos), 0, 50, null, null);
return logCount <= (leaves.size() / 2) ? logCount + leaves.size() : 0; int leafCount = leaves.size();
return logCount <= (leafCount / 2) ? logCount + leafCount : 0;
} }
/** /**

View file

@ -0,0 +1,6 @@
{
"logs": [ "unicopia:palm_log", "unicopia:palm_wood" ],
"leaves": [ "unicopia:palm_leaves" ],
"wideTrunk": false,
"drops": []
}