9
0
mirror of https://github.com/Xiao-MoMi/Custom-Crops.git synced 2025-12-27 19:09:09 +00:00

add custom break reason

This commit is contained in:
XiaoMoMi
2024-10-02 01:31:49 +08:00
parent a2660648c7
commit b189020679
3 changed files with 3 additions and 3 deletions

View File

@@ -23,4 +23,5 @@ public enum BreakReason {
EXPLODE,
ACTION,
PHYSICS,
CUSTOM
}

View File

@@ -126,7 +126,7 @@ public class CropBlock extends AbstractCustomCropsBlock {
}
CropBreakEvent breakEvent = new CropBreakEvent(event.entityBreaker(), event.blockBreaker(), cropConfig, event.brokenID(), event.location(),
state, BreakReason.BREAK);
state, event.reason());
if (EventUtils.fireAndCheckCancel(breakEvent)) {
event.setCancelled(true);
return;

View File

@@ -74,8 +74,7 @@ public class CustomCropsBlockStateImpl implements CustomCropsBlockState {
@Override
public String toString() {
return "CustomCropsBlockState{" + owner.type().asString() +
"[" + compoundMap.asString() +
"]" + "}";
compoundMap.asString() + "}";
}
@Override