Added Ender Crystal and new new recipe for Staff of Travel

This commit is contained in:
CrazyPants committed 2014-09-08 01:22:45 +08:00
1 parent 8e8f7cdf00
commit bff0e043ea
13 files changed
+191 -110

No files matched your search

+1
View File
@@ -114,6 +114,7 @@ enderio.machineChassi.name=Machine Chassis
enderio.basicGear.name=Basic Gear
enderio.pulsatingCrystal.name=Pulsating Crystal
enderio.vibrantCrystal.name=Vibrant Crystal
enderio.enderCrystal.name=Ender Crystal
enderio.darkGrindingBall.name=Dark Steel Ball
enderio.darkGrindingBall.tooltip.detailed.line1=SAG Mill Grinding Ball
enderio.darkGrindingBall.tooltip.detailed.line2=Main Output
Binary file not shown.

After

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 689 B

After

Width:  |  Height:  |  Size: 629 B

@@ -267,6 +267,7 @@ public final class Config {
public static int soulBinderLevelThreePowerPerTickRF = 2000;
public static int soulBinderBrokenSpawnerRF = 2500000;
public static int soulBinderReanimationRF = 100000;
public static int soulBinderEnderCystalRF = 100000;
public static boolean powerConduitCanDifferentTiersConnect = true;
public static int powerConduitTierOneRF = 640;
@@ -737,6 +738,8 @@ public final class Config {
"The number of RF required to change the type of a broken spawner.").getInt(soulBinderBrokenSpawnerRF);
soulBinderReanimationRF = config.get(sectionSoulBinder.name, "soulBinderReanimationRF", soulBinderReanimationRF,
"The number of RF required to to re-animated a mob head.").getInt(soulBinderReanimationRF);
soulBinderEnderCystalRF = config.get(sectionSoulBinder.name, "soulBinderEnderCystalRF", soulBinderEnderCystalRF,
"The number of RF required to create an ender crystal.").getInt(soulBinderEnderCystalRF);
sliceAndSpliceLevelOnePowerPerTickRF = config.get(sectionPower.name, "sliceAndSpliceLevelOnePowerPerTickRF", sliceAndSpliceLevelOnePowerPerTickRF,
"The number of RF/t consumed by an unupgraded Slice'N'Splice").getInt(sliceAndSpliceLevelOnePowerPerTickRF);
@@ -24,6 +24,7 @@ public class ItemRecipes {
ItemStack wrench = new ItemStack(EnderIO.itemYetaWench, 1, 0);
GameRegistry.addShapedRecipe(wrench, "s s", " b ", " s ", 's', electricalSteel, 'b', basicGear);
//Magnet
ItemStack magnet = new ItemStack(EnderIO.itemMagnet, 1, 0);
EnderIO.itemMagnet.setEnergy(magnet, 0);
GameRegistry.addShapedRecipe(magnet, "scc", " v", "scc", 's', electricalSteel, 'c', conductiveIron, 'v', vibCry);
@@ -46,6 +47,7 @@ public class ItemRecipes {
ItemStack dsppSilent = new ItemStack(EnderIO.blockDarkSteelPressurePlate, 1, 1);
GameRegistry.addShapedRecipe(dsppSilent, " ", " p ", " w ", 'p', dspp, 'w', Blocks.wool);
//Soul Vessel
GameRegistry.addShapedRecipe(new ItemStack(EnderIO.itemSoulVessel), " s ", "q q", " q ", 's', soularium, 'q', new ItemStack(EnderIO.blockFusedQuartz,1,0));
@@ -163,7 +163,7 @@ public class ItemSoulVessel extends Item implements IResourceTooltipProvider {
}
String entityId = EntityList.getEntityString(entity);
System.out.println("ItemSoulVessel.itemInteractionForEntity: " + entityId);
// System.out.println("ItemSoulVessel.itemInteractionForEntity: " + entityId);
if(isBlackListed(entityId)) {
return false;
}
@@ -0,0 +1,130 @@
package crazypants.enderio.machine.soul;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.item.ItemStack;
import crazypants.enderio.EnderIO;
import crazypants.enderio.ModObject;
import crazypants.enderio.config.Config;
import crazypants.enderio.machine.IMachineRecipe;
import crazypants.enderio.machine.MachineRecipeInput;
import crazypants.enderio.machine.IMachineRecipe.ResultStack;
import crazypants.enderio.material.FrankenSkull;
public abstract class AbstractSoulBinderRecipe implements IMachineRecipe, ISoulBinderRecipe {
private int energyRequired;
private String uid;
private Class<?> entityClass;
protected AbstractSoulBinderRecipe(int energyRequired, String uid, Class<?> entityClass) {
this.energyRequired = energyRequired;
this.uid = uid;
this.entityClass = entityClass;
}
@Override
public String getUid() {
return uid;
}
@Override
public int getEnergyRequired(MachineRecipeInput... inputs) {
return getEnergyRequired();
}
@Override
public boolean isRecipe(MachineRecipeInput... inputs) {
int validCount = 0;
for(MachineRecipeInput input : inputs) {
if(isValidInput(input)) {
validCount++;
} else {
return false;
}
}
return validCount == 2;
}
@Override
public ResultStack[] getCompletedResult(float randomChance, MachineRecipeInput... inputs) {
String mobType = null;
for(MachineRecipeInput input : inputs) {
if(input != null && EnderIO.itemSoulVessel.containsSoul(input.item)) {
mobType = EnderIO.itemSoulVessel.getMobTypeFromStack(input.item);
}
}
if(!getSupportedSouls().contains(mobType)) {
return new ResultStack[0];
}
ItemStack resultStack = getOutputStack(mobType);
ItemStack soulVessel = new ItemStack(EnderIO.itemSoulVessel);
return new ResultStack[] {new ResultStack(soulVessel), new ResultStack(resultStack)};
}
@Override
public float getExperianceForOutput(ItemStack output) {
return 0;
}
@Override
public boolean isValidInput(MachineRecipeInput input) {
if(input == null || input.item == null) {
return false;
}
int slot = input.slotNumber;
ItemStack item = input.item;
if(slot == 0) {
return getSupportedSouls().contains(EnderIO.itemSoulVessel.getMobTypeFromStack(item));
}
if(slot == 1) {
return item.isItemEqual(getInputStack());
}
return false;
}
@Override
public String getMachineName() {
return ModObject.blockSoulBinder.unlocalisedName;
}
@Override
public List<MachineRecipeInput> getQuantitiesConsumed(MachineRecipeInput[] inputs) {
List<MachineRecipeInput> result = new ArrayList<MachineRecipeInput>(inputs.length);
for(MachineRecipeInput input : inputs) {
if(input != null && input.item != null) {
ItemStack resStack = input.item.copy();
resStack.stackSize = 1;
MachineRecipeInput mri = new MachineRecipeInput(input.slotNumber, resStack);
result.add(mri);
}
}
return result;
}
protected ItemStack getOutputStack(String mobType) {
return getOutputStack();
}
@Override
public List<String> getSupportedSouls() {
return Collections.singletonList((String)EntityList.classToStringMapping.get(entityClass));
}
@Override
public int getEnergyRequired() {
return energyRequired;
}
public void setEnergyRequired(int energyRequired) {
this.energyRequired = energyRequired;
}
}
@@ -50,6 +50,7 @@ public class BlockSoulBinder extends AbstractMachineBlock<TileSoulBinder> {
super.init();
MachineRecipeRegistry.instance.registerRecipe(ModObject.blockSoulBinder.unlocalisedName, SoulBinderSpawnerRecipe.instance);
MachineRecipeRegistry.instance.registerRecipe(ModObject.blockSoulBinder.unlocalisedName, SoulBinderReanimationRecipe.instance);
MachineRecipeRegistry.instance.registerRecipe(ModObject.blockSoulBinder.unlocalisedName, SoulBinderEnderCystalRecipe.instance);
}
@Override
@@ -0,0 +1,31 @@
package crazypants.enderio.machine.soul;
import net.minecraft.entity.monster.EntityEnderman;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.item.ItemStack;
import crazypants.enderio.EnderIO;
import crazypants.enderio.config.Config;
import crazypants.enderio.material.FrankenSkull;
import crazypants.enderio.material.Material;
public class SoulBinderEnderCystalRecipe extends AbstractSoulBinderRecipe {
public static SoulBinderEnderCystalRecipe instance = new SoulBinderEnderCystalRecipe();
private SoulBinderEnderCystalRecipe() {
super(Config.soulBinderEnderCystalRF, "SoulBinderEnderCystalRecipe", EntityEnderman.class);
}
@Override
public ItemStack getInputStack() {
return new ItemStack(EnderIO.itemMaterial, 1, Material.VIBRANT_CYSTAL.ordinal());
}
@Override
public ItemStack getOutputStack() {
return new ItemStack(EnderIO.itemMaterial, 1, Material.ENDER_CRYSTAL.ordinal());
}
}
@@ -14,96 +14,16 @@ import crazypants.enderio.machine.IMachineRecipe;
import crazypants.enderio.machine.MachineRecipeInput;
import crazypants.enderio.material.FrankenSkull;
public class SoulBinderReanimationRecipe implements IMachineRecipe, ISoulBinderRecipe {
public class SoulBinderReanimationRecipe extends AbstractSoulBinderRecipe {
public static SoulBinderReanimationRecipe instance = new SoulBinderReanimationRecipe();
@Override
public String getUid() {
return "SoulBinderReanimationRecipe";
private SoulBinderReanimationRecipe() {
super(Config.soulBinderReanimationRF, "SoulBinderReanimationRecipe", EntityZombie.class);
}
@Override
public int getEnergyRequired(MachineRecipeInput... inputs) {
return Config.soulBinderReanimationRF;
}
@Override
public boolean isRecipe(MachineRecipeInput... inputs) {
int validCount = 0;
for(MachineRecipeInput input : inputs) {
if(isValidInput(input)) {
validCount++;
} else {
return false;
}
}
return validCount == 2;
}
@Override
public ResultStack[] getCompletedResult(float randomChance, MachineRecipeInput... inputs) {
String mobType = null;
for(MachineRecipeInput input : inputs) {
if(input != null && EnderIO.itemSoulVessel.containsSoul(input.item)) {
mobType = EnderIO.itemSoulVessel.getMobTypeFromStack(input.item);
}
}
if(!isZombie(mobType)) {
return new ResultStack[0];
}
ItemStack frankenZombie = new ItemStack(EnderIO.itemFrankenSkull, 1, FrankenSkull.FRANKEN_ZOMBIE.ordinal());
ItemStack soulVessel = new ItemStack(EnderIO.itemSoulVessel);
return new ResultStack[] {new ResultStack(soulVessel), new ResultStack(frankenZombie)};
}
@Override
public float getExperianceForOutput(ItemStack output) {
return 0;
}
@Override
public boolean isValidInput(MachineRecipeInput input) {
if(input == null || input.item == null) {
return false;
}
int slot = input.slotNumber;
ItemStack item = input.item;
if(slot == 0) {
return isZombie(EnderIO.itemSoulVessel.getMobTypeFromStack(item));
}
if(slot == 1) {
return item.getItem() == EnderIO.itemFrankenSkull && item.getItemDamage() == FrankenSkull.ZOMBIE_CONTROLLER.ordinal();
}
return false;
}
@Override
public String getMachineName() {
return ModObject.blockSoulBinder.unlocalisedName;
}
@Override
public List<MachineRecipeInput> getQuantitiesConsumed(MachineRecipeInput[] inputs) {
List<MachineRecipeInput> result = new ArrayList<MachineRecipeInput>(inputs.length);
for(MachineRecipeInput input : inputs) {
if(input != null && input.item != null) {
ItemStack resStack = input.item.copy();
resStack.stackSize = 1;
MachineRecipeInput mri = new MachineRecipeInput(input.slotNumber, resStack);
result.add(mri);
}
}
return result;
}
boolean isZombie(String mobType) {
//return mobType != null && mobType.equals("Zombie");
return mobType != null && mobType.equals(EntityList.classToStringMapping.get(EntityZombie.class));
}
@Override
public ItemStack getInputStack() {
public ItemStack getInputStack() {
return new ItemStack(EnderIO.itemFrankenSkull, 1, FrankenSkull.ZOMBIE_CONTROLLER.ordinal());
}
@@ -111,15 +31,5 @@ public class SoulBinderReanimationRecipe implements IMachineRecipe, ISoulBinderR
public ItemStack getOutputStack() {
return new ItemStack(EnderIO.itemFrankenSkull, 1, FrankenSkull.FRANKEN_ZOMBIE.ordinal());
}
@Override
public List<String> getSupportedSouls() {
return Collections.singletonList((String)EntityList.classToStringMapping.get(EntityZombie.class));
}
@Override
public int getEnergyRequired() {
return Config.soulBinderReanimationRF;
}
}
@@ -68,11 +68,8 @@ public class ItemMaterial extends Item {
if(par1ItemStack == null) {
return false;
}
int damage = par1ItemStack.getItemDamage();
if(damage == Material.VIBRANT_CYSTAL.ordinal() || damage == Material.PULSATING_CYSTAL.ordinal()) {
return true;
}
return false;
int damage = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, Material.values().length);
return Material.values()[damage].hasEffect;
}
}
@@ -7,16 +7,23 @@ public enum Material {
BINDER_COMPOSITE("binderComposite"),
PHASED_IRON_NUGGET("phasedIronNugget"),
VIBRANT_NUGGET("vibrantNugget"),
PULSATING_CYSTAL("pulsatingCrystal"),
VIBRANT_CYSTAL("vibrantCrystal"),
DRAK_GRINDING_BALL("darkGrindingBall");
PULSATING_CYSTAL("pulsatingCrystal", true),
VIBRANT_CYSTAL("vibrantCrystal", true),
DRAK_GRINDING_BALL("darkGrindingBall"),
ENDER_CRYSTAL("enderCrystal", true);
public final String unlocalisedName;
public final String iconKey;
public final boolean hasEffect;
private Material(String unlocalisedName) {
this(unlocalisedName, false);
}
private Material(String unlocalisedName, boolean hasEffect) {
this.unlocalisedName = "enderio." + unlocalisedName;
this.iconKey = "enderio:" + unlocalisedName;
this.hasEffect = hasEffect;
}
}
@@ -29,12 +29,11 @@ public class TeleportRecipes {
//travel staff
ItemStack travelStaff = new ItemStack(EnderIO.itemTravelStaff);
EnderIO.itemTravelStaff.setEnergy(travelStaff, 0);
ItemStack vibCry = new ItemStack(EnderIO.itemMaterial, 1, Material.VIBRANT_CYSTAL.ordinal());
ItemStack electricalSteel = new ItemStack(EnderIO.itemAlloy, 1, Alloy.ELECTRICAL_STEEL.ordinal());
ItemStack endCry = new ItemStack(EnderIO.itemMaterial, 1, Material.ENDER_CRYSTAL.ordinal());
ItemStack darkSteel = new ItemStack(EnderIO.itemAlloy, 1, Alloy.DARK_STEEL.ordinal());
IRecipe rec = GameRegistry
.addShapedRecipe(travelStaff, " g", " s ", "c ", 's', electricalSteel, 'c', enderCapacitor, 'g', vibCry);
rec = GameRegistry
.addShapedRecipe(travelStaff, "g ", " s ", " c", 's', electricalSteel, 'c', enderCapacitor, 'g', vibCry);
.addShapedRecipe(travelStaff, " e", " s ", "s ", 's', darkSteel, 'c', enderCapacitor, 'e', endCry);
}
}