Merge pull request #1598 from MatthiasMann/master

added recipes for Lumium and Signalum
This commit is contained in:
tterrag1098 committed 2015-01-06 15:11:36 -05:00
commit ff41ead8be
3 files changed
+78 -2

No files matched your search

@@ -381,6 +381,39 @@ To write the contents of the ore dictionary to config/oreDictionaryRegistery.txt
</output>
</recipe>
<recipe name="Signalum" energyCost="32000">
<input>
<itemStack oreDictionary="ingotCopper" number="3" />
<itemStack oreDictionary="ingotSilver" />
<itemStack modID="minecraft" itemName="redstone" number="10" />
</input>
<output>
<itemStack oreDictionary="ingotSignalum" number="4" />
</output>
</recipe>
<recipe name="Lumium from dust" energyCost="32000">
<input>
<itemStack oreDictionary="ingotTin" number="3" />
<itemStack oreDictionary="ingotSilver" />
<itemStack modID="minecraft" itemName="glowstone_dust" number="4" />
</input>
<output>
<itemStack oreDictionary="ingotLumium" number="4" />
</output>
</recipe>
<recipe name="Lumium" energyCost="32000">
<input>
<itemStack oreDictionary="ingotTin" number="3" />
<itemStack oreDictionary="ingotSilver" />
<itemStack modID="minecraft" itemName="glowstone" />
</input>
<output>
<itemStack oreDictionary="ingotLumium" number="4" />
</output>
</recipe>
<!--
<recipe name="Steel" energyCost="8000">
<input>
+2
View File
@@ -516,6 +516,7 @@ item.enderio.itemConduitProbe.tooltip.detailed.line5=R-Click to paste them
item.enderio.itemConduitProbe.tooltip.detailed.line6=Use Shift-Mouse Wheel or 'Y' to change mode
item.itemSoulVessel.name=Soul Vial
enderio.item.itemSoulVessel.tooltip.fluidname=Fluid Name:
item.itemSoulVessel.tooltip.detailed.line1=R-Click on a mob to
item.itemSoulVessel.tooltip.detailed.line2=capture its soul
item.itemSoulVessel.tooltip.detailed.line3=R-Click again to release it
@@ -810,6 +811,7 @@ enderio.gui.conduit.gas.autoExtract=Auto Extract
//Enchants
enchantment.enderio.soulBound=Soulbound
description.enchantment.enderio.soulBound=This enchantment prevents the item from being lost on death
//Configuration
enderio.config.title=Ender IO Configuration
@@ -22,6 +22,8 @@ import net.minecraft.util.Facing;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -31,6 +33,7 @@ import crazypants.enderio.ModObject;
import crazypants.enderio.config.Config;
import crazypants.enderio.gui.IResourceTooltipProvider;
import crazypants.util.EntityUtil;
import crazypants.util.Lang;
public class ItemSoulVessel extends Item implements IResourceTooltipProvider {
@@ -135,6 +138,10 @@ public class ItemSoulVessel extends Item implements IResourceTooltipProvider {
return false;
}
if(itemstack.hasDisplayName() && mob instanceof EntityLiving) {
((EntityLiving)mob).setCustomNameTag(itemstack.getDisplayName());
}
world.spawnEntityInWorld(mob);
if(mob instanceof EntityLiving) {
((EntityLiving)mob).playLivingSound();
@@ -186,11 +193,13 @@ public class ItemSoulVessel extends Item implements IResourceTooltipProvider {
entity.writeToNBT(root);
ItemStack capturedMobVessel = new ItemStack(EnderIO.itemSoulVessel);
capturedMobVessel.setTagCompound(root);
setDisplayNameFromEntityNameTag(capturedMobVessel, entity);
player.swingItem();
if(!isCreative) {
entity.setDead();
if(entity.isDead) {
capturedMobVessel.setTagCompound(root);
item.stackSize--;
if (!player.inventory.addItemStackToInventory(capturedMobVessel))
{
@@ -201,7 +210,6 @@ public class ItemSoulVessel extends Item implements IResourceTooltipProvider {
return true;
}
} else {
capturedMobVessel.setTagCompound(root);
if (!player.inventory.addItemStackToInventory(capturedMobVessel)) //Inventory full, drop it in the world!
{
entity.worldObj.spawnEntityInWorld(new EntityItem(entity.worldObj,entity.posX, entity.posY, entity.posZ, capturedMobVessel));
@@ -231,9 +239,23 @@ public class ItemSoulVessel extends Item implements IResourceTooltipProvider {
ItemStack res = new ItemStack(this);
res.stackTagCompound = root;
setDisplayNameFromEntityNameTag(res, ent);
return res;
}
private void setDisplayNameFromEntityNameTag(ItemStack item, Entity ent) {
if(ent instanceof EntityLiving) {
EntityLiving entLiv = (EntityLiving)ent;
if(entLiv.hasCustomNameTag()) {
String name = entLiv.getCustomNameTag();
if(name.length() > 0) {
item.setStackDisplayName(name);
}
}
}
}
public boolean containsSoul(ItemStack item) {
if(item == null) {
return false;
@@ -254,6 +276,17 @@ public class ItemSoulVessel extends Item implements IResourceTooltipProvider {
return item.stackTagCompound.getString("id");
}
/** Support for displaying fluid name of captured Moo Fluids cow */
public String getFluidNameFromStack(ItemStack item) {
if(!containsSoul(item)) {
return null;
}
if(item == null || item.stackTagCompound == null || !item.stackTagCompound.hasKey("FluidName")) {
return null;
}
return item.stackTagCompound.getString("FluidName");
}
private boolean isBlackListed(String entityId) {
for (String str : blackList) {
if(str != null && str.equals(entityId)) {
@@ -278,6 +311,14 @@ public class ItemSoulVessel extends Item implements IResourceTooltipProvider {
} else {
par3List.add("Empty");
}
String fluidName = getFluidNameFromStack(par1ItemStack);
if(fluidName != null) {
Fluid fluid = FluidRegistry.getFluid(fluidName);
if(fluid != null) {
par3List.add(Lang.localize("item.itemSoulVessel.tooltip.fluidname") + " " + fluid.getLocalizedName());
}
}
}
}