mirror of
https://github.com/Theta-Dev/ConstructionWand.git
synced 2024-11-27 00:20:58 +01:00
Compare commits
No commits in common. "c53845ced973c1d821ce625ee5767e3c67be84e8" and "05658450c854a4444e7134d1f459b2c711881278" have entirely different histories.
c53845ced9
...
05658450c8
6 changed files with 28 additions and 28 deletions
20
README.md
20
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
|
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.
|
block you are facing, conjure blocks in mid air or destroy lots of blocks very fast.
|
||||||
|
|
||||||
![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.19/images/wands.png)
|
![](images/wands.png)
|
||||||
|
|
||||||
**Note:** These are the instructions for ConstructionWand version 2.0+, which introduced some new features.
|
**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)
|
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 |
|
| Infinity | Unbreakable | 1024 | Yes | 8 | 81 |
|
||||||
|
|
||||||
## Crafting
|
## Crafting
|
||||||
![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.19/images/crafting1.png)
|
![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.16.2/images/crafting1.png)
|
||||||
![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.19/images/crafting2.png)
|
![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.16.2/images/crafting2.png)
|
||||||
![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.19/images/crafting3.png)
|
![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.16.2/images/crafting3.png)
|
||||||
![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.19/images/crafting4.png)
|
![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.16.2/images/crafting4.png)
|
||||||
![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.19/images/crafting5.png)
|
![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.16.2/images/crafting5.png)
|
||||||
![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.19/images/crafting6.png)
|
![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.16.2/images/crafting6.png)
|
||||||
|
|
||||||
## Keybindings
|
## Keybindings
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ you can use the undo feature if you've made a mistake.
|
||||||
## Options
|
## Options
|
||||||
SNEAK+OPTKEY+Right clicking empty space opens the option screen of your wand.
|
SNEAK+OPTKEY+Right clicking empty space opens the option screen of your wand.
|
||||||
|
|
||||||
![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.19/images/options.png)
|
![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.15/images/options.png)
|
||||||
|
|
||||||
**Restriction:** If restriction is enabled the wand will only place blocks in one row or column
|
**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).
|
(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.
|
**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:
|
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.19/images/placedir.png)
|
![](https://raw.githubusercontent.com/Theta-Dev/ConstructionWand/1.15/images/placedir.png)
|
||||||
|
|
||||||
**Replacement:** Enables/disables the replacement of replaceable blocks (Fluids, snow, tallgrass).
|
**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.
|
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
|
If you find some of them you can tell me by creating
|
||||||
an issue, commenting on Curse or editing the default blacklist yourself
|
an issue, commenting on Curse or editing the default blacklist yourself
|
||||||
(it is located at https://github.com/Theta-Dev/ConstructionWand/blob/1.19/src/main/java/thetadev/constructionwand/basics/ConfigServer.java#L25)
|
(it is located at https://github.com/Theta-Dev/ConstructionWand/blob/1.16.2/src/main/java/thetadev/constructionwand/basics/ConfigServer.java#L28)
|
||||||
and making a PR.
|
and making a PR.
|
||||||
|
|
||||||
## Contributions and #Hacktoberfest
|
## Contributions and #Hacktoberfest
|
||||||
|
|
|
@ -129,7 +129,7 @@ dependencies {
|
||||||
|
|
||||||
compileOnly "mezz.jei:jei-${mcversion}-common-api:${jei_version}"
|
compileOnly "mezz.jei:jei-${mcversion}-common-api:${jei_version}"
|
||||||
compileOnly "mezz.jei:jei-${mcversion}-forge-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([
|
compileOnly fg.deobf([
|
||||||
group: "vazkii.botania",
|
group: "vazkii.botania",
|
||||||
|
|
|
@ -4,15 +4,15 @@ org.gradle.daemon=false
|
||||||
author=thetadev
|
author=thetadev
|
||||||
modid=constructionwand
|
modid=constructionwand
|
||||||
|
|
||||||
mcversion=1.19.2
|
mcversion=1.19.1
|
||||||
forgeversion=43.2.4
|
forgeversion=42.0.9
|
||||||
mcp_channel=official
|
mcp_channel=official
|
||||||
mcp_mappings=1.19.2
|
mcp_mappings=1.19.1
|
||||||
|
|
||||||
# Source: https://maven.blamejared.com/vazkii/botania/Botania/
|
# Source: https://maven.blamejared.com/vazkii/botania/Botania/
|
||||||
botania=1.19.2-437-FORGE
|
botania=1.18.2-430-SNAPSHOT
|
||||||
# Source: https://dvs1.progwml6.com/files/maven/mezz/jei/
|
# Source: https://dvs1.progwml6.com/files/maven/mezz/jei/
|
||||||
jei_version=11.5.0.297
|
jei_version=11.2.0.244
|
||||||
|
|
||||||
version_major=2
|
version_major=2
|
||||||
version_minor=9
|
version_minor=8
|
|
@ -5,7 +5,7 @@ import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
import thetadev.constructionwand.api.IContainerHandler;
|
import thetadev.constructionwand.api.IContainerHandler;
|
||||||
import vazkii.botania.api.BotaniaForgeCapabilities;
|
import vazkii.botania.api.BotaniaForgeCapabilities;
|
||||||
import vazkii.botania.api.item.BlockProvider;
|
import vazkii.botania.api.item.IBlockProvider;
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@ -18,10 +18,10 @@ public class HandlerBotania implements IContainerHandler
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int countItems(Player player, ItemStack itemStack, ItemStack inventoryStack) {
|
public int countItems(Player player, ItemStack itemStack, ItemStack inventoryStack) {
|
||||||
Optional<BlockProvider> provOptional = inventoryStack.getCapability(BotaniaForgeCapabilities.BLOCK_PROVIDER).resolve();
|
Optional<IBlockProvider> provOptional = inventoryStack.getCapability(BotaniaForgeCapabilities.BLOCK_PROVIDER).resolve();
|
||||||
if(provOptional.isEmpty()) return 0;
|
if(provOptional.isEmpty()) return 0;
|
||||||
|
|
||||||
BlockProvider prov = provOptional.get();
|
IBlockProvider prov = provOptional.get();
|
||||||
int provCount = prov.getBlockCount(player, inventoryStack, Block.byItem(itemStack.getItem()));
|
int provCount = prov.getBlockCount(player, inventoryStack, Block.byItem(itemStack.getItem()));
|
||||||
if(provCount == -1)
|
if(provCount == -1)
|
||||||
return Integer.MAX_VALUE;
|
return Integer.MAX_VALUE;
|
||||||
|
@ -30,10 +30,10 @@ public class HandlerBotania implements IContainerHandler
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int useItems(Player player, ItemStack itemStack, ItemStack inventoryStack, int count) {
|
public int useItems(Player player, ItemStack itemStack, ItemStack inventoryStack, int count) {
|
||||||
Optional<BlockProvider> provOptional = inventoryStack.getCapability(BotaniaForgeCapabilities.BLOCK_PROVIDER).resolve();
|
Optional<IBlockProvider> provOptional = inventoryStack.getCapability(BotaniaForgeCapabilities.BLOCK_PROVIDER).resolve();
|
||||||
if(provOptional.isEmpty()) return 0;
|
if(provOptional.isEmpty()) return 0;
|
||||||
|
|
||||||
BlockProvider prov = provOptional.get();
|
IBlockProvider prov = provOptional.get();
|
||||||
if(prov.provideBlock(player, inventoryStack, Block.byItem(itemStack.getItem()), true))
|
if(prov.provideBlock(player, inventoryStack, Block.byItem(itemStack.getItem()), true))
|
||||||
return 0;
|
return 0;
|
||||||
return count;
|
return count;
|
||||||
|
|
|
@ -2,7 +2,7 @@ package thetadev.constructionwand.containers.handlers;
|
||||||
|
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraftforge.common.capabilities.ForgeCapabilities;
|
import net.minecraftforge.items.CapabilityItemHandler;
|
||||||
import net.minecraftforge.items.IItemHandler;
|
import net.minecraftforge.items.IItemHandler;
|
||||||
import thetadev.constructionwand.api.IContainerHandler;
|
import thetadev.constructionwand.api.IContainerHandler;
|
||||||
import thetadev.constructionwand.basics.WandUtil;
|
import thetadev.constructionwand.basics.WandUtil;
|
||||||
|
@ -13,12 +13,12 @@ public class HandlerCapability implements IContainerHandler
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public boolean matches(Player player, ItemStack itemStack, ItemStack inventoryStack) {
|
public boolean matches(Player player, ItemStack itemStack, ItemStack inventoryStack) {
|
||||||
return inventoryStack != null && inventoryStack.getCapability(ForgeCapabilities.ITEM_HANDLER).isPresent();
|
return inventoryStack != null && inventoryStack.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).isPresent();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int countItems(Player player, ItemStack itemStack, ItemStack inventoryStack) {
|
public int countItems(Player player, ItemStack itemStack, ItemStack inventoryStack) {
|
||||||
Optional<IItemHandler> itemHandlerOptional = inventoryStack.getCapability(ForgeCapabilities.ITEM_HANDLER).resolve();
|
Optional<IItemHandler> itemHandlerOptional = inventoryStack.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).resolve();
|
||||||
if(itemHandlerOptional.isEmpty()) return 0;
|
if(itemHandlerOptional.isEmpty()) return 0;
|
||||||
|
|
||||||
int total = 0;
|
int total = 0;
|
||||||
|
@ -36,7 +36,7 @@ public class HandlerCapability implements IContainerHandler
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int useItems(Player player, ItemStack itemStack, ItemStack inventoryStack, int count) {
|
public int useItems(Player player, ItemStack itemStack, ItemStack inventoryStack, int count) {
|
||||||
Optional<IItemHandler> itemHandlerOptional = inventoryStack.getCapability(ForgeCapabilities.ITEM_HANDLER).resolve();
|
Optional<IItemHandler> itemHandlerOptional = inventoryStack.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).resolve();
|
||||||
if(itemHandlerOptional.isEmpty()) return 0;
|
if(itemHandlerOptional.isEmpty()) return 0;
|
||||||
|
|
||||||
IItemHandler itemHandler = itemHandlerOptional.get();
|
IItemHandler itemHandler = itemHandlerOptional.get();
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package thetadev.constructionwand.wand;
|
package thetadev.constructionwand.wand;
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
|
import net.minecraft.server.level.ServerPlayer;
|
||||||
import net.minecraft.sounds.SoundSource;
|
import net.minecraft.sounds.SoundSource;
|
||||||
import net.minecraft.world.InteractionHand;
|
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.item.BlockItem;
|
import net.minecraft.world.item.BlockItem;
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
||||||
|
@ -99,7 +99,7 @@ public class WandJob
|
||||||
// If the item cant be taken, undo the placement
|
// If the item cant be taken, undo the placement
|
||||||
if(wandSupplier.takeItemStack(snapshot.getRequiredItems()) == 0) {
|
if(wandSupplier.takeItemStack(snapshot.getRequiredItems()) == 0) {
|
||||||
executed.add(snapshot);
|
executed.add(snapshot);
|
||||||
wand.hurtAndBreak(1, player, e -> e.broadcastBreakEvent(InteractionHand.MAIN_HAND));
|
wand.hurt(1, player.getRandom(), (ServerPlayer) player);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ConstructionWand.LOGGER.info("Item could not be taken. Remove block: " +
|
ConstructionWand.LOGGER.info("Item could not be taken. Remove block: " +
|
||||||
|
|
Loading…
Reference in a new issue