Skip to content

Commit

Permalink
Added block handler flag that might help for the issues with Elysium …
Browse files Browse the repository at this point in the history
…and Orespawn
  • Loading branch information
ata4 committed May 27, 2016
1 parent 1f9e768 commit ed704d5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ public class DragonMountsConfig {

// config properties
private boolean eggsInChests = false;
private boolean disableBlockOverride = false;
private boolean debug = false;

public DragonMountsConfig(Configuration config) {
eggsInChests = config.getBoolean("eggsInChests", "server", eggsInChests, "Spawns dragon eggs in generated chests when enabled");
debug = config.getBoolean("debug", "client", debug, "Debug mode. Unless you're a developer or are told to activate it, you don't want to set this to true.");
disableBlockOverride = config.getBoolean("disableBlockOverride", "client", debug, "Disables right-click override on the vanilla dragon egg block. May help to fix issues with other mods.");

if (config.hasChanged()) {
config.save();
Expand All @@ -45,4 +47,8 @@ public boolean isEggsInChests() {
public boolean isDebug() {
return debug;
}

public boolean isDisableBlockOverride() {
return disableBlockOverride;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

package info.ata4.minecraft.dragon.server.handler;

import info.ata4.minecraft.dragon.DragonMounts;
import info.ata4.minecraft.dragon.server.block.BlockDragonBreedEgg;
import info.ata4.minecraft.dragon.server.entity.EntityTameableDragon;
import info.ata4.minecraft.dragon.server.entity.breeds.EnumDragonBreed;
Expand Down Expand Up @@ -41,6 +42,12 @@ public void onPlayerInteract(PlayerInteractEvent evt) {
IBlockState state = world.getBlockState(pos);
Block block = world.getBlockState(pos).getBlock();

// don't interact with vanilla egg blocks if configured
if (DragonMounts.instance.getConfig().isDisableBlockOverride() &&
block == Blocks.dragon_egg) {
return;
}

// ignore non-egg blocks
if (block != Blocks.dragon_egg && block != BlockDragonBreedEgg.INSTANCE) {
return;
Expand Down

0 comments on commit ed704d5

Please sign in to comment.