1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-19 19:25:48 +00:00
This commit is contained in:
TheBusyBiscuit 2020-11-30 17:39:31 +01:00
parent 1d4cb85cb1
commit b4edc6c5bf
3 changed files with 36 additions and 2 deletions

View File

@ -82,6 +82,7 @@
* Fixed #2574
* Fixed color in android script downloading screen
* Fixed #2576
* Fixed #2496
## Release Candidate 17 (17 Oct 2020)

View File

@ -85,8 +85,19 @@ public class BlockPhysicsListener implements Listener {
public void onLiquidFlow(BlockFromToEvent e) {
Block block = e.getToBlock();
if (SlimefunTag.FLUID_SENSITIVE_MATERIALS.isTagged(block.getType()) && BlockStorage.hasBlockInfo(block)) {
e.setCancelled(true);
// Check if this Material can be destroyed by fluids
if (SlimefunTag.FLUID_SENSITIVE_MATERIALS.isTagged(block.getType())) {
// Check if this Block holds any data
if (BlockStorage.hasBlockInfo(block)) {
e.setCancelled(true);
} else {
Location loc = block.getLocation();
// Fixes #2496 - Make sure it is not a moving block
if (SlimefunPlugin.getTickerTask().isReserved(loc)) {
e.setCancelled(true);
}
}
}
}

View File

@ -227,14 +227,36 @@ public class TickerTask implements Runnable {
@ParametersAreNonnullByDefault
public void queueMove(Location from, Location to) {
Validate.notNull(from, "Source Location cannot be null!");
Validate.notNull(to, "Target Location cannot be null!");
movingQueue.put(from, to);
}
@ParametersAreNonnullByDefault
public void queueDelete(Location l, boolean destroy) {
Validate.notNull(l, "Location must not be null!");
deletionQueue.put(l, destroy);
}
/**
* This method checks if the given {@link Location} has been reserved
* by this {@link TickerTask}.
* A reserved {@link Location} does not currently hold any data but will
* be occupied upon the next tick.
* Checking this ensures that our {@link Location} does not get treated like a normal
* {@link Location} as it is theoretically "moving".
*
* @param l
* The {@link Location} to check
*
* @return Whether this {@link Location} has been reserved and will be filled upon the next tick
*/
public boolean isReserved(@Nonnull Location l) {
return movingQueue.containsValue(l);
}
/**
* This returns the delay between ticks
*