Skip to content

Commit

Permalink
fix: model rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
klikli-dev committed Jan 22, 2024
1 parent 966835d commit cd2c122
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import com.klikli_dev.occultism.Occultism;
import com.klikli_dev.occultism.common.entity.spirit.AfritEntity;
import com.klikli_dev.occultism.common.entity.spirit.DjinniEntity;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.resources.ResourceLocation;
import software.bernie.geckolib.model.DefaultedEntityGeoModel;
Expand All @@ -36,4 +37,9 @@ public AfritModel() {
super(new ResourceLocation(Occultism.MODID, "afrit"), true);
}

@Override
public RenderType getRenderType(AfritEntity animatable, ResourceLocation texture) {
return RenderType.entityTranslucent(this.getTextureResource(animatable));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
package com.klikli_dev.occultism.client.model.entity;

import com.klikli_dev.occultism.Occultism;
import com.klikli_dev.occultism.common.entity.spirit.AfritEntity;
import com.klikli_dev.occultism.common.entity.spirit.DjinniEntity;
import com.klikli_dev.occultism.registry.OccultismSpiritJobs;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.resources.ResourceLocation;
import software.bernie.geckolib.model.DefaultedEntityGeoModel;

Expand Down Expand Up @@ -54,6 +56,11 @@ public ModelData getModelData(DjinniEntity animatable) {
return this.worker;
}

@Override
public RenderType getRenderType(DjinniEntity animatable, ResourceLocation texture) {
return RenderType.entityTranslucent(this.getTextureResource(animatable));
}

@Override
public ResourceLocation getModelResource(DjinniEntity animatable) {
return this.getModelData(animatable).model();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import com.klikli_dev.occultism.Occultism;
import com.klikli_dev.occultism.common.entity.spirit.AfritEntity;
import com.klikli_dev.occultism.common.entity.spirit.DjinniEntity;
import com.klikli_dev.occultism.common.entity.spirit.MaridEntity;
import net.minecraft.client.model.HumanoidModel;
import net.minecraft.client.model.geom.ModelPart;
Expand All @@ -43,5 +44,10 @@ public class MaridModel extends DefaultedEntityGeoModel<MaridEntity> {
public MaridModel() {
super(new ResourceLocation(Occultism.MODID, "marid"), true);
}

@Override
public RenderType getRenderType(MaridEntity animatable, ResourceLocation texture) {
return RenderType.entityTranslucent(this.getTextureResource(animatable));
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,5 @@ public class MaridRenderer extends GeoEntityRenderer<MaridEntity> {

public MaridRenderer(EntityRendererProvider.Context renderManager) {
super(renderManager, new MaridModel());

this.addRenderLayer(new AutoGlowingGeoLayer<>(this));
}
}

0 comments on commit cd2c122

Please sign in to comment.