Dust of Revealing Pt.2, also Whoops.

This commit is contained in:
Vatuu 2022-05-16 19:40:39 +02:00
parent 923860a90b
commit a63a6f751f
No known key found for this signature in database
GPG Key ID: C6F07B79B2ED9150
5 changed files with 6 additions and 8 deletions

View File

@ -98,7 +98,7 @@ public class DustRevealer {
Engine access = IrisToolbelt.access(world).getEngine();
if(access != null) {
String a = access.getObjectPlacementKey(block.getX(), block.getY(), block.getZ());
String a = access.getObjectPlacementKey(block.getX(), block.getY() - block.getWorld().getMinHeight(), block.getZ());
if(a != null) {
world.playSound(block.getLocation(), Sound.ITEM_LODESTONE_COMPASS_LOCK, 1f, 0.1f);

View File

@ -42,6 +42,7 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
@ -388,6 +389,8 @@ public class WandSVC implements IrisService {
@EventHandler
public void on(PlayerInteractEvent e) {
if(e.getHand() != EquipmentSlot.HAND)
return;
try {
if(isHoldingWand(e.getPlayer())) {
if(e.getAction().equals(Action.LEFT_CLICK_BLOCK)) {

View File

@ -60,7 +60,7 @@ public class IrisEngineMantle implements EngineMantle {
public IrisEngineMantle(Engine engine) {
this.engine = engine;
this.mantle = new Mantle(new File(engine.getWorld().worldFolder(), "mantle"), engine.getTarget().getHeight(), engine.getTarget().getMinY());
this.mantle = new Mantle(new File(engine.getWorld().worldFolder(), "mantle"), engine.getTarget().getHeight());
radius = radCache.aquire(this::computeParallaxSize);
components = new KList<>();
registerComponent(new MantleCarvingComponent(this));

View File

@ -42,8 +42,6 @@ public class EngineTarget {
return world.maxHeight() - world.minHeight();
}
public int getMinY() { return world.minHeight(); }
public void close() {
}

View File

@ -58,7 +58,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
public class Mantle {
private final File dataFolder;
private final int worldHeight;
private final int minY;
private final Map<Long, Long> lastUse;
@Getter
private final Map<Long, TectonicPlate> loadedRegions;
@ -77,12 +76,11 @@ public class Mantle {
* the world's height (in blocks)
*/
@BlockCoordinates
public Mantle(File dataFolder, int worldHeight, int minY) {
public Mantle(File dataFolder, int worldHeight) {
this.hyperLock = new HyperLock();
this.closed = new AtomicBoolean(false);
this.dataFolder = dataFolder;
this.worldHeight = worldHeight;
this.minY = minY;
this.io = new AtomicBoolean(false);
dataFolder.mkdirs();
unload = new KSet<>();
@ -354,7 +352,6 @@ public class Mantle {
@SuppressWarnings("unchecked")
@BlockCoordinates
public <T> T get(int x, int y, int z, Class<T> t) {
y -= minY;
if(closed.get()) {
throw new RuntimeException("The Mantle is closed");
}