Skip to content

Commit

Permalink
Fix Color registry on Neo to match
Browse files Browse the repository at this point in the history
  • Loading branch information
UnlikePaladin committed Nov 25, 2024
1 parent da6acbd commit 49bbee0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@
import net.neoforged.fml.common.Mod;
import net.neoforged.neoforge.client.event.RegisterColorHandlersEvent;

@Mod.EventBusSubscriber(modid = "pfm", bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
public class ColorRegistryNeoForge {
@SubscribeEvent
public static void registerBlockColors(RegisterColorHandlersEvent.Block event){
ColorRegistryImpl.blockColors = event.getBlockColors();
ColorRegistry.registerBlockColors();
ColorRegistryImpl.BLOCK_COLOR_PROVIDER_MAP.forEach((block, blockColorProvider) -> event.getBlockColors().registerColorProvider(blockColorProvider, block));
}
@SubscribeEvent

public static void registerItemColors(RegisterColorHandlersEvent.Item event){
ColorRegistryImpl.itemColors = event.getItemColors();
ColorRegistry.registerItemColors();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import com.google.common.base.Suppliers;
import com.unlikepaladin.pfm.PaladinFurnitureMod;
import com.unlikepaladin.pfm.client.PathPackRPWrapper;
import com.unlikepaladin.pfm.client.neoforge.ColorRegistryNeoForge;
import com.unlikepaladin.pfm.config.PaladinFurnitureModConfig;
import com.unlikepaladin.pfm.registry.dynamic.neoforge.LateBlockRegistryNeoForge;
import com.unlikepaladin.pfm.registry.neoforge.*;
import com.unlikepaladin.pfm.registry.neoforge.*;
import net.minecraft.resource.*;
import net.minecraft.resource.featuretoggle.FeatureFlags;
import com.unlikepaladin.pfm.runtime.PFMDataGenerator;
Expand All @@ -15,6 +15,7 @@
import net.minecraft.resource.metadata.PackResourceMetadata;
import net.minecraft.text.Text;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.bus.api.EventPriority;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.common.Mod;
import net.neoforged.fml.javafmlmod.FMLJavaModLoadingContext;
Expand Down Expand Up @@ -49,12 +50,15 @@ public PaladinFurnitureModNeoForge() {
NeoForge.EVENT_BUS.register(BlockEntityRegistryNeoForge.class);
NeoForge.EVENT_BUS.register(SoundRegistryNeoForge.class);
NeoForge.EVENT_BUS.register(NetworkRegistryNeoForge.class);
FMLJavaModLoadingContext.get().getModEventBus().addListener(EventPriority.LOW, ColorRegistryNeoForge::registerBlockColors);
FMLJavaModLoadingContext.get().getModEventBus().addListener(EventPriority.LOWEST, ColorRegistryNeoForge::registerItemColors);
NetworkRegistryNeoForge.registerPackets();
LateBlockRegistryNeoForge.addDynamicBlockRegistration();
PaladinFurnitureMod.isClient = FMLEnvironment.dist == Dist.CLIENT;
FMLJavaModLoadingContext.get().getModEventBus().addListener(ItemGroupRegistryNeoForge::registerItemGroups);
FMLJavaModLoadingContext.get().getModEventBus().addListener(ItemGroupRegistryNeoForge::addToVanillaItemGroups);
FMLJavaModLoadingContext.get().getModEventBus().addListener(PaladinFurnitureModNeoForge::generateResources);

}

@SubscribeEvent
Expand Down

0 comments on commit 49bbee0

Please sign in to comment.