Fixed bug where players couldn't place regular blocks next to secured networks, fixes #1332
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
### 1.5.6
|
||||
- Updated Forge to stable 2387 (raoulvdberge)
|
||||
- Fixed bug where players couldn't place regular blocks next to secured networks (raoulvdberge)
|
||||
- Removed Processing Pattern Encoder, that functionality is now available in the Pattern Grid (raoulvdberge)
|
||||
|
||||
### 1.5.5
|
||||
|
||||
@@ -16,26 +16,29 @@ public class NetworkNodeListener {
|
||||
@SubscribeEvent
|
||||
public void onWorldTick(TickEvent.WorldTickEvent e) {
|
||||
if (!e.world.isRemote) {
|
||||
if (e.phase == TickEvent.Phase.END) {
|
||||
e.world.profiler.startSection("network node ticking");
|
||||
|
||||
if (e.phase == TickEvent.Phase.END) {
|
||||
for (INetworkNode node : API.instance().getNetworkNodeManager(e.world).all()) {
|
||||
node.update();
|
||||
}
|
||||
}
|
||||
|
||||
e.world.profiler.endSection();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBlockPlace(BlockEvent.PlaceEvent e) {
|
||||
if (!e.getWorld().isRemote) {
|
||||
for (EnumFacing facing : EnumFacing.VALUES) {
|
||||
TileEntity tile = e.getWorld().getTileEntity(e.getBlockSnapshot().getPos().offset(facing));
|
||||
TileEntity placed = e.getWorld().getTileEntity(e.getPos());
|
||||
|
||||
if (tile != null && tile.hasCapability(CapabilityNetworkNodeProxy.NETWORK_NODE_PROXY_CAPABILITY, facing.getOpposite())) {
|
||||
INetworkNodeProxy nodeProxy = tile.getCapability(CapabilityNetworkNodeProxy.NETWORK_NODE_PROXY_CAPABILITY, facing.getOpposite());
|
||||
if (placed != null && placed.hasCapability(CapabilityNetworkNodeProxy.NETWORK_NODE_PROXY_CAPABILITY, null)) {
|
||||
for (EnumFacing facing : EnumFacing.VALUES) {
|
||||
TileEntity side = e.getWorld().getTileEntity(e.getBlockSnapshot().getPos().offset(facing));
|
||||
|
||||
if (side != null && side.hasCapability(CapabilityNetworkNodeProxy.NETWORK_NODE_PROXY_CAPABILITY, facing.getOpposite())) {
|
||||
INetworkNodeProxy nodeProxy = side.getCapability(CapabilityNetworkNodeProxy.NETWORK_NODE_PROXY_CAPABILITY, facing.getOpposite());
|
||||
INetworkNode node = nodeProxy.getNode();
|
||||
|
||||
if (node.getNetwork() != null && !node.getNetwork().getSecurityManager().hasPermission(Permission.BUILD, e.getPlayer())) {
|
||||
@@ -49,6 +52,7 @@ public class NetworkNodeListener {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBlockBreak(BlockEvent.BreakEvent e) {
|
||||
|
||||
Reference in New Issue
Block a user