版本信息
你使用的系统:win10
你使用的IDE:IntelliJ IDEA
你使用的IDE版本:2020.1.2
Forge版本: 31.2.5
Minecraft版本: 1.15.2
出错图
错误情况简述
我想在TER中渲染一个长方体模型,模型可以显示,但贴图始终没有显示,模型是中间的那个黑色的。
**相关代码**
private final ModelRenderer strainer;
......
@Override
public void render(WaterFilterUpTile tileEntityIn, float partialTicks, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int combinedLightIn, int combinedOverlayIn) {
matrixStackIn.push();
//Render strainer
tileEntityIn.getStrainer().ifPresent(itemStackHandler -> {
if (!itemStackHandler.getStackInSlot(0).isEmpty() && itemStackHandler.getStackInSlot(0).getItem() instanceof StrainerItem){
Material material = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation(WaterSource.MODID,"entity/strainer/primitive_strainer"));
IVertexBuilder ivertexbuilder = material.getBuffer(bufferIn, RenderType::getEntityCutoutNoCull);
this.strainer.render(matrixStackIn, ivertexbuilder, combinedLightIn, combinedOverlayIn);
}
});
}
@SubscribeEvent
public static void onTextureStitch(TextureStitchEvent.Pre event) {
if (!event.getMap().getTextureLocation().equals(AtlasTexture.LOCATION_BLOCKS_TEXTURE)) {
return;
}
event.addSprite(new ResourceLocation(WaterSource.MODID,"entity/strainer/primitive_strainer"));
}