Jump to content

Having trouble with the mod I'm porting


Jeremy Quann

Recommended Posts

I'm having trouble of that thing shown down here:

package chumbanotz.mutantbeasts.client;

import chumbanotz.mutantbeasts.MutantBeasts;
import chumbanotz.mutantbeasts.client.gui.screen.CreeperMinionTrackerScreen;
import chumbanotz.mutantbeasts.client.particle.EndersoulParticle;
import chumbanotz.mutantbeasts.client.particle.SkullSpiritParticle;
import chumbanotz.mutantbeasts.client.renderer.entity.BodyPartRenderer;
import chumbanotz.mutantbeasts.client.renderer.entity.CreeperMinionEggRenderer;
import chumbanotz.mutantbeasts.client.renderer.entity.CreeperMinionRenderer;
import chumbanotz.mutantbeasts.client.renderer.entity.EndersoulCloneRenderer;
import chumbanotz.mutantbeasts.client.renderer.entity.EndersoulFragmentRenderer;
import chumbanotz.mutantbeasts.client.renderer.entity.MutantArrowRenderer;
import chumbanotz.mutantbeasts.client.renderer.entity.MutantCreeperRenderer;
import chumbanotz.mutantbeasts.client.renderer.entity.MutantEndermanRenderer;
import chumbanotz.mutantbeasts.client.renderer.entity.MutantSkeletonRenderer;
import chumbanotz.mutantbeasts.client.renderer.entity.MutantSnowGolemRenderer;
import chumbanotz.mutantbeasts.client.renderer.entity.MutantZombieRenderer;
import chumbanotz.mutantbeasts.client.renderer.entity.SpiderPigRenderer;
import chumbanotz.mutantbeasts.client.renderer.entity.ThrowableBlockRenderer;
import chumbanotz.mutantbeasts.client.renderer.entity.layers.CreeperMinionShoulderLayer;
import chumbanotz.mutantbeasts.client.renderer.entity.model.EndersoulHandModel;
import chumbanotz.mutantbeasts.entity.*;
import chumbanotz.mutantbeasts.entity.mutant.MutantCreeperEntity;
import chumbanotz.mutantbeasts.entity.mutant.MutantEndermanEntity;
import chumbanotz.mutantbeasts.entity.mutant.MutantSkeletonEntity;
import chumbanotz.mutantbeasts.entity.mutant.MutantSnowGolemEntity;
import chumbanotz.mutantbeasts.entity.mutant.MutantZombieEntity;
import chumbanotz.mutantbeasts.entity.mutant.SpiderPigEntity;
import chumbanotz.mutantbeasts.entity.projectile.ChemicalXEntity;
import chumbanotz.mutantbeasts.entity.projectile.MutantArrowEntity;
import chumbanotz.mutantbeasts.entity.projectile.ThrowableBlockEntity;
import chumbanotz.mutantbeasts.particles.MBParticleTypes;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.model.HumanoidModel;
import net.minecraft.client.model.SkullModel;
import net.minecraft.client.renderer.blockentity.SkullBlockRenderer;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.entity.PlayerRenderer;
import net.minecraft.client.renderer.entity.RenderLayerParent;
import net.minecraft.client.renderer.entity.SpriteRenderer;
import net.minecraft.client.renderer.entity.ThrownItemRenderer;
import net.minecraft.client.renderer.entity.layers.RenderLayer;
import net.minecraft.client.renderer.entity.model.BipedModel;
import net.minecraft.client.renderer.entity.model.RendererModel;
import net.minecraft.client.renderer.entity.player.PlayerRenderer;
import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.ModelResourceLocation;
import net.minecraft.client.renderer.model.ModelRotation;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.core.particles.ParticleType;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.block.SkullBlock;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.client.event.ModelBakeEvent;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.client.event.ParticleFactoryRegisterEvent;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.DeferredWorkQueue;
import net.minecraftforge.client.ClientRegistry
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.util.ObfuscationReflectionHelper;

import java.util.Map;

@EventBusSubscriber(modid = "mutantbeasts", bus = Mod.EventBusSubscriber.Bus.MOD, value = {Dist.CLIENT})
public enum ClientEventHandler {
	INSTANCE;

