Skip to content

Commit

Permalink
Fix startup crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
Drullkus committed Dec 19, 2023
1 parent 2224202 commit 63fd178
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 17 deletions.
31 changes: 21 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ minecraft.accessTransformers.file rootProject.file('src/main/resources/META-INF/
runs {
// applies to all the run configs below
configureEach {
dependencies {
runtime "net.kyori:text-api:${TEXT}"
runtime "net.kyori:text-serializer-gson:${TEXT}"
runtime "net.kyori:text-serializer-legacy:${TEXT}"
runtime "net.kyori:text-serializer-plain:${TEXT}"

runtime "org.enginehub.piston:core:${PISTON}"
runtime "org.enginehub.piston.core-ap:runtime:${PISTON}"
runtime "org.enginehub.piston:default-impl:${PISTON}"
}

// Recommended logging data for a userdev environment
// The markers can be added/remove as needed separated by commas.
// "SCAN": For mods scan.
Expand Down Expand Up @@ -89,27 +100,27 @@ dependencies {
// For all intends and purposes: You can treat this dependency as if it is a normal library you would use.
implementation "net.neoforged:neoforge:${neo_version}"

implementation("net.kyori:text-api:${TEXT}")
implementation("net.kyori:text-serializer-gson:${TEXT}")
implementation("net.kyori:text-serializer-legacy:${TEXT}")
implementation("net.kyori:text-serializer-plain:${TEXT}")
implementation "net.kyori:text-api:${TEXT}"
implementation "net.kyori:text-serializer-gson:${TEXT}"
implementation "net.kyori:text-serializer-legacy:${TEXT}"
implementation "net.kyori:text-serializer-plain:${TEXT}"
implementation "com.sk89q.lib:jlibnoise:1.0.0"
implementation "org.enginehub.piston:core:${PISTON}"
implementation "org.enginehub.piston.core-ap:runtime:${PISTON}"
implementation "org.enginehub.piston:default-impl:${PISTON}"
implementation "org.yaml:snakeyaml:2.0"
implementation("org.enginehub.piston.core-ap:annotations:${PISTON}")
implementation("org.enginehub.piston.core-ap:processor:${PISTON}")
annotationProcessor("org.enginehub.piston.core-ap:annotations:${PISTON}")
annotationProcessor("org.enginehub.piston.core-ap:processor:${PISTON}")
implementation "org.enginehub.piston.core-ap:annotations:${PISTON}"
implementation "org.enginehub.piston.core-ap:processor:${PISTON}"
annotationProcessor "org.enginehub.piston.core-ap:annotations:${PISTON}"
annotationProcessor "org.enginehub.piston.core-ap:processor:${PISTON}"
implementation ("com.sk89q:jchronic:0.2.4a") {
exclude group: "junit", module: "junit"
}
compileOnly("com.google.auto.value:auto-value-annotations:${AUTO_VALUE}")
implementation("com.google.auto.value:auto-value-annotations:${AUTO_VALUE}")
annotationProcessor("com.google.auto.value:auto-value:${AUTO_VALUE}")
antlr("org.antlr:antlr4:4.9.1")
implementation("org.antlr:antlr4-runtime:4.9.1")
compileOnly("de.schlichtherle:truezip:6.8.4")
implementation("de.schlichtherle:truezip:6.8.4")
implementation("org.mozilla:rhino-runtime:1.7.13")

// Example mod dependency with JEI
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ loader_version_range=[1,)

# The unique mod identifier for the mod. Must be lowercase in English locale. Must fit the regex [a-z][a-z0-9_]{1,63}
# Must match the String constant located in the main mod class annotated with @Mod.
mod_id=examplemod
mod_id=worldedit
# The human-readable display name for the mod.
mod_name=Example Mod
mod_name=World Edit
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=All Rights Reserved
# The mod version. See https://semver.org/
mod_version=1.0.0
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
mod_group_id=com.example.examplemod
mod_group_id=com.sk89
# The authors of the mod. This is a simple text string that is used for display purposes in the mod list.
mod_authors=YourNameHere, OtherNameHere
mod_authors=EngineHub
# The description of the mod. This is a simple multiline text string that is used for display purposes in the mod list.
mod_description=Example mod description.\nNewline characters can be used and will be replaced properly.
mod_description=Ported to NeoForged by Drullkus
# Pack version - this changes each minecraft release, in general.
pack_format_number=18

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/sk89q/worldedit/forge/ThreadSafeCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ public Set<UUID> getOnlineIds() {
}

@SubscribeEvent
public void tickStart(TickEvent event) {
public void tickStart(TickEvent.ServerTickEvent event) {
long now = System.currentTimeMillis();

if (now - lastRefresh > REFRESH_DELAY) {
Set<UUID> onlineIds = new HashSet<>();

MinecraftServer server = ServerLifecycleHooks.getCurrentServer();
MinecraftServer server = event.getServer();
if (server == null) {
return;
}
Expand Down

0 comments on commit 63fd178

Please sign in to comment.