Added enderman skull as a drop and fixed skull drop chances for everything.

This commit is contained in:
CrazyPants committed 2014-07-25 00:18:02 +08:00
1 parent 25c0038c87
commit 404e0af195
4 files changed
+24 -9

No files matched your search

@@ -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();
@@ -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,
@@ -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;
@@ -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);