diff --git a/src/main/java/galena/doom_and_gloom/client/screen/StoneTabletScreen.java b/src/main/java/galena/doom_and_gloom/client/screen/StoneTabletScreen.java index e6c728b7..0abdfa58 100644 --- a/src/main/java/galena/doom_and_gloom/client/screen/StoneTabletScreen.java +++ b/src/main/java/galena/doom_and_gloom/client/screen/StoneTabletScreen.java @@ -58,7 +58,7 @@ public StoneTabletScreen(StoneTabletBlockEntity sign, boolean isFiltered, Compon this.messages = IntStream.range(0, maxLines) .mapToObj(i -> this.text.getMessage(i, isFiltered)) .map(Component::getString).toArray(String[]::new); - this.canEdit = !sign.getBlockState().getValue(StoneTabletBlock.ENGRAVED); + this.canEdit = sign.getBlockState().getValue(StoneTabletBlock.TYPE).canEdit(); } @Override @@ -72,7 +72,7 @@ protected void init() { this.addRenderableWidget(Button.builder(Component.translatable("gui.doom_and_gloom.stone_tablet.engrave"), (p_98177_) -> { this.onEngrave(); }).bounds(this.width / 2 - 100, 196, 98, 20).build()); - this.addRenderableWidget(Button.builder(CommonComponents.GUI_DONE, (p_280851_) -> { + this.addRenderableWidget(Button.builder(Component.translatable("gui.doom_and_gloom.stone_tablet.cancel"), (p_280851_) -> { this.onDone(); }).bounds(this.width / 2 + 2, 196, 98, 20).build()); } @@ -246,7 +246,6 @@ private void drawEngravedString(GuiGraphics guiGraphics, String string, int pX, private void setMessage(String message) { this.messages[this.line] = message; this.text = this.text.withMessage(this.line, Component.literal(message)); - this.sign.setText(this.text); } private void onDone() { @@ -254,6 +253,8 @@ private void onDone() { } private void onEngrave() { + //TODO: Engrave sound + this.sign.setText(this.text); this.engraveOnClose = true; this.minecraft.setScreen(null); } diff --git a/src/main/java/galena/doom_and_gloom/content/block/StoneTabletBlock.java b/src/main/java/galena/doom_and_gloom/content/block/StoneTabletBlock.java index 77a63152..7126aa7e 100644 --- a/src/main/java/galena/doom_and_gloom/content/block/StoneTabletBlock.java +++ b/src/main/java/galena/doom_and_gloom/content/block/StoneTabletBlock.java @@ -5,12 +5,15 @@ import galena.doom_and_gloom.network.packet.EngraveStoneTabletPacket; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.CommonComponents; import net.minecraft.network.chat.contents.LiteralContents; import net.minecraft.server.level.ServerPlayer; +import net.minecraft.util.StringRepresentable; 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.context.BlockPlaceContext; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; @@ -24,9 +27,11 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; import net.minecraft.world.level.material.FluidState; import net.minecraft.world.level.material.Fluids; import net.minecraft.world.phys.BlockHitResult; +import net.minecraft.world.phys.HitResult; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraftforge.network.PacketDistributor; @@ -39,11 +44,11 @@ public class StoneTabletBlock extends Block implements SimpleWaterloggedBlock, T public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING; - public static final BooleanProperty ATTACHED_TO_WALL = BlockStateProperties.ATTACHED; - public static final BooleanProperty ENGRAVED = BooleanProperty.create("engraved"); + public static final EnumProperty ATTACHMENT = EnumProperty.create("attachment", Attachment.class); + public static final EnumProperty TYPE = EnumProperty.create("type", Type.class); - protected static final VoxelShape SHAPE_X = Block.box(6.0, 0.0, 2.0, 10.0, 16.0, 14.0); - protected static final VoxelShape SHAPE_Z = Block.box(2.0, 0.0, 6.0, 14.0, 16.0, 10.0); + protected static final VoxelShape SHAPE_Z = Block.box(6.0, 0.0, 2.0, 10.0, 16.0, 14.0); + protected static final VoxelShape SHAPE_X = Block.box(2.0, 0.0, 6.0, 14.0, 16.0, 10.0); protected static final VoxelShape SHAPE_SOUTH = Block.box(2.0D, 0.0D, 0.0D, 14.0D, 16.0D, 4.0D); protected static final VoxelShape SHAPE_NORTH = Block.box(2.0D, 0.0D, 12.0D, 14.0D, 16.0D, 16.0D); @@ -51,34 +56,54 @@ public class StoneTabletBlock extends Block implements SimpleWaterloggedBlock, T protected static final VoxelShape SHAPE_EAST = Block.box(0.0D, 0.0D, 2.0D, 4.0D, 16.0D, 14.0D); protected static final VoxelShape SHAPE_WEST = Block.box(12.0D, 0.0D, 2.0D, 16.0D, 16.0D, 14.0D); + protected static final VoxelShape SHAPE_FLOOR_Z = Block.box(2.0, 0.0, 0.0, 14.0, 4.0, 16.0); + protected static final VoxelShape SHAPE_FLOOR_X = Block.box(0.0, 0.0, 2.0, 16.0, 4.0, 14.0); + + protected static final VoxelShape SHAPE_CEILING_Z = Block.box(2.0, 0.0, 12.0, 14.0, 16.0, 16.0); + protected static final VoxelShape SHAPE_CEILING_X = Block.box(0.0, 0.0, 12.0, 16.0, 16.0, 14.0); public StoneTabletBlock(Properties pProperties) { super(pProperties); this.registerDefaultState(this.getStateDefinition().any() .setValue(WATERLOGGED, false) - .setValue(FACING, Direction.NORTH).setValue(ATTACHED_TO_WALL, false) - .setValue(ENGRAVED, false)); + .setValue(FACING, Direction.NORTH).setValue(ATTACHMENT, Attachment.CENTER_UPRIGHT) + .setValue(TYPE, Type.DEFAULT)); } @Override public @Nullable BlockState getStateForPlacement(BlockPlaceContext pContext) { - boolean water = pContext.getLevel().getFluidState(pContext.getClickedPos()).getType() == Fluids.WATER; + BlockPos pos = pContext.getClickedPos(); + boolean water = pContext.getLevel().getFluidState(pos).getType() == Fluids.WATER; + BlockState state = this.defaultBlockState().setValue(WATERLOGGED, water); + + Level level = pContext.getLevel(); + + Direction clickFace = pContext.getClickedFace(); + if (clickFace.getAxis() == Direction.Axis.Y) { + BlockState below = level.getBlockState(pos.relative(clickFace.getOpposite())); + if (below.getBlock() instanceof StoneTabletBlock && below.getValue(ATTACHMENT).isUpright()) { + return state.setValue(FACING, below.getValue(FACING)) + .setValue(ATTACHMENT, below.getValue(ATTACHMENT)); + } + + Player p = pContext.getPlayer(); + if (p != null && p.isShiftKeyDown()) { + return state.setValue(FACING, pContext.getHorizontalDirection().getOpposite()) + .setValue(ATTACHMENT, clickFace == Direction.UP ? Attachment.CEILING : Attachment.FLOOR); + } - if (pContext.getClickedFace().getAxis() == Direction.Axis.Y) { - return this.defaultBlockState().setValue(FACING, pContext.getHorizontalDirection().getOpposite()) - .setValue(ATTACHED_TO_WALL, false) - .setValue(WATERLOGGED, water); + return state.setValue(FACING, pContext.getHorizontalDirection().getOpposite()) + .setValue(ATTACHMENT, Attachment.CENTER_UPRIGHT); } else { - return this.defaultBlockState().setValue(FACING, pContext.getClickedFace().getOpposite()) - .setValue(ATTACHED_TO_WALL, true) - .setValue(WATERLOGGED, water); + return this.defaultBlockState().setValue(FACING, clickFace) + .setValue(ATTACHMENT, Attachment.WALL); } } @Override protected void createBlockStateDefinition(StateDefinition.Builder pBuilder) { super.createBlockStateDefinition(pBuilder); - pBuilder.add(WATERLOGGED, FACING, ATTACHED_TO_WALL, ENGRAVED); + pBuilder.add(WATERLOGGED, FACING, ATTACHMENT, TYPE); } @Override @@ -91,19 +116,29 @@ public BlockState updateShape(BlockState pState, Direction pFacing, BlockState p @Override public VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) { - if (pState.getValue(ATTACHED_TO_WALL)) { - return switch (pState.getValue(FACING)) { + return switch (pState.getValue(ATTACHMENT)) { + case FLOOR -> switch (pState.getValue(FACING)) { + case NORTH, SOUTH -> SHAPE_FLOOR_Z; + default -> SHAPE_FLOOR_X; + }; + + case CEILING -> switch (pState.getValue(FACING)) { + case NORTH, SOUTH -> SHAPE_CEILING_Z; + default -> SHAPE_CEILING_X; + }; + + case WALL -> switch (pState.getValue(FACING)) { case SOUTH -> SHAPE_SOUTH; case EAST -> SHAPE_EAST; case WEST -> SHAPE_WEST; default -> SHAPE_NORTH; }; - } else { - return switch (pState.getValue(FACING)) { + + case CENTER_UPRIGHT -> switch (pState.getValue(FACING)) { case NORTH, SOUTH -> SHAPE_X; default -> SHAPE_Z; }; - } + }; } @Override @@ -142,6 +177,21 @@ public FluidState getFluidState(BlockState pState) { return pState.getValue(WATERLOGGED) ? Fluids.WATER.getSource(false) : super.getFluidState(pState); } + @Override + public ItemStack getCloneItemStack(BlockState state, HitResult target, BlockGetter level, BlockPos pos, Player player) { + if (level.getBlockEntity(pos) instanceof StoneTabletBlockEntity tile) { + ItemStack stack = this.asItem().getDefaultInstance(); + CompoundTag tag = new CompoundTag(); + tag.put("BlockEntityTag", tile.saveWithoutMetadata()); + CompoundTag c = new CompoundTag(); + c.putString("type", state.getValue(TYPE).getSerializedName()); + tag.put("BlockStateTag", c); + stack.setTag(tag); + return stack; + } + return super.getCloneItemStack(state, target, level, pos, player); + } + public void openTextEdit(ServerPlayer pPlayer, StoneTabletBlockEntity pSignEntity) { pSignEntity.setAllowedPlayerEditor(pPlayer.getUUID()); DGNetwork.CHANNEL.send( @@ -155,7 +205,33 @@ private boolean otherPlayerIsEditingSign(Player pPlayer, StoneTabletBlockEntity } @Override - public BlockEntityType getType() { + public BlockEntityType getType() { return OBlockEntities.STONE_TABLET.get(); } + + public enum Type implements StringRepresentable { + DEFAULT, ENGRAVED, CRACKED; + + @Override + public String getSerializedName() { + return this.name().toLowerCase(); + } + + public boolean canEdit() { + return this == DEFAULT; + } + } + + public enum Attachment implements StringRepresentable { + CENTER_UPRIGHT, WALL, CEILING, FLOOR; + + @Override + public String getSerializedName() { + return this.name().toLowerCase(); + } + + public boolean isUpright() { + return this == CENTER_UPRIGHT || this == WALL; + } + } } \ No newline at end of file diff --git a/src/main/java/galena/doom_and_gloom/content/block/StoneTabletBlockEntity.java b/src/main/java/galena/doom_and_gloom/content/block/StoneTabletBlockEntity.java index 9e22c9c3..a3f4eef1 100644 --- a/src/main/java/galena/doom_and_gloom/content/block/StoneTabletBlockEntity.java +++ b/src/main/java/galena/doom_and_gloom/content/block/StoneTabletBlockEntity.java @@ -19,6 +19,7 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.storage.loot.functions.LootItemFunction; import net.minecraft.world.phys.Vec2; import net.minecraft.world.phys.Vec3; import org.jetbrains.annotations.Nullable; @@ -62,6 +63,7 @@ protected void saveAdditional(CompoundTag tag) { @Override public void load(CompoundTag tag) { super.load(tag); + if (tag.contains("text")) { StoneTabletText.DIRECT_CODEC .parse(NbtOps.INSTANCE, tag.getCompound("text")) diff --git a/src/main/java/galena/doom_and_gloom/data/OLang.java b/src/main/java/galena/doom_and_gloom/data/OLang.java index 2addf67e..f33264e6 100644 --- a/src/main/java/galena/doom_and_gloom/data/OLang.java +++ b/src/main/java/galena/doom_and_gloom/data/OLang.java @@ -42,7 +42,10 @@ protected void addTranslations() { addSubtitle("entity", "holler_death", "Holler dies"); addSubtitle("entity", "holler_hurt", "Holler hurts"); addSubtitle("entity", "holler_shrieks", "Holler shrieks"); - addSubtitle("entity", "holler_hollers", "Holler hollers"); + addSubtitle("entity", "holler_hollers", "Holler wails"); //howls? howls? whispers? + + addSubtitle("gui", "stone_tablet.engrave", "Engrave"); + addSubtitle("gui", "stone_tablet.cancel", "Cancel"); /* Automatically create translations for blocks and items based on their registry name. diff --git a/src/main/java/galena/doom_and_gloom/index/OSoundEvents.java b/src/main/java/galena/doom_and_gloom/index/OSoundEvents.java index cfb6084c..db14c32b 100644 --- a/src/main/java/galena/doom_and_gloom/index/OSoundEvents.java +++ b/src/main/java/galena/doom_and_gloom/index/OSoundEvents.java @@ -30,7 +30,10 @@ public class OSoundEvents { public static final RegistryObject SEPULCHER_UNSEALING = HELPER.createSoundEvent("block.sepulcher.unsealing"); public static final RegistryObject SEPULCHER_HARVEST = HELPER.createSoundEvent("block.sepulcher.harvest"); - public static final RegistryObject GRAVETENDER_WORK = HELPER.createSoundEvent("entity.villager.work_carpenter"); + //TODO: add these 2 + public static final RegistryObject GRAVETENDER_WORK = HELPER.createSoundEvent("entity.villager.work_gravetender"); + + public static final RegistryObject STONE_TABLET_ENGRAVE = HELPER.createSoundEvent("block.stone_tablet.engrave"); public static final RegistryObject HOLLER_DEATH = HELPER.createSoundEvent("entity.holler_death"); public static final RegistryObject HOLLER_HURTS = HELPER.createSoundEvent("entity.holler_hurts"); diff --git a/src/main/java/galena/doom_and_gloom/network/packet/StoneTabletUpdatePacket.java b/src/main/java/galena/doom_and_gloom/network/packet/StoneTabletUpdatePacket.java index 70585447..112e314e 100644 --- a/src/main/java/galena/doom_and_gloom/network/packet/StoneTabletUpdatePacket.java +++ b/src/main/java/galena/doom_and_gloom/network/packet/StoneTabletUpdatePacket.java @@ -2,12 +2,15 @@ import galena.doom_and_gloom.content.block.StoneTabletBlock; import galena.doom_and_gloom.content.block.StoneTabletBlockEntity; +import galena.doom_and_gloom.index.OSoundEvents; import net.minecraft.ChatFormatting; import net.minecraft.core.BlockPos; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.network.FilteredText; +import net.minecraft.sounds.SoundSource; import net.minecraft.world.level.Level; +import net.minecraft.world.level.gameevent.GameEvent; import net.minecraftforge.network.NetworkEvent; import java.util.List; @@ -53,7 +56,11 @@ private void updateSignText(ServerPlayer player, List filteredText if (level.hasChunkAt(pos) && level.getBlockEntity(pos) instanceof StoneTabletBlockEntity te) { te.updateStoneTabletText(player, filteredText); if(engrave){ - level.setBlockAndUpdate(pos, level.getBlockState(pos).setValue(StoneTabletBlock.ENGRAVED, true)); + level.setBlockAndUpdate(pos, level.getBlockState(pos) + .setValue(StoneTabletBlock.TYPE, StoneTabletBlock.Type.ENGRAVED)); + level.playSound(null, pos, OSoundEvents.STONE_TABLET_ENGRAVE.get(), + SoundSource.BLOCKS, 1.0f, 1.0f); + level.gameEvent(player, GameEvent.BLOCK_CHANGE, pos); } } } diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index f8414540..cd2019e4 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -38,4 +38,11 @@ TODO mandatory=true versionRange="[7.1.0,)" ordering="AFTER" + side="BOTH" + +[[dependencies.doom_and_gloom]] + modId="oreganized" + mandatory=true + versionRange="*" + ordering="AFTER" side="BOTH" \ No newline at end of file diff --git a/src/main/resources/assets/doom_and_gloom/blocksates/stone_tablet.json b/src/main/resources/assets/doom_and_gloom/blocksates/stone_tablet.json deleted file mode 100644 index bf49d991..00000000 --- a/src/main/resources/assets/doom_and_gloom/blocksates/stone_tablet.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "variants": { - "attached=true,facing=north,engraved=false": { - "model": "doom_and_gloom:block/stone_tablet_wall" - }, - "attached=true,facing=east,engraved=false": { - "model": "doom_and_gloom:block/stone_tablet_wall", - "y": 90 - }, - "attached=true,facing=south,engraved=false": { - "model": "doom_and_gloom:block/stone_tablet_wall", - "y": 180 - }, - "attached=true,facing=west,engraved=false": { - "model": "doom_and_gloom:block/stone_tablet_wall", - "y": 270 - }, - - - "attached=false,facing=north,engraved=false": { - "model": "doom_and_gloom:block/stone_tablet" - }, - "attached=false,facing=east,engraved=false": { - "model": "doom_and_gloom:block/stone_tablet", - "y": 90 - }, - "attached=false,facing=south,engraved=false": { - "model": "doom_and_gloom:block/stone_tablet", - "y": 180 - }, - "attached=false,facing=west,engraved=false": { - "model": "doom_and_gloom:block/stone_tablet", - "y": 270 - }, - - - - - "attached=true,facing=north,engraved=true": { - "model": "doom_and_gloom:block/stone_tablet_wall_engraved" - }, - "attached=true,facing=east,engraved=true": { - "model": "doom_and_gloom:block/stone_tablet_wall_engraved", - "y": 90 - }, - "attached=true,facing=south,engraved=true": { - "model": "doom_and_gloom:block/stone_tablet_wall_engraved", - "y": 180 - }, - "attached=true,facing=west,engraved=true": { - "model": "doom_and_gloom:block/stone_tablet_wall_engraved", - "y": 270 - }, - - - "attached=false,facing=north,engraved=true": { - "model": "doom_and_gloom:block/stone_tablet_engraved" - }, - "attached=false,facing=east,engraved=true": { - "model": "doom_and_gloom:block/stone_tablet_engraved", - "y": 90 - }, - "attached=false,facing=south,engraved=true": { - "model": "doom_and_gloom:block/stone_tablet_engraved", - "y": 180 - }, - "attached=false,facing=west,engraved=true": { - "model": "doom_and_gloom:block/stone_tablet_engraved", - "y": 270 - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/doom_and_gloom/blockstates/stone_tablet.json b/src/main/resources/assets/doom_and_gloom/blockstates/stone_tablet.json new file mode 100644 index 00000000..5ed5ff2b --- /dev/null +++ b/src/main/resources/assets/doom_and_gloom/blockstates/stone_tablet.json @@ -0,0 +1,95 @@ +{ + "variants": { + "attached=true,facing=north,type=default": { + "model": "doom_and_gloom:block/stone_tablet_wall" + }, + "attached=true,facing=east,type=default": { + "model": "doom_and_gloom:block/stone_tablet_wall", + "y": 90 + }, + "attached=true,facing=south,type=default": { + "model": "doom_and_gloom:block/stone_tablet_wall", + "y": 180 + }, + "attached=true,facing=west,type=default": { + "model": "doom_and_gloom:block/stone_tablet_wall", + "y": 270 + }, + "attached=false,facing=north,type=default": { + "model": "doom_and_gloom:block/stone_tablet" + }, + "attached=false,facing=east,type=default": { + "model": "doom_and_gloom:block/stone_tablet", + "y": 90 + }, + "attached=false,facing=south,type=default": { + "model": "doom_and_gloom:block/stone_tablet", + "y": 180 + }, + "attached=false,facing=west,type=default": { + "model": "doom_and_gloom:block/stone_tablet", + "y": 270 + }, + "attached=true,facing=north,type=engraved": { + "model": "doom_and_gloom:block/stone_tablet_wall_engraved" + }, + "attached=true,facing=east,type=engraved": { + "model": "doom_and_gloom:block/stone_tablet_wall_engraved", + "y": 90 + }, + "attached=true,facing=south,type=engraved": { + "model": "doom_and_gloom:block/stone_tablet_wall_engraved", + "y": 180 + }, + "attached=true,facing=west,type=engraved": { + "model": "doom_and_gloom:block/stone_tablet_wall_engraved", + "y": 270 + }, + "attached=false,facing=north,type=engraved": { + "model": "doom_and_gloom:block/stone_tablet_engraved" + }, + "attached=false,facing=east,type=engraved": { + "model": "doom_and_gloom:block/stone_tablet_engraved", + "y": 90 + }, + "attached=false,facing=south,type=engraved": { + "model": "doom_and_gloom:block/stone_tablet_engraved", + "y": 180 + }, + "attached=false,facing=west,type=engraved": { + "model": "doom_and_gloom:block/stone_tablet_engraved", + "y": 270 + }, + + "attached=true,facing=north,type=cracked": { + "model": "doom_and_gloom:block/stone_tablet_wall_cracked" + }, + "attached=true,facing=east,type=cracked": { + "model": "doom_and_gloom:block/stone_tablet_wall_cracked", + "y": 90 + }, + "attached=true,facing=south,type=cracked": { + "model": "doom_and_gloom:block/stone_tablet_wall_cracked", + "y": 180 + }, + "attached=true,facing=west,type=cracked": { + "model": "doom_and_gloom:block/stone_tablet_wall_cracked", + "y": 270 + }, + "attached=false,facing=north,type=cracked": { + "model": "doom_and_gloom:block/stone_tablet_cracked" + }, + "attached=false,facing=east,type=cracked": { + "model": "doom_and_gloom:block/stone_tablet_cracked", + "y": 90 + }, + "attached=false,facing=south,type=cracked": { + "model": "doom_and_gloom:block/stone_tablet_cracked", + "y": 180 + }, + "attached=false,facing=west,type=cracked": { + "model": "doom_and_gloom:block/stone_tablet_cracked", + "y": 270 + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/doom_and_gloom/models/block/stone_tablet.json b/src/main/resources/assets/doom_and_gloom/models/block/stone_tablet.json index 76b1c918..3cd8a5d6 100644 --- a/src/main/resources/assets/doom_and_gloom/models/block/stone_tablet.json +++ b/src/main/resources/assets/doom_and_gloom/models/block/stone_tablet.json @@ -6,13 +6,13 @@ }, "elements": [ { - "from": [2, 0, 0], - "to": [14, 16, 2], - "rotation": {"angle": 0, "axis": "y", "origin": [2, 0, 0]}, + "from": [2, 0, 7], + "to": [14, 16, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [2, 0, 7]}, "faces": { - "north": {"uv": [8.5, 1, 14.5, 9], "texture": "#particle"}, + "north": {"uv": [1.5, 1, 7.5, 9], "texture": "#particle"}, "east": {"uv": [7.5, 1, 8.5, 9], "texture": "#particle"}, - "south": {"uv": [1.5, 1, 7.5, 9], "texture": "#particle"}, + "south": {"uv": [8.5, 1, 14.5, 9], "texture": "#particle"}, "west": {"uv": [0.5, 1, 1.5, 9], "texture": "#particle"}, "up": {"uv": [1.5, 0, 7.5, 1], "texture": "#particle"}, "down": {"uv": [1.5, 9, 7.5, 10], "texture": "#particle"} diff --git a/src/main/resources/assets/doom_and_gloom/models/block/stone_tablet_cracked.json b/src/main/resources/assets/doom_and_gloom/models/block/stone_tablet_cracked.json new file mode 100644 index 00000000..01e8db9a --- /dev/null +++ b/src/main/resources/assets/doom_and_gloom/models/block/stone_tablet_cracked.json @@ -0,0 +1,8 @@ +{ + "parent": "doom_and_gloom:block/stone_tablet", + "credit": "Made with Blockbench", + "texture_size": [32, 32], + "textures": { + "particle": "doom_and_gloom:block/stone_tablet_cracked" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/doom_and_gloom/models/block/stone_tablet_engraved.json b/src/main/resources/assets/doom_and_gloom/models/block/stone_tablet_engraved.json index 882b6816..5244aebb 100644 --- a/src/main/resources/assets/doom_and_gloom/models/block/stone_tablet_engraved.json +++ b/src/main/resources/assets/doom_and_gloom/models/block/stone_tablet_engraved.json @@ -3,6 +3,6 @@ "credit": "Made with Blockbench", "texture_size": [32, 32], "textures": { - "particle": "doom_and_gloom:block/stone_tablet" + "particle": "doom_and_gloom:block/stone_tablet_engraved" } } \ No newline at end of file diff --git a/src/main/resources/assets/doom_and_gloom/models/block/stone_tablet_wall.json b/src/main/resources/assets/doom_and_gloom/models/block/stone_tablet_wall.json index 9e664d2a..cc5660e9 100644 --- a/src/main/resources/assets/doom_and_gloom/models/block/stone_tablet_wall.json +++ b/src/main/resources/assets/doom_and_gloom/models/block/stone_tablet_wall.json @@ -1,8 +1,22 @@ { - "parent": "doom_and_gloom:block/stone_tablet_wall", "credit": "Made with Blockbench", "texture_size": [32, 32], "textures": { - "particle": "doom_and_gloom:block/stone_tablet_engraved" - } + "particle": "doom_and_gloom:block/stone_tablet" + }, + "elements": [ + { + "from": [2, 0, 14], + "to": [14, 16, 16], + "rotation": {"angle": 0, "axis": "y", "origin": [2, 0, 14]}, + "faces": { + "north": {"uv": [1.5, 1, 7.5, 9], "texture": "#particle"}, + "east": {"uv": [7.5, 1, 8.5, 9], "texture": "#particle"}, + "south": {"uv": [8.5, 1, 14.5, 9], "texture": "#particle"}, + "west": {"uv": [0.5, 1, 1.5, 9], "texture": "#particle"}, + "up": {"uv": [1.5, 0, 7.5, 1], "texture": "#particle"}, + "down": {"uv": [1.5, 9, 7.5, 10], "texture": "#particle"} + } + } + ] } \ No newline at end of file diff --git a/src/main/resources/assets/doom_and_gloom/models/block/stone_tablet_wall_cracked.json b/src/main/resources/assets/doom_and_gloom/models/block/stone_tablet_wall_cracked.json new file mode 100644 index 00000000..a2586de0 --- /dev/null +++ b/src/main/resources/assets/doom_and_gloom/models/block/stone_tablet_wall_cracked.json @@ -0,0 +1,8 @@ +{ + "parent": "doom_and_gloom:block/stone_tablet_wall", + "credit": "Made with Blockbench", + "texture_size": [32, 32], + "textures": { + "particle": "doom_and_gloom:block/stone_tablet_cracked" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/doom_and_gloom/models/block/stone_tablet_wall_engraved.json b/src/main/resources/assets/doom_and_gloom/models/block/stone_tablet_wall_engraved.json new file mode 100644 index 00000000..9e664d2a --- /dev/null +++ b/src/main/resources/assets/doom_and_gloom/models/block/stone_tablet_wall_engraved.json @@ -0,0 +1,8 @@ +{ + "parent": "doom_and_gloom:block/stone_tablet_wall", + "credit": "Made with Blockbench", + "texture_size": [32, 32], + "textures": { + "particle": "doom_and_gloom:block/stone_tablet_engraved" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/doom_and_gloom/models/item/stone_tablet.json b/src/main/resources/assets/doom_and_gloom/models/item/stone_tablet.json new file mode 100644 index 00000000..25d05131 --- /dev/null +++ b/src/main/resources/assets/doom_and_gloom/models/item/stone_tablet.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "doom_and_gloom:item/stone_tablet" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/doom_and_gloom/textures/block/cracked_tablet.png b/src/main/resources/assets/doom_and_gloom/textures/block/cracked_tablet.png deleted file mode 100644 index 12c48b59..00000000 Binary files a/src/main/resources/assets/doom_and_gloom/textures/block/cracked_tablet.png and /dev/null differ diff --git a/src/main/resources/assets/doom_and_gloom/textures/block/cracked_tablet_.png b/src/main/resources/assets/doom_and_gloom/textures/block/cracked_tablet_.png deleted file mode 100644 index 12c48b59..00000000 Binary files a/src/main/resources/assets/doom_and_gloom/textures/block/cracked_tablet_.png and /dev/null differ diff --git a/src/main/resources/assets/doom_and_gloom/textures/block/cracked_tablet_new.png b/src/main/resources/assets/doom_and_gloom/textures/block/stone_tablet_cracked.png similarity index 89% rename from src/main/resources/assets/doom_and_gloom/textures/block/cracked_tablet_new.png rename to src/main/resources/assets/doom_and_gloom/textures/block/stone_tablet_cracked.png index 81bd1103..93d26785 100644 Binary files a/src/main/resources/assets/doom_and_gloom/textures/block/cracked_tablet_new.png and b/src/main/resources/assets/doom_and_gloom/textures/block/stone_tablet_cracked.png differ diff --git a/src/main/resources/data/doom_and_gloom/loot_tables/stone_tablet.json b/src/main/resources/data/doom_and_gloom/loot_tables/stone_tablet.json new file mode 100644 index 00000000..1209fb9e --- /dev/null +++ b/src/main/resources/data/doom_and_gloom/loot_tables/stone_tablet.json @@ -0,0 +1,39 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:copy_nbt", + "source": "block_entity", + "ops": [ + { + "source": "Pixels", + "target": "BlockEntityTag.text", + "op": "replace" + } + ] + }, + { + "block": "doom_and_gloom:stone_tablet", + "function": "minecraft:copy_state", + "properties": [ + "type" + ] + } + ], + "name": "doom_and_gloom:stone_tablet" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/block/mineable/pickaxe.json b/src/main/resources/data/minecraft/tags/block/mineable/pickaxe.json new file mode 100644 index 00000000..e2a0779e --- /dev/null +++ b/src/main/resources/data/minecraft/tags/block/mineable/pickaxe.json @@ -0,0 +1,5 @@ +{ + "values": [ + "doom_and_gloom:stone_tablet" + ] +} \ No newline at end of file