Actually gen

This commit is contained in:
Daniel Mills 2021-08-04 02:13:08 -04:00
parent 1155789a75
commit 6f08c1f758
3 changed files with 12 additions and 4 deletions

View File

@ -31,6 +31,7 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.EntitySpawnEvent;
import org.bukkit.event.entity.ProjectileLaunchEvent;
import org.bukkit.event.world.ChunkLoadEvent;
import org.bukkit.event.world.WorldSaveEvent;
@ -58,7 +59,7 @@ public abstract class EngineAssignedWorldManager extends EngineAssignedComponent
}
@EventHandler
public void on(ProjectileLaunchEvent e) {
public void on(EntitySpawnEvent e) {
if (e.getEntity().getWorld().equals(getTarget().getWorld().realWorld())) {
if(e.getEntityType().equals(EntityType.ENDER_SIGNAL))
{

View File

@ -39,6 +39,7 @@ import com.volmit.iris.util.documentation.BlockCoordinates;
import com.volmit.iris.util.documentation.ChunkCoordinates;
import com.volmit.iris.util.format.Form;
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.scheduling.J;
import com.volmit.iris.util.scheduling.PrecisionStopwatch;
@ -429,13 +430,13 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
boolean placed = false;
if (getEngine().getDimension().getStronghold() != null) {
List<IrisPosition> poss = getEngine().getCompound().getStrongholdPositions();
List<Position2> poss = getEngine().getDimension().getStrongholds(getEngine().getWorld().seed());
if (poss != null) {
for (IrisPosition pos : poss) {
for (Position2 pos : poss) {
if (x == pos.getX() >> 4 && z == pos.getZ() >> 4) {
IrisJigsawStructure structure = getData().getJigsawStructureLoader().load(getEngine().getDimension().getStronghold());
placeAfter.addAll(placeStructure(pos, structure, rng));
placeAfter.addAll(placeStructure(pos.toIris(), structure, rng));
placed = true;
}
}

View File

@ -18,6 +18,8 @@
package com.volmit.iris.util.math;
import com.volmit.iris.engine.object.IrisPosition;
public class Position2 {
private int x;
private int z;
@ -82,4 +84,8 @@ public class Position2 {
public Position2 blockToChunk() {
return new Position2(x >> 4, z >> 4);
}
public IrisPosition toIris() {
return new IrisPosition(x, 0, z);
}
}