mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-19 10:43:14 +00:00
Saplings
This commit is contained in:
parent
ffc8a5188d
commit
8da9156bb5
@ -1,8 +1,12 @@
|
||||
package com.volmit.iris.core;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.IrisEngine;
|
||||
import com.volmit.iris.engine.IrisWorldManager;
|
||||
import com.volmit.iris.engine.IrisWorlds;
|
||||
import com.volmit.iris.engine.framework.IrisAccess;
|
||||
import com.volmit.iris.engine.object.IrisBiome;
|
||||
import com.volmit.iris.engine.object.IrisDimension;
|
||||
import org.bukkit.TreeType;
|
||||
import org.bukkit.block.data.type.Sapling;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -20,11 +24,25 @@ public class SaplingManager implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onStructureGrowEvent(StructureGrowEvent event) {
|
||||
|
||||
// Must be iris world
|
||||
if (!IrisWorlds.isIrisWorld(event.getWorld())) return;
|
||||
|
||||
IrisAccess worldAccess;
|
||||
try {
|
||||
worldAccess = Objects.requireNonNull(IrisWorlds.access(event.getWorld()));
|
||||
} catch (Throwable e){
|
||||
Iris.reportError(e);
|
||||
return;
|
||||
}
|
||||
IrisDimension dim = worldAccess.getCompound().getDefaultEngine().getDimension();
|
||||
|
||||
// Must have override enabled
|
||||
if (!dim.isOverrideSaplings()) return;
|
||||
|
||||
// TODO: Remove this line
|
||||
Iris.info("Sapling grew @ " + event.getLocation() + " for " + event.getSpecies().name() + " bonemealed is " + event.isFromBonemeal() + " by player " + Objects.requireNonNull(event.getPlayer()).getName());
|
||||
|
||||
|
||||
Iris.info("Should replace sapling now!");
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user