diff --git a/README.md b/README.md index d817519..d5cfd07 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,49 @@ ![Showcase](https://tggamesyt.dev/assets/szar.gif) # Szar +*Szar means Shit in Hungarian* -Ez egy privát, kísérleti fabric Minecraft 1.20.1 mod. +Szar is a private, experimental Fabric Minecraft 1.20.1 mod created as a school programming project and as a joke between classmates and friends. -## FIGYELMEZTETÉS -Ez a mod 18+ tartalmat tartalmaz, beleértve: -- sértő, rasszista vagy provokatív elemeket -- felnőtteknek szóló témákat -- illegális vagy valós életben elfogadhatatlan dolgok fiktív megjelenítését +The mod features a wide variety of over-the-top, humorous, and intentionally absurd ideas. Its content is entirely fictional and parody-style, designed for fun and creativity, and **not meant to be taken seriously**. -A mod **nem oktatási célú**, **nem támogatja**, és **nem népszerűsíti** ezeket a témákat. -Kizárólag saját használatra készült. +## Features -Ha ezek a tartalmak zavaróak számodra, **NE használd**. -A mod használata **kizárólag saját felelősségre történik**. +This mod includes (but is not limited to): + +- Crazy functional blocks +- Custom music discs +- Weapons such as guns +- Casinos with multiple gambling machines +- Police systems +- Drugs, memes, and historical figures +- Nukes and backrooms +- Board games +- And basically anything that would be “crazy in Minecraft” + +If you can imagine it being absurd or over-the-top in Minecraft, chances are this mod has it, if not, please contact me and it will! + +# Hungarian / Magyar +# Szar +*buzi ai forditas mer lusta vagyok* -# Shit +A Szar egy privát, kísérleti Fabric Minecraft 1.20.1 mod, amelyet iskolai programozási projektként és viccnek készítettek osztálytársak és barátok között. -This is a private, experimental 1.20.1 fabric Minecraft mod. +A mod számos túlzó, humoros és szándékosan abszurd ötletet tartalmaz. A tartalom teljesen fiktív és paródiaszerű, szórakoztatásra és kreativitásra készült, **nem szabad komolyan venni**. -## WARNING (EN) +### Funkciók -This mod contains **18+ content**, including the following: -- offensive, provocative, or otherwise inappropriate themes -- adult themed content -- fictional representations of content that would be unacceptable or illegal in real life +A mod tartalmaz (de nem kizárólagosan): -This mod is **not intended for public use**, does **not endorse** any of the themes depicted, and was created **for personal use only**. +- Őrült, funkcionális blokkok +- Egyedi zenélőlemezek +- Fegyverek, például pisztolyok +- Kaszinók többféle szerencsejáték géppel +- Rendőrségi rendszerek +- Drogok, mémek és történelmi személyek +- Nukleáris fegyverek és backroomból inspirált helyszínek +- Társasjátékok +- És gyakorlatilag bármi, ami “őrült” lenne a Minecraftban -If you find such content disturbing or offensive, **do not use this mod**. -Use at your **own responsibility**. +Ha el tudod képzelni, hogy valami túlzó vagy őrült lehet a Minecraftban, nagy valószínűséggel ez a mod tartalmazza, ha meg nem, akkor írj rám, és fogja! \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index eed3948..4abad65 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ minecraft_version=1.20.1 yarn_mappings=1.20.1+build.10 loader_version=0.18.3 # Mod Properties -mod_version=26.3.25.2 +mod_version=26.3.26 maven_group=dev.tggamesyt archives_base_name=szar # Dependencies diff --git a/src/client/java/dev/tggamesyt/szar/client/mixin/ParticleManagerMixin.java b/src/client/java/dev/tggamesyt/szar/client/mixin/ParticleManagerMixin.java new file mode 100644 index 0000000..e918684 --- /dev/null +++ b/src/client/java/dev/tggamesyt/szar/client/mixin/ParticleManagerMixin.java @@ -0,0 +1,130 @@ +package dev.tggamesyt.szar.client.mixin; + +import dev.tggamesyt.szar.*; +import net.minecraft.block.BlockState; +import net.minecraft.client.particle.BlockDustParticle; +import net.minecraft.client.particle.ParticleManager; +import net.minecraft.client.world.ClientWorld; +import net.minecraft.registry.Registries; +import net.minecraft.util.ActionResult; +import net.minecraft.util.Identifier; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Box; +import net.minecraft.util.math.Direction; +import net.minecraft.util.math.random.Random; +import net.minecraft.world.World; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(ParticleManager.class) +public class ParticleManagerMixin { + + @Shadow + public ClientWorld world; + + @Inject(method = "addBlockBreakParticles", at = @At("HEAD"), cancellable = true) + private void redirectBreakParticles(BlockPos pos, BlockState state, CallbackInfo ci) { + if (world == null) return; + + if (!(state.getBlock() instanceof BlueprintStairsBlock || + state.getBlock() instanceof BlueprintSlabBlock || + state.getBlock() instanceof BlueprintDoorBlock || + state.getBlock() instanceof BlueprintTrapDoorBlock || + state.getBlock() instanceof BlueprintWallBlock || + state.getBlock() instanceof BlueprintFenceBlock)) { + return; + } + + var be = world.getBlockEntity(pos); + if (!(be instanceof BlueprintBlockEntity blueprint) || !blueprint.hasStoredBlock()) return; + + BlockState storedState = Registries.BLOCK + .get(new Identifier(blueprint.getStoredBlockId())) + .getDefaultState(); + + ci.cancel(); + + // ✅ USE BLUEPRINT SHAPE, NOT STORED + var shape = state.getOutlineShape(world, pos); + + shape.forEachBox((minX, minY, minZ, maxX, maxY, maxZ) -> { + double dx = Math.min(1.0, maxX - minX); + double dy = Math.min(1.0, maxY - minY); + double dz = Math.min(1.0, maxZ - minZ); + + int ix = Math.max(2, net.minecraft.util.math.MathHelper.ceil(dx / 0.25)); + int iy = Math.max(2, net.minecraft.util.math.MathHelper.ceil(dy / 0.25)); + int iz = Math.max(2, net.minecraft.util.math.MathHelper.ceil(dz / 0.25)); + + for (int x = 0; x < ix; x++) { + for (int y = 0; y < iy; y++) { + for (int z = 0; z < iz; z++) { + + double fx = (x + 0.5) / ix; + double fy = (y + 0.5) / iy; + double fz = (z + 0.5) / iz; + + double px = fx * dx + minX; + double py = fy * dy + minY; + double pz = fz * dz + minZ; + + ((ParticleManager)(Object)this).addParticle( + new BlockDustParticle( + world, + pos.getX() + px, + pos.getY() + py, + pos.getZ() + pz, + fx - 0.5, + fy - 0.5, + fz - 0.5, + storedState, // ✅ texture comes from stored + pos + ) + ); + } + } + } + }); + } + + @Inject(method = "addBlockBreakingParticles", at = @At("HEAD"), cancellable = true) + private void redirectBreakingParticles(BlockPos pos, Direction direction, CallbackInfo ci) { + if (world == null) return; + + BlockState state = world.getBlockState(pos); + if (!(state.getBlock() instanceof BlueprintStairsBlock || + state.getBlock() instanceof BlueprintSlabBlock || + state.getBlock() instanceof BlueprintDoorBlock || + state.getBlock() instanceof BlueprintTrapDoorBlock || + state.getBlock() instanceof BlueprintWallBlock || + state.getBlock() instanceof BlueprintFenceBlock)) {return;} + + var be = world.getBlockEntity(pos); + if (!(be instanceof BlueprintBlockEntity blueprint) || !blueprint.hasStoredBlock()) return; + + BlockState storedState = Registries.BLOCK + .get(new Identifier(blueprint.getStoredBlockId())) + .getDefaultState(); + ci.cancel(); + + Box box = storedState.getOutlineShape(world, pos).getBoundingBox(); + int i = pos.getX(), j = pos.getY(), k = pos.getZ(); + Random random = Random.create(); + double d = i + random.nextDouble() * (box.maxX - box.minX - 0.2) + 0.1 + box.minX; + double e = j + random.nextDouble() * (box.maxY - box.minY - 0.2) + 0.1 + box.minY; + double g = k + random.nextDouble() * (box.maxZ - box.minZ - 0.2) + 0.1 + box.minZ; + if (direction == Direction.DOWN) e = j + box.minY - 0.1; + if (direction == Direction.UP) e = j + box.maxY + 0.1; + if (direction == Direction.NORTH) g = k + box.minZ - 0.1; + if (direction == Direction.SOUTH) g = k + box.maxZ + 0.1; + if (direction == Direction.WEST) d = i + box.minX - 0.1; + if (direction == Direction.EAST) d = i + box.maxX + 0.1; + + ((ParticleManager)(Object)this).addParticle( + new BlockDustParticle(world, d, e, g, 0, 0, 0, storedState, pos).move(0.2f).scale(0.6f) + ); + } +} \ No newline at end of file diff --git a/src/client/resources/szar.client.mixins.json b/src/client/resources/szar.client.mixins.json index b9a6424..66882fb 100644 --- a/src/client/resources/szar.client.mixins.json +++ b/src/client/resources/szar.client.mixins.json @@ -16,6 +16,7 @@ "MouseMixin", "PackMixin", "PackScreenCloseMixin", + "ParticleManagerMixin", "PlayerEntityRendererMixin", "PlayerHeldItemFeatureRendererMixin", "PlayerModelMixin", diff --git a/src/main/java/dev/tggamesyt/szar/BlueprintBehavior.java b/src/main/java/dev/tggamesyt/szar/BlueprintBehavior.java index f4608e0..eb2c1a5 100644 --- a/src/main/java/dev/tggamesyt/szar/BlueprintBehavior.java +++ b/src/main/java/dev/tggamesyt/szar/BlueprintBehavior.java @@ -1,13 +1,17 @@ package dev.tggamesyt.szar; +import net.minecraft.block.Block; import net.minecraft.block.BlockState; +import net.minecraft.block.DoorBlock; import net.minecraft.block.entity.BlockEntity; +import net.minecraft.block.enums.DoubleBlockHalf; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.BlockItem; import net.minecraft.item.ItemStack; import net.minecraft.registry.Registries; import net.minecraft.util.ActionResult; import net.minecraft.util.Hand; +import net.minecraft.util.Identifier; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.world.BlockView; @@ -35,6 +39,14 @@ public class BlueprintBehavior { } if (!held.isEmpty() && held.getItem() instanceof BlockItem blockItem && !blueprint.hasStoredBlock()) { + if (blockItem.getBlock() instanceof BlueprintStairsBlock || + blockItem.getBlock() instanceof BlueprintSlabBlock || + blockItem.getBlock() instanceof BlueprintDoorBlock || + blockItem.getBlock() instanceof BlueprintTrapDoorBlock || + blockItem.getBlock() instanceof BlueprintWallBlock || + blockItem.getBlock() instanceof BlueprintFenceBlock) { + return ActionResult.PASS; + } String id = Registries.BLOCK.getId(blockItem.getBlock()).toString(); blueprint.setStoredBlock(id); if (!player.isCreative()) held.decrement(1); @@ -50,12 +62,17 @@ public class BlueprintBehavior { public static float calcBreakingDelta(BlockState state, PlayerEntity player, BlockView world, BlockPos pos, float baseHardness) { BlockEntity be = world.getBlockEntity(pos); + if (!(be instanceof BlueprintBlockEntity blueprint) || !blueprint.hasStoredBlock()) { return baseHardness; } - float hardness = blueprint.getStoredHardness(); - if (hardness < 0) return 0f; // unbreakable - return player.getBlockBreakingSpeed(state) / hardness / 30f; + + BlockState storedState = Registries.BLOCK + .get(new Identifier(blueprint.getStoredBlockId())) + .getDefaultState(); + + // Fully delegate to vanilla logic + return storedState.calcBlockBreakingDelta(player, world, pos); } /** @@ -63,11 +80,28 @@ public class BlueprintBehavior { */ public static void onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player) { BlockEntity be = world.getBlockEntity(pos); - if (!(be instanceof BlueprintBlockEntity blueprint) || !blueprint.hasStoredBlock()) return; - if (!player.isCreative()) { - ItemStack drop = blueprint.getStoredDrop(); - if (!drop.isEmpty()) { - dropStack(world, pos, drop); + + if (!(be instanceof BlueprintBlockEntity blueprint) || !blueprint.hasStoredBlock()) { + return; + } + + // Drop stored block + if (!world.isClient) { + Block.dropStack(world, pos, blueprint.getStoredDrop()); + } + + // Handle doors (break other half properly) + if (state.getBlock() instanceof DoorBlock) { + DoubleBlockHalf half = state.get(DoorBlock.HALF); + BlockPos otherPos = (half == DoubleBlockHalf.LOWER) ? pos.up() : pos.down(); + + BlockState otherState = world.getBlockState(otherPos); + BlockEntity otherBe = world.getBlockEntity(otherPos); + + if (otherBe instanceof BlueprintBlockEntity otherBlueprint && otherBlueprint.hasStoredBlock()) { + if (!world.isClient) { + Block.dropStack(world, otherPos, otherBlueprint.getStoredDrop()); + } } } } diff --git a/src/main/java/dev/tggamesyt/szar/BlueprintBlockEntity.java b/src/main/java/dev/tggamesyt/szar/BlueprintBlockEntity.java index 48af502..624a44e 100644 --- a/src/main/java/dev/tggamesyt/szar/BlueprintBlockEntity.java +++ b/src/main/java/dev/tggamesyt/szar/BlueprintBlockEntity.java @@ -52,6 +52,9 @@ public class BlueprintBlockEntity extends BlockEntity { public void clearStoredBlock() { this.storedBlockId = null; markDirty(); + if (world != null && !world.isClient) { + world.updateListeners(pos, getCachedState(), getCachedState(), 3); + } } /** Gets the hardness of the stored block, or default if none. */ diff --git a/src/main/java/dev/tggamesyt/szar/BlueprintBlocks.java b/src/main/java/dev/tggamesyt/szar/BlueprintBlocks.java index e769228..27b1eb1 100644 --- a/src/main/java/dev/tggamesyt/szar/BlueprintBlocks.java +++ b/src/main/java/dev/tggamesyt/szar/BlueprintBlocks.java @@ -13,6 +13,8 @@ import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; import net.minecraft.util.Identifier; +import static dev.tggamesyt.szar.Szar.MOD_ID; + public class BlueprintBlocks { private static AbstractBlock.Settings settings() { @@ -20,29 +22,33 @@ public class BlueprintBlocks { .mapColor(MapColor.TERRACOTTA_LIGHT_BLUE) .strength(1.0f); } - + public static final Item BLUEPRINT = Registry.register( + Registries.ITEM, + new Identifier(MOD_ID, "blueprint"), + new Item(new Item.Settings()) + ); public static final BlueprintStairsBlock BLUEPRINT_STAIRS = - Registry.register(Registries.BLOCK, new Identifier(Szar.MOD_ID, "blueprint_stairs"), + Registry.register(Registries.BLOCK, new Identifier(MOD_ID, "blueprint_stairs"), new BlueprintStairsBlock(settings())); public static final BlueprintSlabBlock BLUEPRINT_SLAB = - Registry.register(Registries.BLOCK, new Identifier(Szar.MOD_ID, "blueprint_slab"), + Registry.register(Registries.BLOCK, new Identifier(MOD_ID, "blueprint_slab"), new BlueprintSlabBlock(settings())); public static final BlueprintDoorBlock BLUEPRINT_DOOR = - Registry.register(Registries.BLOCK, new Identifier(Szar.MOD_ID, "blueprint_door"), + Registry.register(Registries.BLOCK, new Identifier(MOD_ID, "blueprint_door"), new BlueprintDoorBlock(settings())); public static final BlueprintTrapDoorBlock BLUEPRINT_TRAPDOOR = - Registry.register(Registries.BLOCK, new Identifier(Szar.MOD_ID, "blueprint_trapdoor"), + Registry.register(Registries.BLOCK, new Identifier(MOD_ID, "blueprint_trapdoor"), new BlueprintTrapDoorBlock(settings())); public static final BlueprintWallBlock BLUEPRINT_WALL = - Registry.register(Registries.BLOCK, new Identifier(Szar.MOD_ID, "blueprint_wall"), + Registry.register(Registries.BLOCK, new Identifier(MOD_ID, "blueprint_wall"), new BlueprintWallBlock(AbstractBlock.Settings.copy(Blocks.STONE_BRICK_WALL))); public static final BlueprintFenceBlock BLUEPRINT_FENCE = - Registry.register(Registries.BLOCK, new Identifier(Szar.MOD_ID, "blueprint_fence"), + Registry.register(Registries.BLOCK, new Identifier(MOD_ID, "blueprint_fence"), new BlueprintFenceBlock(AbstractBlock.Settings.copy(Blocks.OAK_FENCE))); public static final BlockEntityType BLUEPRINT_STAIRS_BE_TYPE; @@ -54,51 +60,51 @@ public class BlueprintBlocks { static { BLUEPRINT_STAIRS_BE_TYPE = Registry.register(Registries.BLOCK_ENTITY_TYPE, - new Identifier(Szar.MOD_ID, "blueprint_stairs_be"), + new Identifier(MOD_ID, "blueprint_stairs_be"), FabricBlockEntityTypeBuilder.create(BlueprintBlockEntity::new, BLUEPRINT_STAIRS).build()); BLUEPRINT_SLAB_BE_TYPE = Registry.register(Registries.BLOCK_ENTITY_TYPE, - new Identifier(Szar.MOD_ID, "blueprint_slab_be"), + new Identifier(MOD_ID, "blueprint_slab_be"), FabricBlockEntityTypeBuilder.create(BlueprintBlockEntity::new, BLUEPRINT_SLAB).build()); BLUEPRINT_DOOR_BE_TYPE = Registry.register(Registries.BLOCK_ENTITY_TYPE, - new Identifier(Szar.MOD_ID, "blueprint_door_be"), + new Identifier(MOD_ID, "blueprint_door_be"), FabricBlockEntityTypeBuilder.create(BlueprintBlockEntity::new, BLUEPRINT_DOOR).build()); BLUEPRINT_TRAPDOOR_BE_TYPE = Registry.register(Registries.BLOCK_ENTITY_TYPE, - new Identifier(Szar.MOD_ID, "blueprint_trapdoor_be"), + new Identifier(MOD_ID, "blueprint_trapdoor_be"), FabricBlockEntityTypeBuilder.create(BlueprintBlockEntity::new, BLUEPRINT_TRAPDOOR).build()); BLUEPRINT_WALL_BE_TYPE = Registry.register(Registries.BLOCK_ENTITY_TYPE, - new Identifier(Szar.MOD_ID, "blueprint_wall_be"), + new Identifier(MOD_ID, "blueprint_wall_be"), FabricBlockEntityTypeBuilder.create(BlueprintBlockEntity::new, BLUEPRINT_WALL).build()); BLUEPRINT_FENCE_BE_TYPE = Registry.register(Registries.BLOCK_ENTITY_TYPE, - new Identifier(Szar.MOD_ID, "blueprint_fence_be"), + new Identifier(MOD_ID, "blueprint_fence_be"), FabricBlockEntityTypeBuilder.create(BlueprintBlockEntity::new, BLUEPRINT_FENCE).build()); } public static final BlockItem BLUEPRINT_STAIRS_ITEM = Registry.register(Registries.ITEM, - new Identifier(Szar.MOD_ID, "blueprint_stairs"), + new Identifier(MOD_ID, "blueprint_stairs"), new BlockItem(BLUEPRINT_STAIRS, new Item.Settings())); public static final BlockItem BLUEPRINT_SLAB_ITEM = Registry.register(Registries.ITEM, - new Identifier(Szar.MOD_ID, "blueprint_slab"), + new Identifier(MOD_ID, "blueprint_slab"), new BlockItem(BLUEPRINT_SLAB, new Item.Settings())); public static final BlockItem BLUEPRINT_DOOR_ITEM = Registry.register(Registries.ITEM, - new Identifier(Szar.MOD_ID, "blueprint_door"), + new Identifier(MOD_ID, "blueprint_door"), new BlockItem(BLUEPRINT_DOOR, new Item.Settings())); public static final BlockItem BLUEPRINT_TRAPDOOR_ITEM = Registry.register(Registries.ITEM, - new Identifier(Szar.MOD_ID, "blueprint_trapdoor"), + new Identifier(MOD_ID, "blueprint_trapdoor"), new BlockItem(BLUEPRINT_TRAPDOOR, new Item.Settings())); public static final BlockItem BLUEPRINT_WALL_ITEM = Registry.register(Registries.ITEM, - new Identifier(Szar.MOD_ID, "blueprint_wall"), + new Identifier(MOD_ID, "blueprint_wall"), new BlockItem(BLUEPRINT_WALL, new Item.Settings())); public static final BlockItem BLUEPRINT_FENCE_ITEM = Registry.register(Registries.ITEM, - new Identifier(Szar.MOD_ID, "blueprint_fence"), + new Identifier(MOD_ID, "blueprint_fence"), new BlockItem(BLUEPRINT_FENCE, new Item.Settings())); public static void init() {} // just call this to trigger class loading } diff --git a/src/main/java/dev/tggamesyt/szar/BlueprintWallBlock.java b/src/main/java/dev/tggamesyt/szar/BlueprintWallBlock.java index 734b4ed..8d84a3f 100644 --- a/src/main/java/dev/tggamesyt/szar/BlueprintWallBlock.java +++ b/src/main/java/dev/tggamesyt/szar/BlueprintWallBlock.java @@ -9,6 +9,7 @@ import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.world.BlockView; import net.minecraft.world.World; +import net.minecraft.block.WallBlock; public class BlueprintWallBlock extends WallBlock implements BlockEntityProvider { diff --git a/src/main/java/dev/tggamesyt/szar/Szar.java b/src/main/java/dev/tggamesyt/szar/Szar.java index 4627980..4d4391b 100644 --- a/src/main/java/dev/tggamesyt/szar/Szar.java +++ b/src/main/java/dev/tggamesyt/szar/Szar.java @@ -366,7 +366,7 @@ public class Szar implements ModInitializer { boolean showRacist = !ServerConfig.get("racist"); boolean showGambling = !ServerConfig.get("gambling"); boolean showNsfw = !ServerConfig.get("nsfw"); - // random ahh silly stuff + // memes entries.add(Szar.POPTART); entries.add(Szar.NYAN_SPAWNEGG); entries.add(Szar.BAITER_DISC); @@ -374,6 +374,8 @@ public class Szar implements ModInitializer { entries.add(Szar.EFN_DISK); entries.add(Szar.FIRTANA); entries.add(Szar.HELLO_DISC); + entries.add(Szar.KEBAB); + // backrooms entries.add(Szar.TRACKER_BLOCK_ITEM); entries.add(Szar.PORTAL_BLOCK_ITEM); entries.add(Szar.WALL_ITEM); @@ -384,15 +386,15 @@ public class Szar implements ModInitializer { entries.add(Szar.BEAN); entries.add(Szar.CAN_OF_BEANS); entries.add(Szar.ALMOND_WATER); - entries.add(Szar.KEBAB); - + // blueprint stuff + entries.add(BlueprintBlocks.BLUEPRINT); entries.add(BlueprintBlocks.BLUEPRINT_DOOR_ITEM); entries.add(BlueprintBlocks.BLUEPRINT_TRAPDOOR_ITEM); entries.add(BlueprintBlocks.BLUEPRINT_FENCE_ITEM); entries.add(BlueprintBlocks.BLUEPRINT_SLAB_ITEM); entries.add(BlueprintBlocks.BLUEPRINT_WALL_ITEM); entries.add(BlueprintBlocks.BLUEPRINT_STAIRS_ITEM); - + // board games entries.add(Szar.TIC_TAC_TOE_ITEM); entries.add(Szar.CONNECT_FOUR_ITEM); entries.add(Szar.CHESS_ITEM); diff --git a/src/main/resources/assets/szar/blockstates/blueprint_wall.json b/src/main/resources/assets/szar/blockstates/blueprint_wall.json index d41c07f..1a87b92 100644 --- a/src/main/resources/assets/szar/blockstates/blueprint_wall.json +++ b/src/main/resources/assets/szar/blockstates/blueprint_wall.json @@ -1,9 +1,22 @@ { "multipart": [ - { "apply": { "model": "szar:block/blueprint_wall_post" } }, - { "apply": { "model": "szar:block/blueprint_wall_side", "uvlock": true } }, - { "apply": { "model": "szar:block/blueprint_wall_side", "y": 90, "uvlock": true } }, - { "apply": { "model": "szar:block/blueprint_wall_side", "y": 180, "uvlock": true } }, - { "apply": { "model": "szar:block/blueprint_wall_side", "y": 270, "uvlock": true } } + { "apply": { "model": "szar:block/blueprint_wall_post" }, + "when": { "up": "true" } }, + { "apply": { "model": "szar:block/blueprint_wall_side", "uvlock": true }, + "when": { "north": "low" } }, + { "apply": { "model": "szar:block/blueprint_wall_side", "y": 90, "uvlock": true }, + "when": { "east": "low" } }, + { "apply": { "model": "szar:block/blueprint_wall_side", "y": 180, "uvlock": true }, + "when": { "south": "low" } }, + { "apply": { "model": "szar:block/blueprint_wall_side", "y": 270, "uvlock": true }, + "when": { "west": "low" } }, + { "apply": { "model": "szar:block/blueprint_wall_side_tall", "uvlock": true }, + "when": { "north": "tall" } }, + { "apply": { "model": "szar:block/blueprint_wall_side_tall", "y": 90, "uvlock": true }, + "when": { "east": "tall" } }, + { "apply": { "model": "szar:block/blueprint_wall_side_tall", "y": 180, "uvlock": true }, + "when": { "south": "tall" } }, + { "apply": { "model": "szar:block/blueprint_wall_side_tall", "y": 270, "uvlock": true }, + "when": { "west": "tall" } } ] } \ No newline at end of file diff --git a/src/main/resources/assets/szar/lang/en_us.json b/src/main/resources/assets/szar/lang/en_us.json index 0bddfc8..ac7d9c3 100644 --- a/src/main/resources/assets/szar/lang/en_us.json +++ b/src/main/resources/assets/szar/lang/en_us.json @@ -197,5 +197,6 @@ "block.szar.blueprint_door": "Blueprint Door", "block.szar.blueprint_trapdoor": "Blueprint Trapdoor", "block.szar.blueprint_wall": "Blueprint Wall", - "block.szar.blueprint_fence": "Blueprint Fence" + "block.szar.blueprint_fence": "Blueprint Fence", + "item.szar.blueprint": "Blueprint" } diff --git a/src/main/resources/assets/szar/models/block/blueprint_fence_inventory.json b/src/main/resources/assets/szar/models/block/blueprint_fence_inventory.json new file mode 100644 index 0000000..81d5bee --- /dev/null +++ b/src/main/resources/assets/szar/models/block/blueprint_fence_inventory.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/fence_inventory", + "textures": { + "texture": "szar:block/blueprint" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/szar/models/block/blueprint_wall_inventory.json b/src/main/resources/assets/szar/models/block/blueprint_wall_inventory.json new file mode 100644 index 0000000..caa470b --- /dev/null +++ b/src/main/resources/assets/szar/models/block/blueprint_wall_inventory.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_inventory", + "textures": { + "wall": "szar:block/blueprint" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/szar/models/item/blueprint.json b/src/main/resources/assets/szar/models/item/blueprint.json new file mode 100644 index 0000000..5185885 --- /dev/null +++ b/src/main/resources/assets/szar/models/item/blueprint.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "szar:item/blueprint" + } +} diff --git a/src/main/resources/assets/szar/models/item/blueprint_door.json b/src/main/resources/assets/szar/models/item/blueprint_door.json index 4c643b5..716ea02 100644 --- a/src/main/resources/assets/szar/models/item/blueprint_door.json +++ b/src/main/resources/assets/szar/models/item/blueprint_door.json @@ -1 +1 @@ -{ "parent": "minecraft:item/generated", "textures": { "layer0": "szar:block/blueprint" } } \ No newline at end of file +{ "parent": "minecraft:item/generated", "textures": { "layer0": "szar:block/blueprint_door" } } \ No newline at end of file diff --git a/src/main/resources/assets/szar/models/item/blueprint_fence.json b/src/main/resources/assets/szar/models/item/blueprint_fence.json index 1b76c2a..2044c92 100644 --- a/src/main/resources/assets/szar/models/item/blueprint_fence.json +++ b/src/main/resources/assets/szar/models/item/blueprint_fence.json @@ -1 +1 @@ -{ "parent": "szar:block/blueprint_fence_post" } \ No newline at end of file +{ "parent": "szar:block/blueprint_fence_inventory" } \ No newline at end of file diff --git a/src/main/resources/assets/szar/models/item/blueprint_wall.json b/src/main/resources/assets/szar/models/item/blueprint_wall.json index 26441b5..965d61c 100644 --- a/src/main/resources/assets/szar/models/item/blueprint_wall.json +++ b/src/main/resources/assets/szar/models/item/blueprint_wall.json @@ -1 +1 @@ -{ "parent": "szar:block/blueprint_wall_post" } \ No newline at end of file +{ "parent": "szar:block/blueprint_wall_inventory" } \ No newline at end of file diff --git a/src/main/resources/assets/szar/textures/block/blueprint_door.png b/src/main/resources/assets/szar/textures/block/blueprint_door.png new file mode 100644 index 0000000..c5545bc Binary files /dev/null and b/src/main/resources/assets/szar/textures/block/blueprint_door.png differ diff --git a/src/main/resources/assets/szar/textures/item/blueprint.png b/src/main/resources/assets/szar/textures/item/blueprint.png index 72fc86e..bd99e0c 100644 Binary files a/src/main/resources/assets/szar/textures/item/blueprint.png and b/src/main/resources/assets/szar/textures/item/blueprint.png differ diff --git a/src/main/resources/data/minecraft/tags/blocks/fences.json b/src/main/resources/data/minecraft/tags/blocks/fences.json new file mode 100644 index 0000000..46d8026 --- /dev/null +++ b/src/main/resources/data/minecraft/tags/blocks/fences.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "szar:blueprint_fence" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/walls.json b/src/main/resources/data/minecraft/tags/blocks/walls.json new file mode 100644 index 0000000..e8df754 --- /dev/null +++ b/src/main/resources/data/minecraft/tags/blocks/walls.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "szar:blueprint_wall" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/wooden_fences.json b/src/main/resources/data/minecraft/tags/blocks/wooden_fences.json new file mode 100644 index 0000000..46d8026 --- /dev/null +++ b/src/main/resources/data/minecraft/tags/blocks/wooden_fences.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "szar:blueprint_fence" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/szar/loot_tables/blocks/blueprint_door.json b/src/main/resources/data/szar/loot_tables/blocks/blueprint_door.json new file mode 100644 index 0000000..f305bc0 --- /dev/null +++ b/src/main/resources/data/szar/loot_tables/blocks/blueprint_door.json @@ -0,0 +1,14 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "szar:blueprint_door" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/szar/loot_tables/blocks/blueprint_fence.json b/src/main/resources/data/szar/loot_tables/blocks/blueprint_fence.json new file mode 100644 index 0000000..04e1500 --- /dev/null +++ b/src/main/resources/data/szar/loot_tables/blocks/blueprint_fence.json @@ -0,0 +1,14 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "szar:blueprint_fence" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/szar/loot_tables/blocks/blueprint_slab.json b/src/main/resources/data/szar/loot_tables/blocks/blueprint_slab.json new file mode 100644 index 0000000..6e04e39 --- /dev/null +++ b/src/main/resources/data/szar/loot_tables/blocks/blueprint_slab.json @@ -0,0 +1,29 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "szar:blueprint_slab", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:block_state_property", + "block": "szar:blueprint_slab", + "property": "type", + "values": { + "double": 2, + "bottom": 1, + "top": 1 + } + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/szar/loot_tables/blocks/blueprint_stairs.json b/src/main/resources/data/szar/loot_tables/blocks/blueprint_stairs.json new file mode 100644 index 0000000..dc2161e --- /dev/null +++ b/src/main/resources/data/szar/loot_tables/blocks/blueprint_stairs.json @@ -0,0 +1,14 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "szar:blueprint_stairs" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/szar/loot_tables/blocks/blueprint_trapdoor.json b/src/main/resources/data/szar/loot_tables/blocks/blueprint_trapdoor.json new file mode 100644 index 0000000..cd87619 --- /dev/null +++ b/src/main/resources/data/szar/loot_tables/blocks/blueprint_trapdoor.json @@ -0,0 +1,14 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "szar:blueprint_trapdoor" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/szar/loot_tables/blocks/blueprint_wall.json b/src/main/resources/data/szar/loot_tables/blocks/blueprint_wall.json new file mode 100644 index 0000000..13e91c5 --- /dev/null +++ b/src/main/resources/data/szar/loot_tables/blocks/blueprint_wall.json @@ -0,0 +1,14 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "szar:blueprint_wall" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/szar/recipes/blueprint.json b/src/main/resources/data/szar/recipes/blueprint.json new file mode 100644 index 0000000..3a38583 --- /dev/null +++ b/src/main/resources/data/szar/recipes/blueprint.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + " B ", + "BPB", + " B " + ], + "key": { + "B": { + "tag": "szar:blue" + }, + "P": { + "item": "minecraft:paper" + } + }, + "result": { + "item": "szar:blueprint", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/szar/recipes/blueprint_door.json b/src/main/resources/data/szar/recipes/blueprint_door.json new file mode 100644 index 0000000..655aad3 --- /dev/null +++ b/src/main/resources/data/szar/recipes/blueprint_door.json @@ -0,0 +1,17 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "BB", + "BB", + "BB" + ], + "key": { + "B": { + "item": "szar:blueprint" + } + }, + "result": { + "item": "szar:blueprint_door", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/szar/recipes/blueprint_fence.json b/src/main/resources/data/szar/recipes/blueprint_fence.json new file mode 100644 index 0000000..2bd3f5b --- /dev/null +++ b/src/main/resources/data/szar/recipes/blueprint_fence.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "BDB", + "BDB" + ], + "key": { + "B": { + "item": "szar:blueprint" + }, + "D": { + "tag": "szar:blue" + } + }, + "result": { + "item": "szar:blueprint_fence", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/szar/recipes/blueprint_slabs.json b/src/main/resources/data/szar/recipes/blueprint_slabs.json new file mode 100644 index 0000000..8f0d872 --- /dev/null +++ b/src/main/resources/data/szar/recipes/blueprint_slabs.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "BBB" + ], + "key": { + "B": { + "item": "szar:blueprint" + } + }, + "result": { + "item": "szar:blueprint_slab", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/szar/recipes/blueprint_stairs.json b/src/main/resources/data/szar/recipes/blueprint_stairs.json new file mode 100644 index 0000000..b1c9919 --- /dev/null +++ b/src/main/resources/data/szar/recipes/blueprint_stairs.json @@ -0,0 +1,17 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "B ", + "BB ", + "BBB" + ], + "key": { + "B": { + "item": "szar:blueprint" + } + }, + "result": { + "item": "szar:blueprint_stairs", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/szar/recipes/blueprint_trapdoor.json b/src/main/resources/data/szar/recipes/blueprint_trapdoor.json new file mode 100644 index 0000000..76aba29 --- /dev/null +++ b/src/main/resources/data/szar/recipes/blueprint_trapdoor.json @@ -0,0 +1,16 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "BB", + "BB" + ], + "key": { + "B": { + "item": "szar:blueprint" + } + }, + "result": { + "item": "szar:blueprint_trapdoor", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/szar/recipes/blueprint_wall.json b/src/main/resources/data/szar/recipes/blueprint_wall.json new file mode 100644 index 0000000..8d690a9 --- /dev/null +++ b/src/main/resources/data/szar/recipes/blueprint_wall.json @@ -0,0 +1,16 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "BBB", + "BBB" + ], + "key": { + "B": { + "item": "szar:blueprint" + } + }, + "result": { + "item": "szar:blueprint_wall", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/szar/tags/items/blue.json b/src/main/resources/data/szar/tags/items/blue.json new file mode 100644 index 0000000..32c13cc --- /dev/null +++ b/src/main/resources/data/szar/tags/items/blue.json @@ -0,0 +1,8 @@ +{ + "replace": false, + "values": [ + "minecraft:light_blue_dye", + "minecraft:cyan_dye", + "minecraft:blue_dye" + ] +} \ No newline at end of file diff --git a/src/main/resources/szar.accesswidener b/src/main/resources/szar.accesswidener index a7d420d..68a7e4e 100644 --- a/src/main/resources/szar.accesswidener +++ b/src/main/resources/szar.accesswidener @@ -7,4 +7,5 @@ accessible field net/minecraft/server/network/ServerPlayerInteractionManager pla accessible method net/minecraft/client/render/entity/LivingEntityRenderer addFeature (Lnet/minecraft/client/render/entity/feature/FeatureRenderer;)Z accessible field net/minecraft/client/render/entity/EntityRenderDispatcher renderers Ljava/util/Map; accessible method net/minecraft/world/GameRules$BooleanRule create (ZLjava/util/function/BiConsumer;)Lnet/minecraft/world/GameRules$Type; -accessible method net/minecraft/client/render/block/BlockModelRenderer renderQuad (Lnet/minecraft/world/BlockRenderView;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/client/render/VertexConsumer;Lnet/minecraft/client/util/math/MatrixStack$Entry;Lnet/minecraft/client/render/model/BakedQuad;FFFFIIIII)V \ No newline at end of file +accessible method net/minecraft/client/render/block/BlockModelRenderer renderQuad (Lnet/minecraft/world/BlockRenderView;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/client/render/VertexConsumer;Lnet/minecraft/client/util/math/MatrixStack$Entry;Lnet/minecraft/client/render/model/BakedQuad;FFFFIIIII)V +accessible field net/minecraft/client/particle/ParticleManager world Lnet/minecraft/client/world/ClientWorld; \ No newline at end of file