-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #300 from AlphaMode/1.19.2
1.19.2 port
- Loading branch information
Showing
121 changed files
with
3,350 additions
and
787 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 22 additions & 10 deletions
32
common/src/main/java/org/valkyrienskies/mod/event/RegistryEvents.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,41 @@ | ||
package org.valkyrienskies.mod.event; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import kotlin.Unit; | ||
import net.minecraft.core.RegistryAccess; | ||
import org.valkyrienskies.mod.common.hooks.VSGameEvents; | ||
|
||
public class RegistryEvents { | ||
|
||
private static List<Runnable> onTagsLoaded = new ArrayList<>(); | ||
private static List<Runnable> onRegistriesComplete = new ArrayList<>(); | ||
|
||
// this can be beter... | ||
/** | ||
* @deprecated Use VSGameEvents | ||
*/ | ||
@Deprecated(forRemoval = true) | ||
public static void onTagsLoaded(final Runnable event) { | ||
onTagsLoaded.add(event); | ||
VSGameEvents.INSTANCE.getTagsAreLoaded().on(x -> event.run()); | ||
} | ||
|
||
/** | ||
* @deprecated Use VSGameEvents | ||
*/ | ||
@Deprecated(forRemoval = true) | ||
public static void tagsAreLoaded(final RegistryAccess registries, final boolean client) { | ||
onTagsLoaded.forEach(Runnable::run); | ||
VSGameEvents.INSTANCE.getTagsAreLoaded().emit(Unit.INSTANCE); | ||
} | ||
|
||
/** | ||
* @deprecated Use VSGameEvents | ||
*/ | ||
@Deprecated(forRemoval = true) | ||
public static void onRegistriesComplete(final Runnable event) { | ||
onRegistriesComplete.add(event); | ||
VSGameEvents.INSTANCE.getRegistriesCompleted().on(x -> event.run()); | ||
} | ||
|
||
/** | ||
* @deprecated Use VSGameEvents | ||
*/ | ||
@Deprecated(forRemoval = true) | ||
public static void registriesAreComplete() { | ||
onRegistriesComplete.forEach(Runnable::run); | ||
VSGameEvents.INSTANCE.getRegistriesCompleted().emit(Unit.INSTANCE); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.