mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 21:38:00 +01:00
Palm trees are recognised as trees by the buck ability now
This commit is contained in:
parent
86c569127a
commit
1e043af154
3 changed files with 15 additions and 3 deletions
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
6
src/main/resources/data/unicopia/tree_types/palm.json
Normal file
6
src/main/resources/data/unicopia/tree_types/palm.json
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"logs": [ "unicopia:palm_log", "unicopia:palm_wood" ],
|
||||||
|
"leaves": [ "unicopia:palm_leaves" ],
|
||||||
|
"wideTrunk": false,
|
||||||
|
"drops": []
|
||||||
|
}
|
Loading…
Reference in a new issue