Skip to content

Commit

Permalink
Fixed event.cancel()
Browse files Browse the repository at this point in the history
  • Loading branch information
LatvianModder committed Jun 26, 2024
1 parent 13e2f24 commit 2f6dedb
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ mod_version=2100.7.0

neoforge_version=21.0.37-beta
parchment_version=2024.06.23
rhino_version=2100.2.5-build.29
architectury_version=13.0.1
rhino_version=2100.2.5-build.32
architectury_version=13.0.2

rei_version=16.0.729
jei_version=19.0.0.11
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ static MutableComponent of(Context cx, @Nullable Object o) {
} else {
return ofString(s);
}
} else if (o instanceof Tag tag) {
return (MutableComponent) NbtUtils.toPrettyComponent(tag);
} else if (o instanceof Map<?, ?> map && (map.containsKey("text") || map.containsKey("translate"))) {
MutableComponent text;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class EventHandler extends BaseFunction {
public final String name;
public final ScriptTypePredicate scriptTypePredicate;
public final Supplier<Class<? extends KubeEvent>> eventType;
private TypeInfo result;
protected TypeInfo result;
public transient EventTargetType<?> target;
public transient boolean targetRequired;
protected EventHandlerContainer[] eventContainers;
Expand Down Expand Up @@ -72,7 +72,9 @@ public EventHandler exceptionHandler(EventExceptionHandler handler) {

private <E> TargetedEventHandler<E> requiredTarget(EventTargetType<E> type, boolean required) {
var handler = new TargetedEventHandler<>(group, name, scriptTypePredicate, type, eventType);
handler.result = result;
handler.targetRequired = required;
handler.exceptionHandler = exceptionHandler;
handler.group.getHandlers().put(name, handler);
return handler;
}
Expand Down
17 changes: 12 additions & 5 deletions src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ displayTest = "NONE"
[[dependencies.kubejs]]
modId = "neoforge"
type = "required"
versionRange = "[20.6.75-beta,)"
versionRange = "[21.0,)"
ordering = "NONE"
side = "BOTH"

Expand All @@ -34,16 +34,23 @@ side = "BOTH"
[[dependencies.kubejs]]
modId = "jei"
type = "optional"
versionRange = "[1.0.0,)"
versionRange = "[19.0.0.11,)"
ordering = "AFTER"
side = "BOTH"
side = "CLIENT"

[[dependencies.kubejs]]
modId = "roughlyenoughitems"
type = "optional"
versionRange = "[9.1.572,)"
versionRange = "[16.0.729,)"
ordering = "AFTER"
side = "BOTH"
side = "CLIENT"

[[dependencies.kubejs]]
modId = "emi"
type = "optional"
versionRange = "[1.1,)"
ordering = "AFTER"
side = "CLIENT"

[[mixins]]
config = "kubejs.mixins.json"

0 comments on commit 2f6dedb

Please sign in to comment.