pick 97420a31d The big reformat of 2020
This commit is contained in:
@@ -18,7 +18,6 @@
|
||||
|
||||
package appeng.util;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -27,62 +26,51 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class InWorldToolOperationResult {
|
||||
|
||||
public class InWorldToolOperationResult
|
||||
{
|
||||
private final BlockState blockState;
|
||||
private final List<ItemStack> drops;
|
||||
|
||||
private final BlockState blockState;
|
||||
private final List<ItemStack> drops;
|
||||
public InWorldToolOperationResult() {
|
||||
this.blockState = null;
|
||||
this.drops = null;
|
||||
}
|
||||
|
||||
public InWorldToolOperationResult()
|
||||
{
|
||||
this.blockState = null;
|
||||
this.drops = null;
|
||||
}
|
||||
public InWorldToolOperationResult(final BlockState block, final List<ItemStack> drops) {
|
||||
this.blockState = block;
|
||||
this.drops = drops;
|
||||
}
|
||||
|
||||
public InWorldToolOperationResult( final BlockState block, final List<ItemStack> drops )
|
||||
{
|
||||
this.blockState = block;
|
||||
this.drops = drops;
|
||||
}
|
||||
public InWorldToolOperationResult(final BlockState block) {
|
||||
this.blockState = block;
|
||||
this.drops = null;
|
||||
}
|
||||
|
||||
public InWorldToolOperationResult( final BlockState block )
|
||||
{
|
||||
this.blockState = block;
|
||||
this.drops = null;
|
||||
}
|
||||
public static InWorldToolOperationResult getBlockOperationResult(final ItemStack[] items) {
|
||||
final List<ItemStack> temp = new ArrayList<>();
|
||||
BlockState b = null;
|
||||
|
||||
public static InWorldToolOperationResult getBlockOperationResult( final ItemStack[] items )
|
||||
{
|
||||
final List<ItemStack> temp = new ArrayList<>();
|
||||
BlockState b = null;
|
||||
for (final ItemStack l : items) {
|
||||
if (b == null) {
|
||||
final Block bl = Block.getBlockFromItem(l.getItem());
|
||||
|
||||
for( final ItemStack l : items )
|
||||
{
|
||||
if( b == null )
|
||||
{
|
||||
final Block bl = Block.getBlockFromItem( l.getItem() );
|
||||
if (bl != null && !(bl instanceof AirBlock)) {
|
||||
b = bl.getDefaultState();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if( bl != null && !( bl instanceof AirBlock ) )
|
||||
{
|
||||
b = bl.getDefaultState();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
temp.add(l);
|
||||
}
|
||||
|
||||
temp.add( l );
|
||||
}
|
||||
return new InWorldToolOperationResult(b, temp);
|
||||
}
|
||||
|
||||
return new InWorldToolOperationResult( b, temp );
|
||||
}
|
||||
public BlockState getBlockState() {
|
||||
return this.blockState;
|
||||
}
|
||||
|
||||
public BlockState getBlockState()
|
||||
{
|
||||
return this.blockState;
|
||||
}
|
||||
|
||||
public List<ItemStack> getDrops()
|
||||
{
|
||||
return this.drops;
|
||||
}
|
||||
public List<ItemStack> getDrops() {
|
||||
return this.drops;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user