From 78799ff4ace4a8080f95730775baa29c7883e8a2 Mon Sep 17 00:00:00 2001 From: Vasco Lavos Date: Tue, 1 Jul 2014 04:15:45 +0100 Subject: [PATCH] Added the Paintslinger Lens. --- .../common/crafting/ModCrafingRecipes.java | 9 +++ .../vazkii/botania/common/item/ItemLens.java | 55 ++++++++++++++++-- .../botania/common/lexicon/LexiconData.java | 4 ++ .../botania/common/lib/LibItemNames.java | 3 +- .../vazkii/botania/common/lib/LibLexicon.java | 1 + resources/assets/botania/lang/en_US.lang | 7 +++ .../botania/textures/items/lensPaint.png | Bin 0 -> 3017 bytes 7 files changed, 74 insertions(+), 5 deletions(-) create mode 100644 resources/assets/botania/textures/items/lensPaint.png diff --git a/MODSRC/vazkii/botania/common/crafting/ModCrafingRecipes.java b/MODSRC/vazkii/botania/common/crafting/ModCrafingRecipes.java index bfcd03ea6..beb7f1349 100644 --- a/MODSRC/vazkii/botania/common/crafting/ModCrafingRecipes.java +++ b/MODSRC/vazkii/botania/common/crafting/ModCrafingRecipes.java @@ -158,6 +158,7 @@ public final class ModCrafingRecipes { public static IRecipe recipeSeaLamp; public static IRecipe recipeLensInfluence; public static IRecipe recipeLensWeight; + public static IRecipe recipeLensPaint; public static void init() { // Lexicon Recipe @@ -950,6 +951,14 @@ public final class ModCrafingRecipes { 'L', new ItemStack(ModItems.lens)); recipeLensWeight = BotaniaAPI.getLatestAddedRecipe(); + // Paint Lens Recipe + addOreDictRecipe(new ItemStack(ModItems.lens, 1, 14), + " E ", "WLW", " E ", + 'E', LibOreDict.ELEMENTIUM, + 'W', new ItemStack(Blocks.wool, 1, Short.MAX_VALUE), + 'L', new ItemStack(ModItems.lens)); + recipeLensPaint = 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 6b63d92fd..51435fd03 100644 --- a/MODSRC/vazkii/botania/common/item/ItemLens.java +++ b/MODSRC/vazkii/botania/common/item/ItemLens.java @@ -29,6 +29,7 @@ import net.minecraft.entity.passive.EntitySheep; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.entity.projectile.EntityThrowable; +import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -56,7 +57,6 @@ import vazkii.botania.common.core.helper.MathHelper; import vazkii.botania.common.core.helper.Vector3; import vazkii.botania.common.crafting.recipe.CompositeLensRecipe; import vazkii.botania.common.entity.EntityManaBurst; -import vazkii.botania.common.entity.EntityPixie; import vazkii.botania.common.lib.LibItemNames; import cpw.mods.fml.common.registry.GameRegistry; @@ -64,7 +64,7 @@ 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; + MAGNET = 10, EXPLOSIVE = 11, INFLUENCE = 12, WEIGHT = 13, PAINT = 14; private static final Map> blacklist = new HashMap(); @@ -78,14 +78,26 @@ public class ItemLens extends ItemMod implements ILens { blacklistLenses(EXPLOSIVE, MINE); blacklistLenses(EXPLOSIVE, WEIGHT); blacklistLenses(MINE, WEIGHT); + blacklistLenses(PAINT, MINE); + blacklistLenses(PAINT, EXPLOSIVE); + blacklistLenses(PAINT, WEIGHT); + blacklistLenses(PAINT, PHANTOM); } + private static final List paintableBlocks = new ArrayList() {{ + add(Blocks.stained_glass); + add(Blocks.stained_glass_pane); + add(Blocks.stained_hardened_clay); + add(Blocks.wool); + } + }; + private static final String TAG_COLOR = "color"; private static final String TAG_COMPOSITE_LENS = "compositeLens"; public static IIcon iconGlass; - public static final int SUBTYPES = 14; + public static final int SUBTYPES = 15; IIcon[] ringIcons; public ItemLens() { @@ -282,6 +294,41 @@ public class ItemLens extends ItemMod implements ILens { entity.worldObj.spawnEntityInWorld(falling); } } + break; + } + case PAINT : { + int storedColor = getStoredColor(stack); + if(!burst.isFake() && storedColor > -1 && storedColor < 16) { + Block block = entity.worldObj.getBlock(pos.blockX, pos.blockY, pos.blockZ); + if(paintableBlocks.contains(block)) { + int meta = entity.worldObj.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ); + List coordsToPaint = new ArrayList(); + List coordsFound = new ArrayList(); + + ChunkCoordinates theseCoords = new ChunkCoordinates(pos.blockX, pos.blockY, pos.blockZ); + coordsFound.add(theseCoords); + + do { + List iterCoords = new ArrayList(coordsFound); + for(ChunkCoordinates coords : iterCoords) { + coordsFound.remove(coords); + coordsToPaint.add(coords); + + for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { + Block block_ = entity.worldObj.getBlock(coords.posX + dir.offsetX, coords.posY + dir.offsetY, coords.posZ + dir.offsetZ); + int meta_ = entity.worldObj.getBlockMetadata(coords.posX + dir.offsetX, coords.posY + dir.offsetY, coords.posZ + dir.offsetZ); + ChunkCoordinates coords_ = new ChunkCoordinates(coords.posX + dir.offsetX, coords.posY + dir.offsetY, coords.posZ + dir.offsetZ); + if(block_ == block && meta_ == meta && !coordsFound.contains(coords_) && !coordsToPaint.contains(coords_)) + coordsFound.add(coords_); + } + } + } while(!coordsFound.isEmpty()); + + for(ChunkCoordinates coords : coordsToPaint) + entity.worldObj.setBlockMetadataWithNotify(coords.posX, coords.posY, coords.posZ, storedColor, 2); + } + } + break; } } @@ -384,7 +431,7 @@ public class ItemLens extends ItemMod implements ILens { movable.motionY = entity.motionY; movable.motionZ = entity.motionZ; } - + break; } } diff --git a/MODSRC/vazkii/botania/common/lexicon/LexiconData.java b/MODSRC/vazkii/botania/common/lexicon/LexiconData.java index 6b601b56a..bb2cf0dae 100644 --- a/MODSRC/vazkii/botania/common/lexicon/LexiconData.java +++ b/MODSRC/vazkii/botania/common/lexicon/LexiconData.java @@ -67,6 +67,7 @@ public final class LexiconData { public static LexiconEntry redstoneSpreader; public static LexiconEntry manastar; public static LexiconEntry dreamwoodSpreader; + public static LexiconEntry paintLens; public static LexiconEntry functionalIntro; public static LexiconEntry jadedAmaranthus; @@ -243,6 +244,9 @@ public final class LexiconData { dreamwoodSpreader = new ALexiconEntry(LibLexicon.MANA_DREAMWOOD_SPREADER, categoryMana); dreamwoodSpreader.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipesDreamwoodSpreader)); + paintLens = new ALexiconEntry(LibLexicon.MANA_PAINT_LENS, categoryMana); + paintLens.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeLensPaint)); + // FUNCTIONAL FLOWERS ENTRIES functionalIntro = new BLexiconEntry(LibLexicon.FFLOWER_INTRO, categoryFunctionalFlowers); functionalIntro.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageText("3"), new PageCraftingRecipe("4", ModCrafingRecipes.recipeRedstoneRoot)); diff --git a/MODSRC/vazkii/botania/common/lib/LibItemNames.java b/MODSRC/vazkii/botania/common/lib/LibItemNames.java index 6a3fc1ab7..b2915b637 100644 --- a/MODSRC/vazkii/botania/common/lib/LibItemNames.java +++ b/MODSRC/vazkii/botania/common/lib/LibItemNames.java @@ -99,7 +99,8 @@ public final class LibItemNames { "lensMagnet", "lensExplosive", "lensInfluence", - "lensWeight" + "lensWeight", + "lensPaint" }; public static final String[] MANA_RESOURCE_NAMES = new String[] { diff --git a/MODSRC/vazkii/botania/common/lib/LibLexicon.java b/MODSRC/vazkii/botania/common/lib/LibLexicon.java index 707d65c51..dcc9b6ebf 100644 --- a/MODSRC/vazkii/botania/common/lib/LibLexicon.java +++ b/MODSRC/vazkii/botania/common/lib/LibLexicon.java @@ -45,6 +45,7 @@ public final class LibLexicon { public static final String MANA_REDSTONE_SPREADER = "redstoneSpreader"; public static final String MANA_MANASTAR = "manastar"; public static final String MANA_DREAMWOOD_SPREADER = "dreamwoodSpreader"; + public static final String MANA_PAINT_LENS = "paintLens"; public static final String FFLOWER_INTRO = "fIntro"; public static final String FFLOWER_JADED_AMARANTHUS = "jadedAmaranthus"; diff --git a/resources/assets/botania/lang/en_US.lang b/resources/assets/botania/lang/en_US.lang index 3d7d985ba..7f7e1698f 100644 --- a/resources/assets/botania/lang/en_US.lang +++ b/resources/assets/botania/lang/en_US.lang @@ -442,6 +442,8 @@ item.botania:lensInfluence.name=Mana Lens: Influence item.botania:lensInfluence.short=Influence 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:manaPetal0.name=White Mana Petal item.botania:manaPetal1.name=Orange Mana Petal item.botania:manaPetal2.name=Magenta Mana Petal @@ -745,6 +747,11 @@ botania.entry.dreamwoodSpreader=Elven Mana Spreader botania.page.dreamwoodSpreader0=Simply put, &1Dreamwood&0 conducts &4Mana&0 better than &1Livingwood&0. Add in some adjustments like &1Elementium&0 or &1Mana Petals&0 and what you get is a &1Mana Spreader&0 that can conduct more &4Mana&0, faster and for more time without &4Mana loss&0.
On the negative side, it can't be turned into a &1Redstone Mana Spreader&0. botania.page.dreamwoodSpreader1=Better spreaders, that's it +# -- PAINTSLINGER LENS +botania.entry.paintLens=Paintslinger Lens +botania.page.paintLens0=The &4Elves&0 are one crafty bunch. This lens is somewhat unique in comparison to the other lenses. The &1Paintslinger Lens&0 needs to be dyed one of the 16 colors of the spectrum to function. When it hits a colorable block (&1Wool, Stained Clay or Glass&0...) it'll turn any blocks connected, of the same type and color, into the color of the &4Mana Burst&0 itself. +botania.page.paintLens1=A M'AIDER Stranded Girl + # - FUNCTIONAL FLOWERS # -- AN INTRODUCTION TO FUNCTION botania.entry.fIntro=An Introduction to Function diff --git a/resources/assets/botania/textures/items/lensPaint.png b/resources/assets/botania/textures/items/lensPaint.png new file mode 100644 index 0000000000000000000000000000000000000000..0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