Skip to content

Commit

Permalink
Merge pull request #158 from karayuumac/master
Browse files Browse the repository at this point in the history
ハーフ破壊抑制・バグ修正
  • Loading branch information
karayuumac authored Aug 27, 2017
2 parents f009363 + f33a314 commit 06a8134
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ commands:
default: op
permission: gigantic.lastquit
halfguard:
description: This is HaldGuard command.
description: This is HalfGuard command.
usage: /<command>
default: op
permission: gigantic.halfguard
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.github.unchama.listener.listeners;

import com.github.unchama.player.protect.HalfBlockProtectData;
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
import net.md_5.bungee.api.ChatColor;

import org.bukkit.*;
Expand Down Expand Up @@ -36,9 +37,11 @@ public class BlockBreakListener implements Listener {
ConfigManager config = Gigantic.yml.getManager(ConfigManager.class);
DebugManager debug = Gigantic.yml.getManager(DebugManager.class);
Zenchantments Ze;
WorldGuardPlugin Wg;

public BlockBreakListener() {
Ze = Util.getZenchantments();
Wg = Util.getWorldGuard();
}

@EventHandler(priority = EventPriority.LOWEST)
Expand Down Expand Up @@ -178,7 +181,12 @@ public void onBreakHalfBlock(BlockBreakEvent event) {
//整地ワールド名を取得しておく
final String SEICHIWORLDNAME = config.getSeichiWorldName();

if (b.getType().equals(Material.DOUBLE_STEP)) {
//自分の保護下でない
if (Wg.canBuild(p, b)) {
return;
}

if (b.getType().equals(Material.DOUBLE_STEP) && b.getData() == 0) {
//重ねハーフブロックの時下面は残す
b.setType(Material.STEP);
b.setData((byte) 0);
Expand Down

0 comments on commit 06a8134

Please sign in to comment.