Fix Loader Redstone #89
@ -3,8 +3,10 @@ package de.steamwar.bausystem.world;
|
|||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.block.data.BlockData;
|
import org.bukkit.block.data.BlockData;
|
||||||
import org.bukkit.block.data.Powerable;
|
import org.bukkit.block.data.Powerable;
|
||||||
|
import org.bukkit.block.data.type.Switch;
|
||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
|
|
||||||
@ -33,7 +35,24 @@ class AutoLoader_15 {
|
|||||||
Powerable powerable = (Powerable) data;
|
Powerable powerable = (Powerable) data;
|
||||||
powerable.setPowered(active);
|
powerable.setPowered(active);
|
||||||
block.setBlockData(powerable);
|
block.setBlockData(powerable);
|
||||||
updateBlock(block.getLocation());
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
relative.getState().update(true);
|
||||||
|
updateBlock(relative.getLocation());
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren