Fixes some crashes, added new command, closes #165

This commit is contained in:
Modmuss50 2015-10-06 20:35:54 +01:00
parent 2a314aa4bb
commit 3b7001d44f
3 changed files with 13 additions and 2 deletions

View file

@ -7,6 +7,8 @@ import net.minecraft.util.ChatComponentText;
import net.minecraftforge.fluids.Fluid;
import techreborn.api.fuel.FluidPowerManager;
import techreborn.api.recipe.RecipeHandler;
import techreborn.partSystem.IModPart;
import techreborn.partSystem.ModPartRegistry;
import java.util.Objects;
@ -45,6 +47,10 @@ public class TechRebornDevCommand extends CommandBase {
sender.addChatMessage(new ChatComponentText("Found invalid fluid entry"));
}
}
} else if ("parts".equals(args[0])){
for (IModPart part : ModPartRegistry.parts){
sender.addChatMessage(new ChatComponentText(part.getName()));
}
}
}
}

View file

@ -11,6 +11,8 @@ import codechicken.multipart.MultiPartRegistry;
import codechicken.multipart.NormallyOccludedPart;
import codechicken.multipart.TMultiPart;
import codechicken.multipart.TileMultipart;
import cpw.mods.fml.common.Loader;
import ic2.api.info.IC2Classic;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@ -76,7 +78,9 @@ public class FMPFactory implements MultiPartRegistry.IPartFactory2,
@Override
public void init() {
MultiPartRegistry.registerConverter(new CableConverter());
if(Loader.isModLoaded("IC2")){
MultiPartRegistry.registerConverter(new CableConverter());
}
}
@Override

View file

@ -50,7 +50,8 @@ public class FMPModPart extends TMultiPart implements TSlottedPart,
public Iterable<Cuboid6> getOcclusionBoxes() {
List<Cuboid6> cubes = new ArrayList<Cuboid6>();
for (Vecs3dCube c : iModPart.getOcclusionBoxes())
cubes.add(new Cuboid6(c.toAABB()));
if(c != null)
cubes.add(new Cuboid6(c.toAABB()));
return cubes;
}