SteamWar/BauSystem
Archiviert
13
0

Fixed CCE When Block is Changed #101

Manuell gemergt
Lixfel hat 3 Commits von detonator2.0 nach master 2020-09-25 16:25:02 +02:00 zusammengeführt
Nur Änderungen aus Commit dbaba2fbcc werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -25,6 +25,7 @@ import net.md_5.bungee.api.ChatMessageType;
import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.data.Powerable;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
@ -81,7 +82,14 @@ public class Detonator implements Listener {
Boolean powered; Boolean powered;
if(activation.activation == -1) switch (Core.getVersion()) { if(activation.activation == -1) switch (Core.getVersion()) {
case 15: case 15:
try {
powered = AutoLoader_15.getLever(activation.location.getBlock()); powered = AutoLoader_15.getLever(activation.location.getBlock());
}catch (ClassCastException e) {
Review

Kleiner Denkfehler von meiner seite.

Kleiner Denkfehler von meiner seite.
locs.forEach(detonatorActivation -> {
if(detonatorActivation.location.equals(activation.location)) locs.remove(detonatorActivation);
});
return;
}
AutoLoader_15.setRedstone(activation.location, !powered); AutoLoader_15.setRedstone(activation.location, !powered);
break; break;
default: default:
@ -111,7 +119,7 @@ public class Detonator implements Listener {
event.setCancelled(true); event.setCancelled(true);
switch (event.getAction()) { switch (event.getAction()) {
case LEFT_CLICK_BLOCK: case LEFT_CLICK_BLOCK:
Detoloader detoloader = null; Detoloader detoloader;
switch(Core.getVersion()){ switch(Core.getVersion()){
case 15: case 15:
detoloader = AutoLoader_15.onPlayerInteractLoader(event); detoloader = AutoLoader_15.onPlayerInteractLoader(event);