Skip to content

Commit

Permalink
Update to Forge 47.3.29
Browse files Browse the repository at this point in the history
  • Loading branch information
Mgazul committed Feb 8, 2025
1 parent 72a99df commit be9e5d3
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
### Minecraft Forge Hybrid server implementing the Spigot/Bukkit API, formerly known as Thermos/Cauldron/MCPC+

[![](https://img.shields.io/github/stars/MohistMC/Mohist.svg?label=Stars&logo=github)](https://github.com/MohistMC/Mohist/stargazers)
[![](https://img.shields.io/badge/Forge-1.20.1--47.3.27-brightgreen.svg?colorB=26303d&logo=Conda-Forge)](https://files.minecraftforge.net/net/minecraftforge/forge/index_1.20.1.html)
[![](https://img.shields.io/badge/Forge-1.20.1--47.3.29-brightgreen.svg?colorB=26303d&logo=Conda-Forge)](https://files.minecraftforge.net/net/minecraftforge/forge/index_1.20.1.html)
[![](https://img.shields.io/badge/NeoForge-1.20.1--47.1.106-brightgreen.svg?colorB=26303d)](https://neoforged.net/)
[![](https://img.shields.io/badge/JDK-17.0.10-brightgreen.svg?colorB=469C00&logo=java)](https://www.azul.com/downloads/?version=java-17-lts#zulu)
[![](https://img.shields.io/badge/Gradle-8.8-brightgreen.svg?colorB=469C00&logo=gradle)](https://docs.gradle.org/8.8/release-notes.html)
Expand All @@ -20,7 +20,7 @@
Progress
------

- [x] Rectify Forge([**90e8fb1c3**](https://github.com/MinecraftForge/MinecraftForge/commit/90e8fb1c3))
- [x] Rectify Forge([**fa109380f**](https://github.com/MinecraftForge/MinecraftForge/commit/fa109380f))
- [x] Rectify NeoForge([**e7ac32353**](https://github.com/neoforged/NeoForge/commit/e7ac32353))
- [x] Start patch
* [x] Bukkit([**997de31d**](https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/commits/997de31d))
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ org.gradle.daemon=false
bukkit_version=997de31d
craftbukkit_version=ddc9a2dad
spigot_version=d2eba2c8
forge_version=47.3.27
forge_version=47.3.29
neoforge_version=47.1.106
mohist_group_id=com.mohistmc

Expand Down
7 changes: 6 additions & 1 deletion patches/minecraft/net/minecraft/server/Bootstrap.java.patch
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
--- a/net/minecraft/server/Bootstrap.java
+++ b/net/minecraft/server/Bootstrap.java
@@ -54,6 +_,8 @@
@@ -54,6 +_,13 @@
CauldronInteraction.m_175649_();
BuiltInRegistries.m_257498_();
CreativeModeTabs.m_280019_();
+ net.minecraftforge.registries.GameData.vanillaSnapshot();
+ // Forge: Hacky fix to ensure that NetworkConstants is loaded before mods are constructed.
+ // Many older mods use network internals that shouldn't be used, yet are exposed so they get used anyways.
+ // This can cause class-loading issues with ForgeMod loading NetworkConstants and HandshakeResolver.
+ // To ensure that doesn't happen, we load it here and now. This is not an issue in 1.20.2 and newer.
+ net.minecraftforge.network.NetworkHooks.init();
+ if (false) // skip redirectOutputToLog, Forge already redirects stdout and stderr output to log so that they print with more context
m_135890_();
f_285608_.set(Duration.between(instant, Instant.now()).toMillis());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2056,7 +2056,7 @@
+ String originalFormat = event.getFormat(), originalMessage = event.getMessage();
+ Bukkit.getPluginManager().callEvent(event);
+
+ KouKou.chat(originalMessage);
+ KouKou.chat("<%s>: %s".formatted(thisPlayer.getName(), originalMessage));
+ if (PlayerChatEvent.getHandlerList().getRegisteredListeners().length != 0) {
+ // Evil plugins still listening to deprecated event
+ final PlayerChatEvent queueEvent = new PlayerChatEvent(thisPlayer, event.getMessage(), event.getFormat(), event.getRecipients());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
+ private Item item; // Mohist

public EmeraldsForVillagerTypeItem(int p_35669_, int p_35670_, int p_35671_, Map<VillagerType, Item> p_35672_) {
+ //if (false) // FORGE: Modders can add custom villager types, so remove this validation
+ if (Boolean.valueOf(false)) // FORGE: Modders can add custom villager types, so remove this validation, weird condition is to make the compiler not strip this dead code, breaking some mixins
BuiltInRegistries.f_256934_.m_123024_().filter((p_35680_) -> {
return !p_35672_.containsKey(p_35680_);
}).findAny().ifPresent((p_258962_) -> {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/mohistmc/bukkit/LoginHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected PlayerPreLoginEvent.Result evaluate() {
}

public static void disconnect(ServerGamePacketListenerImpl serverGamePacketListener, String pTextComponent){
Waitable waitable = new Waitable() {
Waitable<Object> waitable = new Waitable<>() {
@Override
protected Object evaluate() {
serverGamePacketListener.disconnect(pTextComponent);
Expand Down
1 change: 1 addition & 0 deletions src/main/java/net/minecraftforge/common/ForgeHooks.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
import net.minecraft.world.level.biome.BiomeSpecialEffects;
import net.minecraft.world.level.biome.BiomeGenerationSettings;
import net.minecraft.world.level.biome.MobSpawnSettings;
import net.minecraftforge.common.extensions.IForgeEntity;
import net.minecraftforge.common.loot.IGlobalLootModifier;
import net.minecraftforge.common.loot.LootModifierManager;
import net.minecraftforge.common.loot.LootTableIdCondition;
Expand Down
1 change: 0 additions & 1 deletion src/main/java/net/minecraftforge/common/ForgeMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,6 @@ public ForgeMod(FMLJavaModLoadingContext context)
return uuid.toString();
});

LOGGER.debug(FORGEMOD, "Loading Network data for FML net version: {}", NetworkConstants.init());
CrashReportCallables.registerCrashCallable("FML", ForgeVersion::getSpec);
CrashReportCallables.registerCrashCallable("Forge", ()->ForgeVersion.getGroup()+":"+ForgeVersion.getVersion());

Expand Down
5 changes: 5 additions & 0 deletions src/main/java/net/minecraftforge/network/NetworkHooks.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ public class NetworkHooks
{
private static final Logger LOGGER = LogManager.getLogger();

public static void init()
{
LOGGER.debug("Loading Network data for FML net version: {}", NetworkConstants.init());
}

public static String getFMLVersion(final String ip)
{
return ip.contains("\0") ? Objects.equals(ip.split("\0")[1], NetworkConstants.NETVERSION) ? NetworkConstants.NETVERSION : ip.split("\0")[1] : NetworkConstants.NOVERSION;
Expand Down

0 comments on commit be9e5d3

Please sign in to comment.