From 53ecd773af88b3b7f8e261bc0a95368579bec7a6 Mon Sep 17 00:00:00 2001 From: CrazyPants Date: Thu, 24 Jul 2014 17:13:14 +0800 Subject: [PATCH 1/5] #821 Upgraded Powered Spawner only requesting 400 RF/t --- .../machine/spawner/TilePoweredSpawner.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/main/java/crazypants/enderio/machine/spawner/TilePoweredSpawner.java b/src/main/java/crazypants/enderio/machine/spawner/TilePoweredSpawner.java index 601be252..b1330a63 100644 --- a/src/main/java/crazypants/enderio/machine/spawner/TilePoweredSpawner.java +++ b/src/main/java/crazypants/enderio/machine/spawner/TilePoweredSpawner.java @@ -16,14 +16,26 @@ import crazypants.enderio.machine.IMachineRecipe; import crazypants.enderio.machine.IPoweredTask; import crazypants.enderio.machine.PoweredTask; import crazypants.enderio.machine.SlotDefinition; +import crazypants.enderio.power.BasicCapacitor; +import crazypants.enderio.power.Capacitors; +import crazypants.enderio.power.PowerHandlerUtil; public class TilePoweredSpawner extends AbstractPoweredTaskEntity { public static final int MIN_SPAWN_DELAY_BASE = Config.poweredSpawnerMinDelayTicks; public static final int MAX_SPAWN_DELAY_BASE = Config.poweredSpawnerMaxDelayTicks; + public static final float POWER_PER_TICK_ONE = Config.poweredSpawnerLevelOnePowerPerTick; + private static final BasicCapacitor CAP_ONE = new BasicCapacitor((int) (POWER_PER_TICK_ONE * 1.25), Capacitors.BASIC_CAPACITOR.capacitor.getMaxEnergyStored()); + public static final float POWER_PER_TICK_TWO = Config.poweredSpawnerLevelTwoPowerPerTick; + private static final BasicCapacitor CAP_TWO = new BasicCapacitor((int) (POWER_PER_TICK_TWO * 1.25), + Capacitors.ACTIVATED_CAPACITOR.capacitor.getMaxEnergyStored()); + public static final float POWER_PER_TICK_THREE = Config.poweredSpawnerLevelThreePowerPerTick; + private static final BasicCapacitor CAP_THREE = new BasicCapacitor((int) (POWER_PER_TICK_THREE * 1.25), + Capacitors.ENDER_CAPACITOR.capacitor.getMaxEnergyStored()); + public static final int MIN_PLAYER_DISTANCE = Config.poweredSpawnerMaxPlayerDistance; public static final boolean USE_VANILLA_SPAWN_CHECKS = Config.poweredSpawnerUseVanillaSpawChecks; @@ -44,6 +56,25 @@ public class TilePoweredSpawner extends AbstractPoweredTaskEntity { logic.spawnDelay = 0; } + public void setCapacitor(Capacitors capacitorType) { + this.capacitorType = capacitorType; + switch (capacitorType) { + case BASIC_CAPACITOR: + PowerHandlerUtil.configure(powerHandler, CAP_ONE); + break; + case ACTIVATED_CAPACITOR: + PowerHandlerUtil.configure(powerHandler, CAP_TWO); + break; + case ENDER_CAPACITOR: + PowerHandlerUtil.configure(powerHandler, CAP_THREE); + break; + default: + PowerHandlerUtil.configure(powerHandler, CAP_ONE); + break; + } + forceClientUpdate = true; + } + @Override public String getMachineName() { return ModObject.blockPoweredSpawner.unlocalisedName; From 6fd5883379b54e5f482e36b7fc1f0ba55683879e Mon Sep 17 00:00:00 2001 From: CrazyPants Date: Thu, 24 Jul 2014 17:44:49 +0800 Subject: [PATCH 2/5] #822 3 sand to 1 quite clear glass in alloy furnace --- .../enderio/machine/recipe/AbstractMachineRecipe.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/crazypants/enderio/machine/recipe/AbstractMachineRecipe.java b/src/main/java/crazypants/enderio/machine/recipe/AbstractMachineRecipe.java index e8993eb9..4e09b81c 100644 --- a/src/main/java/crazypants/enderio/machine/recipe/AbstractMachineRecipe.java +++ b/src/main/java/crazypants/enderio/machine/recipe/AbstractMachineRecipe.java @@ -23,14 +23,16 @@ public abstract class AbstractMachineRecipe implements IMachineRecipe { @Override public List getQuantitiesConsumed(MachineRecipeInput[] inputs) { IRecipe rec = getRecipeForInputs(inputs); - List result = new ArrayList(); - for (MachineRecipeInput input : inputs) { - if(input != null && (input.item != null || input.fluid != null)) { - for (RecipeInput ri : rec.getInputs()) { + List result = new ArrayList(); + for (RecipeInput ri : rec.getInputs()) { + for (MachineRecipeInput input : inputs) { + if(input != null && (input.item != null || input.fluid != null)) { if(ri.isInput(input.item)) { result.add(new MachineRecipeInput(input.slotNumber, ri.getInput().copy())); + break; } else if(ri.isInput(input.fluid)) { result.add(new MachineRecipeInput(input.slotNumber, ri.getFluidInput().copy())); + break; } } } From 25c0038c872a730b1107994e0cb64076a4a3a08e Mon Sep 17 00:00:00 2001 From: CrazyPants Date: Thu, 24 Jul 2014 23:52:51 +0800 Subject: [PATCH 3/5] Added enderman skull. --- .../textures/blocks/endermanSkullFront.png | Bin 0 -> 242 bytes .../blocks/endermanSkullFrontEyes.png | Bin 0 -> 254 bytes .../textures/blocks/endermanSkullSide.png | Bin 0 -> 248 bytes .../textures/blocks/endermanSkullTop.png | Bin 0 -> 228 bytes .../enderio/textures/items/endermanSkull.png | Bin 0 -> 252 bytes .../java/crazypants/enderio/ClientProxy.java | 6 ++ src/main/java/crazypants/enderio/EnderIO.java | 4 + .../java/crazypants/enderio/ModObject.java | 3 +- .../item/skull/BlockEndermanSkull.java | 100 ++++++++++++++++++ .../item/skull/EndermanSkullRenderer.java | 92 ++++++++++++++++ .../enderio/item/skull/TileEndermanSkull.java | 25 +++++ .../java/crazypants/render/CubeRenderer.java | 13 +++ 12 files changed, 242 insertions(+), 1 deletion(-) create mode 100644 resources/assets/enderio/textures/blocks/endermanSkullFront.png create mode 100644 resources/assets/enderio/textures/blocks/endermanSkullFrontEyes.png create mode 100644 resources/assets/enderio/textures/blocks/endermanSkullSide.png create mode 100644 resources/assets/enderio/textures/blocks/endermanSkullTop.png create mode 100644 resources/assets/enderio/textures/items/endermanSkull.png create mode 100644 src/main/java/crazypants/enderio/item/skull/BlockEndermanSkull.java create mode 100644 src/main/java/crazypants/enderio/item/skull/EndermanSkullRenderer.java create mode 100644 src/main/java/crazypants/enderio/item/skull/TileEndermanSkull.java diff --git a/resources/assets/enderio/textures/blocks/endermanSkullFront.png b/resources/assets/enderio/textures/blocks/endermanSkullFront.png new file mode 100644 index 0000000000000000000000000000000000000000..3b82936c18cb2dd1a1f8703c6cef124afa0139a7 GIT binary patch literal 242 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucL8%hgh?3y^w370~qEv=}#LT=BJwMkFg)(D3 zQ$0figD*u3fvOTcT^vI!{Ezkravd<>aJFszzJFyjdlTDY5qq(U3$rAmDpT1*|9-Gu zd?IjhijD@;WP7$Md3M8)#+|i|{1*}u;(9p5XMSUqJFxud({uO5|LA`cneYG4a=AUL g^2HyP740{e=QNvdxT90T1GJ36)78&qol`;+0JlO;mH+?% literal 0 HcmV?d00001 diff --git a/resources/assets/enderio/textures/blocks/endermanSkullFrontEyes.png b/resources/assets/enderio/textures/blocks/endermanSkullFrontEyes.png new file mode 100644 index 0000000000000000000000000000000000000000..bfdfff323a4b317ff06cf413cf266f64b92e4bc2 GIT binary patch literal 254 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucL8%hgh?3y^w370~qEv=}#LT=BJwMkFg)(D3 zQ$0figD*u3fvR#nT^vI!{EznE<~(4);X3zF?C#|D7czf6v%43F%Zu1+$$0EhPkOOV z)!=jUJ!2+)UZ-1(jTfG-4S0TILl8^VXU1Cx6qswRwiR<)?|mUFpLVaNfosRC+L))G t8UKfG>-x4k=G;4fwE~fy;`<$6Gg&DpM@%@S*#)$i!PC{xWt~$(69BgYR_Fi# literal 0 HcmV?d00001 diff --git a/resources/assets/enderio/textures/blocks/endermanSkullSide.png b/resources/assets/enderio/textures/blocks/endermanSkullSide.png new file mode 100644 index 0000000000000000000000000000000000000000..5635dac9f8c7b6b65cce9f0b9e1cdc9fec12bff3 GIT binary patch literal 248 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucL8%hgh?3y^w370~qEv=}#LT=BJwMkFg)(D3 zQ$0figD*u3fvVCyT^vI!{I~XUa~)9NaW3w<_kWqRv{_3;=>lQ7FQ26Z1+VixXJ*(_ z@xEX_E4$u_iHG)f->iSSzv0c?JC~Cao8&ZiE#e!L nzoPBb=fht@-Muce@$X>Nn9D5T5y7#_r5dhE*r@3q3fWECU+P N;OXk;vd$@?2>`>>N}d1! literal 0 HcmV?d00001 diff --git a/resources/assets/enderio/textures/items/endermanSkull.png b/resources/assets/enderio/textures/items/endermanSkull.png new file mode 100644 index 0000000000000000000000000000000000000000..7c95a77b37a96391372b34eb1d6ab5da381d60e8 GIT binary patch literal 252 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6;>1s;*b z3=DjSK$uZf!>a)(C{^MbQ4*Y=R#Ki=l*$m0n3-3i=jR%tP-d)Ws%L0m@TF)WP*sJe zi(`m||I$82z5@yz%(bom|7%Wm^F7^hu=mNc9U@z1-qa7Obk@rEc*>h^81nvZeVmSd zWuAhDgr;tUqP_Cz; Date: Fri, 25 Jul 2014 00:18:02 +0800 Subject: [PATCH 4/5] Added enderman skull as a drop and fixed skull drop chances for everything. --- src/main/java/crazypants/enderio/EnderIO.java | 4 ++-- .../java/crazypants/enderio/config/Config.java | 16 ++++++++++++++-- .../item/darksteel/ItemDarkSteelSword.java | 12 +++++++----- .../enderio/material/MaterialRecipes.java | 1 + 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/main/java/crazypants/enderio/EnderIO.java b/src/main/java/crazypants/enderio/EnderIO.java index 9e9fb64c..4e24296b 100644 --- a/src/main/java/crazypants/enderio/EnderIO.java +++ b/src/main/java/crazypants/enderio/EnderIO.java @@ -196,7 +196,7 @@ public class EnderIO { //Blocks public static BlockDarkSteelPressurePlate blockDarkSteelPressurePlate; - public static BlockEndermanSkull blockCustomSkull; + public static BlockEndermanSkull blockEndermanSkull; //Fluids public static Fluid fluidNutrientDistillation; @@ -366,7 +366,7 @@ public class EnderIO { itemDarkSteelPickaxe = ItemDarkSteelPickaxe.create(); itemDarkSteelAxe = ItemDarkSteelAxe.create(); - blockCustomSkull = BlockEndermanSkull.create(); + blockEndermanSkull = BlockEndermanSkull.create(); MaterialRecipes.registerOresInDictionary(); diff --git a/src/main/java/crazypants/enderio/config/Config.java b/src/main/java/crazypants/enderio/config/Config.java index 822ed47f..489bc2be 100644 --- a/src/main/java/crazypants/enderio/config/Config.java +++ b/src/main/java/crazypants/enderio/config/Config.java @@ -147,6 +147,7 @@ public final class Config { public static float darkSteelSwordSkullChance = 0.2f; public static float darkSteelSwordSkullLootingModifier = 0.15f; public static float vanillaSwordSkullLootingModifier = 0.1f; + public static float vanillaSwordSkullChance = 0.05f; public static int darkSteelSwordPowerUsePerHit = 750; public static double darkSteelSwordEnderPearlDropChance = 1; public static double darkSteelSwordEnderPearlDropChancePerLooting = 0.5; @@ -476,19 +477,30 @@ public final class Config { darkSteelSoundLocatorLifespan = config.get(sectionDarkSteel.name, "darkSteelSoundLocatorLifespan", darkSteelSoundLocatorLifespan, "Number of ticks the 'Sound Locator' icons are displayed for.").getInt(darkSteelSoundLocatorLifespan); + + darkSteelSwordSkullChance = (float) config.get(sectionDarkSteel.name, "darkSteelSwordSkullChance", darkSteelSwordSkullChance, + "The base chance that a skull will be dropped when using a powered dark steel sword (0 = no chance, 1 = 100% chance)").getDouble( + darkSteelSwordSkullChance); darkSteelSwordSkullLootingModifier = (float) config.get(sectionDarkSteel.name, "darkSteelSwordSkullLootingModifier", darkSteelSwordSkullLootingModifier, "The chance per looting level that a skull will be dropped when using a powered dark steel sword (0 = no chance, 1 = 100% chance)").getDouble( darkSteelSwordSkullLootingModifier); + darkSteelSwordWitherSkullChance = (float) config.get(sectionDarkSteel.name, "darkSteelSwordWitherSkullChance", darkSteelSwordWitherSkullChance, "The base chance that a wither skull will be dropped when using a powered dark steel sword (0 = no chance, 1 = 100% chance)").getDouble( - darkSteelSwordWitherSkullChance); + darkSteelSwordWitherSkullChance); darkSteelSwordWitherSkullLootingModifier = (float) config.get(sectionDarkSteel.name, "darkSteelSwordWitherSkullLootingModifie", darkSteelSwordWitherSkullLootingModifier, "The chance per looting level that a wither skull will be dropped when using a powered dark steel sword (0 = no chance, 1 = 100% chance)").getDouble( - darkSteelSwordWitherSkullLootingModifier); + darkSteelSwordWitherSkullLootingModifier); + + + vanillaSwordSkullChance = (float) config.get(sectionDarkSteel.name, "vanillaSwordSkullChance", vanillaSwordSkullChance, + "The base chance that a skull will be dropped when using a non dark steel sword (0 = no chance, 1 = 100% chance)").getDouble( + vanillaSwordSkullChance); vanillaSwordSkullLootingModifier = (float) config.get(sectionPersonal.name, "vanillaSwordSkullLootingModifier", vanillaSwordSkullLootingModifier, "The chance per looting level that a skull will be dropped when using a non-dark steel sword (0 = no chance, 1 = 100% chance)").getDouble( vanillaSwordSkullLootingModifier); + darkSteelSwordPowerUsePerHit = config.get(sectionDarkSteel.name, "darkSteelSwordPowerUsePerHit", darkSteelSwordPowerUsePerHit, "The amount of power (RF) used per hit.").getInt(darkSteelSwordPowerUsePerHit); darkSteelSwordEnderPearlDropChance = config.get(sectionDarkSteel.name, "darkSteelSwordEnderPearlDropChance", darkSteelSwordEnderPearlDropChance, diff --git a/src/main/java/crazypants/enderio/item/darksteel/ItemDarkSteelSword.java b/src/main/java/crazypants/enderio/item/darksteel/ItemDarkSteelSword.java index 876449c3..383a165d 100644 --- a/src/main/java/crazypants/enderio/item/darksteel/ItemDarkSteelSword.java +++ b/src/main/java/crazypants/enderio/item/darksteel/ItemDarkSteelSword.java @@ -106,9 +106,8 @@ public class ItemDarkSteelSword extends ItemSword implements IEnergyContainerIte if(evt.source.getEntity() instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) evt.source.getEntity(); - - double skullDropChance = getSkullDropChance(player, evt); - if(Math.random() <= skullDropChance) { + double skullDropChance = getSkullDropChance(player, evt); + if(Math.random() <= skullDropChance) { ItemStack skull = getSkullForEntity(evt.entityLiving); if(skull != null && !containsDrop(evt, skull)) { //TODO: Shouldn't I add this to the list in the event? @@ -151,7 +150,7 @@ public class ItemDarkSteelSword extends ItemSword implements IEnergyContainerIte if(isEquippedAndPowered(player, Config.darkSteelSwordPowerUsePerHit)) { return Config.darkSteelSwordWitherSkullChance + (Config.darkSteelSwordWitherSkullLootingModifier * evt.lootingLevel); } else { - return 0; + return 0.01; } } float fromWeapon = 0; @@ -160,9 +159,10 @@ public class ItemDarkSteelSword extends ItemSword implements IEnergyContainerIte fromWeapon = Config.darkSteelSwordSkullChance; fromLooting = Config.darkSteelSwordSkullLootingModifier * evt.lootingLevel; } else { + fromWeapon = Config.vanillaSwordSkullChance; fromLooting = Config.vanillaSwordSkullLootingModifier * evt.lootingLevel; } - return Math.min(fromWeapon + fromLooting, 0.025); + return fromWeapon + fromLooting; } private boolean containsDrop(LivingDropsEvent evt, ItemStack skull) { @@ -187,6 +187,8 @@ public class ItemDarkSteelSword extends ItemSword implements IEnergyContainerIte return new ItemStack(Items.skull, 1, 2); } else if(entityLiving instanceof EntityCreeper) { return new ItemStack(Items.skull, 1, 4); + } else if(entityLiving instanceof EntityEnderman) { + return new ItemStack(EnderIO.blockEndermanSkull); } return null; diff --git a/src/main/java/crazypants/enderio/material/MaterialRecipes.java b/src/main/java/crazypants/enderio/material/MaterialRecipes.java index 82b88cb0..929d2986 100644 --- a/src/main/java/crazypants/enderio/material/MaterialRecipes.java +++ b/src/main/java/crazypants/enderio/material/MaterialRecipes.java @@ -51,6 +51,7 @@ public class MaterialRecipes { //Skulls ItemStack skull = new ItemStack(Items.skull, 1, OreDictionary.WILDCARD_VALUE); OreDictionary.registerOre("itemSkull", skull); + OreDictionary.registerOre("itemSkull", new ItemStack(EnderIO.blockEndermanSkull)); //Glass stuff for compatability GameRegistry.addShapedRecipe(new ItemStack(Blocks.glass_pane, 16, 0), " ", "eee", "eee", 'e', pureGlass); From 6ff3c9626e8635958c9021a7daab46b761c3873f Mon Sep 17 00:00:00 2001 From: CrazyPants Date: Fri, 25 Jul 2014 00:21:55 +0800 Subject: [PATCH 5/5] #826 Rendering screen crash in enchanter --- .../crazypants/enderio/machine/enchanter/TileEnchanter.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/crazypants/enderio/machine/enchanter/TileEnchanter.java b/src/main/java/crazypants/enderio/machine/enchanter/TileEnchanter.java index 70e00c6c..3a438d8d 100644 --- a/src/main/java/crazypants/enderio/machine/enchanter/TileEnchanter.java +++ b/src/main/java/crazypants/enderio/machine/enchanter/TileEnchanter.java @@ -231,6 +231,9 @@ public class TileEnchanter extends TileEntityEio implements ISidedInventory { if(item == null) { return 0; } + if(currentEnchantment == null) { + return 0; + } Enchantment enchantment = currentEnchantment.getEnchantment(); int level = item.stackSize; return getEnchantmentCost(currentEnchantment, level);