1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Update MiningTask.java

This commit is contained in:
FN-FAL113 2022-08-05 09:13:19 +08:00 committed by GitHub
parent 36c7fc7726
commit d0b5221df6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -268,8 +268,8 @@ class MiningTask implements Runnable {
if (chest.getType() == Material.CHEST) {
BlockState state = PaperLib.getBlockState(chest, false).getState();
if (state instanceof Chest) {
Inventory inv = ((Chest) state).getBlockInventory();
if (state instanceof Chest chestState) {
Inventory inv = chestState.getBlockInventory();
if (InvUtils.fits(inv, item)) {
inv.addItem(item);
@ -299,8 +299,8 @@ class MiningTask implements Runnable {
if (chest.getType() == Material.CHEST) {
BlockState state = PaperLib.getBlockState(chest, false).getState();
if (state instanceof Chest) {
Inventory inv = ((Chest) state).getBlockInventory();
if (state instanceof Chest chestState) {
Inventory inv = chestState.getBlockInventory();
this.fuelLevel = grabFuelFrom(inv);
}
}