Migrate the logic for which pass a block goes into. Also updated it and made it use tags where possible.

This commit is contained in:
Matthew Miller
2018-07-05 17:00:46 +10:00
parent efa09001c2
commit 7db443a69a
8 changed files with 147 additions and 221 deletions

View File

@ -56,24 +56,6 @@ public class BaseBlock implements BlockStateHolder<BaseBlock>, TileEntityBlock {
@Nullable
private CompoundTag nbtData;
/**
* Construct a block with the given ID and a data value of 0.
*
* @param id ID value
*/
@Deprecated
public BaseBlock(int id) {
try {
this.blockState = LegacyMapper.getInstance().getBlockFromLegacy(id);
if (this.blockState == null) {
this.blockState = BlockTypes.AIR.getDefaultState();
}
} catch (Exception e) {
System.out.println(id);
e.printStackTrace();
}
}
/**
* Construct a block with a state.
*
@ -111,7 +93,15 @@ public class BaseBlock implements BlockStateHolder<BaseBlock>, TileEntityBlock {
*/
@Deprecated
public BaseBlock(int id, int data) {
this(id);
try {
this.blockState = LegacyMapper.getInstance().getBlockFromLegacy(id, data);
if (this.blockState == null) {
this.blockState = BlockTypes.AIR.getDefaultState();
}
} catch (Exception e) {
System.out.println(id);
e.printStackTrace();
}
}
/**