Remove toggle from biome/region sapling config & prevent non-iris world

This commit is contained in:
CocoTheOwner 2021-07-17 18:01:11 +02:00
parent ea6937c0ac
commit 80ede42191
3 changed files with 6 additions and 12 deletions

View File

@ -1,6 +1,8 @@
package com.volmit.iris.core; package com.volmit.iris.core;
import com.volmit.iris.Iris; import com.volmit.iris.Iris;
import com.volmit.iris.engine.IrisWorldManager;
import com.volmit.iris.engine.IrisWorlds;
import org.bukkit.TreeType; import org.bukkit.TreeType;
import org.bukkit.block.data.type.Sapling; import org.bukkit.block.data.type.Sapling;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
@ -18,12 +20,10 @@ public class SaplingManager implements Listener {
@EventHandler @EventHandler
public void onStructureGrowEvent(StructureGrowEvent event) { public void onStructureGrowEvent(StructureGrowEvent event) {
if (event.getSpecies() == TreeType.JUNGLE) if (!IrisWorlds.isIrisWorld(event.getWorld())) return;
Iris.info("Sapling grew @ " + event.getLocation() + " for " + event.getSpecies().name() + " bonemealed is " + event.isFromBonemeal() + " by player " + Objects.requireNonNull(event.getPlayer()).getName());
} // 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());
@EventHandler
public void onBlockPlaceEvent(BlockPlaceEvent event) {
Iris.info("Placed " + event.getBlock().getBlockData().getMaterial().name() + " @ " + event.getBlock().getLocation());
} }
} }

View File

@ -84,9 +84,6 @@ public class IrisBiome extends IrisRegistrant implements IRare {
@Desc("Sapling override settings") @Desc("Sapling override settings")
private IrisSaplings saplings = new IrisSaplings(); private IrisSaplings saplings = new IrisSaplings();
@Desc("Enable sapling overrides")
private boolean useSaplings = false;
@ArrayType(min = 1, type = IrisEffect.class) @ArrayType(min = 1, type = IrisEffect.class)
@Desc("Effects are ambient effects such as potion effects, random sounds, or even particles around each player. All of these effects are played via packets so two players won't see/hear each others effects.\nDue to performance reasons, effects will play arround the player even if where the effect was played is no longer in the biome the player is in.") @Desc("Effects are ambient effects such as potion effects, random sounds, or even particles around each player. All of these effects are played via packets so two players won't see/hear each others effects.\nDue to performance reasons, effects will play arround the player even if where the effect was played is no longer in the biome the player is in.")
private KList<IrisEffect> effects = new KList<>(); private KList<IrisEffect> effects = new KList<>();

View File

@ -82,9 +82,6 @@ public class IrisRegion extends IrisRegistrant implements IRare {
@Desc("Sapling override settings") @Desc("Sapling override settings")
private IrisSaplings saplings = new IrisSaplings(); private IrisSaplings saplings = new IrisSaplings();
@Desc("Enable sapling overrides")
private boolean useSaplings = false;
@MinNumber(1) @MinNumber(1)
@MaxNumber(128) @MaxNumber(128)
@Desc("The rarity of the region") @Desc("The rarity of the region")