mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Actually gen
This commit is contained in:
parent
1155789a75
commit
6f08c1f758
@ -31,6 +31,7 @@ import org.bukkit.event.EventHandler;
|
|||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.block.BlockBreakEvent;
|
import org.bukkit.event.block.BlockBreakEvent;
|
||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
|
import org.bukkit.event.entity.EntitySpawnEvent;
|
||||||
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
||||||
import org.bukkit.event.world.ChunkLoadEvent;
|
import org.bukkit.event.world.ChunkLoadEvent;
|
||||||
import org.bukkit.event.world.WorldSaveEvent;
|
import org.bukkit.event.world.WorldSaveEvent;
|
||||||
@ -58,7 +59,7 @@ public abstract class EngineAssignedWorldManager extends EngineAssignedComponent
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void on(ProjectileLaunchEvent e) {
|
public void on(EntitySpawnEvent e) {
|
||||||
if (e.getEntity().getWorld().equals(getTarget().getWorld().realWorld())) {
|
if (e.getEntity().getWorld().equals(getTarget().getWorld().realWorld())) {
|
||||||
if(e.getEntityType().equals(EntityType.ENDER_SIGNAL))
|
if(e.getEntityType().equals(EntityType.ENDER_SIGNAL))
|
||||||
{
|
{
|
||||||
|
@ -39,6 +39,7 @@ import com.volmit.iris.util.documentation.BlockCoordinates;
|
|||||||
import com.volmit.iris.util.documentation.ChunkCoordinates;
|
import com.volmit.iris.util.documentation.ChunkCoordinates;
|
||||||
import com.volmit.iris.util.format.Form;
|
import com.volmit.iris.util.format.Form;
|
||||||
import com.volmit.iris.util.function.Consumer4;
|
import com.volmit.iris.util.function.Consumer4;
|
||||||
|
import com.volmit.iris.util.math.Position2;
|
||||||
import com.volmit.iris.util.math.RNG;
|
import com.volmit.iris.util.math.RNG;
|
||||||
import com.volmit.iris.util.scheduling.J;
|
import com.volmit.iris.util.scheduling.J;
|
||||||
import com.volmit.iris.util.scheduling.PrecisionStopwatch;
|
import com.volmit.iris.util.scheduling.PrecisionStopwatch;
|
||||||
@ -429,13 +430,13 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
|
|||||||
boolean placed = false;
|
boolean placed = false;
|
||||||
|
|
||||||
if (getEngine().getDimension().getStronghold() != null) {
|
if (getEngine().getDimension().getStronghold() != null) {
|
||||||
List<IrisPosition> poss = getEngine().getCompound().getStrongholdPositions();
|
List<Position2> poss = getEngine().getDimension().getStrongholds(getEngine().getWorld().seed());
|
||||||
|
|
||||||
if (poss != null) {
|
if (poss != null) {
|
||||||
for (IrisPosition pos : poss) {
|
for (Position2 pos : poss) {
|
||||||
if (x == pos.getX() >> 4 && z == pos.getZ() >> 4) {
|
if (x == pos.getX() >> 4 && z == pos.getZ() >> 4) {
|
||||||
IrisJigsawStructure structure = getData().getJigsawStructureLoader().load(getEngine().getDimension().getStronghold());
|
IrisJigsawStructure structure = getData().getJigsawStructureLoader().load(getEngine().getDimension().getStronghold());
|
||||||
placeAfter.addAll(placeStructure(pos, structure, rng));
|
placeAfter.addAll(placeStructure(pos.toIris(), structure, rng));
|
||||||
placed = true;
|
placed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
package com.volmit.iris.util.math;
|
package com.volmit.iris.util.math;
|
||||||
|
|
||||||
|
import com.volmit.iris.engine.object.IrisPosition;
|
||||||
|
|
||||||
public class Position2 {
|
public class Position2 {
|
||||||
private int x;
|
private int x;
|
||||||
private int z;
|
private int z;
|
||||||
@ -82,4 +84,8 @@ public class Position2 {
|
|||||||
public Position2 blockToChunk() {
|
public Position2 blockToChunk() {
|
||||||
return new Position2(x >> 4, z >> 4);
|
return new Position2(x >> 4, z >> 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IrisPosition toIris() {
|
||||||
|
return new IrisPosition(x, 0, z);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user