Stop using some deprecated methods and classes

This commit is contained in:
mezz committed 2017-06-24 22:10:55 -07:00
1 parent 7306764c51
commit 1fcaacd41b
22 files changed
+197 -210

No files matched your search

@@ -11,7 +11,6 @@
package forestry.farming.blocks;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.material.Material;
@@ -39,6 +38,7 @@ import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.common.property.ExtendedBlockState;
import net.minecraftforge.common.property.IExtendedBlockState;
import net.minecraftforge.common.property.IUnlistedProperty;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -142,10 +142,9 @@ public class BlockFarm extends BlockStructure {
}
return world.setBlockToAir(pos);
}
@Override
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
ArrayList<ItemStack> drops = new ArrayList<>();
public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
int meta = getMetaFromState(state);
TileUtil.actOnTile(world, pos, TileFarm.class, farm -> {
ItemStack stack = new ItemStack(this, 1, meta != 1 ? meta : 0);
@@ -154,7 +153,6 @@ public class BlockFarm extends BlockStructure {
stack.setTagCompound(compound);
drops.add(stack);
});
return drops;
}
@Override
@@ -10,8 +10,6 @@
******************************************************************************/
package forestry.farming.blocks;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.Random;
@@ -101,14 +99,13 @@ public class BlockMushroom extends BlockBush implements IItemModelRegister, IGro
public boolean getTickRandomly() {
return true;
}
// / DROPS
@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) {
MushroomType type = state.getValue(VARIANT);
return Collections.singletonList(type.getDrop());
drops.add(type.getDrop());
}
@Override
public boolean canPlaceBlockAt(World worldIn, BlockPos pos) {
return super.canPlaceBlockAt(worldIn, pos) && this.canBlockStay(worldIn, pos, this.getDefaultState());