mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-19 18:55:18 +00:00
comments, debug.
This commit is contained in:
parent
a82279b068
commit
6932e468cf
@ -25,11 +25,10 @@ public class TreeManager implements Listener {
|
|||||||
|
|
||||||
/**This function does the following
|
/**This function does the following
|
||||||
* <br>1. Is the sapling growing in an Iris world? No -> exit</br>
|
* <br>1. Is the sapling growing in an Iris world? No -> exit</br>
|
||||||
* <br>2. Is the sapling overwriting setting on in that dimension? No -> exit</br>
|
* <br>2. Is the Iris world accessible? No -> exit</br>
|
||||||
* <br>3. Check biome for overrides for that sapling type -> Found -> use</br>
|
* <br>3. Is the sapling overwriting setting on in that dimension? No -> exit</br>
|
||||||
* <br>4. Check region ...</br>
|
* <br>4. Check biome, region and dimension for overrides for that sapling type -> Found -> use</br>
|
||||||
* <br>5. Check dimension ...</br>
|
* <br>5. Exit if none are found, cancel event if one or more are.</br>
|
||||||
* <br>6. Exit if none are found</br>
|
|
||||||
* @param event Checks the given event for sapling overrides
|
* @param event Checks the given event for sapling overrides
|
||||||
*/
|
*/
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@ -66,7 +65,13 @@ public class TreeManager implements Listener {
|
|||||||
KMap<IrisTreeSize, KList<KList<Location>>> sizes = IrisTreeSize.getValidSizes(event.getLocation());
|
KMap<IrisTreeSize, KList<KList<Location>>> sizes = IrisTreeSize.getValidSizes(event.getLocation());
|
||||||
KList<IrisTreeSize> keys = sizes.k();
|
KList<IrisTreeSize> keys = sizes.k();
|
||||||
|
|
||||||
// Find best object placement based on size
|
// Check if any were returned
|
||||||
|
if (keys.isEmpty()) {
|
||||||
|
Iris.debug(this.getClass().getName() + " found no matching sapling sizes for the grow event, which should be impossible (considering ONE is an option)");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Find best object placement based on sizes
|
||||||
IrisObjectPlacement placement = null;
|
IrisObjectPlacement placement = null;
|
||||||
while (placement == null && keys.isNotEmpty()){
|
while (placement == null && keys.isNotEmpty()){
|
||||||
IrisTreeSize bestSize = IrisTreeSize.bestSizeInSizes(keys);
|
IrisTreeSize bestSize = IrisTreeSize.bestSizeInSizes(keys);
|
||||||
@ -74,8 +79,9 @@ public class TreeManager implements Listener {
|
|||||||
placement = getObjectPlacement(worldAccess, event.getLocation(), type, bestSize);
|
placement = getObjectPlacement(worldAccess, event.getLocation(), type, bestSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If none was found, just exit
|
// If none were found, just exit
|
||||||
if (placement == null) {
|
if (placement == null) {
|
||||||
|
Iris.debug(this.getClass().getName() + " had options but did not manage to find objectplacements for them");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user