Added Common Renderer To Remove Function

This commit is contained in:
Rabbitminers 2023-04-30 21:00:40 +01:00
parent 411ec36f57
commit 2b76e8d7b3
2 changed files with 29 additions and 1 deletions

View file

@ -0,0 +1,27 @@
package com.simibubi.create.content.logistics.trains.entity;
import com.jozufozu.flywheel.api.MaterialManager;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.simibubi.create.content.logistics.trains.BogeyRenderer;
import net.minecraft.nbt.CompoundTag;
public class BackupBogeyRenderer extends BogeyRenderer.CommonRenderer {
public static BackupBogeyRenderer INSTANCE = new BackupBogeyRenderer();
@Override
public void render(CompoundTag bogeyData, float wheelAngle, PoseStack ms, int light, VertexConsumer vb) {
}
@Override
public void initialiseContraptionModelData(MaterialManager materialManager) {
}
@Override
public CommonRenderer createNewInstance() {
return new BackupBogeyRenderer();
}
}

View file

@ -69,7 +69,8 @@ public class BogeyStyle {
}
public BogeyRenderer getInWorldRenderInstance(BogeySizes.BogeySize size) {
return this.sizes.get(size).renderer();
SizeData sizeData = this.sizes.get(size);
return sizeData != null ? sizeData.renderer() : BackupBogeyRenderer.INSTANCE;
}
public Optional<CommonRenderer> getInWorldCommonRenderInstance() {