	@SubscribeEvent
	public static void onClientSetup(FMLClientSetupEvent event) {
		Map<SkullBlock.Type, SkullModel> MODELS_MAP = (Map<SkullBlock.Type, SkullModel>)ObfuscationReflectionHelper.getPrivateValue(SkullBlockRenderer.class, null, "MODEL_BY_TYPE");
		Map<SkullBlock.Type, ResourceLocation> SKIN_MAP = (Map<SkullBlock.Type, ResourceLocation>) ObfuscationReflectionHelper.getPrivateValue(SkullBlockRenderer.class, null, "SKIN_BY_TYPE");
		MODELS_MAP.put(MBSkullBlock.Types.MUTANT_SKELETON, new SkullModel());
		SKIN_MAP.put(MBSkullBlock.Types.MUTANT_SKELETON, MutantBeasts.getEntityTexture("mutant_skeleton"));
		ClientRegistry.bindTileEntityRenderer(MBTileEntityTypes.SKULL, SkullBlockRenderer::new);
		ClientRegistry.registerEntityShader(CreeperMinionEntity.class, new ResourceLocation("shaders/post/creeper.json"));
		ClientRegistry.registerEntityShader(EndersoulCloneEntity.class, new ResourceLocation("shaders/post/invert.json"));
		ClientRegistry.registerEntityShader(MutantCreeperEntity.class, new ResourceLocation("shaders/post/creeper.json"));
		ClientRegistry.registerEntityShader(MutantEndermanEntity.class, new ResourceLocation("shaders/post/invert.json"));
		RenderingRegistry.registerEntityRenderingHandler(MBEntityType.BODY_PART, BodyPartRenderer::new);
		RenderingRegistry.registerEntityRenderingHandler(MBEntityType.CHEMICAL_X, render -> new ThrownItemRenderer(render, Minecraft.getInstance().getItemRenderer()));
		RenderingRegistry.registerEntityRenderingHandler(MBEntityType.CREEPER_MINION, CreeperMinionRenderer::new);
		RenderingRegistry.registerEntityRenderingHandler(MBEntityType.CREEPER_MINION_EGG, CreeperMinionEggRenderer::new);
		RenderingRegistry.registerEntityRenderingHandler(MBEntityType.ENDERSOUL_CLONE, EndersoulCloneRenderer::new);
		RenderingRegistry.registerEntityRenderingHandler(MBEntityType.ENDERSOUL_FRAGMENT, EndersoulFragmentRenderer::new);
		RenderingRegistry.registerEntityRenderingHandler(MBEntityType.MUTANT_ARROW, MutantArrowRenderer::new);
		RenderingRegistry.registerEntityRenderingHandler(MBEntityType.MUTANT_CREEPER, MutantCreeperRenderer::new);
		RenderingRegistry.registerEntityRenderingHandler(MBEntityType.MUTANT_ENDERMAN, MutantEndermanRenderer::new);
		RenderingRegistry.registerEntityRenderingHandler(MBEntityType.MUTANT_SKELETON, MutantSkeletonRenderer::new);
		RenderingRegistry.registerEntityRenderingHandler(MBEntityType.MUTANT_SNOW_GOLEM, MutantSnowGolemRenderer::new);
		RenderingRegistry.registerEntityRenderingHandler(MBEntityType.MUTANT_ZOMBIE, MutantZombieRenderer::new);
		RenderingRegistry.registerEntityRenderingHandler(MBEntityType.SKULL_SPIRIT, manager -> new EntityRenderer<Entity>(manager) {
			public ResourceLocation getTextureLocation(Entity entity) {
				return null;
			}
		});
		RenderingRegistry.registerEntityRenderingHandler(MBEntityType.SPIDER_PIG, SpiderPigRenderer::new);
		RenderingRegistry.registerEntityRenderingHandler(MBEntityType.THROWABLE_BLOCK, ThrowableBlockRenderer::new);
		for (PlayerRenderer renderer : Minecraft.getInstance().getEntityRenderDispatcher().getSkinMap().values())
			renderer.addLayer((RenderLayer)new CreeperMinionShoulderLayer((RenderLayerParent)renderer));
	}

	@SubscribeEvent
	public static void onParticleFactoryRegistry(ParticleFactoryRegisterEvent event) {
		(Minecraft.getInstance()).particleEngine.register((ParticleType)MBParticleTypes.ENDERSOUL, chumbanotz.mutantbeasts.client.particle.EndersoulParticle.Factory::new);
		(Minecraft.getInstance()).particleEngine.register((ParticleType)MBParticleTypes.SKULL_SPIRIT, chumbanotz.mutantbeasts.client.particle.SkullSpiritParticle.Factory::new);
	}

	public void displayCreeperMinionTrackerGUI(CreeperMinionEntity creeperMinion) {
		Minecraft.getInstance().setScreen((Screen)new CreeperMinionTrackerScreen(creeperMinion));
	}
}

Can anyone help me please?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.