Fixed the earth pony ability

This commit is contained in:
Sollace 2020-05-29 18:11:34 +02:00
parent 645a0d1496
commit 22c430750c
2 changed files with 5 additions and 5 deletions

View file

@ -123,7 +123,7 @@ public class TreeTraverser {
BlockState state = w.getBlockState(pos); BlockState state = w.getBlockState(pos);
boolean yay = false; boolean yay = false;
if (isLeaves(state, log) && state.get(LeavesBlock.PERSISTENT)) { if (isLeaves(state, log) && !state.get(LeavesBlock.PERSISTENT)) {
leaves.add(pos); leaves.add(pos);
yay = true; yay = true;
} else if (variantAndBlockEquals(state, log)) { } else if (variantAndBlockEquals(state, log)) {
@ -140,7 +140,7 @@ public class TreeTraverser {
public static boolean isWoodOrLeaf(World w, BlockState log, BlockPos pos) { public static boolean isWoodOrLeaf(World w, BlockState log, BlockPos pos) {
BlockState state = w.getBlockState(pos); BlockState state = w.getBlockState(pos);
return variantAndBlockEquals(state, log) || (isLeaves(state, log) && state.get(LeavesBlock.PERSISTENT)); return variantAndBlockEquals(state, log) || (isLeaves(state, log) && !state.get(LeavesBlock.PERSISTENT));
} }
private static boolean isLeaves(BlockState state, BlockState log) { private static boolean isLeaves(BlockState state, BlockState log) {

View file

@ -147,9 +147,9 @@ public interface Caster<E extends LivingEntity> extends Owned<E>, Levelled, Affi
default void notifyNearbySpells(Spell sender, BlockPos origin, double radius, int newState) { default void notifyNearbySpells(Spell sender, BlockPos origin, double radius, int newState) {
AwaitTickQueue.enqueueTask(w -> { AwaitTickQueue.enqueueTask(w -> {
VecHelper.findAllEntitiesInRange(getEntity(), getWorld(), origin, radius).filter(i -> i instanceof EtherialListener).forEach(i -> { VecHelper.findAllEntitiesInRange(getEntity(), getWorld(), origin, radius)
((EtherialListener)i).onNearbySpellChange(this, sender, newState); .filter(i -> i instanceof EtherialListener)
}); .forEach(i -> ((EtherialListener)i).onNearbySpellChange(this, sender, newState));
}); });
} }