mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-06 07:46:08 +00:00
Marker exhaustion & auto-removal in invalid positions
This commit is contained in:
@@ -47,6 +47,9 @@ public class IrisMarker extends IrisRegistrant {
|
||||
@Desc("Remove this marker when the block it's assigned to is changed.")
|
||||
private boolean removeOnChange = true;
|
||||
|
||||
@Desc("If true, markers will only be placed here if there is 2 air blocks above it.")
|
||||
private boolean emptyAbove = true;
|
||||
|
||||
@Desc("If this marker is used, what is the chance it removes itself. For example 25% (0.25) would mean that on average 4 uses will remove a specific marker. Set this below 0 (-1) to never exhaust & set this to 1 or higher to always exhaust on first use.")
|
||||
private double exhaustionChance = 0.33;
|
||||
|
||||
|
||||
@@ -663,6 +663,13 @@ public class IrisObject extends IrisRegistrant {
|
||||
markers = new KMap<>();
|
||||
for(IrisObjectMarker j : config.getMarkers())
|
||||
{
|
||||
IrisMarker marker = getLoader().getMarkerLoader().load(j.getMarker());
|
||||
|
||||
if(marker == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
int max = j.getMaximumMarkers();
|
||||
|
||||
for(BlockVector i : getBlocks().k().shuffle())
|
||||
@@ -684,7 +691,7 @@ public class IrisObject extends IrisRegistrant {
|
||||
boolean a = !blocks.containsKey(new BlockVector(i.clone().add(new BlockVector(0, 1, 0))));
|
||||
boolean fff = !blocks.containsKey(new BlockVector(i.clone().add(new BlockVector(0, 2, 0))));
|
||||
|
||||
if((j.isEmptyAbove() && a && fff) || !j.isEmptyAbove())
|
||||
if((marker.isEmptyAbove() && a && fff) || !marker.isEmptyAbove())
|
||||
{
|
||||
markers.put(i, j.getMarker());
|
||||
max--;
|
||||
|
||||
@@ -51,9 +51,6 @@ public class IrisObjectMarker {
|
||||
@Desc("The maximum amount of markers to place. Use these sparingly!")
|
||||
private int maximumMarkers = 8;
|
||||
|
||||
@Desc("If true, markers will only be placed here if there is 2 air blocks above it.")
|
||||
private boolean emptyAbove = true;
|
||||
|
||||
@Desc("If true, markers will only be placed if the block matches the mark list perfectly.")
|
||||
private boolean exact = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user