diff --git a/src/main/java/fr/adrien1106/reframedtemplates/Templates.java b/src/main/java/fr/adrien1106/reframedtemplates/Templates.java index 26848cf..b2e1e94 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/Templates.java +++ b/src/main/java/fr/adrien1106/reframedtemplates/Templates.java @@ -33,7 +33,7 @@ public class Templates implements ModInitializer { //addon devs: *Don't* add your blocks to this collection, it's just for my registration convenience since Templates adds a lot of blocks... @ApiStatus.Internal static final ArrayList INTERNAL_TEMPLATES = new ArrayList<>(); - @ApiStatus.Internal static Block CUBE, STAIRS, SLAB, VERTICAL_SLAB, POST, FENCE, FENCE_GATE, DOOR, TRAPDOOR, IRON_DOOR, IRON_TRAPDOOR, PRESSURE_PLATE, BUTTON, LEVER, WALL, CARPET, PANE, CANDLE, SLOPE, TINY_SLOPE; + @ApiStatus.Internal static Block CUBE, STAIRS, SLAB, VERTICAL_SLAB, POST, FENCE, FENCE_GATE, DOOR, TRAPDOOR, IRON_DOOR, IRON_TRAPDOOR, PRESSURE_PLATE, BUTTON, LEVER, WALL, CARPET, PANE, CANDLE; //For addon devs: Please don't stuff more blocks into this BlockEntityType, and register your own. //You can even re-register the same TemplateEntity class under your own ID if you like. (It's an extensible block entity.) @@ -67,8 +67,6 @@ public class Templates implements ModInitializer { CARPET = registerTemplate("carpet" , new TemplateCarpetBlock(cp(Blocks.WHITE_CARPET))); PANE = registerTemplate("pane" , new TemplatePaneBlock(cp(Blocks.GLASS_PANE))); CANDLE = registerTemplate("candle" , new TemplateCandleBlock(TemplateCandleBlock.configureSettings(cp(Blocks.CANDLE)))); - SLOPE = registerTemplate("slope" , new TemplateSlopeBlock(TemplateInteractionUtil.makeSettings())); - TINY_SLOPE = registerTemplate("tiny_slope" , new TemplateSlopeBlock.Tiny(TemplateInteractionUtil.makeSettings())); //The block entity is still called templates:slope; this is a bit of a legacy mistake. TEMPLATE_BLOCK_ENTITY = Registry.register(Registries.BLOCK_ENTITY_TYPE, id("slope"), @@ -77,7 +75,7 @@ public class Templates implements ModInitializer { Registry.register(Registries.ITEM_GROUP, id("tab"), FabricItemGroup.builder() .displayName(Text.translatable("itemGroup.reframedtemplates.tab")) - .icon(() -> new ItemStack(SLOPE)) + .icon(() -> new ItemStack(SLAB)) .entries((ctx, e) -> { e.addAll(INTERNAL_TEMPLATES.stream().map(ItemStack::new).collect(Collectors.toList())); }).build() diff --git a/src/main/java/fr/adrien1106/reframedtemplates/TemplatesClient.java b/src/main/java/fr/adrien1106/reframedtemplates/TemplatesClient.java index 4aace0d..b9208fd 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/TemplatesClient.java +++ b/src/main/java/fr/adrien1106/reframedtemplates/TemplatesClient.java @@ -80,12 +80,6 @@ public class TemplatesClient implements ClientModInitializer { api.addTemplateModel(Templates.id("wall_side_special") , api.json(Templates.id("block/wall_side"))); api.addTemplateModel(Templates.id("wall_side_tall_special") , api.json(Templates.id("block/wall_side_tall"))); - //mesh models - api.addTemplateModel(Templates.id("slope_special") , api.mesh(Templates.id("block/slope_base"), SlopeBaseMesh::makeUpright).disableAo()); - api.addTemplateModel(Templates.id("slope_side_special") , api.mesh(Templates.id("block/slope_base"), SlopeBaseMesh::makeSide).disableAo()); - api.addTemplateModel(Templates.id("tiny_slope_special") , api.mesh(Templates.id("block/tiny_slope_base"), SlopeBaseMesh::makeTinyUpright).disableAo()); - api.addTemplateModel(Templates.id("tiny_slope_side_special") , api.mesh(Templates.id("block/tiny_slope_base"), SlopeBaseMesh::makeTinySide).disableAo()); - //item only models api.addTemplateModel(Templates.id("button_inventory_special") , api.auto(new Identifier("block/button_inventory"))); api.addTemplateModel(Templates.id("fence_inventory_special") , api.auto(new Identifier("block/fence_inventory"))); @@ -106,8 +100,6 @@ public class TemplatesClient implements ClientModInitializer { api.assignItemModel(Templates.id("trapdoor_bottom_special") , Templates.TRAPDOOR); api.assignItemModel(Templates.id("vertical_slab_special") , Templates.VERTICAL_SLAB); api.assignItemModel(Templates.id("wall_inventory_special") , Templates.WALL); - api.assignItemModel(Templates.id("slope_special") , Templates.SLOPE); - api.assignItemModel(Templates.id("tiny_slope_special") , Templates.TINY_SLOPE); } private void privateInit() { diff --git a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplateSlopeBlock.java b/src/main/java/fr/adrien1106/reframedtemplates/block/TemplateSlopeBlock.java deleted file mode 100644 index 41c2401..0000000 --- a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplateSlopeBlock.java +++ /dev/null @@ -1,74 +0,0 @@ -package fr.adrien1106.reframedtemplates.block; - -import com.google.common.base.MoreObjects; -import fr.adrien1106.reframedtemplates.api.TemplateInteractionUtil; -import fr.adrien1106.reframedtemplates.util.Edge; -import fr.adrien1106.reframedtemplates.util.StairShapeMaker; -import net.minecraft.block.Block; -import net.minecraft.block.BlockState; -import net.minecraft.block.ShapeContext; -import net.minecraft.item.ItemPlacementContext; -import net.minecraft.state.StateManager; -import net.minecraft.state.property.EnumProperty; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.shape.VoxelShape; -import net.minecraft.world.BlockView; -import org.jetbrains.annotations.Nullable; - -public class TemplateSlopeBlock extends WaterloggableTemplateBlock { - public static final EnumProperty EDGE = EnumProperty.of("edge", Edge.class); - - protected final VoxelShape[] shapes = new VoxelShape[Edge.values().length]; - - public TemplateSlopeBlock(Settings settings) { - super(settings); - setDefaultState(getDefaultState().with(EDGE, Edge.DOWN_NORTH)); - - for(Edge edge : Edge.values()) { - shapes[edge.ordinal()] = getShape(edge); - } - } - - protected VoxelShape getShape(Edge edge) { - return StairShapeMaker.makeStair(edge, 1, 0.125d, 0.125d, 0.125d, 8); - } - - @Override - protected void appendProperties(StateManager.Builder builder) { - super.appendProperties(builder.add(EDGE)); - } - - @Nullable - @Override - public BlockState getPlacementState(ItemPlacementContext ctx) { - //not calling TemplateInteractionUtil.modifyPlacementState because we extend TemplateBlock which already does - BlockState sup = super.getPlacementState(ctx); - if(sup != null) sup = sup.with(EDGE, Edge.stairslikePlacement(ctx)); - - return sup; - } - - @Override - public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) { - return MoreObjects.firstNonNull( - TemplateInteractionUtil.getCollisionShape(state, view, pos, ctx), - shapes[state.get(EDGE).ordinal()] - ); - } - - @Override - public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) { - return shapes[state.get(EDGE).ordinal()]; - } - - public static class Tiny extends TemplateSlopeBlock { - public Tiny(Settings settings) { - super(settings); - } - - @Override - protected VoxelShape getShape(Edge edge) { - return StairShapeMaker.makeStair(edge, 0.5, 0.125d, 0.125d, 0.125d, 4); - } - } -} diff --git a/src/main/resources/data/minecraft/tags/blocks/mineable/axe.json b/src/main/resources/data/minecraft/tags/blocks/mineable/axe.json index e3c0758..0f4298b 100644 --- a/src/main/resources/data/minecraft/tags/blocks/mineable/axe.json +++ b/src/main/resources/data/minecraft/tags/blocks/mineable/axe.json @@ -16,8 +16,6 @@ "reframedtemplates:stairs", "reframedtemplates:trapdoor", "reframedtemplates:vertical_slab", - "reframedtemplates:wall", - "reframedtemplates:slope", - "reframedtemplates:tiny_slope" + "reframedtemplates:wall" ] } \ No newline at end of file diff --git a/src/main/resources/data/reframedtemplates/advancements/recipes/decorations/templates.json b/src/main/resources/data/reframedtemplates/advancements/recipes/decorations/templates.json index 406b649..d796f54 100644 --- a/src/main/resources/data/reframedtemplates/advancements/recipes/decorations/templates.json +++ b/src/main/resources/data/reframedtemplates/advancements/recipes/decorations/templates.json @@ -19,9 +19,7 @@ "reframedtemplates:stairs", "reframedtemplates:trapdoor", "reframedtemplates:vertical_slab", - "reframedtemplates:wall", - "reframedtemplates:slope", - "reframedtemplates:tiny_slope" + "reframedtemplates:wall" ] }, "criteria": { diff --git a/src/main/resources/data/reframedtemplates/loot_tables/blocks/slope.json b/src/main/resources/data/reframedtemplates/loot_tables/blocks/slope.json deleted file mode 100644 index 1d400c5..0000000 --- a/src/main/resources/data/reframedtemplates/loot_tables/blocks/slope.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:item", - "name": "reframedtemplates:slope" - } - ], - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/reframedtemplates/loot_tables/blocks/tiny_slope.json b/src/main/resources/data/reframedtemplates/loot_tables/blocks/tiny_slope.json deleted file mode 100644 index 63647a6..0000000 --- a/src/main/resources/data/reframedtemplates/loot_tables/blocks/tiny_slope.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:item", - "name": "reframedtemplates:tiny_slope" - } - ], - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/reframedtemplates/recipes/slope.json b/src/main/resources/data/reframedtemplates/recipes/slope.json deleted file mode 100644 index 9b1b5dc..0000000 --- a/src/main/resources/data/reframedtemplates/recipes/slope.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "I ", - "I~ ", - "III" - ], - "key": { - "I": { - "item": "minecraft:bamboo" - }, - "~": { - "item": "minecraft:string" - } - }, - "result": { - "item": "reframedtemplates:slope", - "count": 4 - }, - "group": "reframedtemplates" -} \ No newline at end of file diff --git a/src/main/resources/data/reframedtemplates/recipes/tiny_slope.json b/src/main/resources/data/reframedtemplates/recipes/tiny_slope.json deleted file mode 100644 index cb3e458..0000000 --- a/src/main/resources/data/reframedtemplates/recipes/tiny_slope.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "I~", - "II" - ], - "key": { - "I": { - "item": "minecraft:bamboo" - }, - "~": { - "item": "minecraft:string" - } - }, - "result": { - "item": "reframedtemplates:tiny_slope", - "count": 8 - }, - "group": "reframedtemplates" -} \ No newline at end of file