mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-10 04:48:34 +00:00
Further modernise and remove legacy item classes
This commit is contained in:
@ -20,6 +20,7 @@
|
||||
package com.sk89q.worldedit.extent.inventory;
|
||||
|
||||
import com.sk89q.worldedit.blocks.*;
|
||||
import com.sk89q.worldedit.blocks.type.ItemTypes;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
|
||||
/**
|
||||
@ -49,7 +50,7 @@ public abstract class BlockBag {
|
||||
public void storeDroppedBlock(int id, int data) throws BlockBagException {
|
||||
BaseItem dropped = BlockType.getBlockBagItem(id, data);
|
||||
if (dropped == null) return;
|
||||
if (dropped.getType() == BlockID.AIR) return;
|
||||
if (dropped.getType() == ItemTypes.AIR) return;
|
||||
|
||||
storeItem(dropped);
|
||||
}
|
||||
@ -107,7 +108,7 @@ public abstract class BlockBag {
|
||||
} catch (OutOfBlocksException e) {
|
||||
BaseItem placed = BlockType.getBlockBagItem(id, data);
|
||||
if (placed == null) throw e; // TODO: check
|
||||
if (placed.getType() == BlockID.AIR) throw e; // TODO: check
|
||||
if (placed.getType() == ItemTypes.AIR) throw e; // TODO: check
|
||||
|
||||
fetchItem(placed);
|
||||
}
|
||||
@ -134,7 +135,7 @@ public abstract class BlockBag {
|
||||
* @throws BlockBagException on error
|
||||
*/
|
||||
public void fetchItem(BaseItem item) throws BlockBagException {
|
||||
fetchBlock(item.getType());
|
||||
fetchBlock(item.getLegacyId());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -158,7 +159,7 @@ public abstract class BlockBag {
|
||||
* @throws BlockBagException on error
|
||||
*/
|
||||
public void storeItem(BaseItem item) throws BlockBagException {
|
||||
storeBlock(item.getType());
|
||||
storeBlock(item.getLegacyId());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user