Code cleanup
This commit is contained in:
@ -57,8 +57,7 @@ public class SharedInventory implements Inventory {
|
||||
|
||||
@Override
|
||||
public ItemStack removeStack(int int_1, int int_2) {
|
||||
ItemStack itemStack_1 = Inventories.splitStack(this.stacks, int_1, int_2);
|
||||
return itemStack_1;
|
||||
return Inventories.splitStack(this.stacks, int_1, int_2);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -9,7 +9,7 @@ import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
public class VeinMinerSession {
|
||||
private static ArrayList<VeinMinerSession> sessions = new ArrayList<>();
|
||||
private static final ArrayList<VeinMinerSession> sessions = new ArrayList<>();
|
||||
|
||||
public ServerPlayerEntity player;
|
||||
public ServerWorld world;
|
||||
|
@ -33,8 +33,8 @@ public class WoodDrill extends DrillBase {
|
||||
public boolean drill(BlockPos startPos) {
|
||||
ServerWorld world = session.world;
|
||||
int broken = 0;
|
||||
ArrayDeque<BlockPos> pendingLogs = new ArrayDeque<BlockPos>();
|
||||
ArrayDeque<BlockPos> logBlocks = new ArrayDeque<BlockPos>();
|
||||
ArrayDeque<BlockPos> pendingLogs = new ArrayDeque<>();
|
||||
ArrayDeque<BlockPos> logBlocks = new ArrayDeque<>();
|
||||
pendingLogs.add(startPos);
|
||||
|
||||
String leavesBlockId = Registries.BLOCK.getId(world.getBlockState(startPos).getBlock()).toString().replace("_log", "_leaves");
|
||||
@ -57,11 +57,8 @@ public class WoodDrill extends DrillBase {
|
||||
}
|
||||
}
|
||||
|
||||
// second round, leaves
|
||||
// The pending blocks are all air now,
|
||||
ArrayDeque<BlockPos> pendingLeaves = logBlocks;
|
||||
while (!pendingLeaves.isEmpty() && broken < getConfig().maxVeinSize) {
|
||||
// remove the immediately surrounding leaves around the log blocks
|
||||
broken += forXYZ(pendingLeaves.remove(), 1, newPos -> {
|
||||
int brokenLeaves = 0;
|
||||
Block newBlock = world.getBlockState(newPos).getBlock();
|
||||
|
Reference in New Issue
Block a user