diff --git a/src/main/generated/assets/galacticraft/blockstates/aluminum_ladder.json b/src/main/generated/assets/galacticraft/blockstates/aluminum_ladder.json new file mode 100644 index 000000000..acaba4366 --- /dev/null +++ b/src/main/generated/assets/galacticraft/blockstates/aluminum_ladder.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=east": { + "model": "galacticraft:block/aluminum_ladder", + "y": 90 + }, + "facing=north": { + "model": "galacticraft:block/aluminum_ladder" + }, + "facing=south": { + "model": "galacticraft:block/aluminum_ladder", + "y": 180 + }, + "facing=west": { + "model": "galacticraft:block/aluminum_ladder", + "y": 270 + } + } +} \ No newline at end of file diff --git a/src/main/generated/assets/galacticraft/blockstates/bronze_ladder.json b/src/main/generated/assets/galacticraft/blockstates/bronze_ladder.json new file mode 100644 index 000000000..5a2c24c99 --- /dev/null +++ b/src/main/generated/assets/galacticraft/blockstates/bronze_ladder.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=east": { + "model": "galacticraft:block/bronze_ladder", + "y": 90 + }, + "facing=north": { + "model": "galacticraft:block/bronze_ladder" + }, + "facing=south": { + "model": "galacticraft:block/bronze_ladder", + "y": 180 + }, + "facing=west": { + "model": "galacticraft:block/bronze_ladder", + "y": 270 + } + } +} \ No newline at end of file diff --git a/src/main/generated/assets/galacticraft/blockstates/steel_ladder.json b/src/main/generated/assets/galacticraft/blockstates/steel_ladder.json new file mode 100644 index 000000000..5c718800a --- /dev/null +++ b/src/main/generated/assets/galacticraft/blockstates/steel_ladder.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=east": { + "model": "galacticraft:block/steel_ladder", + "y": 90 + }, + "facing=north": { + "model": "galacticraft:block/steel_ladder" + }, + "facing=south": { + "model": "galacticraft:block/steel_ladder", + "y": 180 + }, + "facing=west": { + "model": "galacticraft:block/steel_ladder", + "y": 270 + } + } +} \ No newline at end of file diff --git a/src/main/generated/assets/galacticraft/blockstates/titanium_ladder.json b/src/main/generated/assets/galacticraft/blockstates/titanium_ladder.json new file mode 100644 index 000000000..35248aed6 --- /dev/null +++ b/src/main/generated/assets/galacticraft/blockstates/titanium_ladder.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=east": { + "model": "galacticraft:block/titanium_ladder", + "y": 90 + }, + "facing=north": { + "model": "galacticraft:block/titanium_ladder" + }, + "facing=south": { + "model": "galacticraft:block/titanium_ladder", + "y": 180 + }, + "facing=west": { + "model": "galacticraft:block/titanium_ladder", + "y": 270 + } + } +} \ No newline at end of file diff --git a/src/main/generated/assets/galacticraft/lang/en_us.json b/src/main/generated/assets/galacticraft/lang/en_us.json index 949e23913..474a48a14 100644 --- a/src/main/generated/assets/galacticraft/lang/en_us.json +++ b/src/main/generated/assets/galacticraft/lang/en_us.json @@ -85,6 +85,7 @@ "block.galacticraft.aluminum_decoration_slab": "Aluminum Decoration Slab", "block.galacticraft.aluminum_decoration_stairs": "Aluminum Decoration Stairs", "block.galacticraft.aluminum_decoration_wall": "Aluminum Decoration Wall", + "block.galacticraft.aluminum_ladder": "Aluminum Ladder", "block.galacticraft.aluminum_ore": "Aluminum Ore", "block.galacticraft.aluminum_wire": "Aluminum Wire", "block.galacticraft.asteroid_aluminum_ore": "Asteroid Aluminum Ore", @@ -120,6 +121,7 @@ "block.galacticraft.bronze_decoration_slab": "Bronze Decoration Slab", "block.galacticraft.bronze_decoration_stairs": "Bronze Decoration Stairs", "block.galacticraft.bronze_decoration_wall": "Bronze Decoration Wall", + "block.galacticraft.bronze_ladder": "Bronze Ladder", "block.galacticraft.brown_candle_moon_cheese_wheel": "Moon Cheese Wheel with Brown Candle", "block.galacticraft.brown_glass_fluid_pipe": "Brown Stained Glass Fluid Pipe", "block.galacticraft.candle_moon_cheese_wheel": "Moon Cheese Wheel with Candle", @@ -355,6 +357,7 @@ "block.galacticraft.steel_decoration_slab": "Steel Decoration Slab", "block.galacticraft.steel_decoration_stairs": "Steel Decoration Stairs", "block.galacticraft.steel_decoration_wall": "Steel Decoration Wall", + "block.galacticraft.steel_ladder": "Steel Ladder", "block.galacticraft.sulfuric_acid": "Sulfuric Acid", "block.galacticraft.tin_block": "Block of Tin", "block.galacticraft.tin_decoration": "Tin Decoration", @@ -368,6 +371,7 @@ "block.galacticraft.titanium_decoration_slab": "Titanium Decoration Slab", "block.galacticraft.titanium_decoration_stairs": "Titanium Decoration Stairs", "block.galacticraft.titanium_decoration_wall": "Titanium Decoration Wall", + "block.galacticraft.titanium_ladder": "Titanium Ladder", "block.galacticraft.unlit_lantern": "Unlit Lantern", "block.galacticraft.unlit_soul_lantern": "Unlit Soul Lantern", "block.galacticraft.unlit_soul_torch": "Unlit Soul Torch", diff --git a/src/main/generated/assets/galacticraft/models/item/aluminum_ladder.json b/src/main/generated/assets/galacticraft/models/item/aluminum_ladder.json new file mode 100644 index 000000000..b0f3cf8d9 --- /dev/null +++ b/src/main/generated/assets/galacticraft/models/item/aluminum_ladder.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "galacticraft:block/aluminum_ladder" + } +} \ No newline at end of file diff --git a/src/main/generated/assets/galacticraft/models/item/bronze_ladder.json b/src/main/generated/assets/galacticraft/models/item/bronze_ladder.json new file mode 100644 index 000000000..08cb9137c --- /dev/null +++ b/src/main/generated/assets/galacticraft/models/item/bronze_ladder.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "galacticraft:block/bronze_ladder" + } +} \ No newline at end of file diff --git a/src/main/generated/assets/galacticraft/models/item/steel_ladder.json b/src/main/generated/assets/galacticraft/models/item/steel_ladder.json new file mode 100644 index 000000000..8bdabfa70 --- /dev/null +++ b/src/main/generated/assets/galacticraft/models/item/steel_ladder.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "galacticraft:block/steel_ladder" + } +} \ No newline at end of file diff --git a/src/main/generated/assets/galacticraft/models/item/titanium_ladder.json b/src/main/generated/assets/galacticraft/models/item/titanium_ladder.json new file mode 100644 index 000000000..008488dc7 --- /dev/null +++ b/src/main/generated/assets/galacticraft/models/item/titanium_ladder.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "galacticraft:block/titanium_ladder" + } +} \ No newline at end of file diff --git a/src/main/generated/data/galacticraft/advancement/recipes/decorations/aluminum_ladder.json b/src/main/generated/data/galacticraft/advancement/recipes/decorations/aluminum_ladder.json new file mode 100644 index 000000000..40f622f5d --- /dev/null +++ b/src/main/generated/data/galacticraft/advancement/recipes/decorations/aluminum_ladder.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_aluminum_ingot": { + "conditions": { + "items": [ + { + "items": "#c:ingots/aluminum" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "galacticraft:aluminum_ladder" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_aluminum_ingot" + ] + ], + "rewards": { + "recipes": [ + "galacticraft:aluminum_ladder" + ] + } +} \ No newline at end of file diff --git a/src/main/generated/data/galacticraft/advancement/recipes/decorations/titanium_ladder.json b/src/main/generated/data/galacticraft/advancement/recipes/decorations/titanium_ladder.json new file mode 100644 index 000000000..5249c2577 --- /dev/null +++ b/src/main/generated/data/galacticraft/advancement/recipes/decorations/titanium_ladder.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "galacticraft:titanium_ladder" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_titanium_ingot": { + "conditions": { + "items": [ + { + "items": "#c:ingots/titanium" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_titanium_ingot" + ] + ], + "rewards": { + "recipes": [ + "galacticraft:titanium_ladder" + ] + } +} \ No newline at end of file diff --git a/src/main/generated/data/galacticraft/loot_table/blocks/aluminum_ladder.json b/src/main/generated/data/galacticraft/loot_table/blocks/aluminum_ladder.json new file mode 100644 index 000000000..23763c82b --- /dev/null +++ b/src/main/generated/data/galacticraft/loot_table/blocks/aluminum_ladder.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "galacticraft:aluminum_ladder" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/main/generated/data/galacticraft/loot_table/blocks/bronze_ladder.json b/src/main/generated/data/galacticraft/loot_table/blocks/bronze_ladder.json new file mode 100644 index 000000000..495f49c71 --- /dev/null +++ b/src/main/generated/data/galacticraft/loot_table/blocks/bronze_ladder.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "galacticraft:bronze_ladder" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/main/generated/data/galacticraft/loot_table/blocks/steel_ladder.json b/src/main/generated/data/galacticraft/loot_table/blocks/steel_ladder.json new file mode 100644 index 000000000..4c3c7674d --- /dev/null +++ b/src/main/generated/data/galacticraft/loot_table/blocks/steel_ladder.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "galacticraft:steel_ladder" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/main/generated/data/galacticraft/loot_table/blocks/titanium_ladder.json b/src/main/generated/data/galacticraft/loot_table/blocks/titanium_ladder.json new file mode 100644 index 000000000..520272caa --- /dev/null +++ b/src/main/generated/data/galacticraft/loot_table/blocks/titanium_ladder.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "galacticraft:titanium_ladder" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/main/generated/data/galacticraft/recipe/aluminum_ladder.json b/src/main/generated/data/galacticraft/recipe/aluminum_ladder.json new file mode 100644 index 000000000..ec0eb1666 --- /dev/null +++ b/src/main/generated/data/galacticraft/recipe/aluminum_ladder.json @@ -0,0 +1,18 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "A": { + "tag": "c:ingots/aluminum" + } + }, + "pattern": [ + "A A", + "AAA", + "A A" + ], + "result": { + "count": 6, + "id": "galacticraft:aluminum_ladder" + } +} \ No newline at end of file diff --git a/src/main/generated/data/galacticraft/recipe/titanium_ladder.json b/src/main/generated/data/galacticraft/recipe/titanium_ladder.json new file mode 100644 index 000000000..5c5fe5e4c --- /dev/null +++ b/src/main/generated/data/galacticraft/recipe/titanium_ladder.json @@ -0,0 +1,18 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "T": { + "tag": "c:ingots/titanium" + } + }, + "pattern": [ + "T T", + "TTT", + "T T" + ], + "result": { + "count": 6, + "id": "galacticraft:titanium_ladder" + } +} \ No newline at end of file diff --git a/src/main/generated/data/galacticraft/tags/item/metal_ladder_blocks.json b/src/main/generated/data/galacticraft/tags/item/metal_ladder_blocks.json new file mode 100644 index 000000000..368ba400a --- /dev/null +++ b/src/main/generated/data/galacticraft/tags/item/metal_ladder_blocks.json @@ -0,0 +1,9 @@ +{ + "values": [ + "galacticraft:tin_ladder", + "galacticraft:aluminum_ladder", + "galacticraft:titanium_ladder", + "galacticraft:bronze_ladder", + "galacticraft:steel_ladder" + ] +} \ No newline at end of file diff --git a/src/main/java/dev/galacticraft/mod/Constant.java b/src/main/java/dev/galacticraft/mod/Constant.java index 45e468ad1..3e768a26f 100644 --- a/src/main/java/dev/galacticraft/mod/Constant.java +++ b/src/main/java/dev/galacticraft/mod/Constant.java @@ -227,7 +227,11 @@ interface Block { String DARK_DECORATION = "dark_decoration"; String IRON_GRATING = "iron_grating"; - String TIN_LADDER = "tin_ladder"; + String SQUARE_LIGHT_PANEL = "square_light_panel"; + String SPOTLIGHT_LIGHT_PANEL = "spotlight_light_panel"; + String LINEAR_LIGHT_PANEL = "linear_light_panel"; + String DASHED_LIGHT_PANEL = "dashed_light_panel"; + String DIAGONAL_LIGHT_PANEL = "diagonal_light_panel"; String VACUUM_GLASS = "vacuum_glass"; String CLEAR_VACUUM_GLASS = "vacuum_glass_clear"; String STRONG_VACUUM_GLASS = "vacuum_glass_strong"; @@ -235,6 +239,13 @@ interface Block { String WIRE_WALKWAY = "wire_walkway"; String FLUID_PIPE_WALKWAY = "fluid_pipe_walkway"; + // Ladders + String TIN_LADDER = "tin_ladder"; + String ALUMINUM_LADDER = "aluminum_ladder"; + String TITANIUM_LADDER = "titanium_ladder"; + String BRONZE_LADDER = "bronze_ladder"; + String STEEL_LADDER = "steel_ladder"; + // Environment String GLOWSTONE_TORCH = "glowstone_torch"; String GLOWSTONE_WALL_TORCH = "glowstone_wall_torch"; diff --git a/src/main/java/dev/galacticraft/mod/GalacticraftClient.java b/src/main/java/dev/galacticraft/mod/GalacticraftClient.java index fe4c7638a..a485d5fa7 100644 --- a/src/main/java/dev/galacticraft/mod/GalacticraftClient.java +++ b/src/main/java/dev/galacticraft/mod/GalacticraftClient.java @@ -162,6 +162,11 @@ public void onInitializeClient() { GCItemSubPredicates.init(); BlockRenderLayerMap.INSTANCE.putBlock(GCBlocks.TIN_LADDER, RenderType.cutout()); + BlockRenderLayerMap.INSTANCE.putBlock(GCBlocks.ALUMINUM_LADDER, RenderType.cutout()); + BlockRenderLayerMap.INSTANCE.putBlock(GCBlocks.TITANIUM_LADDER, RenderType.cutout()); + BlockRenderLayerMap.INSTANCE.putBlock(GCBlocks.BRONZE_LADDER, RenderType.cutout()); + BlockRenderLayerMap.INSTANCE.putBlock(GCBlocks.STEEL_LADDER, RenderType.cutout()); + BlockRenderLayerMap.INSTANCE.putBlock(GCBlocks.WALKWAY, RenderType.cutout()); BlockRenderLayerMap.INSTANCE.putBlock(GCBlocks.WIRE_WALKWAY, RenderType.cutout()); BlockRenderLayerMap.INSTANCE.putBlock(GCBlocks.FLUID_PIPE_WALKWAY, RenderType.cutout()); diff --git a/src/main/java/dev/galacticraft/mod/content/GCBlocks.java b/src/main/java/dev/galacticraft/mod/content/GCBlocks.java index 856c9406c..87309243b 100644 --- a/src/main/java/dev/galacticraft/mod/content/GCBlocks.java +++ b/src/main/java/dev/galacticraft/mod/content/GCBlocks.java @@ -313,9 +313,15 @@ public class GCBlocks { public static final Block WALKWAY = BLOCKS.registerWithItem(Constant.Block.WALKWAY, new WalkwayBlock(BlockBehaviour.Properties.of().mapColor(MapColor.METAL).strength(5.0f, 5.0f).sound(SoundType.METAL).requiresCorrectToolForDrops().noOcclusion())); public static final Block FLUID_PIPE_WALKWAY = BLOCKS.registerWithItem(Constant.Block.FLUID_PIPE_WALKWAY, new GlassFluidPipeWalkwayBlock(BlockBehaviour.Properties.ofFullCopy(GLASS_FLUID_PIPE), PipeColor.CLEAR)); public static final Block WIRE_WALKWAY = BLOCKS.registerWithItem(Constant.Block.WIRE_WALKWAY, new WireWalkwayBlock(BlockBehaviour.Properties.ofFullCopy(ALUMINUM_WIRE))); - public static final Block TIN_LADDER = BLOCKS.registerWithItem(Constant.Block.TIN_LADDER, new TinLadderBlock(BlockBehaviour.Properties.of().forceSolidOff().noOcclusion().pushReaction(PushReaction.DESTROY).strength(1.0f, 1.0f).sound(SoundType.METAL).requiresCorrectToolForDrops())); public static final Block IRON_GRATING = BLOCKS.registerWithItem(Constant.Block.IRON_GRATING, new IronGratingBlock(BlockBehaviour.Properties.of().mapColor(MapColor.STONE).strength(2.5f, 6.0f).sound(SoundType.METAL).requiresCorrectToolForDrops().noOcclusion())); + // METAL LADDERS + public static final Block TIN_LADDER = BLOCKS.registerWithItem(Constant.Block.TIN_LADDER, new MetalLadderBlock(BlockBehaviour.Properties.of().forceSolidOff().noOcclusion().pushReaction(PushReaction.DESTROY).strength(1.0f, 1.0f).sound(SoundType.METAL).requiresCorrectToolForDrops())); + public static final Block ALUMINUM_LADDER = BLOCKS.registerWithItem(Constant.Block.ALUMINUM_LADDER, new MetalLadderBlock(BlockBehaviour.Properties.of().forceSolidOff().noOcclusion().pushReaction(PushReaction.DESTROY).strength(1.0f, 1.0f).sound(SoundType.METAL).requiresCorrectToolForDrops())); + public static final Block TITANIUM_LADDER = BLOCKS.registerWithItem(Constant.Block.TITANIUM_LADDER, new MetalLadderBlock(BlockBehaviour.Properties.of().forceSolidOff().noOcclusion().pushReaction(PushReaction.DESTROY).strength(1.0f, 1.0f).sound(SoundType.METAL).requiresCorrectToolForDrops())); + public static final Block BRONZE_LADDER = BLOCKS.registerWithItem(Constant.Block.BRONZE_LADDER, new MetalLadderBlock(BlockBehaviour.Properties.of().forceSolidOff().noOcclusion().pushReaction(PushReaction.DESTROY).strength(1.0f, 1.0f).sound(SoundType.METAL).requiresCorrectToolForDrops())); + public static final Block STEEL_LADDER = BLOCKS.registerWithItem(Constant.Block.STEEL_LADDER, new MetalLadderBlock(BlockBehaviour.Properties.of().forceSolidOff().noOcclusion().pushReaction(PushReaction.DESTROY).strength(1.0f, 1.0f).sound(SoundType.METAL).requiresCorrectToolForDrops())); + // VACUUM GLASS public static final Block VACUUM_GLASS = BLOCKS.registerWithItem(Constant.Block.VACUUM_GLASS, new VacuumGlassBlock(BlockBehaviour.Properties.of().noOcclusion().sound(SoundType.GLASS))); public static final Block CLEAR_VACUUM_GLASS = BLOCKS.registerWithItem(Constant.Block.CLEAR_VACUUM_GLASS, new VacuumGlassBlock(BlockBehaviour.Properties.of().noOcclusion().sound(SoundType.GLASS))); diff --git a/src/main/java/dev/galacticraft/mod/content/block/special/TinLadderBlock.java b/src/main/java/dev/galacticraft/mod/content/block/special/MetalLadderBlock.java similarity index 79% rename from src/main/java/dev/galacticraft/mod/content/block/special/TinLadderBlock.java rename to src/main/java/dev/galacticraft/mod/content/block/special/MetalLadderBlock.java index 46b1003a7..5f5c435c7 100644 --- a/src/main/java/dev/galacticraft/mod/content/block/special/TinLadderBlock.java +++ b/src/main/java/dev/galacticraft/mod/content/block/special/MetalLadderBlock.java @@ -22,17 +22,19 @@ package dev.galacticraft.mod.content.block.special; -import dev.galacticraft.mod.content.GCBlocks; +import dev.galacticraft.mod.tag.GCItemTags; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.sounds.SoundSource; import net.minecraft.world.InteractionHand; import net.minecraft.world.ItemInteractionResult; import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.LevelReader; +import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.LadderBlock; import net.minecraft.world.level.block.state.BlockBehaviour; @@ -43,25 +45,27 @@ import java.util.Arrays; -public class TinLadderBlock extends LadderBlock { - public TinLadderBlock(BlockBehaviour.Properties properties) { +public class MetalLadderBlock extends LadderBlock { + public MetalLadderBlock(BlockBehaviour.Properties properties) { super(properties); + this.registerDefaultState(stateDefinition.any().setValue(FACING, Direction.NORTH).setValue(WATERLOGGED, false)); } @Nullable - private ItemInteractionResult checkCanTinLadderBePlaced(Level level, BlockPos checkPos, Player player, ItemStack itemStack, BlockState blockState) { + private ItemInteractionResult checkCanMetalLadderBePlaced(Level level, BlockPos checkPos, Player player, ItemStack itemStack, BlockState blockState, Block ladderBlock) { BlockState checkState = level.getBlockState(checkPos); - // Added check to ensure ladders are all facing the same way. - if (checkState.is(GCBlocks.TIN_LADDER) && blockState.is(GCBlocks.TIN_LADDER) && checkState.getValue(FACING) != blockState.getValue(FACING)) { + // Added check to ensure ladders are all facing the same way. If not, then pass to default interaction. + if (checkState.getBlock() instanceof MetalLadderBlock && blockState.getBlock() instanceof MetalLadderBlock && checkState.getValue(FACING) != blockState.getValue(FACING)) { return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION; } - // Can only place into a fluid if its water. + // If we can replace the block. if (checkState.canBeReplaced()) { + // Can only be waterlogged into a fluid if its water. boolean waterLogged = checkState.is(Blocks.WATER) && (checkState.getFluidState().getAmount() >= 8 || checkState.getFluidState().isSource()) || (checkState.hasProperty(WATERLOGGED) && checkState.getValue(WATERLOGGED)); - var newState = this.defaultBlockState().setValue(FACING, blockState.getValue(FACING)).setValue(WATERLOGGED, waterLogged); + var newState = ladderBlock.defaultBlockState().setValue(FACING, blockState.getValue(FACING)).setValue(WATERLOGGED, waterLogged); level.setBlockAndUpdate(checkPos, newState); level.playSound(null, checkPos, blockState.getSoundType().getPlaceSound(), SoundSource.BLOCKS, (blockState.getSoundType().getVolume() + 1.0F) / 2.0F, blockState.getSoundType().getPitch() * 0.8F); level.gameEvent(GameEvent.BLOCK_PLACE, checkPos, GameEvent.Context.of(player, newState)); @@ -70,7 +74,7 @@ private ItemInteractionResult checkCanTinLadderBePlaced(Level level, BlockPos ch itemStack.shrink(1); } return ItemInteractionResult.SUCCESS; - } else if (!checkState.is(this)) { + } else if (!(checkState.getBlock() instanceof MetalLadderBlock)) { return ItemInteractionResult.SKIP_DEFAULT_BLOCK_INTERACTION; } return null; @@ -78,11 +82,12 @@ private ItemInteractionResult checkCanTinLadderBePlaced(Level level, BlockPos ch @Override protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) { - if (stack.is(GCBlocks.TIN_LADDER.asItem())) { // Checks stack in hand is a tin ladder. + if (stack.is(GCItemTags.METAL_LADDER_BLOCKS)) { // Checks stack in hand is a metal ladder. + Block ladderBlock = ((BlockItem)(stack.getItem())).getBlock(); if (player.getXRot() < 0f) { // If looking above horizontal plane. // Find a pos directly above the existing ladder (this) but below world height where the ladder can be placed. for (BlockPos checkPos = new BlockPos.MutableBlockPos(pos.getX(), pos.getY(), pos.getZ()); checkPos.getY() < level.getMaxBuildHeight(); checkPos = checkPos.offset(0, 1, 0)) { - var result = this.checkCanTinLadderBePlaced(level, checkPos, player, stack, state); + var result = this.checkCanMetalLadderBePlaced(level, checkPos, player, stack, state, ladderBlock); if (result != null) { return result; } @@ -90,7 +95,7 @@ protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Lev } else { // Find a pos directly below the existing ladder (this) but above world bottom where the ladder can be placed. for (BlockPos checkPos = new BlockPos.MutableBlockPos(pos.getX(), pos.getY(), pos.getZ()); checkPos.getY() > level.getMinBuildHeight(); checkPos = checkPos.offset(0, -1, 0)) { - var result = this.checkCanTinLadderBePlaced(level, checkPos, player, stack, state); + var result = this.checkCanMetalLadderBePlaced(level, checkPos, player, stack, state, ladderBlock); if (result != null) { return result; } @@ -113,7 +118,6 @@ protected BlockState updateShape(BlockState state, Direction direction, BlockSta /// Checks to see if a ladder could survive in the suggested location. Called when a nearby block is broken or /// and sometimes when a new ladder is being placed. - /// If you want other ladder blocks to support tin ladders, then use instance of LadderBlock instead of is(TIN_LADDER) @Override public boolean canSurvive(BlockState blockState, LevelReader level, BlockPos blockPos) { Direction facingDirection = blockState.getValue(FACING); @@ -127,12 +131,12 @@ public boolean canSurvive(BlockState blockState, LevelReader level, BlockPos blo if (direction == Direction.UP || direction == Direction.DOWN) { // If the face is sturdy if (checkState.isFaceSturdy(level, checkPos, direction.getOpposite())) return true; - // If it's a tin ladder in facing the same way - if (checkState.is(GCBlocks.TIN_LADDER) && checkState.getValue(FACING) == facingDirection) return true; + // If it's a metal ladder in facing the same way + if (checkState.getBlock() instanceof MetalLadderBlock && checkState.getValue(FACING) == facingDirection) return true; } else { // It's on the same level - not above or below. - // If the face is sturdy and it isn't a tin ladder. This prevents the situation where a tin ladder can be placed - // back to back with another tin ladder and they can end up supporting themselves floating in the air. - if (checkState.isFaceSturdy(level, checkPos, direction.getOpposite()) && !checkState.is(GCBlocks.TIN_LADDER)) return true; + // If the face is sturdy and it isn't a metal ladder. This prevents the situation where a metal ladder can be placed + // back to back with another metal ladder and they can end up supporting themselves floating in the air. + if (checkState.isFaceSturdy(level, checkPos, direction.getOpposite()) && !(checkState.getBlock() instanceof MetalLadderBlock)) return true; } } return false; @@ -147,9 +151,9 @@ public boolean isSupported(BlockState blockState, LevelReader level, BlockPos bl if ((blockState.isFaceSturdy(level, blockPos, Direction.UP) && (direction == Direction.DOWN)) || (blockState.isFaceSturdy(level, blockPos, Direction.DOWN) && (direction == Direction.UP))) return true; - // If this isn't a tin ladder block, and we know it isn't solid, then not supported. + // If this isn't a metal ladder block, and we know it isn't solid, then not supported. // Change this to instanceof LadderBlock if you want wooden (and other ladders) to be considered support. - if (!blockState.is(GCBlocks.TIN_LADDER)) return false; + if (!(blockState.getBlock() instanceof MetalLadderBlock)) return false; // Check to ensure that the ladder is facing in the same direction. if (blockState.getValue(FACING) != facingDirection) return false; diff --git a/src/main/java/dev/galacticraft/mod/content/item/GCCreativeModeTabs.java b/src/main/java/dev/galacticraft/mod/content/item/GCCreativeModeTabs.java index 83a21bccd..82561b6dc 100644 --- a/src/main/java/dev/galacticraft/mod/content/item/GCCreativeModeTabs.java +++ b/src/main/java/dev/galacticraft/mod/content/item/GCCreativeModeTabs.java @@ -214,9 +214,15 @@ public class GCCreativeModeTabs { output.accept(WALKWAY); output.accept(WIRE_WALKWAY); output.accept(FLUID_PIPE_WALKWAY); - output.accept(TIN_LADDER); output.accept(IRON_GRATING); + //LADDER + output.accept(TIN_LADDER); + output.accept(ALUMINUM_LADDER); + output.accept(TITANIUM_LADDER); + output.accept(BRONZE_LADDER); + output.accept(STEEL_LADDER); + // SPECIAL output.accept(ALUMINUM_WIRE); output.accept(SEALABLE_ALUMINUM_WIRE); diff --git a/src/main/java/dev/galacticraft/mod/data/GCBlockLootTableProvider.java b/src/main/java/dev/galacticraft/mod/data/GCBlockLootTableProvider.java index 038eff19d..985b07985 100644 --- a/src/main/java/dev/galacticraft/mod/data/GCBlockLootTableProvider.java +++ b/src/main/java/dev/galacticraft/mod/data/GCBlockLootTableProvider.java @@ -171,9 +171,14 @@ public void generate() { this.dropSelf(GCBlocks.WALKWAY); this.dropSelf(GCBlocks.FLUID_PIPE_WALKWAY); this.dropSelf(GCBlocks.WIRE_WALKWAY); - this.dropSelf(GCBlocks.TIN_LADDER); this.dropSelf(GCBlocks.IRON_GRATING); + this.dropSelf(GCBlocks.TIN_LADDER); + this.dropSelf(GCBlocks.ALUMINUM_LADDER); + this.dropSelf(GCBlocks.TITANIUM_LADDER); + this.dropSelf(GCBlocks.BRONZE_LADDER); + this.dropSelf(GCBlocks.STEEL_LADDER); + this.add(GCBlocks.CANNED_FOOD, LootTable.lootTable()); this.dropSelf(GCBlocks.ALUMINUM_WIRE); diff --git a/src/main/java/dev/galacticraft/mod/data/model/GCModelProvider.java b/src/main/java/dev/galacticraft/mod/data/model/GCModelProvider.java index cbcd2e57e..eeeca8223 100644 --- a/src/main/java/dev/galacticraft/mod/data/model/GCModelProvider.java +++ b/src/main/java/dev/galacticraft/mod/data/model/GCModelProvider.java @@ -137,9 +137,14 @@ public void generateBlockStateModels(BlockModelGenerators generator) { generator.createTrivialCube(GCBlocks.PUMICE); this.createVaporSpout(generator); + // METAL LADDERS + createLadderModels(generator, GCBlocks.TIN_LADDER); + createLadderModels(generator, GCBlocks.ALUMINUM_LADDER); + createLadderModels(generator, GCBlocks.TITANIUM_LADDER); + createLadderModels(generator, GCBlocks.BRONZE_LADDER); + createLadderModels(generator, GCBlocks.STEEL_LADDER); + // MISC DECOR - generator.createNonTemplateHorizontalBlock(GCBlocks.TIN_LADDER); - generator.createSimpleFlatItemModel(GCBlocks.TIN_LADDER); this.createIronGrating(generator); // SPECIAL @@ -386,6 +391,11 @@ public void generateBlockStateModels(BlockModelGenerators generator) { this.createParachests(generator); } + private static void createLadderModels(BlockModelGenerators generator, Block ladderBlock) { + generator.createNonTemplateHorizontalBlock(ladderBlock); + generator.createSimpleFlatItemModel(ladderBlock); + } + private static void createFullCubeActiveMachine(BlockModelGenerators generator, Block block) { createActiveMachine(generator, block, TextureProvider.all(TextureMapping.getBlockTexture(block, "_active")), diff --git a/src/main/java/dev/galacticraft/mod/data/recipes/GCDecorationRecipeProvider.java b/src/main/java/dev/galacticraft/mod/data/recipes/GCDecorationRecipeProvider.java index 20dba3c28..26d023516 100644 --- a/src/main/java/dev/galacticraft/mod/data/recipes/GCDecorationRecipeProvider.java +++ b/src/main/java/dev/galacticraft/mod/data/recipes/GCDecorationRecipeProvider.java @@ -132,6 +132,7 @@ public void buildRecipes(RecipeOutput output) { .unlockedBy(getHasName(Items.IRON_BARS), has(Items.IRON_BARS)) .save(output); + // Metal Ladder Blocks ShapedRecipeBuilder.shaped(RecipeCategory.DECORATIONS, GCBlocks.TIN_LADDER, 6) .define('T', GCItemTags.TIN_INGOTS) .pattern("T T") @@ -139,6 +140,234 @@ public void buildRecipes(RecipeOutput output) { .pattern("T T") .unlockedBy(getHasName(GCItems.TIN_INGOT), has(GCItemTags.TIN_INGOTS)) .save(output); + + ShapedRecipeBuilder.shaped(RecipeCategory.DECORATIONS, GCBlocks.ALUMINUM_LADDER, 6) + .define('A', GCItemTags.ALUMINUM_INGOTS) + .pattern("A A") + .pattern("AAA") + .pattern("A A") + .unlockedBy(getHasName(GCItems.ALUMINUM_INGOT), has(GCItemTags.ALUMINUM_INGOTS)) + .save(output); + + ShapedRecipeBuilder.shaped(RecipeCategory.DECORATIONS, GCBlocks.TITANIUM_LADDER, 6) + .define('T', GCItemTags.TITANIUM_INGOTS) + .pattern("T T") + .pattern("TTT") + .pattern("T T") + .unlockedBy(getHasName(GCItems.TITANIUM_INGOT), has(GCItemTags.TITANIUM_INGOTS)) + .save(output); + +// ShapedRecipeBuilder.shaped(RecipeCategory.DECORATIONS, GCBlocks.BRONZE_LADDER, 6) +// .define('B', GCItemTags.BRONZE_INGOTS) +// .pattern("B B") +// .pattern("BBB") +// .pattern("B B") +// .unlockedBy(getHasName(GCItems.BRONZE_INGOT), has(GCItemTags.BRONZE_INGOTS)) +// .save(output); +// +// ShapedRecipeBuilder.shaped(RecipeCategory.DECORATIONS, GCBlocks.STEEL_LADDER, 6) +// .define('S', GCItemTags.STEEL_INGOTS) +// .pattern("S S") +// .pattern("SSS") +// .pattern("S S") +// .unlockedBy(getHasName(GCItems.STEEL_INGOT), has(GCItemTags.STEEL_INGOTS)) +// .save(output); + + // Metal decoration blocks + decorationBlock(output, GCItems.COMPRESSED_TIN, + GCBlocks.TIN_DECORATION.item(), + GCBlocks.TIN_DECORATION.slabItem(), + GCBlocks.TIN_DECORATION.stairsItem(), + GCBlocks.TIN_DECORATION.wallItem() + ); + detailedDecorationBlock(output, GCItems.COMPRESSED_TIN, + GCBlocks.TIN_DECORATION.detailedItem(), + GCBlocks.TIN_DECORATION.detailedSlabItem(), + GCBlocks.TIN_DECORATION.detailedStairsItem(), + GCBlocks.TIN_DECORATION.detailedWallItem() + ); + + decorationBlock(output, GCItems.COMPRESSED_COPPER, + GCBlocks.COPPER_DECORATION.item(), + GCBlocks.COPPER_DECORATION.slabItem(), + GCBlocks.COPPER_DECORATION.stairsItem(), + GCBlocks.COPPER_DECORATION.wallItem() + ); + detailedDecorationBlock(output, GCItems.COMPRESSED_COPPER, + GCBlocks.COPPER_DECORATION.detailedItem(), + GCBlocks.COPPER_DECORATION.detailedSlabItem(), + GCBlocks.COPPER_DECORATION.detailedStairsItem(), + GCBlocks.COPPER_DECORATION.detailedWallItem() + ); + + decorationBlock(output, GCItems.COMPRESSED_IRON, + GCBlocks.IRON_DECORATION.item(), + GCBlocks.IRON_DECORATION.slabItem(), + GCBlocks.IRON_DECORATION.stairsItem(), + GCBlocks.IRON_DECORATION.wallItem() + ); + detailedDecorationBlock(output, GCItems.COMPRESSED_IRON, + GCBlocks.IRON_DECORATION.detailedItem(), + GCBlocks.IRON_DECORATION.detailedSlabItem(), + GCBlocks.IRON_DECORATION.detailedStairsItem(), + GCBlocks.IRON_DECORATION.detailedWallItem() + ); + + decorationBlock(output, GCItems.COMPRESSED_ALUMINUM, + GCBlocks.ALUMINUM_DECORATION.item(), + GCBlocks.ALUMINUM_DECORATION.slabItem(), + GCBlocks.ALUMINUM_DECORATION.stairsItem(), + GCBlocks.ALUMINUM_DECORATION.wallItem() + ); + detailedDecorationBlock(output, GCItems.COMPRESSED_ALUMINUM, + GCBlocks.ALUMINUM_DECORATION.detailedItem(), + GCBlocks.ALUMINUM_DECORATION.detailedSlabItem(), + GCBlocks.ALUMINUM_DECORATION.detailedStairsItem(), + GCBlocks.ALUMINUM_DECORATION.detailedWallItem() + ); + + decorationBlock(output, GCItems.COMPRESSED_STEEL, + GCBlocks.STEEL_DECORATION.item(), + GCBlocks.STEEL_DECORATION.slabItem(), + GCBlocks.STEEL_DECORATION.stairsItem(), + GCBlocks.STEEL_DECORATION.wallItem() + ); + detailedDecorationBlock(output, GCItems.COMPRESSED_STEEL, + GCBlocks.STEEL_DECORATION.detailedItem(), + GCBlocks.STEEL_DECORATION.detailedSlabItem(), + GCBlocks.STEEL_DECORATION.detailedStairsItem(), + GCBlocks.STEEL_DECORATION.detailedWallItem() + ); + + decorationBlock(output, GCItems.COMPRESSED_BRONZE, + GCBlocks.BRONZE_DECORATION.item(), + GCBlocks.BRONZE_DECORATION.slabItem(), + GCBlocks.BRONZE_DECORATION.stairsItem(), + GCBlocks.BRONZE_DECORATION.wallItem() + ); + detailedDecorationBlock(output, GCItems.COMPRESSED_BRONZE, + GCBlocks.BRONZE_DECORATION.detailedItem(), + GCBlocks.BRONZE_DECORATION.detailedSlabItem(), + GCBlocks.BRONZE_DECORATION.detailedStairsItem(), + GCBlocks.BRONZE_DECORATION.detailedWallItem() + ); + + decorationBlock(output, GCItems.COMPRESSED_METEORIC_IRON, + GCBlocks.METEORIC_IRON_DECORATION.item(), + GCBlocks.METEORIC_IRON_DECORATION.slabItem(), + GCBlocks.METEORIC_IRON_DECORATION.stairsItem(), + GCBlocks.METEORIC_IRON_DECORATION.wallItem() + ); + detailedDecorationBlock(output, GCItems.COMPRESSED_METEORIC_IRON, + GCBlocks.METEORIC_IRON_DECORATION.detailedItem(), + GCBlocks.METEORIC_IRON_DECORATION.detailedSlabItem(), + GCBlocks.METEORIC_IRON_DECORATION.detailedStairsItem(), + GCBlocks.METEORIC_IRON_DECORATION.detailedWallItem() + ); + + decorationBlock(output, GCItems.COMPRESSED_TITANIUM, + GCBlocks.TITANIUM_DECORATION.item(), + GCBlocks.TITANIUM_DECORATION.slabItem(), + GCBlocks.TITANIUM_DECORATION.stairsItem(), + GCBlocks.TITANIUM_DECORATION.wallItem() + ); + detailedDecorationBlock(output, GCItems.COMPRESSED_TITANIUM, + GCBlocks.TITANIUM_DECORATION.detailedItem(), + GCBlocks.TITANIUM_DECORATION.detailedSlabItem(), + GCBlocks.TITANIUM_DECORATION.detailedStairsItem(), + GCBlocks.TITANIUM_DECORATION.detailedWallItem() + ); + + decorationBlockVariants(output, GCBlocks.DARK_DECORATION.item(), + GCBlocks.DARK_DECORATION.slabItem(), + GCBlocks.DARK_DECORATION.stairsItem(), + GCBlocks.DARK_DECORATION.wallItem() + ); + decorationBlockVariants(output, GCBlocks.DARK_DECORATION.detailedItem(), + GCBlocks.DARK_DECORATION.detailedSlabItem(), + GCBlocks.DARK_DECORATION.detailedStairsItem(), + GCBlocks.DARK_DECORATION.detailedWallItem() + ); + + // Rock decoration blocks + decorationBlockVariants(output, GCBlocks.MOON_ROCK, + GCBlocks.MOON_ROCK_SLAB, + GCBlocks.MOON_ROCK_STAIRS, + GCBlocks.MOON_ROCK_WALL + ); + decorationBlockVariants(output, GCBlocks.MOON_ROCK_BRICK, + GCBlocks.MOON_ROCK_BRICK_SLAB, + GCBlocks.MOON_ROCK_BRICK_STAIRS, + GCBlocks.MOON_ROCK_BRICK_WALL + ); + decorationBlockVariants(output, GCBlocks.CRACKED_MOON_ROCK_BRICK, + GCBlocks.CRACKED_MOON_ROCK_BRICK_SLAB, + GCBlocks.CRACKED_MOON_ROCK_BRICK_STAIRS, + GCBlocks.CRACKED_MOON_ROCK_BRICK_WALL + ); + decorationBlockVariants(output, GCBlocks.POLISHED_MOON_ROCK, + GCBlocks.POLISHED_MOON_ROCK_SLAB, + GCBlocks.POLISHED_MOON_ROCK_STAIRS, + GCBlocks.POLISHED_MOON_ROCK_WALL + ); + smeltBuildingBlock(output, GCBlocks.MOON_ROCK, GCBlocks.COBBLED_MOON_ROCK); + smeltBuildingBlock(output, GCBlocks.CRACKED_MOON_ROCK_BRICK, GCBlocks.MOON_ROCK_BRICK); + squareStone(output, GCBlocks.MOON_ROCK_BRICK, GCBlocks.MOON_ROCK); + squareStone(output, GCBlocks.POLISHED_MOON_ROCK, GCBlocks.MOON_ROCK_BRICK); + chiseledStone(output, GCBlocks.CHISELED_MOON_ROCK_BRICK, GCBlocks.MOON_ROCK_BRICK_SLAB, GCBlocks.MOON_ROCK, GCBlocks.MOON_ROCK_BRICK); + pillar(output, GCBlocks.MOON_ROCK_PILLAR, GCBlocks.MOON_ROCK); + + decorationBlockVariants(output, GCBlocks.LUNASLATE, + GCBlocks.LUNASLATE_SLAB, + GCBlocks.LUNASLATE_STAIRS, + GCBlocks.LUNASLATE_WALL + ); + decorationBlockVariants(output, GCBlocks.COBBLED_LUNASLATE, + GCBlocks.COBBLED_LUNASLATE_SLAB, + GCBlocks.COBBLED_LUNASLATE_STAIRS, + GCBlocks.COBBLED_LUNASLATE_WALL + ); + smeltBuildingBlock(output, GCBlocks.LUNASLATE, GCBlocks.COBBLED_LUNASLATE); + + decorationBlockVariants(output, GCBlocks.MOON_BASALT, + GCBlocks.MOON_BASALT_SLAB, + GCBlocks.MOON_BASALT_STAIRS, + GCBlocks.MOON_BASALT_WALL + ); + decorationBlockVariants(output, GCBlocks.MOON_BASALT_BRICK, + GCBlocks.MOON_BASALT_BRICK_SLAB, + GCBlocks.MOON_BASALT_BRICK_STAIRS, + GCBlocks.MOON_BASALT_BRICK_WALL + ); + decorationBlockVariants(output, GCBlocks.CRACKED_MOON_BASALT_BRICK, + GCBlocks.CRACKED_MOON_BASALT_BRICK_SLAB, + GCBlocks.CRACKED_MOON_BASALT_BRICK_STAIRS, + GCBlocks.CRACKED_MOON_BASALT_BRICK_WALL + ); + squareStone(output, GCBlocks.MOON_BASALT_BRICK, GCBlocks.MOON_BASALT); + smeltBuildingBlock(output, GCBlocks.CRACKED_MOON_BASALT_BRICK, GCBlocks.MOON_BASALT_BRICK); + + decorationBlockVariants(output, GCBlocks.MARS_STONE, + GCBlocks.MARS_STONE_SLAB, + GCBlocks.MARS_STONE_STAIRS, + GCBlocks.MARS_STONE_WALL + ); + decorationBlockVariants(output, GCBlocks.MARS_COBBLESTONE, + GCBlocks.MARS_COBBLESTONE_SLAB, + GCBlocks.MARS_COBBLESTONE_STAIRS, + GCBlocks.MARS_COBBLESTONE_WALL + ); + smeltBuildingBlock(output, GCBlocks.MARS_STONE, GCBlocks.MARS_COBBLESTONE); + } + + private static void decorationBlockVariants(RecipeOutput output, ItemLike base, ItemLike slab, ItemLike stairs, ItemLike wall) { + slab(output, RecipeCategory.BUILDING_BLOCKS, slab, base); + stairs(output, stairs, base); + wall(output, RecipeCategory.DECORATIONS, wall, base); + + stonecutterResultFromBase(output, RecipeCategory.BUILDING_BLOCKS, slab, base, 2); + stonecutterResultFromBase(output, RecipeCategory.BUILDING_BLOCKS, stairs, base); + stonecutterResultFromBase(output, RecipeCategory.DECORATIONS, wall, base); } private static void generateBlockFamilyRecipes(RecipeOutput output, BlockFamily blockFamily) { @@ -216,6 +445,31 @@ public static void baseDecorationBlocks(RecipeOutput output, ItemLike input, GCB .save(output); } + public static void decorationBlock(RecipeOutput output, ItemLike input, ItemLike block, ItemLike slab, ItemLike stairs, ItemLike wall) { + ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, block, 4) + .define('#', Items.STONE) + .define('X', input) + .pattern("## ") + .pattern("##X") + .unlockedBy(getHasName(input), has(input)) + .save(output); + + decorationBlockVariants(output, block, slab, stairs, wall); + } + + public static void detailedDecorationBlock(RecipeOutput output, ItemLike input, ItemLike block, ItemLike slab, ItemLike stairs, ItemLike wall) { + ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, block, 4) + .define('#', Items.STONE) + .define('X', input) + .pattern("##") + .pattern("##") + .pattern(" X") + .unlockedBy(getHasName(input), has(input)) + .save(output); + + decorationBlockVariants(output, block, slab, stairs, wall); + } + public static void stairs(RecipeOutput output, ItemLike stairs, ItemLike base) { stairBuilder(stairs, Ingredient.of(base)) .unlockedBy(getHasName(base), has(base)) diff --git a/src/main/java/dev/galacticraft/mod/data/tag/GCItemTagProvider.java b/src/main/java/dev/galacticraft/mod/data/tag/GCItemTagProvider.java index a4a400172..2f53c4077 100644 --- a/src/main/java/dev/galacticraft/mod/data/tag/GCItemTagProvider.java +++ b/src/main/java/dev/galacticraft/mod/data/tag/GCItemTagProvider.java @@ -528,6 +528,13 @@ protected void addTags(HolderLookup.Provider provider) { this.tag(ConventionalItemTags.VILLAGER_JOB_SITES) .add(GCBlocks.LUNAR_CARTOGRAPHY_TABLE.asItem()); + + this.tag(GCItemTags.METAL_LADDER_BLOCKS) + .add(GCBlocks.TIN_LADDER.asItem()) + .add(GCBlocks.ALUMINUM_LADDER.asItem()) + .add(GCBlocks.TITANIUM_LADDER.asItem()) + .add(GCBlocks.BRONZE_LADDER.asItem()) + .add(GCBlocks.STEEL_LADDER.asItem()); } protected FabricTagProvider.@NotNull FabricTagBuilder tag(TagKey tag) { diff --git a/src/main/java/dev/galacticraft/mod/tag/GCItemTags.java b/src/main/java/dev/galacticraft/mod/tag/GCItemTags.java index fcf29cc6d..287adb5d6 100644 --- a/src/main/java/dev/galacticraft/mod/tag/GCItemTags.java +++ b/src/main/java/dev/galacticraft/mod/tag/GCItemTags.java @@ -172,6 +172,8 @@ public class GCItemTags { public static final TagKey TIN_DECORATION_BLOCKS = galacticraftTag("decoration_blocks/tin"); public static final TagKey TITANIUM_DECORATION_BLOCKS = galacticraftTag("decoration_blocks/titanium"); + public static final TagKey METAL_LADDER_BLOCKS = galacticraftTag("metal_ladder_blocks"); + public static TagKey commonTag(String path) { return TagKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(Constant.COMMON_NAMESPACE, path)); } diff --git a/src/main/resources/assets/galacticraft/models/block/aluminum_ladder.json b/src/main/resources/assets/galacticraft/models/block/aluminum_ladder.json new file mode 100644 index 000000000..da3c8277f --- /dev/null +++ b/src/main/resources/assets/galacticraft/models/block/aluminum_ladder.json @@ -0,0 +1,17 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "galacticraft:block/aluminum_ladder", + "texture": "galacticraft:block/aluminum_ladder" + }, + "elements": [ + { "from": [ 0, 0, 15.2 ], + "to": [ 16, 16, 15.2 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/galacticraft/models/block/bronze_ladder.json b/src/main/resources/assets/galacticraft/models/block/bronze_ladder.json new file mode 100644 index 000000000..b6f72749e --- /dev/null +++ b/src/main/resources/assets/galacticraft/models/block/bronze_ladder.json @@ -0,0 +1,17 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "galacticraft:block/bronze_ladder", + "texture": "galacticraft:block/bronze_ladder" + }, + "elements": [ + { "from": [ 0, 0, 15.2 ], + "to": [ 16, 16, 15.2 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/galacticraft/models/block/steel_ladder.json b/src/main/resources/assets/galacticraft/models/block/steel_ladder.json new file mode 100644 index 000000000..7ea1c6677 --- /dev/null +++ b/src/main/resources/assets/galacticraft/models/block/steel_ladder.json @@ -0,0 +1,17 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "galacticraft:block/steel_ladder", + "texture": "galacticraft:block/steel_ladder" + }, + "elements": [ + { "from": [ 0, 0, 15.2 ], + "to": [ 16, 16, 15.2 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/galacticraft/models/block/titanium_ladder.json b/src/main/resources/assets/galacticraft/models/block/titanium_ladder.json new file mode 100644 index 000000000..d77ee5734 --- /dev/null +++ b/src/main/resources/assets/galacticraft/models/block/titanium_ladder.json @@ -0,0 +1,17 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "galacticraft:block/titanium_ladder", + "texture": "galacticraft:block/titanium_ladder" + }, + "elements": [ + { "from": [ 0, 0, 15.2 ], + "to": [ 16, 16, 15.2 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/galacticraft/textures/block/aluminum_ladder.png b/src/main/resources/assets/galacticraft/textures/block/aluminum_ladder.png new file mode 100644 index 000000000..b1b3f2f45 Binary files /dev/null and b/src/main/resources/assets/galacticraft/textures/block/aluminum_ladder.png differ diff --git a/src/main/resources/assets/galacticraft/textures/block/bronze_ladder.png b/src/main/resources/assets/galacticraft/textures/block/bronze_ladder.png new file mode 100644 index 000000000..4fb4c4535 Binary files /dev/null and b/src/main/resources/assets/galacticraft/textures/block/bronze_ladder.png differ diff --git a/src/main/resources/assets/galacticraft/textures/block/steel_ladder.png b/src/main/resources/assets/galacticraft/textures/block/steel_ladder.png new file mode 100644 index 000000000..8180b5497 Binary files /dev/null and b/src/main/resources/assets/galacticraft/textures/block/steel_ladder.png differ diff --git a/src/main/resources/assets/galacticraft/textures/block/tin_ladder.png b/src/main/resources/assets/galacticraft/textures/block/tin_ladder.png index 36dad8518..63477f050 100644 Binary files a/src/main/resources/assets/galacticraft/textures/block/tin_ladder.png and b/src/main/resources/assets/galacticraft/textures/block/tin_ladder.png differ diff --git a/src/main/resources/assets/galacticraft/textures/block/titanium_ladder.png b/src/main/resources/assets/galacticraft/textures/block/titanium_ladder.png new file mode 100644 index 000000000..8f64b524e Binary files /dev/null and b/src/main/resources/assets/galacticraft/textures/block/titanium_ladder.png differ