diff --git a/CHANGELOG.md b/CHANGELOG.md index cc02c908..0351a039 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,6 @@ # CHANGELOG +- ### Updated Fabric Loader to 0.16.5. +- ### Added native EveryCompat support. - ### There's a config now !! - ### Urns can now be interacted with Dirt -- when they are filled in this way, plants can be placed atop them. - To remove the Dirt, simply right-click the Urn with any Shovel -- this uses the #minecraft:shovels tag, so any item tagged as a Shovel will work. @@ -15,4 +17,9 @@ - ### Added Balustrades - Balustrades replace the functionality of placing Trapdoors on top of Lecterns, but in all wood types. - Balustrades can be interacted with a Hammer on either their top or bottom half to toggle the top and bottom respectively. Their center beam cannot be toggled, and uses the texture of Wooden Walls / Beams so they can better connect with them. - - Balustrades can be **SHIFT** + right-clicked with a Hammer to tilt the top cube to represent a slightly taller Lectern. Doing so will give them a custom hitbox, but they will act the same otherwise. \ No newline at end of file + - Balustrades can be **SHIFT** + right-clicked with a Hammer to tilt the top cube to represent a slightly taller Lectern. Doing so will give them a custom hitbox, but they will act the same otherwise. +- ### Added Lattices + - Can connect horizontally and vertically, but do not connect via corners. + - Plants like Leaves and certain other plants like Glow Berries and Vines can be placed on them. + - Glow Berries placed on them can be Bone Mealed to grow. + - They can be climbed. \ No newline at end of file diff --git a/build.gradle b/build.gradle index 384fa5d0..1f04bd21 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '1.2-SNAPSHOT' + id 'fabric-loom' version '1.6-SNAPSHOT' id 'maven-publish' } @@ -54,6 +54,9 @@ dependencies { modImplementation("com.simibubi.create:create-fabric-${minecraft_version}:${fabric_create_version}") // Create Fabric + modImplementation ("curse.maven:every-compat-628539:5670282") // WoodGood + its dependency, Selene + modImplementation ("curse.maven:selene-499980:5666908") + // Fabric API. This is technically optional, but you probably want it anyway. modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" modImplementation "maven.modrinth:midnightlib:${project.midnightlib_version}" diff --git a/gradle.properties b/gradle.properties index 2eddc9aa..87aa52ca 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,15 +7,16 @@ org.gradle.parallel=true # check these on https://fabricmc.net/develop minecraft_version=1.20.1 yarn_mappings=1.20.1+build.10 -loader_version=0.14.24 +loader_version=0.16.5 mod_menu_version=7.2.2 # Mod Properties -mod_version=1.20.1-fabric-1.0.1 +mod_version=1.20.1-fabric-2.0.0 maven_group=com.starfish_studios archives_base_name=bbb # Dependencies + fabric_version=0.90.4+1.20.1 fabric_registrate_version = 1.3.62-MC1.20.1 fabric_flywheel_version = 0.6.9-1 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ac72c34e..a80b22ce 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/src/main/java/com/starfish_studios/bbb/BBBModule.java b/src/main/java/com/starfish_studios/bbb/BBBModule.java new file mode 100644 index 00000000..73076c99 --- /dev/null +++ b/src/main/java/com/starfish_studios/bbb/BBBModule.java @@ -0,0 +1,302 @@ +package com.starfish_studios.bbb; + +import com.starfish_studios.bbb.block.*; +import com.starfish_studios.bbb.item.DescriptionBlockItem; +import com.starfish_studios.bbb.registry.BBBBlocks; +import com.starfish_studios.bbb.registry.BBBItems; +import io.github.fabricators_of_create.porting_lib.common.util.PlantType; +import net.fabricmc.fabric.api.client.rendering.v1.ColorProviderRegistry; +import net.mehvahdjukaar.every_compat.api.*; +import net.mehvahdjukaar.moonlight.api.platform.ClientHelper; +import net.mehvahdjukaar.moonlight.api.set.leaves.LeavesType; +import net.mehvahdjukaar.moonlight.api.set.wood.WoodType; +import net.mehvahdjukaar.moonlight.api.set.wood.WoodTypeRegistry; +import net.mehvahdjukaar.moonlight.api.util.Utils; +import net.minecraft.client.color.block.BlockColor; +import net.minecraft.client.renderer.BiomeColors; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.core.registries.Registries; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.BlockItem; +import net.minecraft.world.level.FoliageColor; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.RotatedPillarBlock; +import net.minecraft.world.level.block.StairBlock; +import net.minecraft.world.level.block.state.BlockState; + +import java.util.Map; + +import static com.starfish_studios.bbb.BuildingButBetter.MOD_ID; + +public class BBBModule extends SimpleModule { + + // Trim, Beam, Beam Stairs, Beam Slab, Pallets, Supports, Balustrades, Walls, Frames, Lanterns, Ladders, Lattices + + public final SimpleEntrySet trims; + public final SimpleEntrySet beams; + public final SimpleEntrySet beamStairs; + public final SimpleEntrySet beamSlabs; + public final SimpleEntrySet pallets; + public final SimpleEntrySet supports; + public final SimpleEntrySet balustrades; + public final SimpleEntrySet walls; + public final SimpleEntrySet frames; + public final SimpleEntrySet lanterns; +// public final SimpleEntrySet ladders; + public final SimpleEntrySet lattices; + + public static void init(String modId) { + new BBBModule(MOD_ID); + } + + @Override + public void registerBlockColors(ClientHelper.BlockColorEvent event) { + super.registerBlockColors(event); + ColorProviderRegistry blockColor = ColorProviderRegistry.BLOCK; +// blockColor.register((state, world, pos, tintIndex) -> { +// if (world == null || pos == null) { +// return FoliageColor.getDefaultColor(); +// } +// return BiomeColors.getAverageFoliageColor(world, pos); +// } +// ); + for (Map.Entry entry : lattices.blocks.entrySet()) { + blockColor.register((state, world, pos, tintIndex) -> { + if (world == null || pos == null) { + return FoliageColor.getDefaultColor(); + } + return BiomeColors.getAverageFoliageColor(world, pos); + }, entry.getValue()); + } + } + + public BBBModule(String modId) { + super(modId, "bbb"); + + SimpleModule bbb = new SimpleModule("bbb", "bbb"); + + + + trims = SimpleEntrySet.builder(WoodType.class, "trim", + getModBlock("oak_trim"), () -> WoodTypeRegistry.OAK_TYPE, + w -> new FacingConnectingBlock(Utils.copyPropertySafe(BBBBlocks.OAK_TRIM))) + .addTag(modRes("trims"), Registries.BLOCK) + .addTag(modRes("trims"), Registries.ITEM) + .copyParentDrop() + .defaultRecipe() + .setTab(getModTab(MOD_ID)) + .setTabMode(TabAddMode.AFTER_SAME_TYPE) + .setRenderType(() -> RenderType::cutout) + .useMergedPalette() + .addTexture(modRes("block/trim/oak_bottom")) + .addTexture(modRes("block/trim/oak_middle")) + .addTexture(modRes("block/trim/oak_none")) + .addTexture(modRes("block/trim/oak_top")) + .addTexture(modRes("block/trim/oak_top_face")) + .build(); + + this.addEntry(trims); + + beams = SimpleEntrySet.builder(WoodType.class, "beam", + getModBlock("oak_beam"), () -> WoodTypeRegistry.OAK_TYPE, + w -> new RotatedPillarBlock(Utils.copyPropertySafe(BBBBlocks.OAK_BEAM))) + .addTag(modRes("beams"), Registries.BLOCK) + .addTag(modRes("beams"), Registries.ITEM) + .copyParentDrop() + .defaultRecipe() + .setTab(getModTab(MOD_ID)) + .setTabMode(TabAddMode.AFTER_SAME_TYPE) + .setRenderType(() -> RenderType::cutout) + .useMergedPalette() + .addTexture(modRes("block/beam/oak")) + .addTexture(modRes("block/beam/oak_top")) + .build(); + + this.addEntry(beams); + + beamStairs = SimpleEntrySet.builder(WoodType.class, "beam_stairs", + getModBlock("oak_beam_stairs"), () -> WoodTypeRegistry.OAK_TYPE, + w -> new StairBlock((Blocks.OAK_PLANKS.defaultBlockState()), Utils.copyPropertySafe(BBBBlocks.OAK_BEAM_STAIRS))) + .addTag(modRes("beams"), Registries.BLOCK) + .addTag(modRes("beams"), Registries.ITEM) + .copyParentDrop() + .defaultRecipe() + .setTab(getModTab(MOD_ID)) + .setTabMode(TabAddMode.AFTER_SAME_TYPE) + .setRenderType(() -> RenderType::cutout) + .useMergedPalette() + .addTexture(modRes("block/beam/oak")) + .addTexture(modRes("block/beam/oak_top")) + .build(); + + this.addEntry(beamStairs); + + beamSlabs = SimpleEntrySet.builder(WoodType.class, "beam_slab", + getModBlock("oak_beam_slab"), () -> WoodTypeRegistry.OAK_TYPE, + w -> new FacingSlabBlock(Utils.copyPropertySafe(BBBBlocks.OAK_BEAM_SLAB))) + .addTag(modRes("beams"), Registries.BLOCK) + .addTag(modRes("beams"), Registries.ITEM) + .copyParentDrop() + .defaultRecipe() + .setTab(getModTab(MOD_ID)) + .setTabMode(TabAddMode.AFTER_SAME_TYPE) + .setRenderType(() -> RenderType::cutout) + .useMergedPalette() + .addTexture(modRes("block/beam/oak")) + .addTexture(modRes("block/beam/oak_top")) + .build(); + + this.addEntry(beamSlabs); + + pallets = SimpleEntrySet.builder(WoodType.class, "pallet", + getModBlock("oak_pallet"), () -> WoodTypeRegistry.OAK_TYPE, + w -> new PalletBlock(Utils.copyPropertySafe(BBBBlocks.OAK_PALLET))) + .addTag(modRes("pallets"), Registries.BLOCK) + .addTag(modRes("pallets"), Registries.ITEM) + .addCustomItem((wood, block, properties) -> new DescriptionBlockItem(block, properties)) + .copyParentDrop() + .defaultRecipe() + .setTab(getModTab(MOD_ID)) + .setTabMode(TabAddMode.AFTER_SAME_TYPE) + .setRenderType(() -> RenderType::cutout) + .useMergedPalette() + .addTexture(modRes("block/pallet/oak_pallet")) + .build(); + + this.addEntry(pallets); + + supports = SimpleEntrySet.builder(WoodType.class, "support", + getModBlock("oak_support"), () -> WoodTypeRegistry.OAK_TYPE, + w -> new SupportBlock(Utils.copyPropertySafe(BBBBlocks.OAK_SUPPORT))) + .addTag(modRes("supports"), Registries.BLOCK) + .addTag(modRes("supports"), Registries.ITEM) + .addCustomItem((wood, block, properties) -> new DescriptionBlockItem(block, properties)) + .copyParentDrop() + .defaultRecipe() + .setTab(getModTab(MOD_ID)) + .setTabMode(TabAddMode.AFTER_SAME_TYPE) + .setRenderType(() -> RenderType::cutout) + .useMergedPalette() + .addTexture(modRes("block/beam/oak")) + .addTexture(modRes("block/beam/oak_top")) + .build(); + + this.addEntry(supports); + + balustrades = SimpleEntrySet.builder(WoodType.class, "balustrade", + getModBlock("oak_balustrade"), () -> WoodTypeRegistry.OAK_TYPE, + w -> new BalustradeBlock(Utils.copyPropertySafe(BBBBlocks.OAK_BALUSTRADE))) + .addTag(modRes("balustrades"), Registries.BLOCK) + .addTag(modRes("balustrades"), Registries.ITEM) + .addCustomItem((wood, block, properties) -> new DescriptionBlockItem(block, properties)) + .copyParentDrop() + .defaultRecipe() + .setTab(getModTab(MOD_ID)) + .setTabMode(TabAddMode.AFTER_SAME_TYPE) + .setRenderType(() -> RenderType::cutout) + .useMergedPalette() + .addTexture(modRes("block/balustrade/oak_top")) + .addTexture(modRes("block/balustrade/oak_sides")) + .build(); + + this.addEntry(balustrades); + + walls = SimpleEntrySet.builder(WoodType.class, "wall", + getModBlock("oak_wall"), () -> WoodTypeRegistry.OAK_TYPE, + w -> new WoodenWallBlock(Utils.copyPropertySafe(BBBBlocks.OAK_WALL))) + .addTag(modRes("wooden_walls"), Registries.BLOCK) +// .addTag(modRes("wooden_walls"), Registries.ITEM) + .copyParentDrop() + .defaultRecipe() + .setTab(getModTab(MOD_ID)) + .setTabMode(TabAddMode.AFTER_SAME_TYPE) + .setRenderType(() -> RenderType::cutout) + .useMergedPalette() + .addTexture(modRes("block/beam/oak")) + .addTexture(modRes("block/beam/oak_top")) + .build(); + + this.addEntry(walls); + + frames = SimpleEntrySet.builder(WoodType.class, "frame", + getModBlock("oak_frame"), () -> WoodTypeRegistry.OAK_TYPE, + w -> new FrameBlock(Utils.copyPropertySafe(BBBBlocks.OAK_FRAME))) + .addTag(modRes("frames"), Registries.BLOCK) + .addTag(modRes("frames"), Registries.ITEM) + .addCustomItem((wood, block, properties) -> new DescriptionBlockItem(block, properties)) + .copyParentDrop() + .defaultRecipe() + .setTab(getModTab(MOD_ID)) + .setTabMode(TabAddMode.AFTER_SAME_TYPE) + .setRenderType(() -> RenderType::cutout) + .useMergedPalette() + .addTexture(modRes("block/frame/oak")) + .addTexture(modRes("block/frame/oak_sticks")) + .build(); + + this.addEntry(frames); + + lanterns = SimpleEntrySet.builder(WoodType.class, "lantern", + getModBlock("oak_lantern"), () -> WoodTypeRegistry.OAK_TYPE, + w -> new WoodenLanternBlock(Utils.copyPropertySafe(BBBBlocks.OAK_LANTERN))) + .addTag(modRes("lanterns"), Registries.BLOCK) + .addTag(modRes("lanterns"), Registries.ITEM) + .addCustomItem((wood, block, properties) -> new DescriptionBlockItem(block, properties)) + .copyParentDrop() + .defaultRecipe() + .setTab(getModTab(MOD_ID)) + .setTabMode(TabAddMode.AFTER_SAME_TYPE) + .setRenderType(() -> RenderType::cutout) + .useMergedPalette() + .addTextureM(modRes("block/lantern/oak"), modRes("block/lantern/lantern_mask")) + .build(); + + this.addEntry(lanterns); + +// ladders = SimpleEntrySet.builder(WoodType.class, "ladder", +// getModBlock("oak_ladder"), () -> WoodTypeRegistry.OAK_TYPE, +// w -> new BBBLadderBlock(1, Utils.copyPropertySafe(BBBBlocks.OAK_LADDER))) +// .addTag(modRes("ladders"), Registries.BLOCK) +// .addTag(modRes("ladders"), Registries.ITEM) +// .copyParentDrop() +// .defaultRecipe() +// .setTab(getModTab(MOD_ID)) +// .setTabMode(TabAddMode.AFTER_SAME_TYPE) +// .setRenderType(() -> RenderType::cutout) +// .useMergedPalette() +// .addTexture(modRes("block/ladder/oak/oak")) +// .addTexture(modRes("block/ladder/spruce/spruce")) +// .addTexture(modRes("block/ladder/birch/birch")) +// .addTexture(modRes("block/ladder/jungle/jungle")) +// .addTexture(modRes("block/ladder/acacia/acacia")) +// .addTexture(modRes("block/ladder/dark_oak/dark_oak")) +// .addTexture(modRes("block/ladder/mangrove/mangrove")) +// .addTexture(modRes("block/ladder/cherry/cherry")) +// .build(); +// +// this.addEntry(ladders); + + lattices = SimpleEntrySet.builder(WoodType.class, "lattice", + getModBlock("oak_lattice"), () -> WoodTypeRegistry.OAK_TYPE, + w -> new LatticeBlock(Utils.copyPropertySafe(BBBBlocks.OAK_LATTICE))) + .addTag(modRes("lattices"), Registries.BLOCK) + .addTag(modRes("lattices"), Registries.ITEM) + .addCustomItem((wood, block, properties) -> new DescriptionBlockItem(block, properties)) + .copyParentDrop() + .defaultRecipe() + .setTab(getModTab(MOD_ID)) + .setTabMode(TabAddMode.AFTER_SAME_TYPE) + .setRenderType(() -> RenderType::cutout) + .useMergedPalette() + .addTexture(modRes("block/lattice/oak")) + .addTexture(ResourceLocation.tryParse("minecraft:block/oak_log")) + .addTexture(ResourceLocation.tryParse("minecraft:block/oak_log_top")) + .build(); + + this.addEntry(lattices); + + + EveryCompatAPI.registerModule(bbb); + } +} diff --git a/src/main/java/com/starfish_studios/bbb/BuildingButBetter.java b/src/main/java/com/starfish_studios/bbb/BuildingButBetter.java index d1f1b3a5..9b4bb34d 100644 --- a/src/main/java/com/starfish_studios/bbb/BuildingButBetter.java +++ b/src/main/java/com/starfish_studios/bbb/BuildingButBetter.java @@ -7,6 +7,8 @@ import net.fabricmc.api.ModInitializer; import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; import net.fabricmc.fabric.api.registry.OxidizableBlocksRegistry; +import net.fabricmc.loader.api.FabricLoader; +import net.mehvahdjukaar.every_compat.EveryCompat; import net.minecraft.Util; import net.minecraft.world.item.CreativeModeTabs; import net.minecraft.world.item.Items; @@ -24,7 +26,14 @@ public class BuildingButBetter implements ModInitializer { @Override public void onInitialize() { MidnightConfig.init(MOD_ID, BBBConfig.class); + + + if(FabricLoader.getInstance().isModLoaded("everycomp")){ + EveryCompat.ACTIVE_MODULES.put(MOD_ID, new BBBModule(MOD_ID)); + } + BlockUseEvent.EVENT.register(new BlockUseEvent()); + Reflection.initialize( BBBCreativeModeTab.class, BBBSoundEvents.class, @@ -32,6 +41,7 @@ public void onInitialize() { BBBBlocks.class ); + // region CREATIVE TAB INJECTIONS ItemGroupEvents.modifyEntriesEvent(CreativeModeTabs.FUNCTIONAL_BLOCKS).register(entries -> { diff --git a/src/main/java/com/starfish_studios/bbb/block/LatticeBlock.java b/src/main/java/com/starfish_studios/bbb/block/LatticeBlock.java index 4895e47d..569a250f 100644 --- a/src/main/java/com/starfish_studios/bbb/block/LatticeBlock.java +++ b/src/main/java/com/starfish_studios/bbb/block/LatticeBlock.java @@ -147,34 +147,34 @@ public VoxelShape getVisualShape(BlockState state, BlockGetter world, BlockPos p } public BlockState getConnections(BlockState state, LevelAccessor level, BlockPos pos) { - boolean n = validConnection(level.getBlockState(pos.north())); - boolean e = validConnection(level.getBlockState(pos.east())); - boolean s = validConnection(level.getBlockState(pos.south())); - boolean w = validConnection(level.getBlockState(pos.west())); - boolean t = validConnection(level.getBlockState(pos.above())); - boolean b = validConnection(level.getBlockState(pos.below())); + boolean n = validConnection(level.getBlockState(pos.north()), level, pos.north()); + boolean e = validConnection(level.getBlockState(pos.east()), level, pos.east()); + boolean s = validConnection(level.getBlockState(pos.south()), level, pos.south()); + boolean w = validConnection(level.getBlockState(pos.west()), level, pos.west()); + boolean t = validConnection(level.getBlockState(pos.above()), level, pos.above()); + boolean b = validConnection(level.getBlockState(pos.below()), level, pos.below()); if (state.getValue(FACING) == Direction.NORTH) { - boolean left = !e || !validConnection(level.getBlockState(pos.east())); - boolean right = !w || !validConnection(level.getBlockState(pos.west())); + boolean left = !e || !validConnection(level.getBlockState(pos.east()), level, pos.east()); + boolean right = !w || !validConnection(level.getBlockState(pos.west()), level, pos.west()); return state .setValue(LEFT, left) .setValue(RIGHT, right); } else if (state.getValue(FACING) == Direction.SOUTH) { - boolean left = !w || !validConnection(level.getBlockState(pos.west())); - boolean right = !e || !validConnection(level.getBlockState(pos.east())); + boolean left = !w || !validConnection(level.getBlockState(pos.west()), level, pos.west()); + boolean right = !e || !validConnection(level.getBlockState(pos.east()), level, pos.east()); return state .setValue(LEFT, left) .setValue(RIGHT, right); } else if (state.getValue(FACING) == Direction.EAST) { - boolean left = !s || !validConnection(level.getBlockState(pos.south())); - boolean right = !n || !validConnection(level.getBlockState(pos.north())); + boolean left = !s || !validConnection(level.getBlockState(pos.south()), level, pos.south()); + boolean right = !n || !validConnection(level.getBlockState(pos.north()), level, pos.north()); return state .setValue(LEFT, left) .setValue(RIGHT, right); } else if (state.getValue(FACING) == Direction.WEST) { - boolean left = !n || !validConnection(level.getBlockState(pos.north())); - boolean right = !s || !validConnection(level.getBlockState(pos.south())); + boolean left = !n || !validConnection(level.getBlockState(pos.north()), level, pos.north()); + boolean right = !s || !validConnection(level.getBlockState(pos.south()), level, pos.south()); return state .setValue(LEFT, left) .setValue(RIGHT, right); @@ -182,13 +182,13 @@ public BlockState getConnections(BlockState state, LevelAccessor level, BlockPos return state; } - public boolean validConnection(BlockState state) { - return state.isFaceSturdy(null, null, Direction.UP) || - state.isFaceSturdy(null, null, Direction.DOWN) || - state.isFaceSturdy(null, null, Direction.NORTH) || - state.isFaceSturdy(null, null, Direction.EAST) || - state.isFaceSturdy(null, null, Direction.SOUTH) || - state.isFaceSturdy(null, null, Direction.WEST) || + public boolean validConnection(BlockState state, BlockGetter getter, BlockPos pos) { + return state.isFaceSturdy(getter, pos, Direction.UP) || + state.isFaceSturdy(getter, pos, Direction.DOWN) || + state.isFaceSturdy(getter, pos, Direction.NORTH) || + state.isFaceSturdy(getter, pos, Direction.EAST) || + state.isFaceSturdy(getter, pos, Direction.SOUTH) || + state.isFaceSturdy(getter, pos, Direction.WEST) || state.is(this); } diff --git a/src/main/java/com/starfish_studios/bbb/item/DescriptionBlockItem.java b/src/main/java/com/starfish_studios/bbb/item/DescriptionBlockItem.java index fc538fb9..f9490e43 100644 --- a/src/main/java/com/starfish_studios/bbb/item/DescriptionBlockItem.java +++ b/src/main/java/com/starfish_studios/bbb/item/DescriptionBlockItem.java @@ -22,6 +22,45 @@ public DescriptionBlockItem(Block block, Properties properties) { public void appendHoverText(ItemStack stack, Level level, List tooltip, TooltipFlag flagIn) { if (!BBBConfig.disableShiftTooltips) { + if (stack.is(BBBTags.BBBItemTags.BALUSTRADES)) { + if (Screen.hasShiftDown()) { + tooltip.add(Component.translatable("description.bbb.pencil").withStyle(ChatFormatting.BLUE) + .append(Component.translatable("description.bbb.balustrade1").withStyle(ChatFormatting.GRAY))); + tooltip.add(Component.translatable("description.bbb.balustrade2").withStyle(ChatFormatting.GRAY)); + tooltip.add(Component.translatable("description.bbb.balustrade3").withStyle(ChatFormatting.GRAY)); + + tooltip.add(Component.translatable("description.bbb.pencil").withStyle(ChatFormatting.BLUE) + .append(Component.translatable("description.bbb.balustrade4").withStyle(ChatFormatting.GRAY))); + tooltip.add(Component.translatable("description.bbb.balustrade5").withStyle(ChatFormatting.GRAY)); + } else + tooltip.add(Component.literal("[").append(Component.translatable("key.keyboard.left.shift")).append(Component.literal("]")).withStyle(ChatFormatting.DARK_GRAY, ChatFormatting.ITALIC)); + } + + if (stack.is(BBBTags.BBBItemTags.URNS)) { + if (Screen.hasShiftDown()) { + tooltip.add(Component.translatable("description.bbb.pencil").withStyle(ChatFormatting.BLUE) + .append(Component.translatable("description.bbb.urn1").withStyle(ChatFormatting.GRAY))); + tooltip.add(Component.translatable("description.bbb.urn2").withStyle(ChatFormatting.GRAY)); + tooltip.add(Component.translatable("description.bbb.pencil").withStyle(ChatFormatting.BLUE) + .append(Component.translatable("description.bbb.urn3").withStyle(ChatFormatting.GRAY))); + tooltip.add(Component.translatable("description.bbb.urn4").withStyle(ChatFormatting.GRAY)); + } else + tooltip.add(Component.literal("[").append(Component.translatable("key.keyboard.left.shift")).append(Component.literal("]")).withStyle(ChatFormatting.DARK_GRAY, ChatFormatting.ITALIC)); + } + + if (stack.is(BBBTags.BBBItemTags.LATTICES)) { + if (Screen.hasShiftDown()) { + tooltip.add(Component.translatable("description.bbb.pencil").withStyle(ChatFormatting.BLUE) + .append(Component.translatable("description.bbb.lattice1").withStyle(ChatFormatting.GRAY))); + tooltip.add(Component.translatable("description.bbb.lattice2").withStyle(ChatFormatting.GRAY)); + tooltip.add(Component.translatable("description.bbb.pencil").withStyle(ChatFormatting.BLUE) + .append(Component.translatable("description.bbb.lattice3").withStyle(ChatFormatting.GRAY))); + tooltip.add(Component.translatable("description.bbb.lattice4").withStyle(ChatFormatting.GRAY)); + } else + tooltip.add(Component.literal("[").append(Component.translatable("key.keyboard.left.shift")).append(Component.literal("]")).withStyle(ChatFormatting.DARK_GRAY, ChatFormatting.ITALIC)); + } + + if (stack.is(BBBTags.BBBItemTags.LANTERNS)) { if (Screen.hasShiftDown()) { tooltip.add(Component.translatable("description.bbb.pencil").withStyle(ChatFormatting.BLUE) diff --git a/src/main/java/com/starfish_studios/bbb/mixin/BushBlockMixin.java b/src/main/java/com/starfish_studios/bbb/mixin/BushBlockMixin.java index fb23bf43..5b17b6f1 100644 --- a/src/main/java/com/starfish_studios/bbb/mixin/BushBlockMixin.java +++ b/src/main/java/com/starfish_studios/bbb/mixin/BushBlockMixin.java @@ -21,6 +21,6 @@ public BushBlockMixin(Properties properties) { @ModifyReturnValue(method = "mayPlaceOn", at = @At("RETURN")) public boolean mayPlaceOn(boolean original, BlockState state, BlockGetter level, BlockPos pos) { - return !original || state.getBlock() instanceof UrnBlock && state.getValue(UrnBlock.SOILED); + return original || state.getBlock() instanceof UrnBlock && state.getValue(UrnBlock.SOILED); } } diff --git a/src/main/java/com/starfish_studios/bbb/registry/BBBBlocks.java b/src/main/java/com/starfish_studios/bbb/registry/BBBBlocks.java index dce9d10e..f9d249f2 100644 --- a/src/main/java/com/starfish_studios/bbb/registry/BBBBlocks.java +++ b/src/main/java/com/starfish_studios/bbb/registry/BBBBlocks.java @@ -17,6 +17,10 @@ public class BBBBlocks { // Stone, Blackstone, Deepslate, Nether Brick, Sandstone, Red Sandstone, Quartz + // Write a list of every wood block. + // Trim, Beam, Beam Stairs, Beam Slab, Pallets, Supports, Balustrades, Walls, Frames, Lanterns, Ladders, Lattices + + // region BALUSTRADES public static final Block OAK_BALUSTRADE = register("oak_balustrade", new BalustradeBlock(FabricBlockSettings.copy((Blocks.OAK_PLANKS)).noOcclusion())); public static final Block SPRUCE_BALUSTRADE = register("spruce_balustrade", new BalustradeBlock(FabricBlockSettings.copy((Blocks.SPRUCE_PLANKS)).noOcclusion())); diff --git a/src/main/java/com/starfish_studios/bbb/registry/BBBTags.java b/src/main/java/com/starfish_studios/bbb/registry/BBBTags.java index cb6cd883..a7560d1c 100644 --- a/src/main/java/com/starfish_studios/bbb/registry/BBBTags.java +++ b/src/main/java/com/starfish_studios/bbb/registry/BBBTags.java @@ -36,6 +36,10 @@ interface BBBBlockTags { // region ITEM TAGS interface BBBItemTags { + TagKey BALUSTRADES = TagKey.create(Registries.ITEM, new ResourceLocation(MOD_ID, "balustrades")); + TagKey URNS = TagKey.create(Registries.ITEM, new ResourceLocation(MOD_ID, "urns")); + TagKey LATTICES = TagKey.create(Registries.ITEM, new ResourceLocation(MOD_ID, "lattices")); + TagKey CHISEL_STONE = TagKey.create(Registries.ITEM, new ResourceLocation(MOD_ID, "chisel/stone")); TagKey LANTERNS = TagKey.create(Registries.ITEM, new ResourceLocation(MOD_ID, "lanterns")); diff --git a/src/main/resources/assets/bbb/lang/en_us.json b/src/main/resources/assets/bbb/lang/en_us.json index 0b55f47b..0494bf5e 100644 --- a/src/main/resources/assets/bbb/lang/en_us.json +++ b/src/main/resources/assets/bbb/lang/en_us.json @@ -11,6 +11,19 @@ "bbb.midnightconfig.disableShiftTooltips": "Disable Shift tooltips", "bbb.midnightconfig.disableShiftTooltips.tooltip": "§8§o[?]§7§o If enabled, tooltips will be removed from all items.", + "block_type.bbb.trim": "%s Trim", + "block_type.bbb.beam": "%s Beam", + "block_type.bbb.beam_stairs": "%s Beam Stairs", + "block_type.bbb.beam_slab": "%s Beam Slab", + "block_type.bbb.pallet": "%s Pallet", + "block_type.bbb.support": "%s Support", + "block_type.bbb.balustrade": "%s Balustrade", + "block_type.bbb.wall": "%s Wall", + "block_type.bbb.frame": "%s Frame", + "block_type.bbb.lantern": "%s Lantern", + "block_type.bbb.ladder": "%s Ladder", + "block_type.bbb.lattice": "%s Lattice", + "subtitles.block.layer.remove_layer": "Layer removed", "item.bbb.hammer": "Hammer", @@ -226,6 +239,18 @@ "block.bbb.cherry_trim": "Cherry Trim", "block.bbb.bamboo_trim": "Bamboo Trim", + "block.bbb.oak_lattice": "Oak Lattice", + "block.bbb.spruce_lattice": "Spruce Lattice", + "block.bbb.birch_lattice": "Birch Lattice", + "block.bbb.jungle_lattice": "Jungle Lattice", + "block.bbb.acacia_lattice": "Acacia Lattice", + "block.bbb.dark_oak_lattice": "Dark Oak Lattice", + "block.bbb.crimson_lattice": "Crimson Lattice", + "block.bbb.warped_lattice": "Warped Lattice", + "block.bbb.mangrove_lattice": "Mangrove Lattice", + "block.bbb.cherry_lattice": "Cherry Lattice", + "block.bbb.bamboo_lattice": "Bamboo Lattice", + "block.bbb.oak_layer": "Oak Layer", "block.bbb.spruce_layer": "Spruce Layer", "block.bbb.birch_layer": "Birch Layer", @@ -286,6 +311,22 @@ "description.bbb.pencil": "✐ ", + "description.bbb.balustrade1": "Right-Click with a Hammer", + "description.bbb.balustrade2": "on either the top or bottom", + "description.bbb.balustrade3": "to toggle the top/bottom.", + "description.bbb.balustrade4": "Sneak + Right-Click with a Hammer", + "description.bbb.balustrade5": "to rotate the top.", + + "description.bbb.urn1": "Right-Click with Dirt", + "description.bbb.urn2": "to fill the Urn.", + "description.bbb.urn3": "Right-Click with a Shovel", + "description.bbb.urn4": "to remove the Dirt.", + + "description.bbb.lattice1": "Right-Click with Leaves, etc.", + "description.bbb.lattice2": "to plant them on the Lattice.", + "description.bbb.lattice3": "Right-Click with Shears", + "description.bbb.lattice4": "to remove plants.", + "description.bbb.moulding1": "Right-Click with a Hammer", "description.bbb.moulding2": "to toggle the dentil.", diff --git a/src/main/resources/assets/bbb/textures/block/lantern/lantern_mask.png b/src/main/resources/assets/bbb/textures/block/lantern/lantern_mask.png new file mode 100644 index 00000000..f8825977 Binary files /dev/null and b/src/main/resources/assets/bbb/textures/block/lantern/lantern_mask.png differ diff --git a/src/main/resources/data/bbb/tags/items/balustrades.json b/src/main/resources/data/bbb/tags/items/balustrades.json new file mode 100644 index 00000000..dad1c5cf --- /dev/null +++ b/src/main/resources/data/bbb/tags/items/balustrades.json @@ -0,0 +1,16 @@ +{ + "values": [ + "bbb:oak_balustrade", + "bbb:spruce_balustrade", + "bbb:birch_balustrade", + "bbb:jungle_balustrade", + "bbb:acacia_balustrade", + "bbb:dark_oak_balustrade", + "bbb:crimson_balustrade", + "bbb:warped_balustrade", + "bbb:mangrove_balustrade", + "bbb:bamboo_balustrade", + "bbb:cherry_balustrade" + + ] +} \ No newline at end of file diff --git a/src/main/resources/data/bbb/tags/items/lattices.json b/src/main/resources/data/bbb/tags/items/lattices.json new file mode 100644 index 00000000..b34a912e --- /dev/null +++ b/src/main/resources/data/bbb/tags/items/lattices.json @@ -0,0 +1,15 @@ +{ + "values": [ + "bbb:oak_lattice", + "bbb:spruce_lattice", + "bbb:birch_lattice", + "bbb:jungle_lattice", + "bbb:acacia_lattice", + "bbb:dark_oak_lattice", + "bbb:crimson_lattice", + "bbb:warped_lattice", + "bbb:mangrove_lattice", + "bbb:bamboo_lattice", + "bbb:cherry_lattice" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/bbb/tags/items/urns.json b/src/main/resources/data/bbb/tags/items/urns.json new file mode 100644 index 00000000..5058078e --- /dev/null +++ b/src/main/resources/data/bbb/tags/items/urns.json @@ -0,0 +1,11 @@ +{ + "values": [ + "bbb:stone_urn", + "bbb:blackstone_urn", + "bbb:sandstone_urn", + "bbb:red_sandstone_urn", + "bbb:quartz_urn", + "bbb:deepslate_urn", + "bbb:nether_brick_urn" + ] +} \ No newline at end of file