mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2024-11-22 18:46:39 +01:00
Fix issue when users could not select non-block items as icons for challenges and levels. (#190)
This commit is contained in:
parent
29a5057535
commit
0c47f811dc
2
pom.xml
2
pom.xml
@ -42,7 +42,7 @@
|
|||||||
<!-- Revision variable removes warning about dynamic version -->
|
<!-- Revision variable removes warning about dynamic version -->
|
||||||
<revision>${build.version}-SNAPSHOT</revision>
|
<revision>${build.version}-SNAPSHOT</revision>
|
||||||
<!-- This allows to change between versions and snapshots. -->
|
<!-- This allows to change between versions and snapshots. -->
|
||||||
<build.version>0.8.0</build.version>
|
<build.version>0.9.0</build.version>
|
||||||
<build.number>-LOCAL</build.number>
|
<build.number>-LOCAL</build.number>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
@ -28,7 +28,36 @@ public class SelectBlocksGUI
|
|||||||
|
|
||||||
public SelectBlocksGUI(User user, boolean singleSelect, BiConsumer<Boolean, Set<Material>> consumer)
|
public SelectBlocksGUI(User user, boolean singleSelect, BiConsumer<Boolean, Set<Material>> consumer)
|
||||||
{
|
{
|
||||||
this(user, singleSelect, new HashSet<>(), consumer);
|
this.consumer = consumer;
|
||||||
|
this.user = user;
|
||||||
|
this.singleSelect = singleSelect;
|
||||||
|
|
||||||
|
// Current GUI cannot display air blocks. It crashes with null-pointer
|
||||||
|
Set<Material> excludedMaterial = new HashSet<>();
|
||||||
|
|
||||||
|
excludedMaterial.add(Material.AIR);
|
||||||
|
excludedMaterial.add(Material.CAVE_AIR);
|
||||||
|
excludedMaterial.add(Material.VOID_AIR);
|
||||||
|
|
||||||
|
// Piston head and moving piston is not necessary. useless.
|
||||||
|
excludedMaterial.add(Material.PISTON_HEAD);
|
||||||
|
excludedMaterial.add(Material.MOVING_PISTON);
|
||||||
|
|
||||||
|
// Barrier cannot be accessible to user.
|
||||||
|
excludedMaterial.add(Material.BARRIER);
|
||||||
|
|
||||||
|
this.elements = new ArrayList<>();
|
||||||
|
this.selectedMaterials = new HashSet<>();
|
||||||
|
|
||||||
|
for (Material material : Material.values())
|
||||||
|
{
|
||||||
|
if (!material.isLegacy() && !excludedMaterial.contains(material))
|
||||||
|
{
|
||||||
|
this.elements.add(material);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.build(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user