mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-05-31 14:16:24 +02:00
fix: Don't use list to proof block is copper. Instead check with name (#4641)
* fix: Don't use list to proof block is copper. Instead check with name * chore: Code-Cleanup
This commit is contained in:
parent
6ef0d58480
commit
2accedf264
@ -28,7 +28,6 @@ import com.plotsquared.core.plot.flag.implementations.CopperOxideFlag;
|
|||||||
import com.plotsquared.core.plot.flag.implementations.MiscInteractFlag;
|
import com.plotsquared.core.plot.flag.implementations.MiscInteractFlag;
|
||||||
import com.plotsquared.core.plot.flag.implementations.SculkSensorInteractFlag;
|
import com.plotsquared.core.plot.flag.implementations.SculkSensorInteractFlag;
|
||||||
import com.plotsquared.core.util.PlotFlagUtil;
|
import com.plotsquared.core.util.PlotFlagUtil;
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Item;
|
import org.bukkit.entity.Item;
|
||||||
@ -42,31 +41,11 @@ import org.bukkit.event.block.BlockReceiveGameEvent;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
public class BlockEventListener117 implements Listener {
|
public class BlockEventListener117 implements Listener {
|
||||||
|
|
||||||
private static final Set<Material> COPPER_OXIDIZING = Set.of(
|
|
||||||
Material.COPPER_BLOCK,
|
|
||||||
Material.EXPOSED_COPPER,
|
|
||||||
Material.WEATHERED_COPPER,
|
|
||||||
Material.OXIDIZED_COPPER,
|
|
||||||
Material.CUT_COPPER,
|
|
||||||
Material.EXPOSED_CUT_COPPER,
|
|
||||||
Material.WEATHERED_CUT_COPPER,
|
|
||||||
Material.OXIDIZED_CUT_COPPER,
|
|
||||||
Material.CUT_COPPER_STAIRS,
|
|
||||||
Material.EXPOSED_CUT_COPPER_STAIRS,
|
|
||||||
Material.WEATHERED_CUT_COPPER_STAIRS,
|
|
||||||
Material.OXIDIZED_CUT_COPPER_STAIRS,
|
|
||||||
Material.CUT_COPPER_SLAB,
|
|
||||||
Material.EXPOSED_CUT_COPPER_SLAB,
|
|
||||||
Material.WEATHERED_CUT_COPPER_SLAB,
|
|
||||||
Material.OXIDIZED_CUT_COPPER_SLAB
|
|
||||||
);
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public BlockEventListener117() {
|
public BlockEventListener117() {
|
||||||
}
|
}
|
||||||
@ -184,7 +163,7 @@ public class BlockEventListener117 implements Listener {
|
|||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (COPPER_OXIDIZING.contains(event.getNewState().getType())) {
|
if (event.getNewState().getType().name().contains("COPPER")) {
|
||||||
if (!plot.getFlag(CopperOxideFlag.class)) {
|
if (!plot.getFlag(CopperOxideFlag.class)) {
|
||||||
plot.debug("Copper could not oxide because copper-oxide = false");
|
plot.debug("Copper could not oxide because copper-oxide = false");
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user