mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-09 17:26:22 +00:00
Add strongholds (POG)
This commit is contained in:
@@ -16,6 +16,8 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.generator.BlockPopulator;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface EngineCompound extends Listener, Hotloadable, DataProvider
|
||||
{
|
||||
public IrisDimension getRootDimension();
|
||||
@@ -24,7 +26,7 @@ public interface EngineCompound extends Listener, Hotloadable, DataProvider
|
||||
|
||||
public World getWorld();
|
||||
|
||||
public IrisPosition getStrongholdPosition();
|
||||
public List<IrisPosition> getStrongholdPositions();
|
||||
|
||||
public void printMetrics(CommandSender sender);
|
||||
|
||||
|
||||
@@ -7,12 +7,13 @@ import lombok.Data;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class EngineData {
|
||||
private String dimension;
|
||||
private String lastVersion;
|
||||
private IrisPosition strongholdPosition;
|
||||
private List<IrisPosition> strongholdPositions;
|
||||
|
||||
public void save(File f)
|
||||
{
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.util.BlockVector;
|
||||
import org.bukkit.util.Consumer;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
@@ -345,6 +346,10 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
|
||||
{
|
||||
KList<Runnable> placeAfter = new KList<>();
|
||||
|
||||
if (structure == null){
|
||||
return null;
|
||||
}
|
||||
|
||||
if(structure.getFeature() != null)
|
||||
{
|
||||
if(structure.getFeature().getBlockRadius() == 32)
|
||||
@@ -366,13 +371,13 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
|
||||
|
||||
if(getEngine().getDimension().getStronghold() != null)
|
||||
{
|
||||
IrisPosition pos = getEngine().getCompound().getStrongholdPosition();
|
||||
|
||||
if(x == pos.getX() >> 4 && z == pos.getZ() >> 4)
|
||||
{
|
||||
IrisJigsawStructure structure = getData().getJigsawStructureLoader().load(getEngine().getDimension().getStronghold());
|
||||
placeAfter.addAll(placeStructure(pos, structure, rng));
|
||||
placed = true;
|
||||
List<IrisPosition> poss = getEngine().getCompound().getStrongholdPositions();
|
||||
for (IrisPosition 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));
|
||||
placed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user