From ea409d34de73db4f685f2e8788d24977aa5a9799 Mon Sep 17 00:00:00 2001 From: MysteriousAges Date: Thu, 10 Oct 2013 23:39:04 -0700 Subject: [PATCH] Hive frames are not enchantable. (Enchants never did anything anyway.) Adjusting hive spawn code. --- .../magicbees/item/ItemMagicHiveFrame.java | 7 ++++ magicbees_src/magicbees/main/Config.java | 2 +- .../main/utils/compat/ForestryHelper.java | 34 ++----------------- .../magicbees/world/feature/FeatureHive.java | 3 +- 4 files changed, 12 insertions(+), 34 deletions(-) diff --git a/magicbees_src/magicbees/item/ItemMagicHiveFrame.java b/magicbees_src/magicbees/item/ItemMagicHiveFrame.java index df8b85a..7fcc3cc 100644 --- a/magicbees_src/magicbees/item/ItemMagicHiveFrame.java +++ b/magicbees_src/magicbees/item/ItemMagicHiveFrame.java @@ -119,4 +119,11 @@ public class ItemMagicHiveFrame extends Item implements IHiveFrame return this.type.geneticDecayMod; } + @Override + public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) + { + return false; + } + + } diff --git a/magicbees_src/magicbees/main/Config.java b/magicbees_src/magicbees/main/Config.java index d529517..69649d7 100644 --- a/magicbees_src/magicbees/main/Config.java +++ b/magicbees_src/magicbees/main/Config.java @@ -221,7 +221,7 @@ public class Config MinecraftForge.setBlockHarvestLevel(hive, t.ordinal(), "scoop", 0); } - FMLLog.info("Replacing stupid-block with 'Here, have some delicious textures' ItemBlock. This is 100% normal."); + FMLLog.info("Replacing stupid-block with 'Here, have some delicious textures' ItemBlock. This is 100%% normal."); Item.itemsList[hive.blockID] = null; Item.itemsList[hive.blockID] = new ItemMultiTextureTile(hive.blockID - 256, hive, HiveType.getAllNames()); } diff --git a/magicbees_src/magicbees/main/utils/compat/ForestryHelper.java b/magicbees_src/magicbees/main/utils/compat/ForestryHelper.java index 697f6e7..64343b2 100644 --- a/magicbees_src/magicbees/main/utils/compat/ForestryHelper.java +++ b/magicbees_src/magicbees/main/utils/compat/ForestryHelper.java @@ -138,41 +138,11 @@ public class ForestryHelper public static EnumTemperature getEnumTemperatureFromValue(float rawTemp) { - EnumTemperature value = EnumTemperature.ICY; - - if (rawTemp >= 2.0f) - { - value = EnumTemperature.HOT; - } - else if (rawTemp >= 1.2f) - { - value = EnumTemperature.WARM; - } - else if (rawTemp >= 0.2f) - { - value = EnumTemperature.NORMAL; - } - else if (rawTemp >= 0.05f) - { - value = EnumTemperature.COLD; - } - - return value; + return EnumTemperature.getFromValue(rawTemp); } public static EnumHumidity getEnumHumidityFromValue(float rawHumidity) { - EnumHumidity value = EnumHumidity.ARID; - - if (rawHumidity >= 0.9f) - { - value = EnumHumidity.DAMP; - } - else if (rawHumidity >= 0.3f) - { - value = EnumHumidity.NORMAL; - } - - return value; + return EnumHumidity.getFromValue(rawHumidity); } } diff --git a/magicbees_src/magicbees/world/feature/FeatureHive.java b/magicbees_src/magicbees/world/feature/FeatureHive.java index 0f1606a..9eb7b07 100644 --- a/magicbees_src/magicbees/world/feature/FeatureHive.java +++ b/magicbees_src/magicbees/world/feature/FeatureHive.java @@ -42,8 +42,9 @@ public class FeatureHive int coordY = getHeight(world, random, coordX, coordZ); boolean doSpawn = false; + Block b = Block.blocksList[world.getBlockId(coordX, coordY + 1, coordZ)]; if (world.isAirBlock(coordX, coordY - 1, coordZ) && world.isAirBlock(coordX, coordY, coordZ) && - GlobalManager.leafBlockIds.contains(world.getBlockId(coordX, coordY + 1, coordZ)) ) + b != null && b.isLeaves(world, coordX, coordY + 1, coordZ)) { world.setBlock(coordX, coordY, coordZ, Config.hive.blockID, HiveType.CURIOUS.ordinal(), 3); if (logSpawns) FMLLog.info("Spawning %s hive at: X %d, Z %d, Y %d", "Curious", coordX, coordZ, coordY);