mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Dust of Revealing Pt.2, also Whoops.
This commit is contained in:
parent
923860a90b
commit
a63a6f751f
@ -98,7 +98,7 @@ public class DustRevealer {
|
|||||||
Engine access = IrisToolbelt.access(world).getEngine();
|
Engine access = IrisToolbelt.access(world).getEngine();
|
||||||
|
|
||||||
if(access != null) {
|
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) {
|
if(a != null) {
|
||||||
world.playSound(block.getLocation(), Sound.ITEM_LODESTONE_COMPASS_LOCK, 1f, 0.1f);
|
world.playSound(block.getLocation(), Sound.ITEM_LODESTONE_COMPASS_LOCK, 1f, 0.1f);
|
||||||
|
|
||||||
|
@ -42,6 +42,7 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
|
import org.bukkit.inventory.EquipmentSlot;
|
||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
import org.bukkit.inventory.ItemFlag;
|
import org.bukkit.inventory.ItemFlag;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
@ -388,6 +389,8 @@ public class WandSVC implements IrisService {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void on(PlayerInteractEvent e) {
|
public void on(PlayerInteractEvent e) {
|
||||||
|
if(e.getHand() != EquipmentSlot.HAND)
|
||||||
|
return;
|
||||||
try {
|
try {
|
||||||
if(isHoldingWand(e.getPlayer())) {
|
if(isHoldingWand(e.getPlayer())) {
|
||||||
if(e.getAction().equals(Action.LEFT_CLICK_BLOCK)) {
|
if(e.getAction().equals(Action.LEFT_CLICK_BLOCK)) {
|
||||||
|
@ -60,7 +60,7 @@ public class IrisEngineMantle implements EngineMantle {
|
|||||||
|
|
||||||
public IrisEngineMantle(Engine engine) {
|
public IrisEngineMantle(Engine engine) {
|
||||||
this.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);
|
radius = radCache.aquire(this::computeParallaxSize);
|
||||||
components = new KList<>();
|
components = new KList<>();
|
||||||
registerComponent(new MantleCarvingComponent(this));
|
registerComponent(new MantleCarvingComponent(this));
|
||||||
|
@ -42,8 +42,6 @@ public class EngineTarget {
|
|||||||
return world.maxHeight() - world.minHeight();
|
return world.maxHeight() - world.minHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMinY() { return world.minHeight(); }
|
|
||||||
|
|
||||||
public void close() {
|
public void close() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||||||
public class Mantle {
|
public class Mantle {
|
||||||
private final File dataFolder;
|
private final File dataFolder;
|
||||||
private final int worldHeight;
|
private final int worldHeight;
|
||||||
private final int minY;
|
|
||||||
private final Map<Long, Long> lastUse;
|
private final Map<Long, Long> lastUse;
|
||||||
@Getter
|
@Getter
|
||||||
private final Map<Long, TectonicPlate> loadedRegions;
|
private final Map<Long, TectonicPlate> loadedRegions;
|
||||||
@ -77,12 +76,11 @@ public class Mantle {
|
|||||||
* the world's height (in blocks)
|
* the world's height (in blocks)
|
||||||
*/
|
*/
|
||||||
@BlockCoordinates
|
@BlockCoordinates
|
||||||
public Mantle(File dataFolder, int worldHeight, int minY) {
|
public Mantle(File dataFolder, int worldHeight) {
|
||||||
this.hyperLock = new HyperLock();
|
this.hyperLock = new HyperLock();
|
||||||
this.closed = new AtomicBoolean(false);
|
this.closed = new AtomicBoolean(false);
|
||||||
this.dataFolder = dataFolder;
|
this.dataFolder = dataFolder;
|
||||||
this.worldHeight = worldHeight;
|
this.worldHeight = worldHeight;
|
||||||
this.minY = minY;
|
|
||||||
this.io = new AtomicBoolean(false);
|
this.io = new AtomicBoolean(false);
|
||||||
dataFolder.mkdirs();
|
dataFolder.mkdirs();
|
||||||
unload = new KSet<>();
|
unload = new KSet<>();
|
||||||
@ -354,7 +352,6 @@ public class Mantle {
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@BlockCoordinates
|
@BlockCoordinates
|
||||||
public <T> T get(int x, int y, int z, Class<T> t) {
|
public <T> T get(int x, int y, int z, Class<T> t) {
|
||||||
y -= minY;
|
|
||||||
if(closed.get()) {
|
if(closed.get()) {
|
||||||
throw new RuntimeException("The Mantle is closed");
|
throw new RuntimeException("The Mantle is closed");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user