speedpowdertools work

This commit is contained in:
Jörg Henke 2020-07-30 23:03:00 +02:00
parent 77bf438714
commit 52f32d3656
6 changed files with 11 additions and 36 deletions

View File

@ -5,6 +5,7 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
* *
*/ */
public class QuickieBlocks { public class QuickieBlocks {
public static final BlockDirtSalpeter DIRT_SALPETER = new BlockDirtSalpeter();
public static final BlockOreNetherSulphor ORE_NETHER_SULPHOR = new BlockOreNetherSulphor(); public static final BlockOreNetherSulphor ORE_NETHER_SULPHOR = new BlockOreNetherSulphor();
public static final BlockOreSalpeter ORE_SALPETER = new BlockOreSalpeter(); public static final BlockOreSalpeter ORE_SALPETER = new BlockOreSalpeter();
public static final BlockOreSandSalpeter ORE_SAND_SALPETER = new BlockOreSandSalpeter(); public static final BlockOreSandSalpeter ORE_SAND_SALPETER = new BlockOreSandSalpeter();

View File

@ -106,9 +106,8 @@ public class EventBlockBreak {
if (tool.canBreakNeigbbors(blockState)) { if (tool.canBreakNeigbbors(blockState)) {
Block currentBlock = blockState.getBlock(); Block currentBlock = blockState.getBlock();
if (validBlocks.contains(currentBlock)) { if (validBlocks.contains(currentBlock)) {
Block.dropStacks(blockState, world, pos); Block.dropStacks(blockState, world, pos); // includes xorbs
world.setBlockState(pos, Blocks.AIR.getDefaultState()); world.setBlockState(pos, Blocks.AIR.getDefaultState());
currentBlock.onStacksDropped(blockState, world, pos, stack);
if (range == null || range.getxRange() > 1 || range.getyRange() > 1 || range.getzRange() > 1) { if (range == null || range.getxRange() > 1 || range.getyRange() > 1 || range.getzRange() > 1) {
HarvestRange nextRadius = range == null ? null : range.addXYZ(-1); HarvestRange nextRadius = range == null ? null : range.addXYZ(-1);
breakBlockRecursive(visitedBlocks, world, validBlocks, pos.north(), tool, nextRadius, blockBreakDirection, player); breakBlockRecursive(visitedBlocks, world, validBlocks, pos.north(), tool, nextRadius, blockBreakDirection, player);

View File

@ -47,6 +47,9 @@ public class RegistryManager {
stacks.add(new ItemStack(QuickieItems.LEVELUP)); stacks.add(new ItemStack(QuickieItems.LEVELUP));
stacks.add(new ItemStack(QuickieItems.PENCIL)); stacks.add(new ItemStack(QuickieItems.PENCIL));
stacks.add(new ItemStack(QuickieTools.SPEEDPOWDERAXE)); 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_NETHER_SULPHOR));
stacks.add(new ItemStack(QuickieBlocks.ORE_SALPETER)); stacks.add(new ItemStack(QuickieBlocks.ORE_SALPETER));
stacks.add(new ItemStack(QuickieBlocks.ORE_SAND_SALPETER)); stacks.add(new ItemStack(QuickieBlocks.ORE_SAND_SALPETER));
@ -65,6 +68,7 @@ public class RegistryManager {
public static final void registerBlocks() { public static final void registerBlocks() {
LOGGER.debug("registering quickiefabric blocks"); LOGGER.debug("registering quickiefabric blocks");
registerBlock(QuickieBlocks.DIRT_SALPETER, "dirtsalpeter");
registerBlock(QuickieBlocks.ORE_NETHER_SULPHOR, "orenethersulphor"); registerBlock(QuickieBlocks.ORE_NETHER_SULPHOR, "orenethersulphor");
registerBlock(QuickieBlocks.ORE_SALPETER, "oresalpeter"); registerBlock(QuickieBlocks.ORE_SALPETER, "oresalpeter");
registerBlock(QuickieBlocks.ORE_SAND_SALPETER, "oresandsalpeter"); registerBlock(QuickieBlocks.ORE_SAND_SALPETER, "oresandsalpeter");

View File

@ -7,4 +7,6 @@ package de.jottyfan.minecraft.quickiefabric.tools;
*/ */
public class QuickieTools { public class QuickieTools {
public static final ToolSpeedpowderAxe SPEEDPOWDERAXE = new ToolSpeedpowderAxe(); public static final ToolSpeedpowderAxe SPEEDPOWDERAXE = new ToolSpeedpowderAxe();
public static final ToolSpeedpowderPickaxe SPEEDPOWDERPICKAXE = new ToolSpeedpowderPickaxe();
public static final ToolSpeedpowderShovel SPEEDPOWDERSHOVEL = new ToolSpeedpowderShovel();
} }

View File

@ -1,8 +1,6 @@
package de.jottyfan.minecraft.quickiefabric.tools; package de.jottyfan.minecraft.quickiefabric.tools;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
@ -12,7 +10,6 @@ import com.google.common.collect.Sets;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks; import net.minecraft.block.Blocks;
import net.minecraft.util.Identifier;
/** /**
* *
@ -23,7 +20,7 @@ public interface ToolRangeable {
public static final Set<Block> SHOVEL_EFFECTIVE_ON = Sets.newHashSet(new Block[] { Blocks.GRAVEL, Blocks.SAND, public static final Set<Block> 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 }); Blocks.GRASS_BLOCK, Blocks.DIRT, Blocks.CLAY, Blocks.FARMLAND, Blocks.GRASS_PATH, Blocks.RED_SAND, Blocks.SOUL_SAND });
public static final List<List<Block>> AXE_BLOCKLISTS = Lists.newArrayList( public static final List<List<Block>> AXE_EFFECTIVE_ON = Lists.newArrayList(
Arrays.asList(Blocks.ACACIA_LOG, Blocks.STRIPPED_ACACIA_LOG, Blocks.ACACIA_WOOD, Blocks.STRIPPED_ACACIA_WOOD), 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.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, 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), Blocks.MUSHROOM_STEM),
Arrays.asList(Blocks.POTTED_RED_MUSHROOM, Blocks.RED_MUSHROOM_BLOCK, Blocks.RED_MUSHROOM, Blocks.MUSHROOM_STEM)); Arrays.asList(Blocks.POTTED_RED_MUSHROOM, Blocks.RED_MUSHROOM_BLOCK, Blocks.RED_MUSHROOM, Blocks.MUSHROOM_STEM));
public static final Set<Block> PICKAXE_BLOCKLISTS = Sets.newHashSet(new Block[] {Blocks.GLOWSTONE}); public static final Set<Block> PICKAXE_EFFECTIVE_ON = Sets.newHashSet(new Block[] {Blocks.GLOWSTONE});
public static final Set<Identifier> 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<Identifier> BIOMESOPLENTY_PICKAXE = Sets
.newHashSet(new Identifier[] { new Identifier("biomesoplenty", "dried_sand") });
public static final List<Set<Identifier>> BIOMESOPLENTY_AXE = Lists.newArrayList(generateBOPAxeSet());
static List<Set<Identifier>> generateBOPAxeSet() {
List<Set<Identifier>> list = new ArrayList<>();
String[] bOPLogs = new String[] { "cherry", "dead", "ethereal", "fir", "hellbark", "jacaranda", "magic", "mahogany",
"palm", "redwood", "umbran", "willow" };
for (String s : bOPLogs) {
Set<Identifier> 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;
}
/** /**
* @return range of blocks to be harvested * @return range of blocks to be harvested

View File

@ -115,7 +115,7 @@ public class ToolRangeableAxe extends AxeItem implements ToolRangeable {
@Override @Override
public List<Block> getBlockList(Block block) { public List<Block> getBlockList(Block block) {
for (List<Block> blockList : AXE_BLOCKLISTS) { for (List<Block> blockList : AXE_EFFECTIVE_ON) {
if (blockList.contains(block)) { if (blockList.contains(block)) {
return blockList; return blockList;
} }