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:
@@ -23,4 +23,5 @@ public enum BreakReason {
|
||||
EXPLODE,
|
||||
ACTION,
|
||||
PHYSICS,
|
||||
CUSTOM
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -74,8 +74,7 @@ public class CustomCropsBlockStateImpl implements CustomCropsBlockState {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CustomCropsBlockState{" + owner.type().asString() +
|
||||
"[" + compoundMap.asString() +
|
||||
"]" + "}";
|
||||
compoundMap.asString() + "}";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user