Update Forge to 2359, removed usage of deprecated getBlocks List version to NonNullList version
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
# Refined Storage Changelog
|
# Refined Storage Changelog
|
||||||
|
|
||||||
### 1.5.3
|
### 1.5.3
|
||||||
- Updated Forge to 2349 (raoulvdberge)
|
- Updated Forge to 2359 (raoulvdberge)
|
||||||
- Updated MCMultiPart to 2.2.1 (raoulvdberge)
|
- Updated MCMultiPart to 2.2.1 (raoulvdberge)
|
||||||
- Fixed Solderer crashing (raoulvdberge)
|
- Fixed Solderer crashing (raoulvdberge)
|
||||||
- Fixed Solderer being able to work with insufficient ingredients (raoulvdberge)
|
- Fixed Solderer being able to work with insufficient ingredients (raoulvdberge)
|
||||||
|
|||||||
@@ -28,10 +28,10 @@ sourceCompatibility = 1.8
|
|||||||
targetCompatibility = 1.8
|
targetCompatibility = 1.8
|
||||||
|
|
||||||
minecraft {
|
minecraft {
|
||||||
version = "1.12-14.21.0.2349"
|
version = "1.12-14.21.0.2359"
|
||||||
runDir = "run"
|
runDir = "run"
|
||||||
useDepAts = true
|
useDepAts = true
|
||||||
mappings = "snapshot_20170623"
|
mappings = "snapshot_20170624"
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public final class RS {
|
|||||||
|
|
||||||
public static final String ID = "refinedstorage";
|
public static final String ID = "refinedstorage";
|
||||||
public static final String VERSION = "1.5.3";
|
public static final String VERSION = "1.5.3";
|
||||||
public static final String DEPENDENCIES = "required-after:forge@[14.21.0.2349,);after:mcmultipart@[2.2.1,);";
|
public static final String DEPENDENCIES = "required-after:forge@[14.21.0.2359,);after:mcmultipart@[2.2.1,);";
|
||||||
public static final String GUI_FACTORY = "com.raoulvdberge.refinedstorage.gui.config.ModGuiFactory";
|
public static final String GUI_FACTORY = "com.raoulvdberge.refinedstorage.gui.config.ModGuiFactory";
|
||||||
public static final String UPDATE_JSON = "https://refinedstorage.raoulvdberge.com/update";
|
public static final String UPDATE_JSON = "https://refinedstorage.raoulvdberge.com/update";
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import net.minecraft.entity.item.EntityItem;
|
|||||||
import net.minecraft.inventory.InventoryHelper;
|
import net.minecraft.inventory.InventoryHelper;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.util.NonNullList;
|
||||||
import net.minecraft.util.math.AxisAlignedBB;
|
import net.minecraft.util.math.AxisAlignedBB;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
@@ -37,7 +38,6 @@ import net.minecraftforge.fluids.capability.wrappers.FluidBlockWrapper;
|
|||||||
import net.minecraftforge.items.IItemHandler;
|
import net.minecraftforge.items.IItemHandler;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class NetworkNodeDestructor extends NetworkNode implements IComparable, IFilterable, IType {
|
public class NetworkNodeDestructor extends NetworkNode implements IComparable, IFilterable, IType {
|
||||||
@@ -103,11 +103,11 @@ public class NetworkNodeDestructor extends NetworkNode implements IComparable, I
|
|||||||
|
|
||||||
if (!frontStack.isEmpty()) {
|
if (!frontStack.isEmpty()) {
|
||||||
if (IFilterable.canTake(itemFilters, mode, compare, frontStack) && frontBlockState.getBlockHardness(world, front) != -1.0) {
|
if (IFilterable.canTake(itemFilters, mode, compare, frontStack) && frontBlockState.getBlockHardness(world, front) != -1.0) {
|
||||||
List<ItemStack> drops;
|
NonNullList<ItemStack> drops = NonNullList.create();
|
||||||
if (upgrades.hasUpgrade(ItemUpgrade.TYPE_SILK_TOUCH) && frontBlock.canSilkHarvest(world, front, frontBlockState, null)) {
|
if (upgrades.hasUpgrade(ItemUpgrade.TYPE_SILK_TOUCH) && frontBlock.canSilkHarvest(world, front, frontBlockState, null)) {
|
||||||
drops = Collections.singletonList(frontStack);
|
drops.add(frontStack);
|
||||||
} else {
|
} else {
|
||||||
drops = frontBlock.getDrops(world, front, frontBlockState, upgrades.getFortuneLevel());
|
frontBlock.getDrops(drops, world, front, frontBlockState, upgrades.getFortuneLevel());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ItemStack drop : drops) {
|
for (ItemStack drop : drops) {
|
||||||
|
|||||||
@@ -22,9 +22,6 @@ import net.minecraft.util.math.BlockPos;
|
|||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class BlockController extends BlockBase {
|
public class BlockController extends BlockBase {
|
||||||
public static final PropertyEnum TYPE = PropertyEnum.create("type", ControllerType.class);
|
public static final PropertyEnum TYPE = PropertyEnum.create("type", ControllerType.class);
|
||||||
|
|
||||||
@@ -100,9 +97,7 @@ public class BlockController extends BlockBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||||
List<ItemStack> drops = new ArrayList<>();
|
|
||||||
|
|
||||||
ItemStack stack = new ItemStack(RSBlocks.CONTROLLER, 1, RSBlocks.CONTROLLER.getMetaFromState(state));
|
ItemStack stack = new ItemStack(RSBlocks.CONTROLLER, 1, RSBlocks.CONTROLLER.getMetaFromState(state));
|
||||||
|
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
stack.setTagCompound(new NBTTagCompound());
|
||||||
@@ -110,8 +105,6 @@ public class BlockController extends BlockBase {
|
|||||||
stack.getTagCompound().setInteger(TileController.NBT_ENERGY_CAPACITY, ((TileController) world.getTileEntity(pos)).getEnergy().getMaxEnergyStored());
|
stack.getTagCompound().setInteger(TileController.NBT_ENERGY_CAPACITY, ((TileController) world.getTileEntity(pos)).getEnergy().getMaxEnergyStored());
|
||||||
|
|
||||||
drops.add(stack);
|
drops.add(stack);
|
||||||
|
|
||||||
return drops;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -23,8 +23,6 @@ import net.minecraft.world.IBlockAccess;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class BlockFluidStorage extends BlockNode {
|
public class BlockFluidStorage extends BlockNode {
|
||||||
public static final PropertyEnum TYPE = PropertyEnum.create("type", FluidStorageType.class);
|
public static final PropertyEnum TYPE = PropertyEnum.create("type", FluidStorageType.class);
|
||||||
@@ -90,11 +88,9 @@ public class BlockFluidStorage extends BlockNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||||
TileFluidStorage storage = (TileFluidStorage) world.getTileEntity(pos);
|
TileFluidStorage storage = (TileFluidStorage) world.getTileEntity(pos);
|
||||||
|
|
||||||
List<ItemStack> drops = new ArrayList<>();
|
|
||||||
|
|
||||||
ItemStack stack = new ItemStack(RSBlocks.FLUID_STORAGE, 1, getMetaFromState(state));
|
ItemStack stack = new ItemStack(RSBlocks.FLUID_STORAGE, 1, getMetaFromState(state));
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
stack.setTagCompound(new NBTTagCompound());
|
||||||
|
|
||||||
@@ -103,8 +99,6 @@ public class BlockFluidStorage extends BlockNode {
|
|||||||
stack.getTagCompound().setTag(NetworkNodeFluidStorage.NBT_STORAGE, storage.getNode().getStorage().getStorageTag());
|
stack.getTagCompound().setTag(NetworkNodeFluidStorage.NBT_STORAGE, storage.getNode().getStorage().getStorageTag());
|
||||||
|
|
||||||
drops.add(stack);
|
drops.add(stack);
|
||||||
|
|
||||||
return drops;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -15,14 +15,13 @@ import net.minecraft.item.ItemStack;
|
|||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.EnumHand;
|
import net.minecraft.util.EnumHand;
|
||||||
|
import net.minecraft.util.NonNullList;
|
||||||
import net.minecraft.util.math.AxisAlignedBB;
|
import net.minecraft.util.math.AxisAlignedBB;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class BlockPortableGrid extends BlockBase {
|
public class BlockPortableGrid extends BlockBase {
|
||||||
private static final AxisAlignedBB PORTABLE_GRID_AABB = new AxisAlignedBB(0, 0, 0, 1, 13.2F / 16F, 1);
|
private static final AxisAlignedBB PORTABLE_GRID_AABB = new AxisAlignedBB(0, 0, 0, 1, 13.2F / 16F, 1);
|
||||||
@@ -84,12 +83,8 @@ public class BlockPortableGrid extends BlockBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||||
List<ItemStack> drops = new ArrayList<>();
|
|
||||||
|
|
||||||
drops.add(((TilePortableGrid) world.getTileEntity(pos)).getAsItem());
|
drops.add(((TilePortableGrid) world.getTileEntity(pos)).getAsItem());
|
||||||
|
|
||||||
return drops;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -23,8 +23,6 @@ import net.minecraft.world.IBlockAccess;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class BlockStorage extends BlockNode {
|
public class BlockStorage extends BlockNode {
|
||||||
public static final PropertyEnum TYPE = PropertyEnum.create("type", ItemStorageType.class);
|
public static final PropertyEnum TYPE = PropertyEnum.create("type", ItemStorageType.class);
|
||||||
@@ -90,11 +88,9 @@ public class BlockStorage extends BlockNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||||
TileStorage storage = (TileStorage) world.getTileEntity(pos);
|
TileStorage storage = (TileStorage) world.getTileEntity(pos);
|
||||||
|
|
||||||
List<ItemStack> drops = new ArrayList<>();
|
|
||||||
|
|
||||||
ItemStack stack = new ItemStack(RSBlocks.STORAGE, 1, getMetaFromState(state));
|
ItemStack stack = new ItemStack(RSBlocks.STORAGE, 1, getMetaFromState(state));
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
stack.setTagCompound(new NBTTagCompound());
|
||||||
|
|
||||||
@@ -103,8 +99,6 @@ public class BlockStorage extends BlockNode {
|
|||||||
stack.getTagCompound().setTag(NetworkNodeStorage.NBT_STORAGE, storage.getNode().getStorage().getStorageTag());
|
stack.getTagCompound().setTag(NetworkNodeStorage.NBT_STORAGE, storage.getNode().getStorage().getStorageTag());
|
||||||
|
|
||||||
drops.add(stack);
|
drops.add(stack);
|
||||||
|
|
||||||
return drops;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -12,10 +12,7 @@ import net.minecraft.inventory.InventoryHelper;
|
|||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.ActionResult;
|
import net.minecraft.util.*;
|
||||||
import net.minecraft.util.EnumActionResult;
|
|
||||||
import net.minecraft.util.EnumFacing;
|
|
||||||
import net.minecraft.util.EnumHand;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.text.Style;
|
import net.minecraft.util.text.Style;
|
||||||
import net.minecraft.util.text.TextComponentTranslation;
|
import net.minecraft.util.text.TextComponentTranslation;
|
||||||
@@ -135,7 +132,9 @@ public class ItemWrench extends ItemBase {
|
|||||||
|
|
||||||
((TileNode) tile).writeConfiguration(data);
|
((TileNode) tile).writeConfiguration(data);
|
||||||
|
|
||||||
ItemStack tileStack = state.getBlock().getDrops(world, pos, state, 0).get(0);
|
NonNullList<ItemStack> drops = NonNullList.create();
|
||||||
|
state.getBlock().getDrops(drops, world, pos, state, 0);
|
||||||
|
ItemStack tileStack = drops.get(0);
|
||||||
|
|
||||||
if (!tileStack.hasTagCompound()) {
|
if (!tileStack.hasTagCompound()) {
|
||||||
tileStack.setTagCompound(new NBTTagCompound());
|
tileStack.setTagCompound(new NBTTagCompound());
|
||||||
|
|||||||
Reference in New Issue
Block a user