SteamWar/BauSystem
Archiviert
13
0

Added Function on Tripwire for 1.12

Dieser Commit ist enthalten in:
Chaoscaot 2020-09-09 22:45:28 +02:00
Ursprung 5ccf3ddf3c
Commit c27a548866
3 geänderte Dateien mit 24 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -23,10 +23,13 @@ import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.event.block.Action;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.material.Tripwire;
import java.util.List;
import java.util.stream.Collectors;
class AutoLoader_12 {
@ -55,6 +58,20 @@ class AutoLoader_12 {
block.setData((byte) 1);
else
block.setData((byte) 0);
}else if(material == Material.TRIPWIRE) {
if(active) {
ArmorStand armorStand = (ArmorStand) Bukkit.getWorlds().get(0).spawnEntity(location, EntityType.ARMOR_STAND);
armorStand.setVisible(false);
armorStand.setBasePlate(false);
armorStand.addScoreboardTag("detonator-" + location.getBlockX() + location.getBlockY() + location.getBlockZ());
}else {
List<Entity> entityList = Bukkit.getWorlds().get(0).getEntitiesByClasses(ArmorStand.class).stream().filter(entity ->
entity.getScoreboardTags().contains("detonator-" + location.getBlockX() + location.getBlockY() + location.getBlockZ()))
.limit(1)
.collect(Collectors.toList());
if(entityList.isEmpty()) return false;
entityList.get(0).remove();
}
}else{
return false;
}
@ -80,6 +97,8 @@ class AutoLoader_12 {
return new Detoloader("Noteblock", 1);
}else if(material == Material.STONE_PLATE || material == Material.WOOD_PLATE){
return new Detoloader("Druckplatte", 20);
}else if (material == Material.TRIPWIRE) {
return new Detoloader("Tripwire", 10);
}
return new Detoloader("§eUnbekannter Block betätigt (nicht aufgenommen)", 0).setAddBack(false);
}

Datei anzeigen

@ -108,7 +108,7 @@ class AutoLoader_15 {
}else if (material == Material.NOTE_BLOCK) {
return new Detoloader("Noteblock", 1);
}else if (material.name().equals("TRIPWIRE")) {
return new Detoloader("Tripwire", 20);
return new Detoloader("Tripwire", 10);
} else {
return new Detoloader("§eUnbekannter Block betätigt", 0).setAddBack(false);
}

Datei anzeigen

@ -175,7 +175,7 @@ public class AutoLoader extends IAutoLoader implements Listener {
if(detoloader.useActive)
new IAutoLoader.RedstoneActivation(this, event.getClickedBlock().getLocation()
, detoloader.getActivation() == 0 ? getLastActivation() : detoloader.getActivation()
, detoloader.isActiv());
, detoloader.isActive());
else
new IAutoLoader.TemporaryActivation(this, event.getClickedBlock().getLocation()
, detoloader.getActivation());