From 52f32d36564021841037cc3839be349ddc96f494 Mon Sep 17 00:00:00 2001 From: jottyfan Date: Thu, 30 Jul 2020 23:03:00 +0200 Subject: [PATCH] speedpowdertools work --- .../quickiefabric/blocks/QuickieBlocks.java | 1 + .../quickiefabric/event/EventBlockBreak.java | 3 +- .../quickiefabric/init/RegistryManager.java | 4 +++ .../quickiefabric/tools/QuickieTools.java | 2 ++ .../quickiefabric/tools/ToolRangeable.java | 35 ++----------------- .../quickiefabric/tools/ToolRangeableAxe.java | 2 +- 6 files changed, 11 insertions(+), 36 deletions(-) diff --git a/src/main/java/de/jottyfan/minecraft/quickiefabric/blocks/QuickieBlocks.java b/src/main/java/de/jottyfan/minecraft/quickiefabric/blocks/QuickieBlocks.java index 717b7fc..4c4e228 100644 --- a/src/main/java/de/jottyfan/minecraft/quickiefabric/blocks/QuickieBlocks.java +++ b/src/main/java/de/jottyfan/minecraft/quickiefabric/blocks/QuickieBlocks.java @@ -5,6 +5,7 @@ package de.jottyfan.minecraft.quickiefabric.blocks; * */ public class QuickieBlocks { + public static final BlockDirtSalpeter DIRT_SALPETER = new BlockDirtSalpeter(); public static final BlockOreNetherSulphor ORE_NETHER_SULPHOR = new BlockOreNetherSulphor(); public static final BlockOreSalpeter ORE_SALPETER = new BlockOreSalpeter(); public static final BlockOreSandSalpeter ORE_SAND_SALPETER = new BlockOreSandSalpeter(); diff --git a/src/main/java/de/jottyfan/minecraft/quickiefabric/event/EventBlockBreak.java b/src/main/java/de/jottyfan/minecraft/quickiefabric/event/EventBlockBreak.java index b837575..7c33295 100644 --- a/src/main/java/de/jottyfan/minecraft/quickiefabric/event/EventBlockBreak.java +++ b/src/main/java/de/jottyfan/minecraft/quickiefabric/event/EventBlockBreak.java @@ -106,9 +106,8 @@ public class EventBlockBreak { if (tool.canBreakNeigbbors(blockState)) { Block currentBlock = blockState.getBlock(); if (validBlocks.contains(currentBlock)) { - Block.dropStacks(blockState, world, pos); + Block.dropStacks(blockState, world, pos); // includes xorbs world.setBlockState(pos, Blocks.AIR.getDefaultState()); - currentBlock.onStacksDropped(blockState, world, pos, stack); if (range == null || range.getxRange() > 1 || range.getyRange() > 1 || range.getzRange() > 1) { HarvestRange nextRadius = range == null ? null : range.addXYZ(-1); breakBlockRecursive(visitedBlocks, world, validBlocks, pos.north(), tool, nextRadius, blockBreakDirection, player); diff --git a/src/main/java/de/jottyfan/minecraft/quickiefabric/init/RegistryManager.java b/src/main/java/de/jottyfan/minecraft/quickiefabric/init/RegistryManager.java index e59e182..d42716b 100644 --- a/src/main/java/de/jottyfan/minecraft/quickiefabric/init/RegistryManager.java +++ b/src/main/java/de/jottyfan/minecraft/quickiefabric/init/RegistryManager.java @@ -47,6 +47,9 @@ public class RegistryManager { stacks.add(new ItemStack(QuickieItems.LEVELUP)); stacks.add(new ItemStack(QuickieItems.PENCIL)); stacks.add(new ItemStack(QuickieTools.SPEEDPOWDERAXE)); + stacks.add(new ItemStack(QuickieTools.SPEEDPOWDERPICKAXE)); + stacks.add(new ItemStack(QuickieTools.SPEEDPOWDERSHOVEL)); + stacks.add(new ItemStack(QuickieBlocks.DIRT_SALPETER)); stacks.add(new ItemStack(QuickieBlocks.ORE_NETHER_SULPHOR)); stacks.add(new ItemStack(QuickieBlocks.ORE_SALPETER)); stacks.add(new ItemStack(QuickieBlocks.ORE_SAND_SALPETER)); @@ -65,6 +68,7 @@ public class RegistryManager { public static final void registerBlocks() { LOGGER.debug("registering quickiefabric blocks"); + registerBlock(QuickieBlocks.DIRT_SALPETER, "dirtsalpeter"); registerBlock(QuickieBlocks.ORE_NETHER_SULPHOR, "orenethersulphor"); registerBlock(QuickieBlocks.ORE_SALPETER, "oresalpeter"); registerBlock(QuickieBlocks.ORE_SAND_SALPETER, "oresandsalpeter"); diff --git a/src/main/java/de/jottyfan/minecraft/quickiefabric/tools/QuickieTools.java b/src/main/java/de/jottyfan/minecraft/quickiefabric/tools/QuickieTools.java index 9634855..a6a56cc 100644 --- a/src/main/java/de/jottyfan/minecraft/quickiefabric/tools/QuickieTools.java +++ b/src/main/java/de/jottyfan/minecraft/quickiefabric/tools/QuickieTools.java @@ -7,4 +7,6 @@ package de.jottyfan.minecraft.quickiefabric.tools; */ public class QuickieTools { public static final ToolSpeedpowderAxe SPEEDPOWDERAXE = new ToolSpeedpowderAxe(); + public static final ToolSpeedpowderPickaxe SPEEDPOWDERPICKAXE = new ToolSpeedpowderPickaxe(); + public static final ToolSpeedpowderShovel SPEEDPOWDERSHOVEL = new ToolSpeedpowderShovel(); } diff --git a/src/main/java/de/jottyfan/minecraft/quickiefabric/tools/ToolRangeable.java b/src/main/java/de/jottyfan/minecraft/quickiefabric/tools/ToolRangeable.java index f0485a2..5936d04 100644 --- a/src/main/java/de/jottyfan/minecraft/quickiefabric/tools/ToolRangeable.java +++ b/src/main/java/de/jottyfan/minecraft/quickiefabric/tools/ToolRangeable.java @@ -1,8 +1,6 @@ package de.jottyfan.minecraft.quickiefabric.tools; -import java.util.ArrayList; import java.util.Arrays; -import java.util.HashSet; import java.util.List; import java.util.Set; @@ -12,7 +10,6 @@ import com.google.common.collect.Sets; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; -import net.minecraft.util.Identifier; /** * @@ -23,7 +20,7 @@ public interface ToolRangeable { public static final Set SHOVEL_EFFECTIVE_ON = Sets.newHashSet(new Block[] { Blocks.GRAVEL, Blocks.SAND, Blocks.GRASS_BLOCK, Blocks.DIRT, Blocks.CLAY, Blocks.FARMLAND, Blocks.GRASS_PATH, Blocks.RED_SAND, Blocks.SOUL_SAND }); - public static final List> AXE_BLOCKLISTS = Lists.newArrayList( + public static final List> AXE_EFFECTIVE_ON = Lists.newArrayList( Arrays.asList(Blocks.ACACIA_LOG, Blocks.STRIPPED_ACACIA_LOG, Blocks.ACACIA_WOOD, Blocks.STRIPPED_ACACIA_WOOD), Arrays.asList(Blocks.BIRCH_LOG, Blocks.STRIPPED_BIRCH_LOG, Blocks.BIRCH_WOOD, Blocks.STRIPPED_BIRCH_WOOD), Arrays.asList(Blocks.DARK_OAK_LOG, Blocks.STRIPPED_DARK_OAK_LOG, Blocks.DARK_OAK_WOOD, @@ -41,35 +38,7 @@ public interface ToolRangeable { Blocks.MUSHROOM_STEM), Arrays.asList(Blocks.POTTED_RED_MUSHROOM, Blocks.RED_MUSHROOM_BLOCK, Blocks.RED_MUSHROOM, Blocks.MUSHROOM_STEM)); - public static final Set PICKAXE_BLOCKLISTS = Sets.newHashSet(new Block[] {Blocks.GLOWSTONE}); - - public static final Set BIOMESOPLENTY_SHOVEL = Sets - .newHashSet(new Identifier[] { new Identifier("biomesoplenty", "flesh"), - new Identifier("biomesoplenty", "dirt"), new Identifier("biomesoplenty", "grass"), - new Identifier("biomesoplenty", "mud"), new Identifier("biomesoplenty", "white_sand") }); - - public static final Set BIOMESOPLENTY_PICKAXE = Sets - .newHashSet(new Identifier[] { new Identifier("biomesoplenty", "dried_sand") }); - - public static final List> BIOMESOPLENTY_AXE = Lists.newArrayList(generateBOPAxeSet()); - - static List> generateBOPAxeSet() { - List> list = new ArrayList<>(); - String[] bOPLogs = new String[] { "cherry", "dead", "ethereal", "fir", "hellbark", "jacaranda", "magic", "mahogany", - "palm", "redwood", "umbran", "willow" }; - for (String s : bOPLogs) { - Set set = new HashSet<>(); - set.add(new Identifier("biomesoplenty", s + "_log")); - set.add(new Identifier("biomesoplenty", s + "_wood")); - set.add(new Identifier("biomesoplenty", "stripped_" + s + "_log")); - set.add(new Identifier("biomesoplenty", "stripped_" + s + "_wood")); - list.add(set); - list.add(Sets.newHashSet(new Identifier("biomesoplenty", s + "_stairs"))); - list.add(Sets.newHashSet(new Identifier("biomesoplenty", s + "_planks"))); - list.add(Sets.newHashSet(new Identifier("biomesoplenty", s + "_slab"))); - } - return list; - } + public static final Set PICKAXE_EFFECTIVE_ON = Sets.newHashSet(new Block[] {Blocks.GLOWSTONE}); /** * @return range of blocks to be harvested diff --git a/src/main/java/de/jottyfan/minecraft/quickiefabric/tools/ToolRangeableAxe.java b/src/main/java/de/jottyfan/minecraft/quickiefabric/tools/ToolRangeableAxe.java index a93ae78..739825e 100644 --- a/src/main/java/de/jottyfan/minecraft/quickiefabric/tools/ToolRangeableAxe.java +++ b/src/main/java/de/jottyfan/minecraft/quickiefabric/tools/ToolRangeableAxe.java @@ -115,7 +115,7 @@ public class ToolRangeableAxe extends AxeItem implements ToolRangeable { @Override public List getBlockList(Block block) { - for (List blockList : AXE_BLOCKLISTS) { + for (List blockList : AXE_EFFECTIVE_ON) { if (blockList.contains(block)) { return blockList; }