From b8ff218ce68baa649c524857f3fc6e40579a9916 Mon Sep 17 00:00:00 2001 From: Faboslav Date: Sun, 13 Oct 2024 17:01:18 +0200 Subject: [PATCH 1/2] 3.0.5 --- CHANGELOG.md | 4 ++++ gradle.properties | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2372c40..dc210c46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.0.5 + +- Fixed server crash + ## 3.0.4 - Improved internal registries logic (Might fix some crashes) diff --git a/gradle.properties b/gradle.properties index 10a8a817..a2ba3937 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ org.gradle.caching=false mod_java_version=17 mod_name=Friends & Foes mod_id=friendsandfoes -mod_version=3.0.4 +mod_version=3.0.5 mod_author=Faboslav mod_description=Adds outvoted and forgotten mobs from the mob vote, expanding on their original concepts and introducing new vanilla-like features. maven_group=com.faboslav.friendsandfoes From 08ff7968cf2d3f60d8902ebdce2e77882772afc4 Mon Sep 17 00:00:00 2001 From: Faboslav Date: Sun, 13 Oct 2024 17:05:08 +0200 Subject: [PATCH 2/2] Fixed server crash --- .../events/client/RegisterRenderLayersEvent.java | 3 +++ .../neoforge/FriendsAndFoesNeoForge.java | 3 --- .../neoforge/FriendsAndFoesNeoForgeClient.java | 10 ++++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/events/client/RegisterRenderLayersEvent.java b/common/src/main/java/com/faboslav/friendsandfoes/common/events/client/RegisterRenderLayersEvent.java index 6520ea48..42d40296 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/events/client/RegisterRenderLayersEvent.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/events/client/RegisterRenderLayersEvent.java @@ -1,6 +1,8 @@ package com.faboslav.friendsandfoes.common.events.client; import com.faboslav.friendsandfoes.common.events.base.EventHandler; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; import net.minecraft.block.Block; import net.minecraft.client.render.RenderLayer; import net.minecraft.fluid.Fluid; @@ -15,6 +17,7 @@ * @author ThatGravyBoat * https://github.com/Team-Resourceful/ResourcefulLib */ +@Environment(EnvType.CLIENT) public record RegisterRenderLayersEvent(BiConsumer fluid, BiConsumer block) { public static final EventHandler EVENT = new EventHandler<>(); diff --git a/neoforge/src/main/java/com/faboslav/friendsandfoes/neoforge/FriendsAndFoesNeoForge.java b/neoforge/src/main/java/com/faboslav/friendsandfoes/neoforge/FriendsAndFoesNeoForge.java index febb5ba9..950f32ad 100644 --- a/neoforge/src/main/java/com/faboslav/friendsandfoes/neoforge/FriendsAndFoesNeoForge.java +++ b/neoforge/src/main/java/com/faboslav/friendsandfoes/neoforge/FriendsAndFoesNeoForge.java @@ -4,11 +4,9 @@ import com.faboslav.friendsandfoes.common.events.AddItemGroupEntriesEvent; import com.faboslav.friendsandfoes.common.events.RegisterVillagerTradesEvent; import com.faboslav.friendsandfoes.common.events.block.RegisterBlockSetTypeEvent; -import com.faboslav.friendsandfoes.common.events.client.RegisterRenderLayersEvent; import com.faboslav.friendsandfoes.common.events.lifecycle.*; import com.faboslav.friendsandfoes.common.init.FriendsAndFoesEntityTypes; import com.faboslav.friendsandfoes.common.init.FriendsAndFoesStructurePoolElements; -import com.faboslav.friendsandfoes.common.init.registry.neoforge.ResourcefulRegistriesImpl; import com.faboslav.friendsandfoes.common.util.CustomRaidMember; import com.faboslav.friendsandfoes.common.util.ServerWorldSpawnersUtil; import com.faboslav.friendsandfoes.common.util.UpdateChecker; @@ -89,7 +87,6 @@ private static void onSetup(final FMLCommonSetupEvent event) { ); } - RegisterRenderLayersEvent.EVENT.invoke(new RegisterRenderLayersEvent(RenderLayers::setRenderLayer, RenderLayers::setRenderLayer)); RegisterBlockSetTypeEvent.EVENT.invoke(new RegisterBlockSetTypeEvent(BlockSetType::register)); RegisterFlammabilityEvent.EVENT.invoke(new RegisterFlammabilityEvent((item, igniteOdds, burnOdds) -> ((FireBlockAccessor) Blocks.FIRE).invokeRegisterFlammableBlock(item, igniteOdds, burnOdds))); diff --git a/neoforge/src/main/java/com/faboslav/friendsandfoes/neoforge/FriendsAndFoesNeoForgeClient.java b/neoforge/src/main/java/com/faboslav/friendsandfoes/neoforge/FriendsAndFoesNeoForgeClient.java index f1f523d7..a6e301ce 100644 --- a/neoforge/src/main/java/com/faboslav/friendsandfoes/neoforge/FriendsAndFoesNeoForgeClient.java +++ b/neoforge/src/main/java/com/faboslav/friendsandfoes/neoforge/FriendsAndFoesNeoForgeClient.java @@ -3,15 +3,14 @@ import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.FriendsAndFoesClient; import com.faboslav.friendsandfoes.common.config.ConfigScreenBuilder; -import com.faboslav.friendsandfoes.common.events.client.RegisterEntityLayersEvent; -import com.faboslav.friendsandfoes.common.events.client.RegisterEntityRenderersEvent; -import com.faboslav.friendsandfoes.common.events.client.RegisterItemColorEvent; -import com.faboslav.friendsandfoes.common.events.client.RegisterParticlesEvent; +import com.faboslav.friendsandfoes.common.events.client.*; +import com.faboslav.friendsandfoes.common.events.lifecycle.ClientSetupEvent; import com.faboslav.friendsandfoes.common.init.FriendsAndFoesItems; import com.faboslav.friendsandfoes.common.init.registry.RegistryEntry; import com.faboslav.friendsandfoes.common.item.DispenserAddedSpawnEgg; import net.minecraft.client.particle.ParticleFactory; import net.minecraft.client.particle.SpriteProvider; +import net.minecraft.client.render.RenderLayers; import net.minecraft.particle.ParticleEffect; import net.minecraft.particle.ParticleType; import net.neoforged.bus.api.IEventBus; @@ -38,6 +37,9 @@ public static void init(IEventBus modEventBus, IEventBus eventBus) { } public static void onClientSetup(final FMLClientSetupEvent event) { + ClientSetupEvent.EVENT.invoke(new ClientSetupEvent(Runnable::run)); + RegisterRenderLayersEvent.EVENT.invoke(new RegisterRenderLayersEvent(RenderLayers::setRenderLayer, RenderLayers::setRenderLayer)); + event.enqueueWork(() -> { if (ModList.get().isLoaded("cloth_config")) { ModLoadingContext.get().registerExtensionPoint(ConfigScreenHandler.ConfigScreenFactory.class, () ->