Skip to content

Commit

Permalink
Make Photosynthesis work on passable blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Flo56958 committed Jul 3, 2023
1 parent 04ff879 commit dff87aa
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class Photosynthesis extends Modifier implements Listener {
private boolean mustStandStill;
private boolean notifyWhenActive;

private final List<Material> allowedMaterials = new ArrayList<>();
private final Set<Material> allowedMaterials = new HashSet<>();

private final Runnable runnable = () -> {
for (final UUID id : data.keySet()) {
Expand All @@ -60,7 +60,7 @@ public class Photosynthesis extends Modifier implements Listener {
if (pLoc.getWorld().getEnvironment() == World.Environment.NORMAL) { //check for overworld
for (int i = pLoc.getBlockY() + 1; i < pLoc.getWorld().getMaxHeight(); i++) {
Block b = pLoc.getWorld().getBlockAt(pLoc.getBlockX(), i, pLoc.getBlockZ());
if (!(allowedMaterials.contains(b.getType()))) {
if (!(allowedMaterials.contains(b.getType()) || b.isPassable())) {
isAboveGround = false;
break;
}
Expand Down

0 comments on commit dff87aa

Please sign in to comment.