Added an option to prevent rabbits eating crops.
This commit is contained in:
parent
70b1022749
commit
e52627f08d
|
|
@ -109,6 +109,11 @@ public class EntityEventHandler implements Listener
|
|||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
else if(!GriefPrevention.instance.config_rabbitsEatCrops && event.getEntityType() == EntityType.RABBIT)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
//don't allow the wither to break blocks, when the wither is determined, too expensive to constantly check for claimed blocks
|
||||
else if(event.getEntityType() == EntityType.WITHER && GriefPrevention.instance.config_claims_worldModes.get(event.getBlock().getWorld()) != ClaimsMode.Disabled)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -162,6 +162,7 @@ public class GriefPrevention extends JavaPlugin
|
|||
public boolean config_endermenMoveBlocks; //whether or not endermen may move blocks around
|
||||
public boolean config_silverfishBreakBlocks; //whether silverfish may break blocks
|
||||
public boolean config_creaturesTrampleCrops; //whether or not non-player entities may trample crops
|
||||
public boolean config_rabbitsEatCrops; //whether or not rabbits may eat crops
|
||||
public boolean config_zombiesBreakDoors; //whether or not hard-mode zombies may break down wooden doors
|
||||
|
||||
public int config_ipLimit; //how many players can share an IP address
|
||||
|
|
@ -562,6 +563,7 @@ public class GriefPrevention extends JavaPlugin
|
|||
this.config_endermenMoveBlocks = config.getBoolean("GriefPrevention.EndermenMoveBlocks", false);
|
||||
this.config_silverfishBreakBlocks = config.getBoolean("GriefPrevention.SilverfishBreakBlocks", false);
|
||||
this.config_creaturesTrampleCrops = config.getBoolean("GriefPrevention.CreaturesTrampleCrops", false);
|
||||
this.config_rabbitsEatCrops = config.getBoolean("GriefPrevention.RabbitsEatCrops", true);
|
||||
this.config_zombiesBreakDoors = config.getBoolean("GriefPrevention.HardModeZombiesBreakDoors", false);
|
||||
|
||||
this.config_mods_ignoreClaimsAccounts = config.getStringList("GriefPrevention.Mods.PlayersIgnoringAllClaims");
|
||||
|
|
@ -801,6 +803,7 @@ public class GriefPrevention extends JavaPlugin
|
|||
outConfig.set("GriefPrevention.EndermenMoveBlocks", this.config_endermenMoveBlocks);
|
||||
outConfig.set("GriefPrevention.SilverfishBreakBlocks", this.config_silverfishBreakBlocks);
|
||||
outConfig.set("GriefPrevention.CreaturesTrampleCrops", this.config_creaturesTrampleCrops);
|
||||
outConfig.set("GriefPrevention.RabbitsEatCrops", this.config_rabbitsEatCrops);
|
||||
outConfig.set("GriefPrevention.HardModeZombiesBreakDoors", this.config_zombiesBreakDoors);
|
||||
|
||||
outConfig.set("GriefPrevention.Database.URL", this.databaseUrl);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user