mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 10:12:53 +00:00
Jigsaw Enhancements
- Added keepEntity property for jigsaw connectors. When set to true, mobs spawned will not despawn - Fixed jigsaw entities being spawned off-center
This commit is contained in:
parent
294324e31b
commit
ced33114cc
@ -45,6 +45,10 @@ public class IrisJigsawPieceConnector
|
|||||||
@Desc("Pick an entity to spawn on this connector")
|
@Desc("Pick an entity to spawn on this connector")
|
||||||
private String spawnEntity;
|
private String spawnEntity;
|
||||||
|
|
||||||
|
@DontObfuscate
|
||||||
|
@Desc("Stop the entity from despawning")
|
||||||
|
private boolean keepEntity;
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@MaxNumber(50)
|
@MaxNumber(50)
|
||||||
@MinNumber(1)
|
@MinNumber(1)
|
||||||
|
@ -15,6 +15,7 @@ import lombok.Data;
|
|||||||
import org.bukkit.Axis;
|
import org.bukkit.Axis;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class PlannedStructure {
|
public class PlannedStructure {
|
||||||
@ -170,7 +171,13 @@ public class PlannedStructure {
|
|||||||
IrisPosition p = i.getWorldPosition(j).add(new IrisPosition(j.getDirection().toVector().multiply(2)));
|
IrisPosition p = i.getWorldPosition(j).add(new IrisPosition(j.getDirection().toVector().multiply(2)));
|
||||||
IrisEntity e = getData().getEntityLoader().load(j.getSpawnEntity());
|
IrisEntity e = getData().getEntityLoader().load(j.getSpawnEntity());
|
||||||
|
|
||||||
e.spawn(a.getCompound().getEngineForHeight(p.getY()), new Location(world, p.getX() + 0.5, p.getY(), p.getZ() + 0.5), rng);
|
if(a != null)
|
||||||
|
{
|
||||||
|
Entity entity = e.spawn(a.getCompound().getEngineForHeight(p.getY()), new Location(world, p.getX() + 0.5, p.getY(), p.getZ() + 0.5), rng);
|
||||||
|
if (j.isKeepEntity()) {
|
||||||
|
entity.setPersistent(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user