diff --git a/specialPeopleStuff.properties b/specialPeopleStuff.properties index c247203ce..7be59bce6 100644 --- a/specialPeopleStuff.properties +++ b/specialPeopleStuff.properties @@ -16,6 +16,6 @@ bootytoast=actuallyadditions:itemWorm@0 #Patreon stuff ftog_thorgal=actuallyadditions:itemCrystal@0 minetechniker=actuallyadditions:itemCrystalEmpowered@2 -3pixel=actuallyadditions:itemCrystal@3 +3pixel=actuallyadditions:itemMoreDamageLens kirindave=actuallyadditions:itemCrystalEmpowered@3 theonewhohunts=actuallyadditions:itemCrystalEmpowered@4 \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/ActuallyAdditionsAPI.java b/src/main/java/de/ellpeck/actuallyadditions/api/ActuallyAdditionsAPI.java index 6ea55b04e..7cd5cd8c1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/ActuallyAdditionsAPI.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/ActuallyAdditionsAPI.java @@ -83,6 +83,7 @@ public final class ActuallyAdditionsAPI{ public static LensConversion lensDefaultConversion; public static Lens lensDetonation; public static Lens lensDeath; + public static Lens lensEvenMoarDeath; public static Lens lensColor; public static Lens lensDisruption; public static Lens lensDisenchanting; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java index d0011dfc5..7ff6f14db 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java @@ -148,6 +148,7 @@ public final class InitBooklet{ new BookletChapter("additionalRecipes", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(Items.LEATHER), new PageReconstructor(1, LensRecipeHandler.recipeSoulSand).setNoText(), new PageReconstructor(2, LensRecipeHandler.recipeLeather).setNoText(), new PageReconstructor(3, LensRecipeHandler.recipeNetherWart).setNoText(), new PageReconstructor(4, LensRecipeHandler.recipePrismarine).setNoText()).setSpecial(); new BookletChapter("lensColor", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemColorLens), new PageTextOnly(1), new PageReconstructor(2, LensRecipeHandler.recipeColorLens).setNoText()); new BookletChapter("lensDeath", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemDamageLens), new PageTextOnly(1), new PageReconstructor(2, LensRecipeHandler.recipeDamageLens).setNoText()); + new BookletChapter("lensMoreDeath", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemMoreDamageLens), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeLensMoreDeath).setNoText()); new BookletChapter("lensDetonation", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemExplosionLens), new PageTextOnly(1), new PageReconstructor(2, LensRecipeHandler.recipeExplosionLens).setNoText()); new BookletChapter("lensDisenchanting", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemDisenchantingLens), new PageTextOnly(1).addTextReplacement("", LensDisenchanting.ENERGY_USE), new PageCrafting(2, ItemCrafting.recipeDisenchantingLens).setNoText()).setSpecial(); new BookletChapter("lensMining", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemMiningLens), new PageTextOnly(1).addTextReplacement("", LensMining.ENERGY_USE), new PageCrafting(2, ItemCrafting.recipeMiningLens).setNoText()).setImportant(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigCrafting.java index def7dbae3..11220bd4f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigCrafting.java @@ -139,6 +139,7 @@ public enum ConfigCrafting{ CHEST_TO_CRATE_UPGRADE("Chest To Crate Upgrade", ConfigCategories.ITEMS_CRAFTING), DISENCHANTING_LENS("Disenchanting Lens", ConfigCategories.ITEMS_CRAFTING), MINING_LENS("Mining Lens", ConfigCategories.ITEMS_CRAFTING), + MORE_DEATH_LENS("Killer Lens", ConfigCategories.ITEMS_CRAFTING), CRATE_KEEPER("Crate Keeper", ConfigCategories.ITEMS_CRAFTING), DRILL_CORE("Drill Core", ConfigCategories.ITEMS_CRAFTING), ATOMIC_RECONSTRUCTOR("Atomic Reconstructor", ConfigCategories.BLOCKS_CRAFTING), diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ItemCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ItemCrafting.java index f56816416..6b3176800 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ItemCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ItemCrafting.java @@ -21,7 +21,9 @@ import de.ellpeck.actuallyadditions.mod.items.metalists.*; import de.ellpeck.actuallyadditions.mod.util.RecipeUtil; import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.block.IGrowable; +import net.minecraft.enchantment.EnchantmentData; import net.minecraft.init.Blocks; +import net.minecraft.init.Enchantments; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemFood; @@ -91,6 +93,7 @@ public final class ItemCrafting{ public static IRecipe recipeMiningLens; public static IRecipe recipeBag; public static IRecipe recipeVoidBag; + public static IRecipe recipeLensMoreDeath; public static void init(){ @@ -188,6 +191,18 @@ public final class ItemCrafting{ recipeMiningLens = RecipeUtil.lastIRecipe(); } + //Killer Lens + if(ConfigCrafting.MORE_DEATH_LENS.isEnabled()){ + ItemStack enchBook = new ItemStack(Items.ENCHANTED_BOOK); + Items.ENCHANTED_BOOK.addEnchantment(enchBook, new EnchantmentData(Enchantments.SHARPNESS, 5)); + + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemMoreDamageLens), + new ItemStack(Items.DIAMOND_SWORD), + new ItemStack(InitItems.itemDamageLens), + enchBook)); + recipeLensMoreDeath = RecipeUtil.lastIRecipe(); + } + //Filter if(ConfigCrafting.FILTER.isEnabled()){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemFilter), diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/creative/CreativeTab.java b/src/main/java/de/ellpeck/actuallyadditions/mod/creative/CreativeTab.java index 2b775dd33..57c546432 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/creative/CreativeTab.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/creative/CreativeTab.java @@ -157,6 +157,7 @@ public class CreativeTab extends CreativeTabs{ this.add(InitItems.itemColorLens); this.add(InitItems.itemExplosionLens); this.add(InitItems.itemDamageLens); + this.add(InitItems.itemMoreDamageLens); this.add(InitItems.itemDisenchantingLens); this.add(InitItems.itemMiningLens); this.add(InitItems.itemLaserWrench); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitItems.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitItems.java index 942c635d3..8ae1ac2e2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitItems.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitItems.java @@ -144,6 +144,7 @@ public final class InitItems{ public static Item itemColorLens; public static Item itemExplosionLens; public static Item itemDamageLens; + public static Item itemMoreDamageLens; public static Item itemDisenchantingLens; public static Item itemMiningLens; @@ -236,6 +237,7 @@ public final class InitItems{ itemColorLens = new ItemLens("itemColorLens", ActuallyAdditionsAPI.lensColor); itemExplosionLens = new ItemLens("itemExplosionLens", ActuallyAdditionsAPI.lensDetonation); itemDamageLens = new ItemLens("itemDamageLens", ActuallyAdditionsAPI.lensDeath); + itemMoreDamageLens = new ItemLens("itemMoreDamageLens", ActuallyAdditionsAPI.lensEvenMoarDeath); itemDisenchantingLens = new ItemLens("itemDisenchantingLens", ActuallyAdditionsAPI.lensDisenchanting); itemMiningLens = new ItemLens("itemMiningLens", ActuallyAdditionsAPI.lensMining); itemCrystal = new ItemCrystal("itemCrystal", false); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensDeath.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensDeath.java index 0fd6f8e0f..39e2ca746 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensDeath.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensDeath.java @@ -24,19 +24,27 @@ public class LensDeath extends Lens{ @Override public boolean invoke(IBlockState hitState, BlockPos hitBlock, IAtomicReconstructor tile){ - int use = 150; //Per Block (because it doesn't only activate when something is hit like the other lenses!) - if(tile.getEnergy() >= use){ - tile.extractEnergy(use); + ArrayList entities = (ArrayList)tile.getWorldObject().getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(hitBlock.getX(), hitBlock.getY(), hitBlock.getZ(), hitBlock.getX()+1, hitBlock.getY()+1, hitBlock.getZ()+1)); + for(EntityLivingBase entity : entities){ + int use = this.getUsePerEntity(); + if(tile.getEnergy() >= use){ + tile.extractEnergy(use); - ArrayList entities = (ArrayList)tile.getWorldObject().getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(hitBlock.getX(), hitBlock.getY(), hitBlock.getZ(), hitBlock.getX()+1, hitBlock.getY()+1, hitBlock.getZ()+1)); - for(EntityLivingBase entity : entities){ - entity.attackEntityFrom(DamageSources.DAMAGE_ATOMIC_RECONSTRUCTOR, 20F); + this.onAttacked(entity, tile); } } return hitBlock != null && !hitState.getBlock().isAir(hitState, tile.getWorldObject(), hitBlock); } + protected void onAttacked(EntityLivingBase entity, IAtomicReconstructor tile){ + entity.attackEntityFrom(DamageSources.DAMAGE_ATOMIC_RECONSTRUCTOR, 20F); + } + + protected int getUsePerEntity(){ + return 350; + } + @Override public float[] getColor(){ return new float[]{188F/255F, 222F/255F, 1F}; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensEvenMoarDeath.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensEvenMoarDeath.java new file mode 100644 index 000000000..5852b85f5 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensEvenMoarDeath.java @@ -0,0 +1,36 @@ +/* + * This file ("LensEvenMoarDeath.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.items.lens; + +import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; +import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import net.minecraft.entity.EntityLivingBase; +import net.minecraftforge.fml.relauncher.ReflectionHelper; + +public class LensEvenMoarDeath extends LensDeath{ + + @Override + protected void onAttacked(EntityLivingBase entity, IAtomicReconstructor tile){ + try{ + ReflectionHelper.setPrivateValue(EntityLivingBase.class, entity, 100, 37); + } + catch(Exception e){ + ModUtil.LOGGER.error("A Damage Lens at "+tile.getX()+", "+tile.getY()+", "+tile.getZ()+" in World "+tile.getWorldObject().provider.getDimension()+" threw an Exception! Don't let that happen again!", e); + } + + super.onAttacked(entity, tile); + } + + @Override + protected int getUsePerEntity(){ + return 2500; + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/Lenses.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/Lenses.java index ac1da4679..9213ebf06 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/Lenses.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/Lenses.java @@ -19,6 +19,7 @@ public final class Lenses{ ActuallyAdditionsAPI.lensDefaultConversion = new LensConversion(); ActuallyAdditionsAPI.lensDetonation = new LensDetonation(); ActuallyAdditionsAPI.lensDeath = new LensDeath(); + ActuallyAdditionsAPI.lensEvenMoarDeath = new LensEvenMoarDeath(); ActuallyAdditionsAPI.lensColor = new LensColor(); ActuallyAdditionsAPI.lensDisruption = new LensDisruption(); ActuallyAdditionsAPI.lensDisenchanting = new LensDisenchanting(); diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index da7d73a74..e78f9534b 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -512,6 +512,7 @@ item.actuallyadditions.itemVoidBag.name=Void Sack item.actuallyadditions.itemMiscCrystallizedCanolaSeed.name=Crystallized Canola Seed item.actuallyadditions.itemMiscEmpoweredCanolaSeed.name=Empowered Canola Seed item.actuallyadditions.itemMiningLens.name=Lens of the Miner +item.actuallyadditions.itemMoreDamageLens.name=Lens of the Killer #Tooltips tooltip.actuallyadditions.onSuffix.desc=On @@ -1049,4 +1050,7 @@ booklet.actuallyadditions.chapter.farmer.name=Farmer booklet.actuallyadditions.chapter.farmer.text.1=The Farmer is a block that can, once placed in the world, plant and harvest crops like Wheat, Potatoes, Canola and more. The left side of its GUI is reserved for seeds, while the right side will contain the harvested goods. It will farm in a 9x9 area in front of it. For every operation, it uses RF. my fam booklet.actuallyadditions.chapter.reviews.name=What people think -booklet.actuallyadditions.chapter.reviews.text.1="Actually Additions, to me, is quite magical in a way." -Saphrym "Actually quite cool. Lots of nice little additions. Gonna be in the pack." -Direwolf20 "Mod Dev quite rude and arrogant" -Bubb1e0seven "A whimsical breath of fresh air in a stuffy tech-mod world." -mezz \ No newline at end of file +booklet.actuallyadditions.chapter.reviews.text.1="Actually Additions, to me, is quite magical in a way." -Saphrym "Actually quite cool. Lots of nice little additions. Gonna be in the pack." -Direwolf20 "Mod Dev quite rude and arrogant" -Bubb1e0seven "A whimsical breath of fresh air in a stuffy tech-mod world." -mezz + +booklet.actuallyadditions.chapter.lensMoreDeath.name=Lens of the Killer +booklet.actuallyadditions.chapter.lensMoreDeath.text.1=The Lens of the Killer works much like the Lens of Certain Death, however it will also drop experience and player-kill loot. This means, however, that it will use a lot more power. To pick up the experience it drops, you might want to try an Experience Solidifier. \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemMoreDamageLens.json b/src/main/resources/assets/actuallyadditions/models/item/itemMoreDamageLens.json new file mode 100644 index 000000000..cb7e6d63d --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/models/item/itemMoreDamageLens.json @@ -0,0 +1,6 @@ +{ + "parent": "actuallyadditions:item/standardItem", + "textures": { + "layer0": "actuallyadditions:items/itemMoreDamageLens" + } +} diff --git a/src/main/resources/assets/actuallyadditions/textures/items/itemMoreDamageLens.png b/src/main/resources/assets/actuallyadditions/textures/items/itemMoreDamageLens.png new file mode 100644 index 000000000..087b3d55b Binary files /dev/null and b/src/main/resources/assets/actuallyadditions/textures/items/itemMoreDamageLens.png differ