Wrench crash fix, cable drop items, cables have hardness
This commit is contained in:
parent
7a5c7df9c2
commit
f4d74f7486
2 changed files with 22 additions and 5 deletions
|
@ -44,6 +44,9 @@ public class ItemWrench extends ItemTR implements ITexturedItem {
|
||||||
if(tile == null){
|
if(tile == null){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if(!(tile instanceof IInventory)){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
List<ItemStack> items = new ArrayList<ItemStack>();
|
List<ItemStack> items = new ArrayList<ItemStack>();
|
||||||
IInventory inventory = (IInventory) tile;
|
IInventory inventory = (IInventory) tile;
|
||||||
|
|
|
@ -3,6 +3,7 @@ package techreborn.parts;
|
||||||
import mcmultipart.MCMultiPartMod;
|
import mcmultipart.MCMultiPartMod;
|
||||||
import mcmultipart.microblock.IMicroblock;
|
import mcmultipart.microblock.IMicroblock;
|
||||||
import mcmultipart.multipart.*;
|
import mcmultipart.multipart.*;
|
||||||
|
import mcmultipart.raytrace.PartMOP;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.properties.IProperty;
|
import net.minecraft.block.properties.IProperty;
|
||||||
import net.minecraft.block.properties.PropertyBool;
|
import net.minecraft.block.properties.PropertyBool;
|
||||||
|
@ -25,10 +26,7 @@ import reborncore.api.power.IEnergyInterfaceTile;
|
||||||
import reborncore.common.misc.Functions;
|
import reborncore.common.misc.Functions;
|
||||||
import reborncore.common.misc.vecmath.Vecs3dCube;
|
import reborncore.common.misc.vecmath.Vecs3dCube;
|
||||||
|
|
||||||
import java.util.EnumSet;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by mark on 02/03/2016.
|
* Created by mark on 02/03/2016.
|
||||||
|
@ -225,7 +223,11 @@ public abstract class CableMultipart extends Multipart implements IOccludingPart
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update() {
|
public void update() {
|
||||||
|
if(getWorld() != null){
|
||||||
|
if(getWorld().getTotalWorldTime() % 80 == 0){
|
||||||
|
checkConnectedSides();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -262,5 +264,17 @@ public abstract class CableMultipart extends Multipart implements IOccludingPart
|
||||||
return "techreborn:cable";
|
return "techreborn:cable";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getHardness(PartMOP hit) {
|
||||||
|
return 1F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ItemStack> getDrops() {
|
||||||
|
List<ItemStack> list = new ArrayList<>();
|
||||||
|
list.add(new ItemStack(TechRebornParts.cables, 1, getCableType().ordinal()));
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue