net.minecraft.client.model.ModelBase Java Examples

The following examples show how to use net.minecraft.client.model.ModelBase. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ClientProxy.java    From Wizardry with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public void init(FMLInitializationEvent event) {
	super.init(event);

	MinecraftForge.EVENT_BUS.register(CapeHandler.instance());

	Map<String, RenderPlayer> skinMap = Minecraft.getMinecraft().getRenderManager().getSkinMap();
	for (RenderPlayer render : skinMap.values()) {
		//	render.addLayer(new BloodRenderLayer(render));
		render.addLayer(new RenderHaloEntity(render.getMainModel().bipedHead));
	}

	Map<Class<? extends Entity>, Render<? extends Entity>> map = Minecraft.getMinecraft().getRenderManager().entityRenderMap;
	for (ResourceLocation entity : EntityList.getEntityNameList()) {
		Class<? extends Entity> clazz = EntityList.getClass(entity);
		Render<? extends Entity> entityRenderer = map.get(clazz);
		if (entityRenderer instanceof RenderLiving<?>) {
			ModelBase main = ((RenderLiving<?>) entityRenderer).getMainModel();
			ModelRenderer renderer = null;
			if (main instanceof ModelBiped) renderer = ((ModelBiped) main).bipedHead;

			((RenderLiving<?>) entityRenderer).addLayer(new RenderHaloEntity(renderer));
		}
	}
}
 
Example #2
Source File: GuiSurgery.java    From Cyberware with MIT License 6 votes vote down vote up
public void renderModel(ModelBase model, float x, float y, float scale, float rotation)
{
	GlStateManager.enableColorMaterial();
	GlStateManager.pushMatrix();
	GlStateManager.translate(x, y, 120F);
	GlStateManager.scale(-scale, scale, scale);
	GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
	GlStateManager.rotate(10.0F, 1.0F, 0.0F, 0.0F);
	GlStateManager.rotate(rotation, 0.0F, 1.0F, 0.0F);
	RenderHelper.enableStandardItemLighting();
	float f1 = 0.7F;
	GlStateManager.glLightModel(2899, RenderHelper.setColorBuffer(f1, f1, f1, 1.0F));
	model.render(null, 0, 0, 0, 0, 0, .0625f);
	GlStateManager.popMatrix();
	RenderHelper.disableStandardItemLighting();
	GlStateManager.disableRescaleNormal();
	OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
	GlStateManager.disableTexture2D();
	OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
	GlStateManager.enableTexture2D();

}
 
Example #3
Source File: MoCRenderWerewolf.java    From mocreaturesdev with GNU General Public License v3.0 5 votes vote down vote up
public MoCRenderWerewolf(MoCModelWereHuman modelwerehuman, ModelBase modelbase, float f)
{
    super(modelbase, f);
    setRenderPassModel(modelwerehuman);
    //tempWerewolf = (MoCModelWerewolf) modelbase;
    tempWerewolf = (MoCModelWere) modelbase;
}
 
Example #4
Source File: SquashableMod.java    From CommunityMod with GNU Lesser General Public License v2.1 5 votes vote down vote up
private static void setMainModel(RenderLivingBase<?> renderer, ModelBase model) {
    try {
        RENDERER_MODEL_FIELD.set(renderer, model);
    } catch (IllegalAccessException e) {
        throw new RuntimeException(e);
    }
}
 
Example #5
Source File: ArmorRenderHooks.java    From GregTech with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static void renderArmorLayer(LayerArmorBase<ModelBase> layer, EntityLivingBase entity, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale, EntityEquipmentSlot slotIn) {
    ItemStack itemStack = entity.getItemStackFromSlot(slotIn);

    if (isArmorItem(itemStack, slotIn)) {
        IArmorItem armorItem = (IArmorItem) itemStack.getItem();
        ModelBase armorModel = layer.getModelFromSlot(slotIn);
        if (armorModel instanceof ModelBiped) {
            armorModel = ForgeHooksClient.getArmorModel(entity, itemStack, slotIn, (ModelBiped) armorModel);
        }
        armorModel.setModelAttributes(layer.renderer.getMainModel());
        armorModel.setLivingAnimations(entity, limbSwing, limbSwingAmount, partialTicks);
        layer.setModelSlotVisible(armorModel, slotIn);

        GlStateManager.enableBlend();
        GlStateManager.blendFunc(SourceFactor.ONE, DestFactor.ONE_MINUS_SRC_ALPHA);

        int layers = armorItem.getArmorLayersAmount(itemStack);
        for (int layerIndex = 0; layerIndex < layers; layerIndex++) {
            int i = armorItem.getArmorLayerColor(itemStack, layerIndex);
            float f = (float) (i >> 16 & 255) / 255.0F;
            float f1 = (float) (i >> 8 & 255) / 255.0F;
            float f2 = (float) (i & 255) / 255.0F;
            GlStateManager.color(f, f1, f2, 1.0f);
            String type = layerIndex == 0 ? null : "layer_" + layerIndex;
            layer.renderer.bindTexture(getArmorTexture(entity, itemStack, slotIn, type));
            armorModel.render(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
        }
        if (itemStack.hasEffect()) {
            LayerArmorBase.renderEnchantedGlint(layer.renderer, entity, armorModel, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale);
        }
    }
}
 
Example #6
Source File: MoCRenderFirefly.java    From mocreaturesdev with GNU General Public License v3.0 4 votes vote down vote up
public MoCRenderFirefly(ModelBase modelbase)
{
    super(modelbase);
    this.setRenderPassModel(new MoCModelFirefly());
}
 
Example #7
Source File: MoCRenderDeer.java    From mocreaturesdev with GNU General Public License v3.0 4 votes vote down vote up
public MoCRenderDeer(ModelBase modelbase, float f)
{
    super(modelbase, f);
}
 
Example #8
Source File: MoCRenderSharkEgg.java    From mocreaturesdev with GNU General Public License v3.0 4 votes vote down vote up
public MoCRenderSharkEgg(ModelBase modelbase, float f)
{
    super(modelbase, f);
}
 
Example #9
Source File: MoCRenderFishy.java    From mocreaturesdev with GNU General Public License v3.0 4 votes vote down vote up
public MoCRenderFishy(ModelBase modelbase, float f)
{
    super(modelbase, f);
}
 
Example #10
Source File: MoCRenderRat.java    From mocreaturesdev with GNU General Public License v3.0 4 votes vote down vote up
public MoCRenderRat(ModelBase modelbase, float f)
{
    super(modelbase, f);
}
 
Example #11
Source File: MoCRenderInsect.java    From mocreaturesdev with GNU General Public License v3.0 4 votes vote down vote up
public MoCRenderInsect(ModelBase modelbase)
{
    super(modelbase, 0.0F);

}
 
Example #12
Source File: MoCRenderButterfly.java    From mocreaturesdev with GNU General Public License v3.0 4 votes vote down vote up
public MoCRenderButterfly(ModelBase modelbase)
{
    super(modelbase);

}
 
Example #13
Source File: MoCRenderDolphin.java    From mocreaturesdev with GNU General Public License v3.0 4 votes vote down vote up
public MoCRenderDolphin(ModelBase modelbase, float f)
{
    super(modelbase, f);
}
 
Example #14
Source File: MoCRenderBird.java    From mocreaturesdev with GNU General Public License v3.0 4 votes vote down vote up
public MoCRenderBird(ModelBase modelbase, float f)
{
    super(modelbase, f);
}
 
Example #15
Source File: MoCRenderHellRat.java    From mocreaturesdev with GNU General Public License v3.0 4 votes vote down vote up
public MoCRenderHellRat(ModelBase modelbase, float f)
{
    super(modelbase, f);
}
 
Example #16
Source File: MoCRenderMouse.java    From mocreaturesdev with GNU General Public License v3.0 4 votes vote down vote up
public MoCRenderMouse(ModelBase modelbase, float f)
{
    super(modelbase, f);
}
 
Example #17
Source File: MoCRenderAnimal.java    From mocreaturesdev with GNU General Public License v3.0 4 votes vote down vote up
public MoCRenderAnimal(ModelBase modelbase, float f)
{
    super(modelbase, f);

}
 
Example #18
Source File: MoCRenderSnake.java    From mocreaturesdev with GNU General Public License v3.0 4 votes vote down vote up
public MoCRenderSnake(ModelBase modelbase, float f)
{
    super(modelbase, 0.0F);
    //tempSnake = (MoCModelSnake) modelbase;
}
 
Example #19
Source File: MoCRenderShark.java    From mocreaturesdev with GNU General Public License v3.0 4 votes vote down vote up
public MoCRenderShark(ModelBase modelbase, float f)
{
    super(modelbase, f);
}
 
Example #20
Source File: MoCRenderBunny.java    From mocreaturesdev with GNU General Public License v3.0 4 votes vote down vote up
public MoCRenderBunny(ModelBase modelbase, float f)
{
    super(modelbase, f);
}
 
Example #21
Source File: MoCRenderRay.java    From mocreaturesdev with GNU General Public License v3.0 4 votes vote down vote up
public MoCRenderRay(ModelBase modelbase, float f)
{
    super(modelbase, f);
    tempRay = (MoCModelRay) modelbase;
}
 
Example #22
Source File: MoCRenderFox.java    From mocreaturesdev with GNU General Public License v3.0 4 votes vote down vote up
public MoCRenderFox(ModelBase modelbase)
{
    super(modelbase, 0.5F);
}
 
Example #23
Source File: MoCRenderCricket.java    From mocreaturesdev with GNU General Public License v3.0 4 votes vote down vote up
public MoCRenderCricket(ModelBase modelbase)
{
    super(modelbase, 0.0F);
    //this.setRenderPassModel(new MoCModelFirefly());
}
 
Example #24
Source File: MoCRenderWWolf.java    From mocreaturesdev with GNU General Public License v3.0 4 votes vote down vote up
public MoCRenderWWolf(ModelBase modelbase, float f)
{
    super(modelbase, f);
    //setRenderPassModel(modelbase1);
}
 
Example #25
Source File: MoCRenderJellyFish.java    From mocreaturesdev with GNU General Public License v3.0 4 votes vote down vote up
public MoCRenderJellyFish(ModelBase modelbase, float f)
{
    super(modelbase, f);
    tempJellyFish = (MoCModelJellyFish) modelbase;
}
 
Example #26
Source File: MoCRenderOstrich.java    From mocreaturesdev with GNU General Public License v3.0 4 votes vote down vote up
public MoCRenderOstrich(ModelBase modelbase, float f)
{
    super(modelbase, 0.5F);
    //tempSnake = (MoCModelSnake) modelbase;
}
 
Example #27
Source File: TcModelRenderer.java    From TofuCraftReload with MIT License 4 votes vote down vote up
public TcModelRenderer(ModelBase model, String boxNameIn)
{
	super(model, boxNameIn);
}
 
Example #28
Source File: RenderUnicorn.java    From Wizardry with GNU Lesser General Public License v3.0 4 votes vote down vote up
public RenderUnicorn(RenderManager renderManager, ModelBase modelBase) {
	super(renderManager, modelBase, 0.75F);
}
 
Example #29
Source File: TcModelRenderer.java    From TofuCraftReload with MIT License 4 votes vote down vote up
public TcModelRenderer(ModelBase model)
{
    super(model);
}
 
Example #30
Source File: TcModelRenderer.java    From TofuCraftReload with MIT License 4 votes vote down vote up
public TcModelRenderer(ModelBase model, int texOffX, int texOffY)
{
	super(model, texOffX, texOffY);
}