From 9c40296db0bc2f8ec29e55d96a9bdecbac7cc9f9 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 8 May 2016 14:11:24 +0200 Subject: [PATCH] Spawner Shards + Spawner Changer recipe and doc --- .../mod/booklet/InitBooklet.java | 3 +++ .../mod/config/values/ConfigCrafting.java | 3 ++- .../mod/crafting/ItemCrafting.java | 11 +++++++++ .../mod/event/BreakEvent.java | 21 ++++++++++++++++++ .../mod/event/InitEvents.java | 1 + .../mod/items/metalists/TheMiscItems.java | 3 ++- .../assets/actuallyadditions/lang/en_US.lang | 9 +++++++- .../models/item/itemMiscSpawnerShard.json | 6 +++++ .../textures/items/itemMiscSpawnerShard.png | Bin 0 -> 375 bytes 9 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/event/BreakEvent.java create mode 100644 src/main/resources/assets/actuallyadditions/models/item/itemMiscSpawnerShard.json create mode 100644 src/main/resources/assets/actuallyadditions/textures/items/itemMiscSpawnerShard.png 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 cb4655401..7c1c9538b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java @@ -12,6 +12,7 @@ package de.ellpeck.actuallyadditions.mod.booklet; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.booklet.BookletPage; +import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheColoredLampColors; import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheMiscBlocks; @@ -80,6 +81,7 @@ public class InitBooklet{ } new BookletChapter("lamps", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockColoredLampOn, 1, TheColoredLampColors.GREEN.ordinal()), lampPages.toArray(new BookletPage[lampPages.size()])); new BookletChapter("enderStar", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.ENDER_STAR.ordinal()), new PageCrafting(1, ItemCrafting.recipeEnderStar)); + new BookletChapter("spawnerShard", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.SPAWNER_SHARD.ordinal()), new PageTextOnly(1).setStack(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.SPAWNER_SHARD.ordinal()))); new BookletChapter("treasureChest", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockTreasureChest), new PagePicture(1, "pageTreasureChest", 150).setStack(new ItemStack(InitBlocks.blockTreasureChest)), new PageTextOnly(2)).setSpecial(); new BookletChapter("hairBalls", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemHairyBall), new PagePicture(1, "pageFurBalls", 110).setStack(new ItemStack(InitItems.itemHairyBall)), new PageTextOnly(2)).setSpecial(); @@ -137,6 +139,7 @@ public class InitBooklet{ potionRingPages.add(new PageCrafting(potionRingPages.size()+1, recipe).setNoText()); } new BookletChapter("potionRings", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemPotionRing), potionRingPages.toArray(new BookletPage[potionRingPages.size()])); + new BookletChapter("spawnerChanger", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemSpawnerChanger), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeSpawnerChanger).setNoText()); //RF Using Items new BookletChapter("drill", ActuallyAdditionsAPI.entryItemsRF, new ItemStack(InitItems.itemDrill, 1, TheColoredLampColors.LIGHT_BLUE.ordinal()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeDrill).setNoText(), new PageCrafting(3, ItemCrafting.recipesDrillColoring), new PageCrafting(4, ItemCrafting.recipeDrillCore).setNoText(), new PageCrafting(5, ItemCrafting.recipeDrillSpeedI).setNoText(), new PageCrafting(6, ItemCrafting.recipeDrillSpeedII).setNoText(), new PageCrafting(7, ItemCrafting.recipeDrillSpeedIII).setNoText(), new PageCrafting(8, ItemCrafting.recipeDrillFortuneI).setNoText(), new PageCrafting(9, ItemCrafting.recipeDrillFortuneII).setNoText(), new PageCrafting(10, ItemCrafting.recipeDrillSilk).setNoText(), new PageCrafting(11, ItemCrafting.recipeDrillThree).setNoText(), new PageCrafting(12, ItemCrafting.recipeDrillFive).setNoText(), new PageCrafting(13, ItemCrafting.recipeDrillPlacing).setNoText()).setSpecial(); 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 dda70f30a..250eefb2a 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 @@ -156,7 +156,8 @@ public enum ConfigCrafting{ ATOMIC_RECONSTRUCTOR("Atomic Reconstructor", ConfigCategories.BLOCKS_CRAFTING), MINER("Miner", ConfigCategories.BLOCKS_CRAFTING), FIREWORK_BOX("Firework Box", ConfigCategories.BLOCKS_CRAFTING), - ENDER_STAR("Ender Star", ConfigCategories.ITEMS_CRAFTING); + ENDER_STAR("Ender Star", ConfigCategories.ITEMS_CRAFTING), + SPAWNER_CHANGER("Spawner Changer", ConfigCategories.ITEMS_CRAFTING); public final String name; public final String category; 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 92b7731b9..7eeac6768 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ItemCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ItemCrafting.java @@ -84,6 +84,7 @@ public class ItemCrafting{ public static IRecipe recipeCrateKeeper; public static IRecipe recipeEnderStar; public static IRecipe recipeRarmorModuleReconstructor; + public static IRecipe recipeSpawnerChanger; public static void init(){ @@ -126,6 +127,16 @@ public class ItemCrafting{ recipeCrateKeeper = RecipeUtil.lastIRecipe(); } + //Spawner Changer + if(ConfigCrafting.SPAWNER_CHANGER.isEnabled()){ + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemSpawnerChanger), + "MSM", "SDS", "MSM", + 'M', new ItemStack(Items.MAGMA_CREAM), + 'S', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.SPAWNER_SHARD.ordinal()), + 'D', new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.DIAMOND.ordinal()))); + recipeSpawnerChanger = RecipeUtil.lastIRecipe(); + } + //Laser Wrench if(ConfigCrafting.LASER_WRENCH.isEnabled()){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemLaserWrench), diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/BreakEvent.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/BreakEvent.java new file mode 100644 index 000000000..3b6e3919d --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/event/BreakEvent.java @@ -0,0 +1,21 @@ +package de.ellpeck.actuallyadditions.mod.event; + +import de.ellpeck.actuallyadditions.mod.items.InitItems; +import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.event.world.BlockEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class BreakEvent{ + + @SubscribeEvent + public void onBlockBreakEvent(BlockEvent.HarvestDropsEvent event){ + IBlockState state = event.getState(); + if(state != null && state.getBlock() == Blocks.MOB_SPAWNER){ + event.getDrops().add(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.SPAWNER_SHARD.ordinal())); + } + } + +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/InitEvents.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/InitEvents.java index fc53bd2d4..0e6df4853 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/InitEvents.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/event/InitEvents.java @@ -28,6 +28,7 @@ public class InitEvents{ Util.registerEvent(new EntityLivingEvent()); Util.registerEvent(new LogoutEvent()); Util.registerEvent(new WorldLoadingEvents()); + Util.registerEvent(new BreakEvent()); MinecraftForge.TERRAIN_GEN_BUS.register(new WorldDecorationEvent()); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/TheMiscItems.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/TheMiscItems.java index 4f7e5317d..556ceb3b6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/TheMiscItems.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/TheMiscItems.java @@ -33,7 +33,8 @@ public enum TheMiscItems{ DRILL_CORE("DrillCore", EnumRarity.UNCOMMON), BLACK_DYE("BlackDye", EnumRarity.EPIC), LENS("Lens", EnumRarity.UNCOMMON), - ENDER_STAR("EnderStar", EnumRarity.EPIC); + ENDER_STAR("EnderStar", EnumRarity.EPIC), + SPAWNER_SHARD("SpawnerShard", EnumRarity.EPIC); public final String name; public final EnumRarity rarity; diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index f4e03eefa..4b64811c4 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -411,6 +411,7 @@ item.actuallyadditions.itemPaxelCrystalGreen.name=Emeradic Crystal AIOT item.actuallyadditions.itemFoodBacon.name=Bacon item.actuallyadditions.itemMiscEnderStar.name=Ender Star item.actuallyadditions.itemSpawnerChanger.name=Spawner Changer +item.actuallyadditions.itemMiscSpawnerShard.name=Spawner Shards #Tooltips tooltip.actuallyadditions.onSuffix.desc=On @@ -781,4 +782,10 @@ booklet.actuallyadditions.chapter.phantomRedstoneface.name=Phantom Redstoneface booklet.actuallyadditions.chapter.phantomRedstoneface.text.1=If you don't know what Phantomfaces are, check the Phantomfaces Entry first. The Phantom Redstoneface can be used to transmit redstone signals. This one, however, works differently to the other Phantomfaces as it only works in one direction. What this means is that the connected block has to provide redstone power for redstone next to the Redstoneface to become powered. It does not work the other way around. booklet.actuallyadditions.chapter.rarmorModuleReconstructor.name=Reconstruction Module -booklet.actuallyadditions.chapter.rarmorModuleReconstructor.text.1=The Reconstruction Module can be used in the Rarmor. The Rarmor is a type of configurable armor that is added by the Rarmor Mod. If you want to use this module, place it inside the Rarmor GUI that is accessed by wearing the armor and opening your inventory. The module, when the player is sneaking, will shoot out a reconstruction beam that would be created by the Atomic Reconstructor without a lens. This will cause blocks that are hit to be reconstructed. \ No newline at end of file +booklet.actuallyadditions.chapter.rarmorModuleReconstructor.text.1=The Reconstruction Module can be used in the Rarmor. The Rarmor is a type of configurable armor that is added by the Rarmor Mod. If you want to use this module, place it inside the Rarmor GUI that is accessed by wearing the armor and opening your inventory. The module, when the player is sneaking, will shoot out a reconstruction beam that would be created by the Atomic Reconstructor without a lens. This will cause blocks that are hit to be reconstructed. + +booklet.actuallyadditions.chapter.spawnerShard.name=Spawner Shards +booklet.actuallyadditions.chapter.spawnerShard.text.1=The Spawner Shards are a crafting ingredient found by breaking spawners. Once a spawner in the world is broken, it will always drop one Shard. + +booklet.actuallyadditions.chapter.spawnerChanger.name=Spawner Changer +booklet.actuallyadditions.chapter.spawnerChanger.text.1=The Spawner Changer is an item that can be used to manipulate the mobs that spawners spawn. This can be accomplished by first of all picking up the desired mob to spawn with the Changer, killing it in the process. Next, the Changer can be right-clicked on the spawner, causing the spawner to be changed. This process probably won't work with every type of mob though. \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemMiscSpawnerShard.json b/src/main/resources/assets/actuallyadditions/models/item/itemMiscSpawnerShard.json new file mode 100644 index 000000000..9373701b2 --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/models/item/itemMiscSpawnerShard.json @@ -0,0 +1,6 @@ +{ + "parent": "actuallyadditions:item/standardItem", + "textures": { + "layer0": "actuallyadditions:items/itemMiscSpawnerShard" + } +} diff --git a/src/main/resources/assets/actuallyadditions/textures/items/itemMiscSpawnerShard.png b/src/main/resources/assets/actuallyadditions/textures/items/itemMiscSpawnerShard.png new file mode 100644 index 0000000000000000000000000000000000000000..2829b049006063701628e1a57fe958f91dd7c699 GIT binary patch literal 375 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6;>1s;*b z3=DjGK$vmro+3}6phSslL`iUdT1k0gQ7S`0VrE{6US4X6f{C7io@I`4ogYxmS5Ftm z5DWjML8tke3R4W~4?xNtl!JvaHPNZr+JK-|LS~ z_@eQ;J;&_q<>$}CJ_TQ9JNd&P$)ieS`nl)P%a823Q(eIEW+#(!bI1vqy9uf{Qd1K0 zS<_mDnLD0`%3eL-EHC-NtigPR#(~m&&z$s$j1A1%<&)2TDwukB4P)l?pv4{MuKrck zu4J*=WX}8`pqnRPgOZf!?!`shyiI4!GO7?{-N4-PHi&20vL2bzH{!qD<{vnm#ZWVQ zljtP>>@0>Q!N>MDSSi=8nsYQg>r}+r##$}QpFX}f|8XnvJqVt