Merge remote-tracking branch 'origin/master'
# Conflicts: # BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java
Dieser Commit ist enthalten in:
Commit
daa6979e5a
@ -3,12 +3,15 @@ package de.steamwar.bausystem.world;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.Powerable;
|
||||
import org.bukkit.block.data.type.Switch;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
|
||||
class AutoLoader_15 {
|
||||
|
||||
private AutoLoader_15() {
|
||||
}
|
||||
|
||||
@ -30,10 +33,32 @@ class AutoLoader_15 {
|
||||
Powerable powerable = (Powerable) data;
|
||||
powerable.setPowered(active);
|
||||
block.setBlockData(powerable);
|
||||
block.getState().update(true);
|
||||
|
||||
if (data instanceof Switch){
|
||||
Switch swtch = (Switch) data;
|
||||
Block relative;
|
||||
switch(swtch.getFace()){
|
||||
case FLOOR:
|
||||
relative = block.getRelative(BlockFace.DOWN);
|
||||
break;
|
||||
case CEILING:
|
||||
relative = block.getRelative(BlockFace.UP);
|
||||
break;
|
||||
default:
|
||||
relative = block.getRelative(swtch.getFacing());
|
||||
break;
|
||||
}
|
||||
updateBlock(relative);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static void updateBlock(Block block) {
|
||||
BlockData data = block.getBlockData();
|
||||
block.setType(Material.BARRIER, true);
|
||||
block.setBlockData(data, true);
|
||||
}
|
||||
|
||||
static void onPlayerInteract(IAutoLoader loader, PlayerInteractEvent event) {
|
||||
if (event.getAction() != Action.RIGHT_CLICK_BLOCK && event.getAction() != Action.PHYSICAL)
|
||||
return;
|
||||
|
@ -16,6 +16,7 @@ import de.steamwar.core.Core;
|
||||
import de.steamwar.scoreboard.SWScoreboard;
|
||||
import de.steamwar.sql.SteamwarUser;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameRule;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.configuration.InvalidConfigurationException;
|
||||
@ -281,6 +282,11 @@ public class BauSystem extends JavaPlugin implements Listener {
|
||||
TraceUtils.locationInit();
|
||||
|
||||
ShowManager.add(p);
|
||||
|
||||
if (Core.getVersion() == 15){
|
||||
ShowManager.add(p);
|
||||
Bukkit.getWorlds().get(0).setGameRule(GameRule.REDUCED_DEBUG_INFO, false);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren