Skip to content

Commit

Permalink
Remove lag from legacy Material support issue
Browse files Browse the repository at this point in the history
Spigot pulls in all the legacy marerials if you loop through the
material values.
  • Loading branch information
tastybento committed Sep 25, 2021
1 parent 354806c commit c660575
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/main/java/world/bentobox/greenhouses/greenhouse/Roof.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@
* @author tastybento
*
*/
@SuppressWarnings("deprecation")
public class Roof extends MinMaxXZ {
private static final List<Material> ROOF_BLOCKS;
static {
// Roof blocks
ROOF_BLOCKS = Arrays.stream(Material.values())
.filter(m -> !m.isLegacy())
.filter(Material::isBlock) // Blocks only, no items
.filter(m -> Tag.TRAPDOORS.isTagged(m) // All trapdoors
|| (m.name().contains("GLASS") && !m.name().contains("GLASS_PANE")) // All glass blocks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
import world.bentobox.greenhouses.Greenhouses;
import world.bentobox.greenhouses.world.AsyncWorldCache;

@SuppressWarnings("deprecation")
public class Walls extends MinMaxXZ {
private static final List<Material> WALL_BLOCKS;
static {
// Hoppers
WALL_BLOCKS = Arrays.stream(Material.values())
.filter(Material::isBlock) // Blocks only, no items
.filter(m -> !m.isLegacy())
.filter(m -> !m.name().contains("TRAPDOOR")) // No trap doors
.filter(m -> m.name().contains("DOOR") // All doors
|| (m.name().contains("GLASS") && !m.name().contains("GLASS_PANE")) // All glass blocks
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package world.bentobox.greenhouses.managers;

import java.util.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;

Expand Down

0 comments on commit c660575

Please sign in to comment.