diff --git a/README.md b/README.md index a1263e3..492de6f 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ With a Construction Wand you can place multiple blocks (up to 1024) at once, ext facing. If that's not enough: you can upgrade your wand with additional cores, allowing you to place a block behind the block you are facing, conjure blocks in mid air or destroy lots of blocks very fast. -![](images/wands.png) +![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.19/images/wands.png) **Note:** These are the instructions for ConstructionWand version 2.0+, which introduced some new features. If you are still using version 1.x, refer to [those](https://github.com/Theta-Dev/ConstructionWand/tree/1.16.2-1.7) @@ -23,12 +23,12 @@ and last longer. These properties can be changed in the config. | Infinity | Unbreakable | 1024 | Yes | 8 | 81 | ## Crafting -![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.16.2/images/crafting1.png) -![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.16.2/images/crafting2.png) -![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.16.2/images/crafting3.png) -![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.16.2/images/crafting4.png) -![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.16.2/images/crafting5.png) -![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.16.2/images/crafting6.png) +![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.19/images/crafting1.png) +![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.19/images/crafting2.png) +![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.19/images/crafting3.png) +![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.19/images/crafting4.png) +![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.19/images/crafting5.png) +![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.19/images/crafting6.png) ## Keybindings @@ -69,7 +69,7 @@ you can use the undo feature if you've made a mistake. ## Options SNEAK+OPTKEY+Right clicking empty space opens the option screen of your wand. -![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.15/images/options.png) +![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.19/images/options.png) **Restriction:** If restriction is enabled the wand will only place blocks in one row or column (choose between North/South, East/West on a horizontal plane and Horizontal, Vertical on a vertical plane). @@ -79,7 +79,7 @@ has no effect if the angel core is enabled. **Direction:** If set to "Player" the wand places blocks in the same direction as if they were placed by yourself. Target mode places the blocks in the same direction as their supporting block. See the picture below: -![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.15/images/placedir.png) +![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.19/images/placedir.png) **Replacement:** Enables/disables the replacement of replaceable blocks (Fluids, snow, tallgrass). @@ -122,7 +122,7 @@ for TileEntities in CW Version 1.7. Chisels&Bits blocks are blacklisted by defau There are probably a few other tile entities from other mods out there which may cause issues as well. If you find some of them you can tell me by creating an issue, commenting on Curse or editing the default blacklist yourself -(it is located at https://github.com/Theta-Dev/ConstructionWand/blob/1.16.2/src/main/java/thetadev/constructionwand/basics/ConfigServer.java#L28) +(it is located at https://github.com/Theta-Dev/ConstructionWand/blob/1.19/src/main/java/thetadev/constructionwand/basics/ConfigServer.java#L25) and making a PR. ## Contributions and #Hacktoberfest diff --git a/build.gradle b/build.gradle index 018b104..581c846 100644 --- a/build.gradle +++ b/build.gradle @@ -129,7 +129,7 @@ dependencies { compileOnly "mezz.jei:jei-${mcversion}-common-api:${jei_version}" compileOnly "mezz.jei:jei-${mcversion}-forge-api:${jei_version}" - // runtimeOnly "mezz.jei:jei-${mcversion}-forge:${jei_version}" + runtimeOnly "mezz.jei:jei-${mcversion}-forge:${jei_version}" compileOnly fg.deobf([ group: "vazkii.botania", diff --git a/gradle.properties b/gradle.properties index 8df594a..1dbca89 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,15 +4,15 @@ org.gradle.daemon=false author=thetadev modid=constructionwand -mcversion=1.19.1 -forgeversion=42.0.9 +mcversion=1.19.2 +forgeversion=43.2.4 mcp_channel=official -mcp_mappings=1.19.1 +mcp_mappings=1.19.2 # Source: https://maven.blamejared.com/vazkii/botania/Botania/ -botania=1.18.2-430-SNAPSHOT +botania=1.19.2-437-FORGE # Source: https://dvs1.progwml6.com/files/maven/mezz/jei/ -jei_version=11.2.0.244 +jei_version=11.5.0.297 version_major=2 -version_minor=8 \ No newline at end of file +version_minor=9 \ No newline at end of file diff --git a/src/main/java/thetadev/constructionwand/containers/handlers/HandlerBotania.java b/src/main/java/thetadev/constructionwand/containers/handlers/HandlerBotania.java index 8ffb651..880f57d 100644 --- a/src/main/java/thetadev/constructionwand/containers/handlers/HandlerBotania.java +++ b/src/main/java/thetadev/constructionwand/containers/handlers/HandlerBotania.java @@ -5,7 +5,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.Block; import thetadev.constructionwand.api.IContainerHandler; import vazkii.botania.api.BotaniaForgeCapabilities; -import vazkii.botania.api.item.IBlockProvider; +import vazkii.botania.api.item.BlockProvider; import java.util.Optional; @@ -18,10 +18,10 @@ public class HandlerBotania implements IContainerHandler @Override public int countItems(Player player, ItemStack itemStack, ItemStack inventoryStack) { - Optional provOptional = inventoryStack.getCapability(BotaniaForgeCapabilities.BLOCK_PROVIDER).resolve(); + Optional provOptional = inventoryStack.getCapability(BotaniaForgeCapabilities.BLOCK_PROVIDER).resolve(); if(provOptional.isEmpty()) return 0; - IBlockProvider prov = provOptional.get(); + BlockProvider prov = provOptional.get(); int provCount = prov.getBlockCount(player, inventoryStack, Block.byItem(itemStack.getItem())); if(provCount == -1) return Integer.MAX_VALUE; @@ -30,10 +30,10 @@ public class HandlerBotania implements IContainerHandler @Override public int useItems(Player player, ItemStack itemStack, ItemStack inventoryStack, int count) { - Optional provOptional = inventoryStack.getCapability(BotaniaForgeCapabilities.BLOCK_PROVIDER).resolve(); + Optional provOptional = inventoryStack.getCapability(BotaniaForgeCapabilities.BLOCK_PROVIDER).resolve(); if(provOptional.isEmpty()) return 0; - IBlockProvider prov = provOptional.get(); + BlockProvider prov = provOptional.get(); if(prov.provideBlock(player, inventoryStack, Block.byItem(itemStack.getItem()), true)) return 0; return count; diff --git a/src/main/java/thetadev/constructionwand/containers/handlers/HandlerCapability.java b/src/main/java/thetadev/constructionwand/containers/handlers/HandlerCapability.java index d67ae0e..c4a85cc 100644 --- a/src/main/java/thetadev/constructionwand/containers/handlers/HandlerCapability.java +++ b/src/main/java/thetadev/constructionwand/containers/handlers/HandlerCapability.java @@ -2,7 +2,7 @@ package thetadev.constructionwand.containers.handlers; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.common.capabilities.ForgeCapabilities; import net.minecraftforge.items.IItemHandler; import thetadev.constructionwand.api.IContainerHandler; import thetadev.constructionwand.basics.WandUtil; @@ -13,12 +13,12 @@ public class HandlerCapability implements IContainerHandler { @Override public boolean matches(Player player, ItemStack itemStack, ItemStack inventoryStack) { - return inventoryStack != null && inventoryStack.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).isPresent(); + return inventoryStack != null && inventoryStack.getCapability(ForgeCapabilities.ITEM_HANDLER).isPresent(); } @Override public int countItems(Player player, ItemStack itemStack, ItemStack inventoryStack) { - Optional itemHandlerOptional = inventoryStack.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).resolve(); + Optional itemHandlerOptional = inventoryStack.getCapability(ForgeCapabilities.ITEM_HANDLER).resolve(); if(itemHandlerOptional.isEmpty()) return 0; int total = 0; @@ -36,7 +36,7 @@ public class HandlerCapability implements IContainerHandler @Override public int useItems(Player player, ItemStack itemStack, ItemStack inventoryStack, int count) { - Optional itemHandlerOptional = inventoryStack.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).resolve(); + Optional itemHandlerOptional = inventoryStack.getCapability(ForgeCapabilities.ITEM_HANDLER).resolve(); if(itemHandlerOptional.isEmpty()) return 0; IItemHandler itemHandler = itemHandlerOptional.get(); diff --git a/src/main/java/thetadev/constructionwand/wand/WandJob.java b/src/main/java/thetadev/constructionwand/wand/WandJob.java index b35f6f6..b294afa 100644 --- a/src/main/java/thetadev/constructionwand/wand/WandJob.java +++ b/src/main/java/thetadev/constructionwand/wand/WandJob.java @@ -1,8 +1,8 @@ package thetadev.constructionwand.wand; import net.minecraft.core.BlockPos; -import net.minecraft.server.level.ServerPlayer; import net.minecraft.sounds.SoundSource; +import net.minecraft.world.InteractionHand; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.Item; @@ -99,7 +99,7 @@ public class WandJob // If the item cant be taken, undo the placement if(wandSupplier.takeItemStack(snapshot.getRequiredItems()) == 0) { executed.add(snapshot); - wand.hurt(1, player.getRandom(), (ServerPlayer) player); + wand.hurtAndBreak(1, player, e -> e.broadcastBreakEvent(InteractionHand.MAIN_HAND)); } else { ConstructionWand.LOGGER.info("Item could not be taken. Remove block: " +