Fix a bunch of bugs

This commit is contained in:
Sam 2018-09-10 16:46:22 +01:00 committed by Alexander Meech
parent 0d708a99f4
commit eb23a25eb5
4 changed files with 8 additions and 32 deletions

View File

@ -586,7 +586,7 @@ public class FriendManager extends MiniDbClientPlugin<List<FriendStatus>>
pending++; pending++;
break; break;
case Accepted: case Accepted:
if (!friend.Online) if (!friend.isOnline())
{ {
offline++; offline++;
} }
@ -612,7 +612,7 @@ public class FriendManager extends MiniDbClientPlugin<List<FriendStatus>>
if (compress) if (compress)
{ {
if (type != FriendStatusType.Accepted || !friend.Online) if (type != FriendStatusType.Accepted || !friend.isOnline())
{ {
continue; continue;
} }

View File

@ -88,7 +88,7 @@ public class FriendMainPage extends ShopPageBase<FriendManager, FriendShop>
{ {
playAcceptSound(player); playAcceptSound(player);
_pageType = pageType; _pageType = pageType;
refresh(); _pageManager.setPage(0);
} }
}); });

View File

@ -669,15 +669,12 @@ public class SpeedBuilders extends SoloGame
public void checkPerfectBuild(Player player) public void checkPerfectBuild(Player player)
{ {
if (_perfectBuild.containsKey(player))
return;
Manager.runSyncLater(() -> Manager.runSyncLater(() ->
{ {
if (!IsLive() || !_buildRecreations.containsKey(player) || _perfectBuild.containsKey(player)) if (!IsLive() || _state != SpeedBuildersState.BUILDING || !_buildRecreations.containsKey(player) || _perfectBuild.containsKey(player))
{ {
return; return;
}; }
if (_buildRecreations.get(player).calculateScoreFromBuild(_currentBuild) == _currentBuild.getPerfectScore()) if (_buildRecreations.get(player).calculateScoreFromBuild(_currentBuild) == _currentBuild.getPerfectScore())
{ {

View File

@ -64,7 +64,7 @@ public class MapCrumbleModule extends Module
{ {
Block block = world.getBlockAt(x, y, z); Block block = world.getBlockAt(x, y, z);
if (block.getType() != Material.AIR && !block.isLiquid()) if (block.getType() != Material.AIR)
{ {
_worldBlocks.add(block); _worldBlocks.add(block);
} }
@ -194,36 +194,15 @@ public class MapCrumbleModule extends Module
} }
} }
@EventHandler(priority = EventPriority.MONITOR) @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void blockPlace(BlockPlaceEvent event) public void blockPlace(BlockPlaceEvent event)
{ {
if (event.isCancelled())
{
return;
}
addWorldBlock(event.getBlock()); addWorldBlock(event.getBlock());
} }
@EventHandler(priority = EventPriority.MONITOR) @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void blockPlace(BlockBreakEvent event) public void blockPlace(BlockBreakEvent event)
{ {
if (event.isCancelled())
{
return;
}
_worldBlocks.remove(event.getBlock()); _worldBlocks.remove(event.getBlock());
} }
@EventHandler(priority = EventPriority.MONITOR)
public void blockPhysics(BlockPhysicsEvent event)
{
if (event.isCancelled())
{
return;
}
addWorldBlock(event.getBlock());
}
} }