diff --git a/MODSRC/vazkii/botania/common/crafting/ModCrafingRecipes.java b/MODSRC/vazkii/botania/common/crafting/ModCrafingRecipes.java index 9fc26c4e3..12c2d56a4 100644 --- a/MODSRC/vazkii/botania/common/crafting/ModCrafingRecipes.java +++ b/MODSRC/vazkii/botania/common/crafting/ModCrafingRecipes.java @@ -161,6 +161,8 @@ public final class ModCrafingRecipes { public static List recipesMiniIsland; public static IRecipe recipeGaiaPylon; public static IRecipe recipeGatherDrum; + public static IRecipe recipeLensFire; + public static IRecipe recipeLensPiston; public static void init() { // Lexicon Recipe @@ -277,7 +279,7 @@ public final class ModCrafingRecipes { addShapelessOreDictRecipe(new ItemStack(ModItems.lens, 1, 8), new ItemStack(ModItems.lens), LibOreDict.RUNE[13]); recipeLensDamaging = BotaniaAPI.getLatestAddedRecipe(); - addShapelessOreDictRecipe(new ItemStack(ModItems.lens, 1, 9), new ItemStack(ModItems.lens), new ItemStack(ModBlocks.pistonRelay)); + addShapelessOreDictRecipe(new ItemStack(ModItems.lens, 1, 9), new ItemStack(ModItems.lens), new ItemStack(ModBlocks.platform)); recipeLensPhantom = BotaniaAPI.getLatestAddedRecipe(); addShapelessOreDictRecipe(new ItemStack(ModItems.lens, 1, 10), new ItemStack(ModItems.lens), "ingotIron", "ingotGold"); @@ -982,6 +984,14 @@ public final class ModCrafingRecipes { 'E', LibOreDict.ELEMENTIUM); recipeGatherDrum = BotaniaAPI.getLatestAddedRecipe(); + // Mana Lens: Kindle + addShapelessOreDictRecipe(new ItemStack(ModItems.lens, 1, 15), new ItemStack(ModItems.lens), new ItemStack(Items.fire_charge)); + recipeLensFire = BotaniaAPI.getLatestAddedRecipe(); + + // Mana Lens: Piston + addShapelessOreDictRecipe(new ItemStack(ModItems.lens, 1, 16), new ItemStack(ModItems.lens), new ItemStack(ModBlocks.pistonRelay)); + recipeLensPiston = BotaniaAPI.getLatestAddedRecipe(); + // Mana and Terrasteel Block Recipes addOreDictRecipe(new ItemStack(ModBlocks.storage, 1, 0), "III", "III", "III", diff --git a/MODSRC/vazkii/botania/common/item/ItemLens.java b/MODSRC/vazkii/botania/common/item/ItemLens.java index 94103d368..4d4a6ad86 100644 --- a/MODSRC/vazkii/botania/common/item/ItemLens.java +++ b/MODSRC/vazkii/botania/common/item/ItemLens.java @@ -63,26 +63,51 @@ import cpw.mods.fml.common.registry.GameRegistry; public class ItemLens extends ItemMod implements ILens { - private static final int NORMAL = 0, SPEED = 1, POWER = 2, TIME = 3, EFFICIENCY = 4, - BOUNCE = 5, GRAVITY = 6, MINE = 7, DAMAGE = 8, PHANTOM = 9, - MAGNET = 10, EXPLOSIVE = 11, INFLUENCE = 12, WEIGHT = 13, PAINT = 14; + private static final int NORMAL = 0, + SPEED = 1, + POWER = 2, + TIME = 3, + EFFICIENCY = 4, + BOUNCE = 5, + GRAVITY = 6, + MINE = 7, + DAMAGE = 8, + PHANTOM = 9, + MAGNET = 10, + EXPLOSIVE = 11, + INFLUENCE = 12, + WEIGHT = 13, + PAINT = 14, + FIRE = 15, + PISTON = 16; - private static final Map> blacklist = new HashMap(); + private static final int PROP_NONE = 0, + PROP_POWER = 1, + PROP_ORIENTATION = 1 << 1, + PROP_TOUCH = 1 << 2, + PROP_INTERACTION = 1 << 3, + PROP_DAMAGE = 1 << 4; + + private static final Map props = new HashMap(); static { - blacklistLenses(POWER, EXPLOSIVE); - blacklistLenses(GRAVITY, MAGNET); - blacklistLenses(PHANTOM, MINE); - blacklistLenses(PHANTOM, EXPLOSIVE); - blacklistLenses(PHANTOM, BOUNCE); - blacklistLenses(PHANTOM, WEIGHT); - blacklistLenses(EXPLOSIVE, MINE); - blacklistLenses(EXPLOSIVE, WEIGHT); - blacklistLenses(MINE, WEIGHT); - blacklistLenses(PAINT, MINE); - blacklistLenses(PAINT, EXPLOSIVE); - blacklistLenses(PAINT, WEIGHT); - blacklistLenses(PAINT, PHANTOM); + setProps(NORMAL, PROP_NONE); + setProps(SPEED, PROP_NONE); + setProps(POWER, PROP_POWER); + setProps(TIME, PROP_NONE); + setProps(EFFICIENCY, PROP_NONE); + setProps(BOUNCE, PROP_TOUCH); + setProps(GRAVITY, PROP_ORIENTATION); + setProps(MINE, PROP_TOUCH | PROP_INTERACTION); + setProps(DAMAGE, PROP_DAMAGE); + setProps(PHANTOM, PROP_TOUCH); + setProps(MAGNET, PROP_ORIENTATION); + setProps(EXPLOSIVE, PROP_DAMAGE | PROP_TOUCH | PROP_INTERACTION); + setProps(INFLUENCE, PROP_NONE); + setProps(WEIGHT, PROP_TOUCH | PROP_INTERACTION); + setProps(PAINT, PROP_TOUCH | PROP_INTERACTION); + setProps(FIRE, PROP_DAMAGE | PROP_TOUCH | PROP_INTERACTION); + setProps(PISTON, PROP_TOUCH | PROP_INTERACTION); } static final List paintableBlocks = new ArrayList() {{ @@ -101,7 +126,7 @@ public class ItemLens extends ItemMod implements ILens { public static IIcon iconGlass; - public static final int SUBTYPES = 15; + public static final int SUBTYPES = 17; IIcon[] ringIcons; public ItemLens() { @@ -359,6 +384,44 @@ public class ItemLens extends ItemMod implements ILens { } break; } + case FIRE : { + ChunkCoordinates coords = burst.getBurstSourceChunkCoordinates(); + if((coords.posX != pos.blockX || coords.posY != pos.blockY || coords.posZ != pos.blockZ) && !burst.isFake() && !isManaBlock) { + ForgeDirection dir = ForgeDirection.getOrientation(pos.sideHit); + if(entity.worldObj.getBlock(pos.blockX, pos.blockY, pos.blockZ) == Blocks.portal) + entity.worldObj.setBlock(pos.blockX, pos.blockY, pos.blockZ, Blocks.air); + else { + int x = pos.blockX + dir.offsetX; + int y = pos.blockY + dir.offsetY; + int z = pos.blockZ + dir.offsetZ; + entity.worldObj.setBlock(x, y, z, Blocks.fire); + } + } + + break; + } + case PISTON : { + ChunkCoordinates coords = burst.getBurstSourceChunkCoordinates(); + if((coords.posX != pos.blockX || coords.posY != pos.blockY || coords.posZ != pos.blockZ) && !burst.isFake() && !isManaBlock && !entity.worldObj.isRemote) { + ForgeDirection dir = ForgeDirection.getOrientation(pos.sideHit).getOpposite(); + int x = pos.blockX + dir.offsetX; + int y = pos.blockY + dir.offsetY; + int z = pos.blockZ + dir.offsetZ; + + if(entity.worldObj.isAirBlock(x, y, z) || entity.worldObj.getBlock(x, y, z).isReplaceable(entity.worldObj, x, y, z)) { + Block block = entity.worldObj.getBlock(pos.blockX, pos.blockY, pos.blockZ); + int meta = entity.worldObj.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ); + TileEntity tile = entity.worldObj.getTileEntity(pos.blockX, pos.blockY, pos.blockZ); + + if(block.getMobilityFlag() == 0 && block != Blocks.obsidian && tile == null) { + entity.worldObj.setBlockToAir(pos.blockX, pos.blockY, pos.blockZ); + entity.worldObj.setBlock(x, y, z, block, meta, 1 | 2); + entity.worldObj.playAuxSFX(2001, pos.blockX, pos.blockY, pos.blockZ, Block.getIdFromBlock(block) + (meta << 12)); + } + } + } + break; + } } ItemStack compositeLens = getCompositeLens(stack); @@ -500,24 +563,12 @@ public class ItemLens extends ItemMod implements ILens { return true; } - public static void blacklistLenses(int lens1, int lens2) { - blacklistLenses(lens1, lens2, true); - } - - public static void blacklistLenses(int lens1, int lens2, boolean recursive) { - if(!blacklist.containsKey(lens1)) - blacklist.put(lens1, new ArrayList()); - blacklist.get(lens1).add(lens2); - - if(recursive) - blacklistLenses(lens2, lens1, false); + public static void setProps(int lens, int props_) { + props.put(lens, props_); } public static boolean isBlacklisted(int lens1, int lens2) { - if(!blacklist.containsKey(lens1)) - return false; - - return blacklist.get(lens1).contains(lens2); + return (props.get(lens1) & props.get(lens2)) == 0; } @Override diff --git a/MODSRC/vazkii/botania/common/lexicon/LexiconData.java b/MODSRC/vazkii/botania/common/lexicon/LexiconData.java index c23c85ca5..9fe2b41fe 100644 --- a/MODSRC/vazkii/botania/common/lexicon/LexiconData.java +++ b/MODSRC/vazkii/botania/common/lexicon/LexiconData.java @@ -226,7 +226,9 @@ public final class LexiconData { new PageText("24"), new PageCraftingRecipe("25", ModCrafingRecipes.recipeLensMagnet), new PageText("26"), new PageCraftingRecipe("27", ModCrafingRecipes.recipeLensExplosive), new PageText("28"), new PageCraftingRecipe("29", ModCrafingRecipes.recipeLensInfluence), - new PageText("30"), new PageCraftingRecipe("31", ModCrafingRecipes.recipeLensWeight)); + new PageText("30"), new PageCraftingRecipe("31", ModCrafingRecipes.recipeLensWeight), + new PageText("32"), new PageCraftingRecipe("33", ModCrafingRecipes.recipeLensFire), + new PageText("34"), new PageCraftingRecipe("35", ModCrafingRecipes.recipeLensPiston)); distributor = new BLexiconEntry(LibLexicon.MANA_DISTRIBUTOR, categoryMana); distributor.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeDistributor)); diff --git a/MODSRC/vazkii/botania/common/lib/LibItemNames.java b/MODSRC/vazkii/botania/common/lib/LibItemNames.java index 8d2e0c38d..ab7a0eb64 100644 --- a/MODSRC/vazkii/botania/common/lib/LibItemNames.java +++ b/MODSRC/vazkii/botania/common/lib/LibItemNames.java @@ -101,7 +101,9 @@ public final class LibItemNames { "lensExplosive", "lensInfluence", "lensWeight", - "lensPaint" + "lensPaint", + "lensFire", + "lensPiston" }; public static final String[] MANA_RESOURCE_NAMES = new String[] { diff --git a/resources/assets/botania/lang/en_US.lang b/resources/assets/botania/lang/en_US.lang index e392e6234..8b31bfeca 100644 --- a/resources/assets/botania/lang/en_US.lang +++ b/resources/assets/botania/lang/en_US.lang @@ -491,6 +491,10 @@ item.botania:lensWeight.name=Mana Lens: Weight item.botania:lensWeight.short=Weight item.botania:lensPaint.name=Mana Lens: Paintslinger item.botania:lensPaint.short=Paintslinger +item.botania:lensFire.name=Mana Lens: Kindle +item.botania:lensFire.short=Kindle +item.botania:lensPiston.name=Mana Lens: Force +item.botania:lensPiston.short=Force item.botania:manaPetal0.name=White Mana Petal item.botania:manaPetal1.name=Orange Mana Petal item.botania:manaPetal2.name=Magenta Mana Petal @@ -753,7 +757,7 @@ botania.page.lens18=The &1Bore Lens&0 charges the &4Mana Burst&0 with the abilit botania.page.lens19=Bore Lens botania.page.lens20=The &1Damaging Lens&0 charges the &4Mana Burst&0 with the power to damage any living beings it comes across, draining its own mana to do so.
Since this relies on the detection abilities of a &1Mana Spreader&0, it won't fire at just anything, as it needs a &4Mana&0 receving block in the end. botania.page.lens21=Damaging Lens -botania.page.lens22=The &1Phantom Lens&0 is an interesting one. By utilizing the spacetime continuum tearing properties of the &1Force Relay&0, it's possible to make a lens that'll allow the &4Mana Burst&0 to pass through blocks. In doing so, the time it can stay without losing mana is decreased. +botania.page.lens22=The &1Phantom Lens&0 is an interesting one. By utilizing the &1Abstruse Platform&0 and its' properties, it's possible to make a lens that'll allow the &4Mana Burst&0 to pass through blocks. In doing so, the time it can stay without losing mana is decreased. botania.page.lens23=Phantom Lens botania.page.lens24=The &1Magnetizing Lens&0, as its name states, allows the &4Mana Burst&0 to magnetize, or home in, on any nearby blocks that can receive &4Mana&0. Doing so slightly decreases the speed of the burst. botania.page.lens25=Magnetizing Lens @@ -763,6 +767,10 @@ botania.page.lens28=The &1Influence Lens&0 allows the &4Mana Burst&0 to have inf botania.page.lens29=Influence Lens botania.page.lens30=The &1Weight Lens&0 carries a strong burden on the &4Mana Burst&0, making any block hit by it, if there doesn't happen to be a block below it, fall, similarly to how &1Sand&0 and &1Gravel&0 do. botania.page.lens31=Weight Lens +botania.page.lens32=The &1Kindle Lens&0 is infused with a burning spark, when it hits a block it'll set it on fire. It has the ability to both ignite and close &1Nether Portals&0. It doesn't seem to set any living beings on fire, though. +botania.page.lens33=Kindle Lens +botania.page.lens34=The &1Force Lens&0 acts as a &1Piston&0, when it hits a block that a piston can move, it'll do just so. +botania.page.lens35=Force Lens # -- PORTABLE MANA TRANSPORT botania.entry.manaTransport=Portable Mana Transport diff --git a/resources/assets/botania/textures/items/lensFire.png b/resources/assets/botania/textures/items/lensFire.png new file mode 100644 index 000000000..3f3c2b986 Binary files /dev/null and b/resources/assets/botania/textures/items/lensFire.png differ diff --git a/resources/assets/botania/textures/items/lensPiston.png b/resources/assets/botania/textures/items/lensPiston.png new file mode 100644 index 000000000..75b95bb2c Binary files /dev/null and b/resources/assets/botania/textures/items/lensPiston.png differ