Fixed a few more errors, and added legacy support to the item parser.

This commit is contained in:
Matthew Miller
2018-07-24 17:12:50 +10:00
parent bc2279f2f6
commit 965e977411
13 changed files with 56 additions and 101 deletions

View File

@ -52,8 +52,7 @@ import javax.annotation.Nullable;
public class BaseBlock implements BlockStateHolder<BaseBlock>, TileEntityBlock {
private BlockState blockState;
@Nullable
private CompoundTag nbtData;
@Nullable CompoundTag nbtData;
/**
* Construct a block with a state.

View File

@ -20,10 +20,8 @@
package com.sk89q.worldedit.blocks;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.world.item.ItemType;
import com.sk89q.worldedit.world.item.ItemTypes;
import com.sk89q.worldedit.world.NbtValued;
import com.sk89q.worldedit.world.registry.LegacyMapper;
import com.sk89q.worldedit.world.item.ItemType;
import javax.annotation.Nullable;
@ -39,20 +37,6 @@ public class BaseItem implements NbtValued {
@Nullable
private CompoundTag nbtData;
/**
* Construct the object.
*
* @param id ID of the item
*/
@Deprecated
public BaseItem(int id) {
ItemType type = LegacyMapper.getInstance().getItemFromLegacy(id);
if (type == null) {
type = ItemTypes.AIR;
}
this.itemType = type;
}
/**
* Construct the object.
*
@ -73,16 +57,6 @@ public class BaseItem implements NbtValued {
this.nbtData = tag;
}
/**
* Get the type of item.
*
* @return the id
*/
@Deprecated
public int getLegacyId() {
return this.itemType.getLegacyId();
}
/**
* Get the type of item.
*

View File

@ -31,16 +31,6 @@ public class BaseItemStack extends BaseItem {
private int amount = 1;
/**
* Construct the object with default stack size of one, with data value of 0.
*
* @param id with data value of 0.
*/
@Deprecated
public BaseItemStack(int id) {
super(id);
}
/**
* Construct the object with default stack size of one, with damage value of 0.
*
@ -50,18 +40,6 @@ public class BaseItemStack extends BaseItem {
super(itemType);
}
/**
* Construct the object.
*
* @param id type ID
* @param amount amount in the stack
*/
@Deprecated
public BaseItemStack(int id, int amount) {
super(id);
this.amount = amount;
}
/**
* Construct the object.
*
@ -73,19 +51,6 @@ public class BaseItemStack extends BaseItem {
this.amount = amount;
}
/**
* Construct the object.
*
* @param id type ID
* @param amount amount in the stack
* @param data data value
*/
@Deprecated
public BaseItemStack(int id, int amount, short data) {
super(id);
this.amount = amount;
}
/**
* Construct the object.
*