Archived
Testing for sign breaking problems, added trace
This commit is contained in:
+16
-13
@@ -253,22 +253,25 @@ faces = {
|
|||||||
|
|
||||||
@hook.event("block.BlockBreakEvent", "highest")
|
@hook.event("block.BlockBreakEvent", "highest")
|
||||||
def on_break(event):
|
def on_break(event):
|
||||||
global checking_block
|
try:
|
||||||
if checking_block or event.isCancelled():
|
global checking_block
|
||||||
return
|
if checking_block or event.isCancelled():
|
||||||
|
return
|
||||||
|
|
||||||
block = event.getBlock()
|
block = event.getBlock()
|
||||||
if block.getMaterial() in (Material.SIGN_POST, Material.WALL_SIGN):
|
if block.getMaterial() in (Material.SIGN_POST, Material.WALL_SIGN):
|
||||||
check_sign(event, block, attached = False)
|
check_sign(event, block, attached = False)
|
||||||
|
|
||||||
for block_face, data_values in faces.iteritems():
|
for block_face, data_values in faces.iteritems():
|
||||||
block2 = block.getRelative(block_face)
|
block2 = block.getRelative(block_face)
|
||||||
if block2.getData() in data_values:
|
if block2.getData() in data_values:
|
||||||
check_sign(event, block2)
|
check_sign(event, block2)
|
||||||
|
|
||||||
block3 = block.getRelative(BlockFace.UP)
|
block3 = block.getRelative(BlockFace.UP)
|
||||||
if block3.getMaterial == Material.SIGN_POST:
|
if block3.getMaterial == Material.SIGN_POST:
|
||||||
check_sign(event, block3)
|
check_sign(event, block3)
|
||||||
|
except:
|
||||||
|
error(trace())
|
||||||
|
|
||||||
|
|
||||||
def check_sign(event, block, attached = True):
|
def check_sign(event, block, attached = True):
|
||||||
|
|||||||
Reference in New Issue
Block a user