diff --git a/gradle.properties b/gradle.properties index c83fbc96b..e65a02871 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,7 +19,7 @@ parchment_version = 2022.03.13 # dependency versions registrate_version = MC1.18.2-1.0.25 -flywheel_version = 1.18-0.6.2.65 +flywheel_version = 1.18-0.6.2.66 jei_minecraft_version = 1.18.2 jei_version = 9.5.3.143 diff --git a/src/main/java/com/simibubi/create/content/logistics/block/data/source/ItemListDataSource.java b/src/main/java/com/simibubi/create/content/logistics/block/data/source/ItemListDataSource.java index fdfbb0274..92be56cbe 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/data/source/ItemListDataSource.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/data/source/ItemListDataSource.java @@ -20,14 +20,14 @@ public class ItemListDataSource extends ValueListDataSource { protected Stream> provideEntries(DataGathererContext context, int maxRows) { BlockEntity sourceTE = context.getSourceTE(); if (!(sourceTE instanceof ContentObserverTileEntity cote)) - return new ArrayList>().stream(); + return Stream.empty(); InvManipulationBehaviour invManipulationBehaviour = cote.getBehaviour(InvManipulationBehaviour.TYPE); FilteringBehaviour filteringBehaviour = cote.getBehaviour(FilteringBehaviour.TYPE); IItemHandler handler = invManipulationBehaviour.getInventory(); if (handler == null) - return new ArrayList>().stream(); + return Stream.empty(); return new CountedItemStackList(handler, filteringBehaviour).getTopNames(maxRows); } diff --git a/src/main/java/com/simibubi/create/content/logistics/block/data/source/ScoreboardDataSource.java b/src/main/java/com/simibubi/create/content/logistics/block/data/source/ScoreboardDataSource.java index b63adc95c..afdf2eb67 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/data/source/ScoreboardDataSource.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/data/source/ScoreboardDataSource.java @@ -23,7 +23,7 @@ public class ScoreboardDataSource extends ValueListDataSource { Level level = context.te() .getLevel(); if (!(level instanceof ServerLevel sLevel)) - return new ArrayList>().stream(); + return Stream.empty(); String name = context.sourceConfig() .getString("Objective"); @@ -50,7 +50,7 @@ public class ScoreboardDataSource extends ValueListDataSource { return ImmutableList .of(IntAttached.with(404, Lang.translate("data_source.scoreboard.objective_not_found", objective))); } - + @Override protected String getTranslationKey() { return "scoreboard"; diff --git a/src/main/java/com/simibubi/create/content/logistics/block/data/source/StatTrackingDataSource.java b/src/main/java/com/simibubi/create/content/logistics/block/data/source/StatTrackingDataSource.java index 95c4e9bef..1423f5a86 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/data/source/StatTrackingDataSource.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/data/source/StatTrackingDataSource.java @@ -26,7 +26,7 @@ public abstract class StatTrackingDataSource extends ScoreboardDataSource { Level level = context.te() .getLevel(); if (!(level instanceof ServerLevel sLevel)) - return new ArrayList>().stream(); + return Stream.empty(); String name = "create_auto_" + getObjectiveName(); Scoreboard scoreboard = level.getScoreboard(); diff --git a/src/main/java/com/simibubi/create/content/logistics/trains/management/display/FlapDisplayRenderer.java b/src/main/java/com/simibubi/create/content/logistics/trains/management/display/FlapDisplayRenderer.java index a1608d554..30bc546b2 100644 --- a/src/main/java/com/simibubi/create/content/logistics/trains/management/display/FlapDisplayRenderer.java +++ b/src/main/java/com/simibubi/create/content/logistics/trains/management/display/FlapDisplayRenderer.java @@ -15,7 +15,6 @@ import com.simibubi.create.foundation.render.CachedBufferer; import com.simibubi.create.foundation.render.SuperByteBuffer; import com.simibubi.create.foundation.utility.AngleHelper; import com.simibubi.create.foundation.utility.AnimationTickHolder; -import com.simibubi.create.foundation.utility.DyeHelper; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Font; @@ -74,9 +73,7 @@ public class FlapDisplayRenderer extends KineticTileEntityRenderer { for (int j = 0; j < lines.size(); j++) { List line = lines.get(j) .getSections(); - int color = flapTe.colour[j] == null ? 0xFF_D3C6BA - : DyeHelper.DYE_TABLE.get(flapTe.colour[j]) - .getFirst() | 0xFF_000000; + int color = flapTe.getLineColor(j); ms.pushPose(); float w = 0; @@ -116,7 +113,7 @@ public class FlapDisplayRenderer extends KineticTileEntityRenderer { } @OnlyIn(Dist.CLIENT) - class FlapDisplayRenderOutput implements FormattedCharSink { + static class FlapDisplayRenderOutput implements FormattedCharSink { final MultiBufferSource bufferSource; final float r, g, b, a; @@ -191,7 +188,7 @@ public class FlapDisplayRenderer extends KineticTileEntityRenderer { if (section.renderCharsIndividually()) x += (standardWidth - glyphWidth) / 2f; - if (!(bakedglyph instanceof EmptyGlyph)) { + if (isNotEmpty(bakedglyph)) { VertexConsumer vertexconsumer = bufferSource.getBuffer(renderTypeOf(bakedglyph)); bakedglyph.render(style.isItalic(), x, 0, pose, vertexconsumer, red, green, blue, a, light); } @@ -229,6 +226,10 @@ public class FlapDisplayRenderer extends KineticTileEntityRenderer { return bakedglyph.renderType(Font.DisplayMode.NORMAL); } + private boolean isNotEmpty(BakedGlyph bakedglyph) { + return !(bakedglyph instanceof EmptyGlyph); + } + } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/trains/management/display/FlapDisplayTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/trains/management/display/FlapDisplayTileEntity.java index 6d651bd87..a3beee299 100644 --- a/src/main/java/com/simibubi/create/content/logistics/trains/management/display/FlapDisplayTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/trains/management/display/FlapDisplayTileEntity.java @@ -7,6 +7,7 @@ import java.util.List; import com.google.gson.JsonElement; import com.simibubi.create.content.contraptions.base.KineticTileEntity; import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; +import com.simibubi.create.foundation.utility.DyeHelper; import com.simibubi.create.foundation.utility.DynamicComponent; import com.simibubi.create.foundation.utility.NBTHelper; @@ -154,7 +155,7 @@ public class FlapDisplayTileEntity extends KineticTileEntity { for (int i = 0; i < ySize * 2; i++) lines.add(new FlapDisplayLayout(getMaxCharCount())); } - + public int getMaxCharCount() { return getMaxCharCount(0); } @@ -276,4 +277,9 @@ public class FlapDisplayTileEntity extends KineticTileEntity { @Override public void addBehaviours(List behaviours) {} + public int getLineColor(int line) { + DyeColor color = colour[line]; + return color == null ? 0xFF_D3C6BA : DyeHelper.DYE_TABLE.get(color) + .getFirst() | 0xFF_000000; + } } diff --git a/src/main/java/com/simibubi/create/content/logistics/trains/management/schedule/TrainHatArmorLayer.java b/src/main/java/com/simibubi/create/content/logistics/trains/management/schedule/TrainHatArmorLayer.java index 8e459a22b..c9d563d72 100644 --- a/src/main/java/com/simibubi/create/content/logistics/trains/management/schedule/TrainHatArmorLayer.java +++ b/src/main/java/com/simibubi/create/content/logistics/trains/management/schedule/TrainHatArmorLayer.java @@ -150,10 +150,9 @@ public class TrainHatArmorLayer @SuppressWarnings({ "rawtypes", "unchecked" }) public static void registerOn(EntityRenderer entityRenderer) { - if (!(entityRenderer instanceof LivingEntityRenderer)) + if (!(entityRenderer instanceof LivingEntityRenderer livingRenderer)) return; - LivingEntityRenderer livingRenderer = (LivingEntityRenderer) entityRenderer; EntityModel model = livingRenderer.getModel(); if (!(model instanceof HierarchicalModel) && !(model instanceof AgeableListModel)) diff --git a/src/main/java/com/simibubi/create/content/palettes/PalettesVariantEntry.java b/src/main/java/com/simibubi/create/content/palettes/PalettesVariantEntry.java index f6d8c1435..7718428e5 100644 --- a/src/main/java/com/simibubi/create/content/palettes/PalettesVariantEntry.java +++ b/src/main/java/com/simibubi/create/content/palettes/PalettesVariantEntry.java @@ -32,7 +32,7 @@ public class PalettesVariantEntry { for (PaletteBlockPattern pattern : paletteStoneVariants.variantTypes) { BlockBuilder builder = registrate.block(pattern.createName(name), pattern.getBlockFactory()) - .initialProperties(baseBlock::get) + .initialProperties(baseBlock) .transform(pickaxeOnly()) .blockstate(pattern.getBlockStateGenerator() .apply(pattern) @@ -56,7 +56,7 @@ public class PalettesVariantEntry { .ifPresent(b -> builder.onRegister(connectedTextures(b))); builder.recipe((c, p) -> { - p.stonecutting(DataIngredient.tag(paletteStoneVariants.materialTag), c::get); + p.stonecutting(DataIngredient.tag(paletteStoneVariants.materialTag), c); pattern.addRecipes(baseBlock, c, p); }); diff --git a/src/main/java/com/simibubi/create/foundation/item/CountedItemStackList.java b/src/main/java/com/simibubi/create/foundation/item/CountedItemStackList.java index e4c683603..2b964a7c6 100644 --- a/src/main/java/com/simibubi/create/foundation/item/CountedItemStackList.java +++ b/src/main/java/com/simibubi/create/foundation/item/CountedItemStackList.java @@ -1,5 +1,6 @@ package com.simibubi.create.foundation.item; +import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Map; @@ -30,7 +31,7 @@ public class CountedItemStackList { public Stream> getTopNames(int limit) { return items.values() .stream() - .flatMap(s -> s.stream()) + .flatMap(Collection::stream) .sorted(IntAttached.comparator()) .limit(limit) .map(entry -> IntAttached.with(entry.count(), entry.stack()