Skip to content

Commit

Permalink
Merge pull request #1972 from mystchonky/server-fix
Browse files Browse the repository at this point in the history
fixes the server launching
  • Loading branch information
WayofTime authored Sep 10, 2023
2 parents bfb6ece + 23648b0 commit d5f37c0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 42 deletions.
13 changes: 0 additions & 13 deletions src/main/java/wayoftime/bloodmagic/BloodMagic.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ public BloodMagic() {
modBus.addListener(this::processIMC);
// Register the doClientStuff method for modloading
modBus.addListener(this::doClientStuff);
modBus.addListener(this::initRenderLayer);
modBus.addListener(this::loadModels);
modBus.addListener(this::gatherData);
modBus.addListener(this::onRegisterCapabilities);

Expand Down Expand Up @@ -222,12 +220,6 @@ public void gatherData(GatherDataEvent event) {

}

private void loadModels(final RegisterGeometryLoaders event) {
event.register("mimicloader", new MimicModelLoader(BloodMagic.rl("block/solidopaquemimic")));
event.register("mimicloader_ethereal", new MimicModelLoader(BloodMagic.rl("block/etherealopaquemimic")));

event.register("loader_holding", new SigilHoldingModelLoader(BloodMagic.rl("item/sigilofholding_base")));
}

private void setup(final FMLCommonSetupEvent event) {
packetHandler.initialize();
Expand All @@ -242,13 +234,8 @@ private void doClientStuff(final FMLClientSetupEvent event) {
MinecraftForge.EVENT_BUS.register(new ClientEvents());
MinecraftForge.EVENT_BUS.register(new KeyBindingBloodMagic());
new BloodMagicKeyHandler();
// IEventBus modBus = FMLJavaModLoadingContext.get().getModEventBus();
//
}

private void initRenderLayer(EntityRenderersEvent.AddLayers event) {
ClientEvents.initRenderLayer(event);
}

private void registerColors(final RegisterColorHandlersEvent event) {
if (event instanceof RegisterColorHandlersEvent.Item)
Expand Down
49 changes: 20 additions & 29 deletions src/main/java/wayoftime/bloodmagic/client/ClientEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.client.event.EntityRenderersEvent;
import net.minecraftforge.client.event.InputEvent;
import net.minecraftforge.client.event.ModelEvent;
import net.minecraftforge.client.event.RegisterColorHandlersEvent;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
Expand All @@ -28,6 +29,8 @@
import wayoftime.bloodmagic.anointment.AnointmentHolder;
import wayoftime.bloodmagic.api.compat.IMultiWillTool;
import wayoftime.bloodmagic.client.model.MimicColor;
import wayoftime.bloodmagic.client.model.MimicModelLoader;
import wayoftime.bloodmagic.client.model.SigilHoldingModelLoader;
import wayoftime.bloodmagic.client.render.BloodMagicModelLayerLocations;
import wayoftime.bloodmagic.client.render.RenderItemRoutingNode;
import wayoftime.bloodmagic.client.render.alchemyarray.*;
Expand Down Expand Up @@ -184,15 +187,6 @@ public void appendTooltip(ItemTooltipEvent event)
}
}

@SubscribeEvent
public static void initRenderLayer(EntityRenderersEvent.AddLayers event)
{
PlayerRenderer render = event.getSkin("default");
render.addLayer(new BloodElytraLayer(render, event.getEntityModels()));
render = event.getSkin("slim");
render.addLayer(new BloodElytraLayer(render, event.getEntityModels()));
}

@SuppressWarnings("deprecation")
public static void initClientEvents(FMLClientSetupEvent event)
{
Expand Down Expand Up @@ -250,19 +244,23 @@ public float call(ItemStack stack, ClientLevel world, LivingEntity entity, int v
AlchemyArrayRendererRegistry.registerRenderer(BloodMagic.rl("array/grove"), new BeaconAlchemyCircleRenderer(BloodMagic.rl("textures/models/alchemyarrays/growthsigil.png")));
AlchemyArrayRendererRegistry.registerRenderer(BloodMagic.rl("array/bounce"), new LowStaticAlchemyCircleRenderer(BloodMagic.rl("textures/models/alchemyarrays/bouncearray.png")));

// Map<String, PlayerRenderer> skinMap = Minecraft.getInstance().getEntityRenderDispatcher().getSkinMap();
// PlayerRenderer render;
// render = skinMap.get("default");
// render.addLayer(new BloodElytraLayer(render));
// render = skinMap.get("slim");
// render.addLayer(new BloodElytraLayer(render));
//
// Map<String, EntityRenderer<? extends Player>> skinMap = Minecraft.getInstance().getEntityRenderDispatcher().getSkinMap();
// PlayerRenderer render;
// render = skinMap.get("default");
// render.addLayer(new BloodElytraLayer(render));
// render = skinMap.get("slim");
// render.addLayer(new BloodElytraLayer(render));
}

@SubscribeEvent
public static void initRenderLayer(EntityRenderersEvent.AddLayers event)
{
PlayerRenderer render = event.getSkin("default");
render.addLayer(new BloodElytraLayer(render, event.getEntityModels()));
render = event.getSkin("slim");
render.addLayer(new BloodElytraLayer(render, event.getEntityModels()));
}

@SubscribeEvent
public static void loadModels(final ModelEvent.RegisterGeometryLoaders event) {
event.register("mimicloader", new MimicModelLoader(BloodMagic.rl("block/solidopaquemimic")));
event.register("mimicloader_ethereal", new MimicModelLoader(BloodMagic.rl("block/etherealopaquemimic")));

event.register("loader_holding", new SigilHoldingModelLoader(BloodMagic.rl("item/sigilofholding_base")));
}

public static void registerItemModelProperties(FMLClientSetupEvent event)
Expand Down Expand Up @@ -320,11 +318,4 @@ public float call(ItemStack stack, ClientLevel world, LivingEntity entity, int v
}
});
}

// TODO: replace with JSON/datagen
// @SubscribeEvent
// public static void onTextureStitchEvent(TextureStitchEvent.Pre event)
// {
// event.addSprite(BloodMagic.rl("item/curios_empty_living_armour_socket"));
// }
}

0 comments on commit d5f37c0

Please sign in to comment.