mirror of
https://github.com/GTNewHorizons/ThaumicTinkerer.git
synced 2026-10-25 20:32:29 +00:00
Awakened Ichorium Pickaxe Fixes (#97)
This commit is contained in:
1 parent
85189235ce
commit
a6047ee7ec
2 files changed
+67
-45
No files matched your search
@@ -105,15 +105,20 @@ public class ItemIchorPickAdv extends ItemIchorPick implements IAdvancedTool {
|
||||
ForgeDirection direction = ForgeDirection.getOrientation(block.sideHit);
|
||||
int fortune = EnchantmentHelper.getFortuneModifier(player);
|
||||
boolean silk = EnchantmentHelper.getSilkTouchModifier(player);
|
||||
if (ConfigHandler.bedrockDimensionID != 0 && blk == Blocks.bedrock
|
||||
&& ((world.provider.isSurfaceWorld() && y < 5)
|
||||
|| (y > 253 && world.provider instanceof WorldProviderBedrock))) {
|
||||
world.setBlock(x, y, z, ThaumicTinkerer.registry.getFirstBlockFromClass(BlockBedrockPortal.class));
|
||||
}
|
||||
if (ConfigHandler.bedrockDimensionID != 0 && blk == Blocks.bedrock
|
||||
&& (y <= 253 && world.provider instanceof WorldProviderBedrock)) {
|
||||
world.setBlock(x, y, z, Blocks.air);
|
||||
|
||||
if (player.isSneaking() && ConfigHandler.bedrockDimensionID != 0 && blk == Blocks.bedrock) {
|
||||
// Bedrock -> Portal (Overworld low Y OR Bedrock dimension high Y)
|
||||
if ((world.provider.isSurfaceWorld() && y < 5)
|
||||
|| (y > 253 && world.provider instanceof WorldProviderBedrock)) {
|
||||
world.setBlock(x, y, z, ThaumicTinkerer.registry.getFirstBlockFromClass(BlockBedrockPortal.class));
|
||||
}
|
||||
|
||||
// Bedrock -> Air (Bedrock dimension normal Y)
|
||||
if (y <= 253 && world.provider instanceof WorldProviderBedrock) {
|
||||
world.setBlock(x, y, z, Blocks.air);
|
||||
}
|
||||
}
|
||||
|
||||
switch (ToolHandler.getMode(stack)) {
|
||||
case 0:
|
||||
break;
|
||||
@@ -122,22 +127,24 @@ public class ItemIchorPickAdv extends ItemIchorPick implements IAdvancedTool {
|
||||
boolean doY = direction.offsetY == 0;
|
||||
boolean doZ = direction.offsetZ == 0;
|
||||
|
||||
ToolHandler.removeBlocksInIteration(
|
||||
player,
|
||||
world,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
doX ? -2 : 0,
|
||||
doY ? -1 : 0,
|
||||
doZ ? -2 : 0,
|
||||
doX ? 3 : 1,
|
||||
doY ? 4 : 1,
|
||||
doZ ? 3 : 1,
|
||||
null,
|
||||
ToolHandler.materialsPick,
|
||||
silk,
|
||||
fortune);
|
||||
if (!player.isSneaking()) {
|
||||
ToolHandler.removeBlocksInIteration(
|
||||
player,
|
||||
world,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
doX ? -2 : 0,
|
||||
doY ? -1 : 0,
|
||||
doZ ? -2 : 0,
|
||||
doX ? 3 : 1,
|
||||
doY ? 4 : 1,
|
||||
doZ ? 3 : 1,
|
||||
null,
|
||||
ToolHandler.materialsPick,
|
||||
silk,
|
||||
fortune);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -146,22 +153,24 @@ public class ItemIchorPickAdv extends ItemIchorPick implements IAdvancedTool {
|
||||
int yo = -direction.offsetY;
|
||||
int zo = -direction.offsetZ;
|
||||
|
||||
ToolHandler.removeBlocksInIteration(
|
||||
player,
|
||||
world,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
xo >= 0 ? 0 : -10,
|
||||
yo >= 0 ? 0 : -10,
|
||||
zo >= 0 ? 0 : -10,
|
||||
xo > 0 ? 10 : 1,
|
||||
yo > 0 ? 10 : 1,
|
||||
zo > 0 ? 10 : 1,
|
||||
null,
|
||||
ToolHandler.materialsPick,
|
||||
silk,
|
||||
fortune);
|
||||
if (!player.isSneaking()) {
|
||||
ToolHandler.removeBlocksInIteration(
|
||||
player,
|
||||
world,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
xo >= 0 ? 0 : -10,
|
||||
yo >= 0 ? 0 : -10,
|
||||
zo >= 0 ? 0 : -10,
|
||||
xo > 0 ? 10 : 1,
|
||||
yo > 0 ? 10 : 1,
|
||||
zo > 0 ? 10 : 1,
|
||||
null,
|
||||
ToolHandler.materialsPick,
|
||||
silk,
|
||||
fortune);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,9 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.item.kami.tool;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -40,11 +42,14 @@ import thaumic.tinkerer.common.dim.WorldProviderBedrock;
|
||||
|
||||
public final class ToolHandler {
|
||||
|
||||
public static Material[] materialsPick = new Material[] { Material.rock, Material.iron, Material.ice,
|
||||
Material.glass, Material.piston, Material.anvil };
|
||||
public static Material[] materialsShovel = new Material[] { Material.grass, Material.ground, Material.sand,
|
||||
public final static Material[] materialsShovel = new Material[] { Material.grass, Material.ground, Material.sand,
|
||||
Material.snow, Material.craftedSnow, Material.clay };
|
||||
public static Material[] materialsAxe = new Material[] { Material.coral, Material.leaves, Material.plants,
|
||||
public final static Material[] materialsPick = Stream.concat(
|
||||
Arrays.stream(
|
||||
new Material[] { Material.rock, Material.iron, Material.ice, Material.glass, Material.piston,
|
||||
Material.anvil }),
|
||||
Arrays.stream(materialsShovel)).toArray(Material[]::new);
|
||||
public final static Material[] materialsAxe = new Material[] { Material.coral, Material.leaves, Material.plants,
|
||||
Material.wood };
|
||||
|
||||
public static int getMode(ItemStack tool) {
|
||||
@@ -74,7 +79,6 @@ public final class ToolHandler {
|
||||
for (int x1 = xs; x1 < xe; x1++) {
|
||||
for (int y1 = ys; y1 < ye; y1++) {
|
||||
for (int z1 = zs; z1 < ze; z1++) {
|
||||
if (x == x1 + x && y == y1 + y && z == z1 + z) continue;
|
||||
Block lock2 = world.getBlock(x1 + x, y1 + y, z1 + z);
|
||||
|
||||
breakExtraBlock(player.worldObj, x1 + x, y1 + y, z1 + z, player, x, y, z, materialsListing);
|
||||
@@ -102,6 +106,15 @@ public final class ToolHandler {
|
||||
|
||||
// only effective materials
|
||||
if (!block.canHarvestBlock(player, meta) || !isRightMaterial(block.getMaterial(), materialsListing)) return;
|
||||
|
||||
if (block == Blocks.bedrock) {
|
||||
// Ignore top & bottom 2 bedrock layers (Bedrock dimension only)
|
||||
if (y > 253 && world.provider instanceof WorldProviderBedrock) return;
|
||||
|
||||
// Ignore bedrock in all other dimensions
|
||||
if (!(world.provider instanceof WorldProviderBedrock)) return;
|
||||
}
|
||||
|
||||
Block refBlock = world.getBlock(refX, refY, refZ);
|
||||
float refStrength = ForgeHooks.blockStrength(refBlock, player, world, refX, refY, refZ);
|
||||
float strength = ForgeHooks.blockStrength(block, player, world, x, y, z);
|
||||
|
||||
Reference in new issue
Block a user