diff --git a/build.gradle.kts b/build.gradle.kts index 2d9a9e74..ead1f2af 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -57,7 +57,7 @@ subprojects { }) compileOnly(group = "com.teamresourceful", name = "yabn", version = "1.0.3") - "include"("modApi"(group = "com.teamresourceful.resourcefullib", name = "resourcefullib-$modLoader-$minecraftVersion", version = resourcefulLibVersion)) + "modApi"(group = "com.teamresourceful.resourcefullib", name = "resourcefullib-$modLoader-$minecraftVersion", version = resourcefulLibVersion) } java { diff --git a/changelog.md b/changelog.md index 3c65b1b1..e342cddb 100644 --- a/changelog.md +++ b/changelog.md @@ -23,7 +23,7 @@ before updating.** - Add more trim types. - Add better tooltips to make it more clear what's hammerable, what can hold cushions, and what can hold sheets. - Shelf variants are now controlled via hammer. -- Fancy beds should no longer break with block entity optimization mods. I haven't tested, but it'll probably work now. +- Fixed fancy bed incompatibility with better beds - Optimized fancy beds. Fancy beds are no longer block entities which improves their performance substantially, far beyond even vanilla beds. - Add highlight support to furniture. This improves the visual outline box of the furniture. diff --git a/common/src/main/generated/resources/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 b/common/src/main/generated/resources/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 index fecf3328..0e0f6ccb 100644 --- a/common/src/main/generated/resources/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 +++ b/common/src/main/generated/resources/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 @@ -1,2 +1,2 @@ -// 1.20.1 2023-10-16T10:04:47.066914 Languages: en_us -0719a9abcf6e64a36b4aaa590a2f77d52ee9fd81 assets/handcrafted/lang/en_us.json +// 1.20.1 2023-10-16T17:42:00.338105 Languages: en_us +a196d1b282263a6be17d08f0beb35c310c7e97b1 assets/handcrafted/lang/en_us.json diff --git a/common/src/main/generated/resources/assets/handcrafted/lang/en_us.json b/common/src/main/generated/resources/assets/handcrafted/lang/en_us.json index 5a518c04..f9a00363 100644 --- a/common/src/main/generated/resources/assets/handcrafted/lang/en_us.json +++ b/common/src/main/generated/resources/assets/handcrafted/lang/en_us.json @@ -378,6 +378,7 @@ "tooltip.handcrafted.bed_pillow": "Right-click with a cushion to change the bed's pillow color.", "tooltip.handcrafted.bed_sheet": "Right-click with a sheet to change the bedsheets.", "tooltip.handcrafted.counter": "Right-click with wood or stone to change the counter surface.", + "tooltip.handcrafted.crockery_combo": "Right-click with any item to place it on the plate.", "tooltip.handcrafted.cushion": "Right-click with a cushion to change the block's look.", "tooltip.handcrafted.hammer": "Changes the look of blocks.", "tooltip.handcrafted.hammer_use_look": "Right-click with a hammer to change the block's look.", diff --git a/common/src/main/java/earth/terrarium/handcrafted/client/renderer/CrockeryRenderer.java b/common/src/main/java/earth/terrarium/handcrafted/client/renderer/CrockeryRenderer.java index d18b8642..e12b8f6b 100644 --- a/common/src/main/java/earth/terrarium/handcrafted/client/renderer/CrockeryRenderer.java +++ b/common/src/main/java/earth/terrarium/handcrafted/client/renderer/CrockeryRenderer.java @@ -6,10 +6,8 @@ import earth.terrarium.handcrafted.common.blocks.crockery.CrockeryBlockEntity; import earth.terrarium.handcrafted.common.blocks.crockery.CrockeryComboBlock; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.LightTexture; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.blockentity.BlockEntityRenderer; -import net.minecraft.client.renderer.texture.OverlayTexture; import net.minecraft.world.item.ItemDisplayContext; public class CrockeryRenderer implements BlockEntityRenderer { @@ -21,7 +19,7 @@ public void render(CrockeryBlockEntity entity, float partialTick, PoseStack pose poseStack.translate(0.5, 1.25f / 16, 0.5); poseStack.mulPose(Axis.YN.rotationDegrees(entity.getBlockState().getValue(CrockeryComboBlock.FACING).getOpposite().toYRot())); poseStack.mulPose(Axis.XP.rotationDegrees(270)); - Minecraft.getInstance().getItemRenderer().renderStatic(entity.getStack(), ItemDisplayContext.GROUND, LightTexture.FULL_BRIGHT, OverlayTexture.NO_OVERLAY, poseStack, bufferSource, Minecraft.getInstance().level, 0); + Minecraft.getInstance().getItemRenderer().renderStatic(entity.getStack(), ItemDisplayContext.GROUND, packedLight, packedOverlay, poseStack, bufferSource, Minecraft.getInstance().level, 0); } } } diff --git a/common/src/main/java/earth/terrarium/handcrafted/common/blocks/base/properties/ColorProperty.java b/common/src/main/java/earth/terrarium/handcrafted/common/blocks/base/properties/ColorProperty.java index 565262f4..b92cfcdc 100644 --- a/common/src/main/java/earth/terrarium/handcrafted/common/blocks/base/properties/ColorProperty.java +++ b/common/src/main/java/earth/terrarium/handcrafted/common/blocks/base/properties/ColorProperty.java @@ -29,14 +29,16 @@ public enum ColorProperty implements StringRepresentable { BLACK, ; - public String toString() { - return getSerializedName(); - } - + @Override public @NotNull String getSerializedName() { return name().toLowerCase(); } + @Override + public String toString() { + return getSerializedName(); + } + public static ColorProperty fromCushion(Item cushion) { return ColorProperty.valueOf(BuiltInRegistries.ITEM.getKey(cushion).getPath().replace("_cushion", "").toUpperCase(Locale.ROOT)); } diff --git a/common/src/main/java/earth/terrarium/handcrafted/common/blocks/base/properties/CounterProperty.java b/common/src/main/java/earth/terrarium/handcrafted/common/blocks/base/properties/CounterProperty.java index 3822e094..1036e058 100644 --- a/common/src/main/java/earth/terrarium/handcrafted/common/blocks/base/properties/CounterProperty.java +++ b/common/src/main/java/earth/terrarium/handcrafted/common/blocks/base/properties/CounterProperty.java @@ -33,14 +33,16 @@ public enum CounterProperty implements StringRepresentable { WARPED_PLANKS, ; - public String toString() { - return getSerializedName(); - } - + @Override public @NotNull String getSerializedName() { return name().toLowerCase(); } + @Override + public String toString() { + return getSerializedName(); + } + public static CounterProperty fromBlock(Item block) { return CounterProperty.valueOf(BuiltInRegistries.ITEM.getKey(block).getPath().toUpperCase(Locale.ROOT)); } diff --git a/common/src/main/java/earth/terrarium/handcrafted/common/blocks/base/properties/DirectionalBlockProperty.java b/common/src/main/java/earth/terrarium/handcrafted/common/blocks/base/properties/DirectionalBlockProperty.java index 466fecfd..5223e571 100644 --- a/common/src/main/java/earth/terrarium/handcrafted/common/blocks/base/properties/DirectionalBlockProperty.java +++ b/common/src/main/java/earth/terrarium/handcrafted/common/blocks/base/properties/DirectionalBlockProperty.java @@ -10,11 +10,13 @@ public enum DirectionalBlockProperty implements StringRepresentable { RIGHT, ; - public String toString() { - return getSerializedName(); - } - + @Override public @NotNull String getSerializedName() { return name().toLowerCase(); } + + @Override + public String toString() { + return getSerializedName(); + } } diff --git a/common/src/main/java/earth/terrarium/handcrafted/common/blocks/base/properties/ModularSeatProperty.java b/common/src/main/java/earth/terrarium/handcrafted/common/blocks/base/properties/ModularSeatProperty.java index 662cebff..3e9ea77e 100644 --- a/common/src/main/java/earth/terrarium/handcrafted/common/blocks/base/properties/ModularSeatProperty.java +++ b/common/src/main/java/earth/terrarium/handcrafted/common/blocks/base/properties/ModularSeatProperty.java @@ -14,6 +14,12 @@ public enum ModularSeatProperty implements StringRepresentable { OUTER_RIGHT, ; + @Override + public @NotNull String getSerializedName() { + return name().toLowerCase(); + } + + @Override public String toString() { return getSerializedName(); } @@ -25,8 +31,4 @@ public String getLocation() { default -> getSerializedName(); }; } - - public @NotNull String getSerializedName() { - return name().toLowerCase(); - } } diff --git a/common/src/main/java/earth/terrarium/handcrafted/common/blocks/base/properties/OptionalColorProperty.java b/common/src/main/java/earth/terrarium/handcrafted/common/blocks/base/properties/OptionalColorProperty.java index 5d4fbac1..35af8bb5 100644 --- a/common/src/main/java/earth/terrarium/handcrafted/common/blocks/base/properties/OptionalColorProperty.java +++ b/common/src/main/java/earth/terrarium/handcrafted/common/blocks/base/properties/OptionalColorProperty.java @@ -30,14 +30,16 @@ public enum OptionalColorProperty implements StringRepresentable { BLACK, ; - public String toString() { - return getSerializedName(); - } - + @Override public @NotNull String getSerializedName() { return name().toLowerCase(); } + @Override + public String toString() { + return getSerializedName(); + } + public static OptionalColorProperty fromCushion(Item cushion) { return OptionalColorProperty.valueOf(BuiltInRegistries.ITEM.getKey(cushion).getPath().replace("_cushion", "").toUpperCase(Locale.ROOT)); } diff --git a/common/src/main/java/earth/terrarium/handcrafted/common/blocks/base/properties/TableProperty.java b/common/src/main/java/earth/terrarium/handcrafted/common/blocks/base/properties/TableProperty.java index 58ed4d64..eca45066 100644 --- a/common/src/main/java/earth/terrarium/handcrafted/common/blocks/base/properties/TableProperty.java +++ b/common/src/main/java/earth/terrarium/handcrafted/common/blocks/base/properties/TableProperty.java @@ -22,11 +22,13 @@ public enum TableProperty implements StringRepresentable { WEST_SIDE, ; - public String toString() { - return getSerializedName(); - } - + @Override public @NotNull String getSerializedName() { return name().toLowerCase(); } + + @Override + public String toString() { + return getSerializedName(); + } } diff --git a/common/src/main/java/earth/terrarium/handcrafted/common/blocks/base/properties/TrimProperty.java b/common/src/main/java/earth/terrarium/handcrafted/common/blocks/base/properties/TrimProperty.java index 9be3e2d4..ecd56489 100644 --- a/common/src/main/java/earth/terrarium/handcrafted/common/blocks/base/properties/TrimProperty.java +++ b/common/src/main/java/earth/terrarium/handcrafted/common/blocks/base/properties/TrimProperty.java @@ -9,11 +9,13 @@ public enum TrimProperty implements StringRepresentable { THIN, ; - public String toString() { - return getSerializedName(); - } - + @Override public @NotNull String getSerializedName() { return name().toLowerCase(); } + + @Override + public String toString() { + return getSerializedName(); + } } diff --git a/common/src/main/java/earth/terrarium/handcrafted/common/blocks/crockery/CrockeryComboBlock.java b/common/src/main/java/earth/terrarium/handcrafted/common/blocks/crockery/CrockeryComboBlock.java index 16b10d02..286dac29 100644 --- a/common/src/main/java/earth/terrarium/handcrafted/common/blocks/crockery/CrockeryComboBlock.java +++ b/common/src/main/java/earth/terrarium/handcrafted/common/blocks/crockery/CrockeryComboBlock.java @@ -1,13 +1,16 @@ package earth.terrarium.handcrafted.common.blocks.crockery; import earth.terrarium.handcrafted.common.blocks.base.SimpleBlock; +import earth.terrarium.handcrafted.common.constants.ConstantComponents; import net.minecraft.core.BlockPos; +import net.minecraft.network.chat.Component; import net.minecraft.sounds.SoundEvents; import net.minecraft.world.Containers; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; @@ -19,6 +22,9 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; @SuppressWarnings("deprecation") public class CrockeryComboBlock extends SimpleBlock implements EntityBlock { @@ -50,6 +56,11 @@ public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { return RenderShape.MODEL; } + @Override + public void appendHoverText(ItemStack stack, @Nullable BlockGetter level, List tooltip, TooltipFlag flag) { + tooltip.add(ConstantComponents.CROCKERY_COMBO); + } + @Override public @NotNull InteractionResult use(BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) { if (level.getBlockEntity(pos) instanceof CrockeryBlockEntity crockery) { diff --git a/common/src/main/java/earth/terrarium/handcrafted/common/constants/ConstantComponents.java b/common/src/main/java/earth/terrarium/handcrafted/common/constants/ConstantComponents.java index fe6b9f38..a5a99ef4 100644 --- a/common/src/main/java/earth/terrarium/handcrafted/common/constants/ConstantComponents.java +++ b/common/src/main/java/earth/terrarium/handcrafted/common/constants/ConstantComponents.java @@ -10,6 +10,7 @@ public class ConstantComponents { public static final Component HAMMER_USE_LOOK_SHIFT = Component.translatable("tooltip.handcrafted.hammer_use_look_shift").copy().withStyle(ChatFormatting.GRAY); public static final Component COUNTER = Component.translatable("tooltip.handcrafted.counter").copy().withStyle(ChatFormatting.GRAY); + public static final Component CROCKERY_COMBO = Component.translatable("tooltip.handcrafted.crockery_combo").copy().withStyle(ChatFormatting.GRAY); public static final Component PLACE_ON_FURNITURE = Component.translatable("tooltip.handcrafted.place_on_furniture").copy().withStyle(ChatFormatting.GRAY); public static final Component CUSHION = Component.translatable("tooltip.handcrafted.cushion").copy().withStyle(ChatFormatting.GRAY); diff --git a/forge/src/main/java/earth/terrarium/handcrafted/datagen/provider/client/ModLangProvider.java b/forge/src/main/java/earth/terrarium/handcrafted/datagen/provider/client/ModLangProvider.java index 46eef905..5a999dbd 100644 --- a/forge/src/main/java/earth/terrarium/handcrafted/datagen/provider/client/ModLangProvider.java +++ b/forge/src/main/java/earth/terrarium/handcrafted/datagen/provider/client/ModLangProvider.java @@ -51,7 +51,9 @@ protected void addTranslations() { add(ConstantComponents.HAMMER_USE_LOOK.getString(), "Right-click with a hammer to change the block's look."); add(ConstantComponents.HAMMER_USE_SHAPE.getString(), "Right-click with a hammer to change the block's shape."); add(ConstantComponents.HAMMER_USE_LOOK_SHIFT.getString(), "Shift-right-click with a hammer to change the block's look."); + add(ConstantComponents.COUNTER.getString(), "Right-click with wood or stone to change the counter surface."); + add(ConstantComponents.CROCKERY_COMBO.getString(), "Right-click with any item to place it on the plate."); add(ConstantComponents.PLACE_ON_FURNITURE.getString(), "Can be placed on furniture."); add(ConstantComponents.CUSHION.getString(), "Right-click with a cushion to change the block's look.");