1.19.4-pre1
This commit is contained in:
parent
32e719115b
commit
759c3fbfc3
58 changed files with 210 additions and 263 deletions
|
@ -52,7 +52,7 @@ public class MachineRecipeDisplay<R extends RebornRecipe> implements Display {
|
|||
public MachineRecipeDisplay(R recipe) {
|
||||
this.recipe = recipe;
|
||||
this.inputs = CollectionUtils.map(recipe.getRebornIngredients(), ing -> EntryIngredients.ofItemStacks(ing.getPreviewStacks()));
|
||||
this.outputs = recipe.getOutputs().stream().map(EntryIngredients::of).collect(Collectors.toList());
|
||||
this.outputs = recipe.getOutputs(null).stream().map(EntryIngredients::of).collect(Collectors.toList());
|
||||
this.time = recipe.getTime();
|
||||
this.energy = recipe.getPower();
|
||||
if (recipe instanceof BlastFurnaceRecipe) {
|
||||
|
|
|
@ -51,8 +51,8 @@ public class GuiAutoCrafting extends GuiBase<BuiltScreenHandler> {
|
|||
this.blockEntityAutoCraftingTable = blockEntity;
|
||||
}
|
||||
|
||||
public void renderItemStack(ItemStack stack, int x, int y) {
|
||||
MinecraftClient.getInstance().getItemRenderer().renderInGuiWithOverrides(stack, x, y);
|
||||
public void renderItemStack(MatrixStack matrixStack, ItemStack stack, int x, int y) {
|
||||
MinecraftClient.getInstance().getItemRenderer().renderInGuiWithOverrides(matrixStack, stack, x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -79,7 +79,7 @@ public class GuiAutoCrafting extends GuiBase<BuiltScreenHandler> {
|
|||
|
||||
CraftingRecipe recipe = blockEntityAutoCraftingTable.getCurrentRecipe();
|
||||
if (recipe != null) {
|
||||
renderItemStack(recipe.getOutput(), 95 + getGuiLeft(), 42 + getGuiTop());
|
||||
renderItemStack(matrixStack, recipe.getOutput(getMachine().getWorld().getRegistryManager()), 95 + getGuiLeft(), 42 + getGuiTop());
|
||||
}
|
||||
|
||||
builder.drawLockButton(matrixStack, this, 145, 4, mouseX, mouseY, layer, blockEntityAutoCraftingTable.locked);
|
||||
|
|
|
@ -32,6 +32,7 @@ import net.minecraft.client.render.WorldRenderer;
|
|||
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
|
||||
import net.minecraft.client.render.block.entity.BlockEntityRendererFactory;
|
||||
import net.minecraft.client.render.model.json.ModelTransformation;
|
||||
import net.minecraft.client.render.model.json.ModelTransformationMode;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
@ -67,7 +68,7 @@ public class StorageUnitRenderer implements BlockEntityRenderer<StorageUnitBaseB
|
|||
case EAST -> matrices.translate(-1, 1, 2);
|
||||
}
|
||||
int lightAbove = WorldRenderer.getLightmapCoordinates(storage.getWorld(), storage.getPos().offset(storage.getFacing()));
|
||||
MinecraftClient.getInstance().getItemRenderer().renderItem(stack, ModelTransformation.Mode.FIXED, lightAbove, OverlayTexture.DEFAULT_UV, matrices, vertexConsumers, 0);
|
||||
MinecraftClient.getInstance().getItemRenderer().renderItem(stack, ModelTransformationMode.FIXED, lightAbove, OverlayTexture.DEFAULT_UV, matrices, vertexConsumers, storage.getWorld(), 0);
|
||||
matrices.pop();
|
||||
|
||||
// Text rendering
|
||||
|
@ -89,12 +90,12 @@ public class StorageUnitRenderer implements BlockEntityRenderer<StorageUnitBaseB
|
|||
// Render item count
|
||||
String count = String.valueOf(storage.storedAmount);
|
||||
xPosition = (float) (-textRenderer.getWidth(count) / 2);
|
||||
textRenderer.draw(count, xPosition, -4f + 40, 0, false, matrices.peek().getPositionMatrix(), vertexConsumers, false, 0, light);
|
||||
textRenderer.draw(count, xPosition, -4f + 40, 0, false, matrices.peek().getPositionMatrix(), vertexConsumers, TextRenderer.TextLayerType.NORMAL, 0, light);
|
||||
|
||||
// Render name
|
||||
String item = stack.getName().asTruncatedString(18);
|
||||
xPosition = (float) (-textRenderer.getWidth(item) / 2);
|
||||
textRenderer.draw(item, xPosition, -4f - 40, 0, false, matrices.peek().getPositionMatrix(), vertexConsumers, false, 0, light);
|
||||
textRenderer.draw(item, xPosition, -4f - 40, 0, false, matrices.peek().getPositionMatrix(), vertexConsumers, TextRenderer.TextLayerType.NORMAL, 0, light);
|
||||
|
||||
matrices.pop();
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ package techreborn.client.render.entitys;
|
|||
|
||||
import net.minecraft.client.model.Model;
|
||||
import net.minecraft.client.model.ModelPart;
|
||||
import net.minecraft.client.model.ModelPartBuilder;
|
||||
import net.minecraft.client.render.RenderLayer;
|
||||
import net.minecraft.client.render.VertexConsumer;
|
||||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
|
@ -40,9 +41,12 @@ import techreborn.blockentity.generator.basic.WindMillBlockEntity;
|
|||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.Set;
|
||||
|
||||
public class TurbineRenderer implements BlockEntityRenderer<WindMillBlockEntity> {
|
||||
private static final Set<Direction> ALL_DIRECTIONS = EnumSet.allOf(Direction.class);
|
||||
private static final TurbineModel MODEL = new TurbineModel();
|
||||
public static final Identifier TEXTURE = new Identifier("techreborn:textures/block/machines/generators/wind_mill_turbine.png");
|
||||
|
||||
|
@ -76,14 +80,14 @@ public class TurbineRenderer implements BlockEntityRenderer<WindMillBlockEntity>
|
|||
super(RenderLayer::getEntityCutoutNoCull);
|
||||
|
||||
ModelPart.Cuboid[] baseCuboids = {
|
||||
new ModelPart.Cuboid(0, 0, -2.0F, -2.0F, -1.0F, 4F, 4F, 2F, 0F, 0F, 0F, false, 64F, 64F),
|
||||
new ModelPart.Cuboid(0, 6, -1.0F, -1.0F, -2.0F, 2F, 2F, 1F, 0F, 0F, 0F, false, 64F, 64F)
|
||||
new ModelPart.Cuboid(0, 0, -2.0F, -2.0F, -1.0F, 4F, 4F, 2F, 0F, 0F, 0F, false, 64F, 64F, ALL_DIRECTIONS),
|
||||
new ModelPart.Cuboid(0, 6, -1.0F, -1.0F, -2.0F, 2F, 2F, 1F, 0F, 0F, 0F, false, 64F, 64F, ALL_DIRECTIONS)
|
||||
};
|
||||
|
||||
base = new ModelPart(Arrays.asList(baseCuboids), new HashMap<>() {
|
||||
{
|
||||
ModelPart.Cuboid[] blade1Cuboids = {
|
||||
new ModelPart.Cuboid(0, 9, -24.0F, -1.0F, -0.5F, 24F, 2F, 1F, 0F, 0F, 0F, false, 64F, 64F)
|
||||
new ModelPart.Cuboid(0, 9, -24.0F, -1.0F, -0.5F, 24F, 2F, 1F, 0F, 0F, 0F, false, 64F, 64F, ALL_DIRECTIONS)
|
||||
};
|
||||
ModelPart blade1 = new ModelPart(Arrays.asList(blade1Cuboids), Collections.emptyMap());
|
||||
blade1.setPivot(0.0F, 0.0F, 0.0F);
|
||||
|
@ -91,7 +95,7 @@ public class TurbineRenderer implements BlockEntityRenderer<WindMillBlockEntity>
|
|||
put("blade1", blade1);
|
||||
|
||||
ModelPart.Cuboid[] blade2Cuboids = {
|
||||
new ModelPart.Cuboid(0, 9, -24.0F, -1.0F, -0.5F, 24F, 2F, 1F, 0F, 0F, 0F, false, 64F, 64F)
|
||||
new ModelPart.Cuboid(0, 9, -24.0F, -1.0F, -0.5F, 24F, 2F, 1F, 0F, 0F, 0F, false, 64F, 64F, ALL_DIRECTIONS)
|
||||
};
|
||||
ModelPart blade2 = new ModelPart(Arrays.asList(blade2Cuboids), Collections.emptyMap());
|
||||
blade2.setPivot(0.0F, 0.0F, 0.0F);
|
||||
|
@ -99,7 +103,7 @@ public class TurbineRenderer implements BlockEntityRenderer<WindMillBlockEntity>
|
|||
put("blade2", blade2);
|
||||
|
||||
ModelPart.Cuboid[] blade3Cuboids = {
|
||||
new ModelPart.Cuboid(0, 9, -24.0F, -2.0F, -1.075F, 24F, 2F, 1F, 0F, 0F, 0F, false, 64F, 64F)
|
||||
new ModelPart.Cuboid(0, 9, -24.0F, -2.0F, -1.075F, 24F, 2F, 1F, 0F, 0F, 0F, false, 64F, 64F, ALL_DIRECTIONS)
|
||||
};
|
||||
ModelPart blade3 = new ModelPart(Arrays.asList(blade3Cuboids), Collections.emptyMap());
|
||||
blade3.setPivot(0.0F, 0.0F, 0.0F);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue