From b71ddb9432f4fe502a698871a7491f397b4a4488 Mon Sep 17 00:00:00 2001 From: Florian Berger Date: Tue, 25 Jan 2022 17:07:45 +0100 Subject: [PATCH 1/6] Increased version number & forge dependency --- LICENSE.md | 2 +- build.gradle | 8 ++++---- src/main/resources/META-INF/mods.toml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index a50e13c..9e84fc3 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 Florian Berger +Copyright (c) 2021-2022 Florian Berger Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/build.gradle b/build.gradle index f8c1afa..b74fdfa 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ apply plugin: 'net.minecraftforge.gradle' apply plugin: 'eclipse' apply plugin: 'maven-publish' -version = '2021.2.1' +version = '2022.1.0' group = 'biz.berger_media.indestructibletools' // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = 'indestructibletools' @@ -27,7 +27,7 @@ minecraft { // stable_# Stables are built at the discretion of the MCP team. // Use non-default mappings at your own risk. they may not always work. // Simply re-run your setup task after changing the mappings to update your workspace. - mappings channel: 'official', version: '1.18' + mappings channel: 'official', version: '1.18.1' // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') @@ -113,7 +113,7 @@ dependencies { // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied. // The userdev artifact is a special name and will get all sorts of transformations applied to it. - minecraft 'net.minecraftforge:forge:1.18-38.0.14' + minecraft 'net.minecraftforge:forge:1.18.1-39.0.59' // Real mod deobf dependency examples - these get remapped to your current mappings // compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency @@ -136,7 +136,7 @@ jar { "Specification-Vendor": "indestructibletoolssareus", "Specification-Version": "1", // We are version 1 of ourselves "Implementation-Title": project.name, - "Implementation-Version": "${version}", + "Implementation-Version": project.jar.archiveVersion, "Implementation-Vendor" :"indestructibletoolssareus", "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") ]) diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 7c7044a..362bc49 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -1,6 +1,6 @@ modLoader="javafml" #mandatory -loaderVersion="[38,)" +loaderVersion="[39,)" license="https://github.com/florian-berger/indestructible-tools/blob/master/LICENSE" issueTrackerURL="https://github.com/florian-berger/indestructible-tools/issues" @@ -8,7 +8,7 @@ issueTrackerURL="https://github.com/florian-berger/indestructible-tools/issues" [[mods]] modId="indestructibletools" -version="2021.2.1" +version="2022.1.0" displayName="Indestructible Tools" logoFile="indestructibletools.png" @@ -22,7 +22,7 @@ This mod is adding some indestructible tools to Minecraft. They are crafted by u # the modid of the dependency modId="forge" mandatory=true - versionRange="[38,)" + versionRange="[39,)" ordering="NONE" side="BOTH" From db60e40aac477f27b6e8de10a2c4efe6fa8f8acf Mon Sep 17 00:00:00 2001 From: Florian Berger Date: Tue, 25 Jan 2022 20:40:20 +0100 Subject: [PATCH 2/6] [Add] Multi tool combining pickaxe, shovel and axe --- .../item/IndestructibleItems.java | 2 + .../item/ItemIndestructibleMultiTool.java | 78 ++++++++++++++++++ .../indestructibletools/lang/de_de.json | 1 + .../indestructibletools/lang/en_us.json | 1 + .../models/item/indestructible_multitool.json | 6 ++ .../items/indestructible_multitool.png | Bin 0 -> 5409 bytes .../recipes/indestructible_multitool.json | 34 ++++++++ .../recipes/indestructible_multitool.json | 28 +++++++ 8 files changed, 150 insertions(+) create mode 100644 src/main/java/biz/berger_media/indestructibletools/item/ItemIndestructibleMultiTool.java create mode 100644 src/main/resources/assets/indestructibletools/models/item/indestructible_multitool.json create mode 100644 src/main/resources/assets/indestructibletools/textures/items/indestructible_multitool.png create mode 100644 src/main/resources/data/indestructibletools/advancements/recipes/indestructible_multitool.json create mode 100644 src/main/resources/data/indestructibletools/recipes/indestructible_multitool.json diff --git a/src/main/java/biz/berger_media/indestructibletools/item/IndestructibleItems.java b/src/main/java/biz/berger_media/indestructibletools/item/IndestructibleItems.java index 2cf40c5..c07c18a 100644 --- a/src/main/java/biz/berger_media/indestructibletools/item/IndestructibleItems.java +++ b/src/main/java/biz/berger_media/indestructibletools/item/IndestructibleItems.java @@ -28,4 +28,6 @@ public class IndestructibleItems { public static final RegistryObject INDESTRUCTIBLE_HOE = ITEMS.register("indestructible_hoe", ItemIndestructibleHoe::new); + public static final RegistryObject INDESTRUCTIBLE_MULTITOOL = + ITEMS.register("indestructible_multitool", ItemIndestructibleMultiTool::new); } diff --git a/src/main/java/biz/berger_media/indestructibletools/item/ItemIndestructibleMultiTool.java b/src/main/java/biz/berger_media/indestructibletools/item/ItemIndestructibleMultiTool.java new file mode 100644 index 0000000..42bb49e --- /dev/null +++ b/src/main/java/biz/berger_media/indestructibletools/item/ItemIndestructibleMultiTool.java @@ -0,0 +1,78 @@ +package biz.berger_media.indestructibletools.item; + +import biz.berger_media.indestructibletools.helpers.EnchantmentHelper; +import biz.berger_media.indestructibletools.helpers.ItemHelper; +import net.minecraft.tags.BlockTags; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.PickaxeItem; +import net.minecraft.world.item.Tiers; +import net.minecraft.world.item.enchantment.Enchantment; +import net.minecraft.world.level.block.state.BlockState; + +/** + * Class that represents the Multi-Tool (can be used as different tool) + */ +public class ItemIndestructibleMultiTool extends PickaxeItem { + public ItemIndestructibleMultiTool() { + super(Tiers.NETHERITE, 4, -1.5F, ItemHelper.getProperties()); + } + + @Override + public boolean isFireResistant() { + return true; + } + + @Override + public boolean isDamageable(ItemStack stack) { + return false; + } + + @Override + public float getDestroySpeed(ItemStack stack, BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_AXE)) { + return this.speed; + } + + if (state.is(BlockTags.MINEABLE_WITH_SHOVEL)) { + return this.speed; + } + + return super.getDestroySpeed(stack, state); + } + + @Override + public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_AXE)) { + return true; + } + + if (state.is(BlockTags.MINEABLE_WITH_SHOVEL)) { + return true; + } + + return super.isCorrectToolForDrops(stack, state); + } + + @Override + public boolean isEnchantable(ItemStack stack) { + return !stack.isEnchanted(); + } + + @Override + public boolean canApplyAtEnchantingTable(ItemStack stack, Enchantment enchantment) { + if (EnchantmentHelper.isInvalidEnchantment(enchantment)) { + return false; + } + + return super.canApplyAtEnchantingTable(stack, enchantment); + } + + @Override + public boolean isBookEnchantable(ItemStack stack, ItemStack book) { + if (EnchantmentHelper.isBookEnchantedWithInvalidSpell(book)) { + return false; + } + + return super.isBookEnchantable(stack, book); + } +} diff --git a/src/main/resources/assets/indestructibletools/lang/de_de.json b/src/main/resources/assets/indestructibletools/lang/de_de.json index e706e5a..4967426 100644 --- a/src/main/resources/assets/indestructibletools/lang/de_de.json +++ b/src/main/resources/assets/indestructibletools/lang/de_de.json @@ -6,5 +6,6 @@ "item.indestructibletools.indestructible_shovel": "Unzerstörbare Schaufel", "item.indestructibletools.indestructible_sword": "Unzerstörbares Schwert", "item.indestructibletools.indestructible_hoe": "Unzerstörbare Hacke", + "item.indestructibletools.indestructible_multitool": "Unzerstörbares Mehrfach-Werkzeug", "item.indestructibletools.indestructible_ingot": "Unzerstörbarer Barren" } \ No newline at end of file diff --git a/src/main/resources/assets/indestructibletools/lang/en_us.json b/src/main/resources/assets/indestructibletools/lang/en_us.json index eaae425..9ff062c 100644 --- a/src/main/resources/assets/indestructibletools/lang/en_us.json +++ b/src/main/resources/assets/indestructibletools/lang/en_us.json @@ -6,5 +6,6 @@ "item.indestructibletools.indestructible_shovel": "Indestructible shovel", "item.indestructibletools.indestructible_sword": "Indestructible sword", "item.indestructibletools.indestructible_hoe": "Indestructible hoe", + "item.indestructibletools.indestructible_multitool": "Indestructible multitool", "item.indestructibletools.indestructible_ingot": "Indestructible ingot" } \ No newline at end of file diff --git a/src/main/resources/assets/indestructibletools/models/item/indestructible_multitool.json b/src/main/resources/assets/indestructibletools/models/item/indestructible_multitool.json new file mode 100644 index 0000000..9581fa4 --- /dev/null +++ b/src/main/resources/assets/indestructibletools/models/item/indestructible_multitool.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "indestructibletools:items/indestructible_multitool" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/indestructibletools/textures/items/indestructible_multitool.png b/src/main/resources/assets/indestructibletools/textures/items/indestructible_multitool.png new file mode 100644 index 0000000000000000000000000000000000000000..39d6d81f399b6c4d2a0a35b95bd0868233aded31 GIT binary patch literal 5409 zcmeHKX;c&05)Q~FBAbW^I>rDZBUwqv0s$e!utgxEh>F@tIuOW4(vSeoxU#q)g1F$m zp~EORI)bwUoi~3x=gmL+oKAPwt@`TLS9R;=ZVp<= znrvuoh(I7F`}%lu;HRnjHqe8AXZ3#o5D1+k2_Z`%4xmKJj3$ZK+FSZ^WO*vHP>Ys%i+BzGZ$ha;| zm0Ub)l03M%d;U$+=aRX-$xdhWnkJtpID_`y^}<}fJeI!X*bCB=`bp(S`{N7fqps`U z{#x#~`%>6>o9m($?bYRXZp|^+gtb=r_&4NwtkF)n`no>O6Z|2JYM*d?EwU^*haB|K z)%n01fBH~k4Y|H-PqvsEalPL5dPfYkyg6}ked6-d{+N;+VAcJugIyylAIC*>{UUX;(0L3E5qsnBoA>6KIQVlOV@NJ+46o>QqTR|soPg{3raF=l4x7g z3O8U2bqAJ34&C%pv{FvZJF&OOJb_SZg?=}ryuF-pEq#YW)4;$~*{eS+*5UWstQyds zeLtP@y1tYZzeew@rO~@CL78^_?me5kh3R=_tT=P=y?e)3CZ?U})q8}h>e12*?u(qn zr|ULt3QK*&()E~_40Wd&8CE3b&#$a$Lddh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$&Q8;pEaAZ3Y+Gzk=~r8GaHkiRHU2XdAoMd`^=pVNR-9d2eZSG zTA7xkhz!(x-h6|MxWYd!?(7i!z8PtN%<(qW(aWvxLLd^Z{ounfnB9G1LQdAX{KgkM zI9`rPI3qJ=2A&rIF7oqq)XgIyjy#B(y#-a2A6*p|#?K>NXfX9k-T7X-os#_G@=G`A zrSuEh%{?xmis8D))$yAzhF)30eD=FtMgLpR!|6)aKn^2QM6`aPyQHG6V5@oGS^M%Q zX4BezwdQRciH$E5FE+XOvTi2oFxIJG;`A!7?QrOAX5u?vH+qVd&XnU$wfzlEhv@eQ zDF?T8`KRos5oY{Vm%Z3{%cXneGafuSxQcx0ryl;Mhr&y#jlH;?S99M4G=JDK%Nok_ Uei9)Hg{emPG8cO1d#&E^H--^QE&u=k literal 0 HcmV?d00001 diff --git a/src/main/resources/data/indestructibletools/advancements/recipes/indestructible_multitool.json b/src/main/resources/data/indestructibletools/advancements/recipes/indestructible_multitool.json new file mode 100644 index 0000000..28eb1c4 --- /dev/null +++ b/src/main/resources/data/indestructibletools/advancements/recipes/indestructible_multitool.json @@ -0,0 +1,34 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "indestructibletools:indestructible_multitool" + ] + }, + "criteria": { + "has_ingot": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "indestructibletools:indestructible_pickaxe" + ] + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "indestructibletools:indestructible_multitool" + } + } + }, + "requirements": [ + [ + "has_ingot", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/indestructibletools/recipes/indestructible_multitool.json b/src/main/resources/data/indestructibletools/recipes/indestructible_multitool.json new file mode 100644 index 0000000..3f7a673 --- /dev/null +++ b/src/main/resources/data/indestructibletools/recipes/indestructible_multitool.json @@ -0,0 +1,28 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "PSA", + "#I#", + " I " + ], + "key": { + "#": { + "item": "minecraft:string" + }, + "I": { + "item": "minecraft:stick" + }, + "P": { + "item": "indestructibletools:indestructible_pickaxe" + }, + "S": { + "item": "indestructibletools:indestructible_shovel" + }, + "A": { + "item": "indestructibletools:indestructible_axe" + } + }, + "result": { + "item": "indestructibletools:indestructible_multitool" + } +} \ No newline at end of file From 0d0ea6c14544ffc87a3a481d45afa9dce76bdb2c Mon Sep 17 00:00:00 2001 From: Florian Berger Date: Tue, 25 Jan 2022 20:53:01 +0100 Subject: [PATCH 3/6] [Add] Multitool right click to make path block --- .../IndestructibleTools.java | 6 ++ .../events/RightClickBlockEventListener.java | 70 +++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 src/main/java/biz/berger_media/indestructibletools/events/RightClickBlockEventListener.java diff --git a/src/main/java/biz/berger_media/indestructibletools/IndestructibleTools.java b/src/main/java/biz/berger_media/indestructibletools/IndestructibleTools.java index 6cb314c..4a1af14 100644 --- a/src/main/java/biz/berger_media/indestructibletools/IndestructibleTools.java +++ b/src/main/java/biz/berger_media/indestructibletools/IndestructibleTools.java @@ -1,8 +1,11 @@ package biz.berger_media.indestructibletools; +import biz.berger_media.indestructibletools.events.RightClickBlockEventListener; import biz.berger_media.indestructibletools.item.IndestructibleItems; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.state.BlockState; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.fml.common.Mod; @@ -20,6 +23,8 @@ public class IndestructibleTools { */ public static final String MOD_ID = "indestructibletools"; + public static final BlockState DirtPathState = Blocks.DIRT_PATH.defaultBlockState(); + /** * Creates an instance of the mod */ @@ -30,6 +35,7 @@ public IndestructibleTools() { IndestructibleItems.ITEMS.register(bus); MinecraftForge.EVENT_BUS.register(this); + MinecraftForge.EVENT_BUS.register(new RightClickBlockEventListener()); } private void setup(final FMLCommonSetupEvent event) { diff --git a/src/main/java/biz/berger_media/indestructibletools/events/RightClickBlockEventListener.java b/src/main/java/biz/berger_media/indestructibletools/events/RightClickBlockEventListener.java new file mode 100644 index 0000000..741a69e --- /dev/null +++ b/src/main/java/biz/berger_media/indestructibletools/events/RightClickBlockEventListener.java @@ -0,0 +1,70 @@ +package biz.berger_media.indestructibletools.events; + +import biz.berger_media.indestructibletools.IndestructibleTools; +import biz.berger_media.indestructibletools.item.ItemIndestructibleMultiTool; +import net.minecraft.core.BlockPos; +import net.minecraft.sounds.SoundEvents; +import net.minecraft.sounds.SoundSource; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.material.Material; +import net.minecraftforge.event.entity.player.PlayerInteractEvent; +import net.minecraftforge.eventbus.api.Event; +import net.minecraftforge.eventbus.api.SubscribeEvent; + +public class RightClickBlockEventListener { + /** + * Listener for the RightClick event on a block + */ + @SubscribeEvent + public void onRightClick(PlayerInteractEvent.RightClickBlock event) { + if (event.getResult() != Event.Result.DEFAULT || event.isCanceled()) { + return; + } + + Player player = event.getPlayer(); + Level world = event.getWorld(); + InteractionHand hand = event.getHand(); + + if (player.getItemInHand(hand).getItem() instanceof ItemIndestructibleMultiTool) { + BlockPos pos = event.getPos(); + if (world.getBlockState(pos.above()).getMaterial() == Material.AIR) { + BlockState state = world.getBlockState(pos); + if (isConvertible(state)) { + convertToPath(world, pos, player, hand); + } + } + } + } + + /** + * Checks if the target block can be converted to a Dirt Path + */ + private static boolean isConvertible(BlockState state) { + Block block = state.getBlock(); + return block == Blocks.COARSE_DIRT || block == Blocks.DIRT || + block == Blocks.MYCELIUM || block == Blocks.PODZOL || + block == Blocks.GRASS_BLOCK; + } + + /** + * Replaces a block at position with a dirt path and plays a sound + * + * @param world World where the block should be replaced + * @param pos Position that should be replaced + * @param player Player that is replacing the block + * @param hand Hand that should swing + */ + private static void convertToPath(Level world, BlockPos pos, Player player, InteractionHand hand) { + world.playSound(player, pos, SoundEvents.SHOVEL_FLATTEN, SoundSource.BLOCKS, 1.0F, 1.0F); + player.swing(hand); + + if (!world.isClientSide) { + world.setBlock(pos, IndestructibleTools.DirtPathState, 11); + } + } +} From 081780209bd0de286d8afb983e14918e0619b87e Mon Sep 17 00:00:00 2001 From: Florian Berger Date: Tue, 25 Jan 2022 20:57:43 +0100 Subject: [PATCH 4/6] [Change] Documentation stuff --- README.md | 29 ++++++++++++++++++++++--- curseforge/images/Recipe_Multitool.png | Bin 0 -> 2170 bytes curseforge/images/tools-recipes.gif | Bin 0 -> 9540 bytes gimp/indestructible_multitool.xcf | Bin 0 -> 4218 bytes 4 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 curseforge/images/Recipe_Multitool.png create mode 100644 curseforge/images/tools-recipes.gif create mode 100644 gimp/indestructible_multitool.xcf diff --git a/README.md b/README.md index 05059c3..c2ed26d 100644 --- a/README.md +++ b/README.md @@ -9,15 +9,38 @@ The 'Mending' enchantment isn't enough for me. So I created a mod that adds such ## Recipes -The following recipes are added to the game:\ +To craft the ingot, use the following shapeless recipe:\ ![Recipe_Ingot](/curseforge/images/Recipe_Ingot.png?raw=true) + +With these ingots, you are able to craft the known tools by using the known patterns:\ +![Recipes_Gif](/curseforge/images/Recipe_Multitool.png?raw=true) + + +
+Recipes as static images + +**Axe**\ ![Recipe_Axe](/curseforge/images/Recipe_Axe.png?raw=true) + +**Hoe**\ ![Recipe_Hoe](/curseforge/images/Recipe_Hoe.png?raw=true) + +**Pickaxe**\ ![Recipe_Pickaxe](/curseforge/images/Recipe_Pickaxe.png?raw=true) + +**Shovel**\ ![Recipe_Shovel](/curseforge/images/Recipe_Shovel.png?raw=true) + +**Sword**\ ![Recipe_Sword](/curseforge/images/Recipe_Sword.png?raw=true) +
+## Multi-Tool +From **Version 2022.1**, this modification contains a multi-tool. It combines the capabilities of the pickaxe, the shovel and the axe. You can craft it by using the following recipe:\ +![Recipe_MultiTool](/curseforge/images/Recipe_Multitool.png?raw=true) +\ +Thanks to [Fundryi](https://github.com/Fundryi) for the [Multi-Tool suggestion](https://github.com/florian-berger/indestructible-tools/issues/4)! ### Using in modpacks -You can use this mod in every modpack that is available for free. You are allowed to distribute the mod file in an own ModPack launcher. -Just add a link to this repository, [my website](https://berger-media.biz/downloads/10/minecraft/indestructible-tools) or the [CurseForge page](https://www.curseforge.com/minecraft/mc-mods/indestructible-tools) of this modification. +You can use this mod in every modpack that is available for free. You are allowed to distribute the mod file in an own ModPack launcher.\ +If the modpack is not distributed via CurseForge, you need to add a link to this repository, [my website](https://berger-media.biz/downloads/10/minecraft/indestructible-tools) or the [CurseForge page](https://www.curseforge.com/minecraft/mc-mods/indestructible-tools) of this modification. diff --git a/curseforge/images/Recipe_Multitool.png b/curseforge/images/Recipe_Multitool.png new file mode 100644 index 0000000000000000000000000000000000000000..a3d7e8eb36c8400525b5c73a1c4fdc633555b628 GIT binary patch literal 2170 zcmZuydpOf=AOF$iP)H{ljd^M$#7rZT$dDDGtF%$rFxE0>Ia8|%@noK`&9OYBF(Rbp zoFs=1+Awl>h&*e&y=)$>c(5!0NTq^_<$Jh!VCdr9fisa;8F$C1`Yp1Wi$8r;@2 z*L^nm`&P-;;#8DexhL-NI703bBdFppb91JTMxyU5N_pEC6b4^e;$lXa!TPO#bc@;l z89SAn$}6K;Y0d1-SS%!CULJU9!OS0yFFpSH49y|w+zIkKg$zimDd)$l)-Uy)78GX# zggY3jnWbZL9cHX$^zB%LqbK6c{svRyqL$;V``V;Wc^$BOqh22_S7|td&${Ss-wnTN z_)uQOlaDy>TJhz?!Ym}>2RgEU-iVSLAb0W6J+R$BkRK(r*g{5hp1gUPq_^45`9{f= zGHi=*C18SF0&E7)oFPeAYX0K9wFI9mupDZlvp2>kZ#`{5M{lj-EOp)`#oM7Acv1S^ z>T}wxPg&|vv5x>;rEX6pG$m~VgXII9-uSM^T@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-vQJl_ieNRCjvwMPlhls`m!R=6qi~j ztArvQh;&G_YW_Gz0909*-gt|+@59cYfZYcYw~t$H==vt_I9kNk7^FhuZS&6X`4G4C zKZns)P?UT2O6(u8>$BOf9VjA76OKjuwKHzR!lz1iu{dF=pl;*v95N6aF#7w|*v#gCRGtYEFA*rWnGADN%sL9O65jGsDvr<$RG-*o z+tZ#%b-)UJqTX{mS4dyQ;>sOHwGxA|oH4stj$Q4&IR5*Nmj(_X^k1J!iDdu) literal 0 HcmV?d00001 diff --git a/gimp/indestructible_multitool.xcf b/gimp/indestructible_multitool.xcf new file mode 100644 index 0000000000000000000000000000000000000000..6355419bde76417fff164caf1aebc4ab8ca1813e GIT binary patch literal 4218 zcmdT|&2Jk;6d!*iPO^5>LO_M0VVhEUTPd!cRy2*$L}~bFByb~=Dh(I3jo0f{{SoYK zo1W4G2O`cOB(!&gQ2q%d4*nw$2gHeEQJbdr@O!g6?gSYUa%mZB=Dm3{`+GBQ-~4uD z*Q;%qo9kusUcOLZD958p`ZuU2P-8JPuc8hud@cT<3VjSUiTW1m>yaLZe2uZhJmhf~ z&=X$GcAW{g>6Kt&g!7}-@*h+kv(>12rE?=z*mBg=MXYfWShdv9XF%io2ccDBs7|MOE zI?;6a(#w^`J*R43cWikeX+9ldfqI(sxrb!|bVO?*wfz#A0G^C)jDjv{zAb+Y++BZ86ABW!o~ec7(+$U1iF!nDr(* z7`qr@7hNu~Atg2>uzM}Ai(O>`Ha`qDkFa^xkl2tC8xq*P7TCP2Ou#l2c2bPsHBcR9 zUE>*rsdJ($GI)J0ik=F!Or7~n=jF_`=sh1b*C^k$l3LO_DgaTgrK)|#U`lMwgeLGiD(DG)>a@=Ft&qsn~ao>0@FI8E#tk#zG5%*;dr?0L98u>m6D{? zi1${9Evj%(K4g}>^*i>Y zdyb7axY2WLm{}uoOm;XnvIZO*r`WVSeu8q=pv>(&6C#Zq)+@2wJiQzBA}O0+xo+1> zxXCX2ONJg`E)y@N}*1Lp@zm(XkUg4A}x)!e$;F}MjLuwM)g~u+I|$; zQA#6K)EN4sSClacp6mwT<(SnK!64g{bUeVGhGd)sKZjII94m=fh`6HRU4)Z3crY}i zB>&=eX^mlngbUim^-JPPwgqm;wZM&-7PukLO5BiT3704qxJ0kO1-$~7D_odjMu;oP z6u2Rk0yiR3;D$6RaYGU%Tw+k*k^#72Pv9D3_* Date: Tue, 25 Jan 2022 20:59:16 +0100 Subject: [PATCH 5/6] [Fix] Use correct image in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c2ed26d..7f26db6 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ To craft the ingot, use the following shapeless recipe:\ ![Recipe_Ingot](/curseforge/images/Recipe_Ingot.png?raw=true) With these ingots, you are able to craft the known tools by using the known patterns:\ -![Recipes_Gif](/curseforge/images/Recipe_Multitool.png?raw=true) +![Recipes_Gif](/curseforge/images/tools-recipes.gif?raw=true)
From 7183fd055449a8908173e1e02bb881e660620834 Mon Sep 17 00:00:00 2001 From: Florian Berger Date: Tue, 25 Jan 2022 21:21:33 +0100 Subject: [PATCH 6/6] no message --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7f26db6..c99d3db 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,6 @@ From **Version 2022.1**, this modification contains a multi-tool. It combines th \ Thanks to [Fundryi](https://github.com/Fundryi) for the [Multi-Tool suggestion](https://github.com/florian-berger/indestructible-tools/issues/4)! -### Using in modpacks +## Usage in modpacks You can use this mod in every modpack that is available for free. You are allowed to distribute the mod file in an own ModPack launcher.\ If the modpack is not distributed via CurseForge, you need to add a link to this repository, [my website](https://berger-media.biz/downloads/10/minecraft/indestructible-tools) or the [CurseForge page](https://www.curseforge.com/minecraft/mc-mods/indestructible-tools) of this modification.