BlockState for breaking blocks by Water

This commit is contained in:
Jascha Starke 2013-09-22 13:02:53 +02:00
parent c2ac988439
commit d53929a1b9
3 changed files with 8 additions and 8 deletions

View file

@ -2,7 +2,7 @@ package de.jaschastarke.minecraft.limitedcreative;
import de.jaschastarke.bukkit.lib.CoreModule; import de.jaschastarke.bukkit.lib.CoreModule;
import de.jaschastarke.bukkit.lib.commands.AliasHelpedCommand; import de.jaschastarke.bukkit.lib.commands.AliasHelpedCommand;
import de.jaschastarke.bukkit.lib.modules.AttachedBlocksDestroy; import de.jaschastarke.bukkit.lib.modules.AdditionalBlockBreaks;
import de.jaschastarke.minecraft.limitedcreative.blockstate.BlockListener; import de.jaschastarke.minecraft.limitedcreative.blockstate.BlockListener;
import de.jaschastarke.minecraft.limitedcreative.blockstate.BlockStateCommand; import de.jaschastarke.minecraft.limitedcreative.blockstate.BlockStateCommand;
import de.jaschastarke.minecraft.limitedcreative.blockstate.BlockStateConfig; import de.jaschastarke.minecraft.limitedcreative.blockstate.BlockStateConfig;
@ -42,8 +42,8 @@ public class ModBlockStates extends CoreModule<LimitedCreative> {
config = new BlockStateConfig(this, entry); config = new BlockStateConfig(this, entry);
plugin.getPluginConfig().registerSection(config); plugin.getPluginConfig().registerSection(config);
if (plugin.getModule(AttachedBlocksDestroy.class) == null) { if (plugin.getModule(AdditionalBlockBreaks.class) == null) {
plugin.addModule(new AttachedBlocksDestroy(plugin)); plugin.addModule(new AdditionalBlockBreaks(plugin));
} }
listeners.addListener(new BlockListener(this)); listeners.addListener(new BlockListener(this));

View file

@ -5,7 +5,7 @@ import java.util.WeakHashMap;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import de.jaschastarke.bukkit.lib.CoreModule; import de.jaschastarke.bukkit.lib.CoreModule;
import de.jaschastarke.bukkit.lib.modules.AttachedBlocksDestroy; import de.jaschastarke.bukkit.lib.modules.AdditionalBlockBreaks;
import de.jaschastarke.minecraft.limitedcreative.limits.BlockListener; import de.jaschastarke.minecraft.limitedcreative.limits.BlockListener;
import de.jaschastarke.minecraft.limitedcreative.limits.EntityListener; import de.jaschastarke.minecraft.limitedcreative.limits.EntityListener;
import de.jaschastarke.minecraft.limitedcreative.limits.LimitConfig; import de.jaschastarke.minecraft.limitedcreative.limits.LimitConfig;
@ -41,8 +41,8 @@ public class ModCreativeLimits extends CoreModule<LimitedCreative> {
if (blockDrops == null) if (blockDrops == null)
blockDrops = plugin.addModule(new FeatureBlockItemSpawn(plugin)).getModule(); blockDrops = plugin.addModule(new FeatureBlockItemSpawn(plugin)).getModule();
if (plugin.getModule(AttachedBlocksDestroy.class) == null) { if (plugin.getModule(AdditionalBlockBreaks.class) == null) {
plugin.addModule(new AttachedBlocksDestroy(plugin)); plugin.addModule(new AdditionalBlockBreaks(plugin));
} }
if (!config.getEnabled()) { if (!config.getEnabled()) {

View file

@ -19,7 +19,7 @@ import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.metadata.FixedMetadataValue; import org.bukkit.metadata.FixedMetadataValue;
import de.jaschastarke.bukkit.lib.events.AttachedBlockDestroyedEvent; import de.jaschastarke.bukkit.lib.events.BlockDestroyedEvent;
import de.jaschastarke.minecraft.limitedcreative.ModBlockStates; import de.jaschastarke.minecraft.limitedcreative.ModBlockStates;
public class BlockListener implements Listener { public class BlockListener implements Listener {
@ -52,7 +52,7 @@ public class BlockListener implements Listener {
} }
@EventHandler @EventHandler
public void onAttachedBlockBreak(AttachedBlockDestroyedEvent event) { public void onOtherBlockDestroy(BlockDestroyedEvent event) {
try { try {
BlockState s = mod.getModel().getState(event.getBlock()); BlockState s = mod.getModel().getState(event.getBlock());
if (s != null) { if (s != null) {