mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-28 15:46:01 +00:00
Apply various common one-to-one replacements
More work on common too. network package now done.
This commit is contained in:
1 parent
a0114b5112
commit
a80f724cc2
189 files changed
+1586
-1634
No files matched your search
@@ -7,6 +7,8 @@ import mekanism.api.Coord4D;
|
||||
import mekanism.api.util.ListUtils;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockSand;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
@@ -17,29 +19,23 @@ public final class MinerUtils
|
||||
|
||||
public static List<ItemStack> getDrops(World world, Coord4D obj, boolean silk)
|
||||
{
|
||||
Block block = obj.getBlock(world);
|
||||
IBlockState state = obj.getBlockState(world);
|
||||
Block block = state.getBlock();
|
||||
|
||||
if(block == null)
|
||||
if(block == null || block.isAir(world, obj))
|
||||
{
|
||||
return new ArrayList<ItemStack>();
|
||||
}
|
||||
|
||||
if(block.isAir(world, obj.xCoord, obj.yCoord, obj.zCoord))
|
||||
{
|
||||
return new ArrayList<ItemStack>();
|
||||
}
|
||||
|
||||
int meta = obj.getBlockState(world);
|
||||
|
||||
if(!silk)
|
||||
{
|
||||
return block.getDrops(world, obj.xCoord, obj.yCoord, obj.zCoord, meta, 0);
|
||||
return block.getDrops(world, obj, state, 0);
|
||||
}
|
||||
else {
|
||||
List<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
ret.add(new ItemStack(block, 1, meta));
|
||||
ret.add(new ItemStack(block, 1, block.getMetaFromState(state)));
|
||||
|
||||
if(specialSilkIDs.contains(block) || (block.getDrops(world, obj.xCoord, obj.yCoord, obj.zCoord, meta, 0) != null && block.getDrops(world, obj.xCoord, obj.yCoord, obj.zCoord, meta, 0).size() > 0))
|
||||
if(specialSilkIDs.contains(block) || (block.getDrops(world, obj, state, 0) != null && block.getDrops(world, obj, state, 0).size() > 0))
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user