mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 10:12:53 +00:00
Fixes
- Fixed NPE occuring when Jigsaw fails to find Object in pool. Now just produces a warning in the console like it should - Fixed pointless copies of lists being created within PlannedStructure - Fixed mobs spawning within other blocks and suffocating on spawn - Fixed creating a jigsaw with a non existent object causing jigsaw commands to lock up (#377) - Fixed editing a non existent jigsaw just not doing anything
This commit is contained in:
parent
82161c10f8
commit
b6bc269505
@ -53,8 +53,11 @@ public class CommandIrisJigsawEdit extends MortarCommand
|
||||
{
|
||||
File dest = piece.getLoadFile();
|
||||
new JigsawEditor(sender.player(), piece, IrisDataManager.loadAnyObject(piece.getObject()), dest);
|
||||
return true;
|
||||
}
|
||||
|
||||
sender.sendMessage("Failed to find existing jigsaw piece: " + args[0]);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -48,6 +48,12 @@ public class CommandIrisJigsawNew extends MortarCommand
|
||||
}
|
||||
|
||||
IrisObject object = IrisDataManager.loadAnyObject(args[2]);
|
||||
|
||||
if (object == null) {
|
||||
sender.sendMessage("Failed to find existing object: " + args[2]);
|
||||
return true;
|
||||
}
|
||||
|
||||
File dest = Iris.instance.getDataFile("packs", args[1], "jigsaw-pieces", args[0] + ".json");
|
||||
new JigsawEditor(sender.player(), null, object, dest);
|
||||
sender.sendMessage("* Right Click blocks to make them connectors");
|
||||
|
@ -80,6 +80,6 @@ public class IrisEntityInitialSpawn
|
||||
|
||||
private Entity spawn100(Engine g, Location at)
|
||||
{
|
||||
return getRealEntity(g).spawn(g, at.clone().add(0, 1, 0), rng.aquire(() -> new RNG(g.getTarget().getWorld().getSeed() + 4)));
|
||||
return getRealEntity(g).spawn(g, at.clone().add(0.5, 1, 0.5), rng.aquire(() -> new RNG(g.getTarget().getWorld().getSeed() + 4)));
|
||||
}
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ public class PlannedStructure {
|
||||
}
|
||||
|
||||
private void generateOutwards() {
|
||||
for(PlannedPiece i : getPiecesWithAvailableConnectors().shuffleCopy(rng))
|
||||
for(PlannedPiece i : getPiecesWithAvailableConnectors().shuffle(rng))
|
||||
{
|
||||
if(!generatePieceOutwards(i))
|
||||
{
|
||||
@ -317,7 +317,7 @@ public class PlannedStructure {
|
||||
{
|
||||
IrisJigsawPiece pi = getData().getJigsawPieceLoader().load(j);
|
||||
|
||||
if(terminating && !pi.isTerminal())
|
||||
if (pi == null || (terminating && !pi.isTerminal()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@ -325,8 +325,7 @@ public class PlannedStructure {
|
||||
p.addIfMissing(pi);
|
||||
}
|
||||
}
|
||||
|
||||
return p.shuffleCopy(rng);
|
||||
return p.shuffle(rng);
|
||||
}
|
||||
|
||||
private void generateStartPiece() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user