Update Forge to 2359, removed usage of deprecated getBlocks List version to NonNullList version

This commit is contained in:
raoulvdberge
2017-06-24 13:59:42 +02:00
parent d8b3bcca40
commit 4024beaecf
9 changed files with 17 additions and 42 deletions

View File

@@ -1,7 +1,7 @@
# Refined Storage Changelog
### 1.5.3
- Updated Forge to 2349 (raoulvdberge)
- Updated Forge to 2359 (raoulvdberge)
- Updated MCMultiPart to 2.2.1 (raoulvdberge)
- Fixed Solderer crashing (raoulvdberge)
- Fixed Solderer being able to work with insufficient ingredients (raoulvdberge)

View File

@@ -28,10 +28,10 @@ sourceCompatibility = 1.8
targetCompatibility = 1.8
minecraft {
version = "1.12-14.21.0.2349"
version = "1.12-14.21.0.2359"
runDir = "run"
useDepAts = true
mappings = "snapshot_20170623"
mappings = "snapshot_20170624"
}
repositories {

View File

@@ -22,7 +22,7 @@ public final class RS {
public static final String ID = "refinedstorage";
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 UPDATE_JSON = "https://refinedstorage.raoulvdberge.com/update";

View File

@@ -20,6 +20,7 @@ import net.minecraft.entity.item.EntityItem;
import net.minecraft.inventory.InventoryHelper;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@@ -37,7 +38,6 @@ import net.minecraftforge.fluids.capability.wrappers.FluidBlockWrapper;
import net.minecraftforge.items.IItemHandler;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
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 (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)) {
drops = Collections.singletonList(frontStack);
drops.add(frontStack);
} else {
drops = frontBlock.getDrops(world, front, frontBlockState, upgrades.getFortuneLevel());
frontBlock.getDrops(drops, world, front, frontBlockState, upgrades.getFortuneLevel());
}
for (ItemStack drop : drops) {

View File

@@ -22,9 +22,6 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import java.util.ArrayList;
import java.util.List;
public class BlockController extends BlockBase {
public static final PropertyEnum TYPE = PropertyEnum.create("type", ControllerType.class);
@@ -100,9 +97,7 @@ public class BlockController extends BlockBase {
}
@Override
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
List<ItemStack> drops = new ArrayList<>();
public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
ItemStack stack = new ItemStack(RSBlocks.CONTROLLER, 1, RSBlocks.CONTROLLER.getMetaFromState(state));
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());
drops.add(stack);
return drops;
}
@Override

View File

@@ -23,8 +23,6 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
public class BlockFluidStorage extends BlockNode {
public static final PropertyEnum TYPE = PropertyEnum.create("type", FluidStorageType.class);
@@ -90,11 +88,9 @@ public class BlockFluidStorage extends BlockNode {
}
@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);
List<ItemStack> drops = new ArrayList<>();
ItemStack stack = new ItemStack(RSBlocks.FLUID_STORAGE, 1, getMetaFromState(state));
stack.setTagCompound(new NBTTagCompound());
@@ -103,8 +99,6 @@ public class BlockFluidStorage extends BlockNode {
stack.getTagCompound().setTag(NetworkNodeFluidStorage.NBT_STORAGE, storage.getNode().getStorage().getStorageTag());
drops.add(stack);
return drops;
}
@Override

View File

@@ -15,14 +15,13 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
public class BlockPortableGrid extends BlockBase {
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
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
List<ItemStack> drops = new ArrayList<>();
public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
drops.add(((TilePortableGrid) world.getTileEntity(pos)).getAsItem());
return drops;
}
@Override

View File

@@ -23,8 +23,6 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
public class BlockStorage extends BlockNode {
public static final PropertyEnum TYPE = PropertyEnum.create("type", ItemStorageType.class);
@@ -90,11 +88,9 @@ public class BlockStorage extends BlockNode {
}
@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);
List<ItemStack> drops = new ArrayList<>();
ItemStack stack = new ItemStack(RSBlocks.STORAGE, 1, getMetaFromState(state));
stack.setTagCompound(new NBTTagCompound());
@@ -103,8 +99,6 @@ public class BlockStorage extends BlockNode {
stack.getTagCompound().setTag(NetworkNodeStorage.NBT_STORAGE, storage.getNode().getStorage().getStorageTag());
drops.add(stack);
return drops;
}
@Override

View File

@@ -12,10 +12,7 @@ import net.minecraft.inventory.InventoryHelper;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.*;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.Style;
import net.minecraft.util.text.TextComponentTranslation;
@@ -135,7 +132,9 @@ public class ItemWrench extends ItemBase {
((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()) {
tileStack.setTagCompound(new NBTTagCompound());