From dcc08c25cd89e93d08ce34147d0a01e01d59c193 Mon Sep 17 00:00:00 2001 From: Lizbeth Rika Date: Tue, 7 Jul 2015 19:24:39 +0100 Subject: [PATCH] All of the tweaks needed for Garden of Glass to work, now to add the new stuff. --- .../subtile/functional/SubTileOrechid.java | 15 ++- .../common/crafting/ModCraftingRecipes.java | 35 +++++- .../crafting/ModManaAlchemyRecipes.java | 6 + .../crafting/ModManaInfusionRecipes.java | 5 + .../common/crafting/ModPetalRecipes.java | 7 +- .../vazkii/botania/common/item/ModItems.java | 1 + .../botania/common/lexicon/LexiconData.java | 6 +- .../vazkii/botania/common/lib/LibOreDict.java | 2 +- .../common/world/SkyblockWorldEvents.java | 114 ++++++++++++++++++ .../common/world/WorldTypeSkyblock.java | 50 +------- .../resources/assets/botania/lang/en_US.lang | 3 +- 11 files changed, 183 insertions(+), 61 deletions(-) create mode 100644 src/main/java/vazkii/botania/common/world/SkyblockWorldEvents.java diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileOrechid.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileOrechid.java index 5ceb82bd2..db5bde6de 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileOrechid.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileOrechid.java @@ -26,12 +26,16 @@ import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.RadiusDescriptor; import vazkii.botania.api.subtile.SubTileFunctional; +import vazkii.botania.common.Botania; import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.lexicon.LexiconData; public class SubTileOrechid extends SubTileFunctional { private static final int COST = 17500; + private static final int COST_GOG = 250; + private static final int DELAY = 100; + private static final int DELAY_GOG = 2; private static final int RANGE = 5; private static final int RANGE_Y = 3; @@ -42,7 +46,8 @@ public class SubTileOrechid extends SubTileFunctional { if(redstoneSignal > 0 || !canOperate()) return; - if(!supertile.getWorldObj().isRemote && mana >= COST && ticksExisted % 100 == 0) { + int cost = getCost(); + if(!supertile.getWorldObj().isRemote && mana >= cost && ticksExisted % getDelay() == 0) { ChunkCoordinates coords = getCoordsToPut(); if(coords != null) { ItemStack stack = getOreToPut(); @@ -54,7 +59,7 @@ public class SubTileOrechid extends SubTileFunctional { supertile.getWorldObj().playAuxSFX(2001, coords.posX, coords.posY, coords.posZ, Block.getIdFromBlock(block) + (meta << 12)); supertile.getWorldObj().playSoundEffect(supertile.xCoord, supertile.yCoord, supertile.zCoord, "botania:orechid", 2F, 1F); - mana -= COST; + mana -= cost; sync(); } } @@ -124,9 +129,13 @@ public class SubTileOrechid extends SubTileFunctional { } public int getCost() { - return COST; + return Botania.gardenOfGlassLoaded ? COST_GOG : COST; } + public int getDelay() { + return Botania.gardenOfGlassLoaded ? DELAY_GOG : DELAY; + } + @Override public RadiusDescriptor getRadius() { return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE); diff --git a/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java b/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java index e8898ffc0..ee5fec466 100644 --- a/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java +++ b/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java @@ -265,6 +265,12 @@ public final class ModCraftingRecipes { public static IRecipe recipeCanopyDrum; public static IRecipe recipeSparkChanger; + // Garden of Glass + public static IRecipe recipeRootToSapling; + public static IRecipe recipeRootToFertilizer; + public static IRecipe recipePebbleCobblestone; + public static IRecipe recipeMagmaToSlimeball; + public static void init() { // Lexicon Recipe addShapelessOreDictRecipe(new ItemStack(ModItems.lexicon), "treeSapling", Items.book); @@ -320,7 +326,7 @@ public final class ModCraftingRecipes { "WWW", "GP ", "WWW", 'W', LibOreDict.LIVING_WOOD, 'P', LibOreDict.PETAL[i], - 'G', "ingotGold"); + 'G', Botania.gardenOfGlassLoaded ? LibOreDict.LIVING_WOOD : "ingotGold"); recipesSpreader = BotaniaAPI.getLatestAddedRecipes(16); // Mana Lens Recipe @@ -507,7 +513,7 @@ public final class ModCraftingRecipes { recipeTurntable = BotaniaAPI.getLatestAddedRecipe(); // Fertilizer Recipes - GameRegistry.addShapelessRecipe(new ItemStack(ModItems.fertilizer), new ItemStack(Items.dye, 1, 15), new ItemStack(ModItems.dye, 1, Short.MAX_VALUE), new ItemStack(ModItems.dye, 1, Short.MAX_VALUE), new ItemStack(ModItems.dye, 1, Short.MAX_VALUE), new ItemStack(ModItems.dye, 1, Short.MAX_VALUE)); + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.fertilizer, Botania.gardenOfGlassLoaded ? 3 : 1), new ItemStack(Items.dye, 1, 15), new ItemStack(ModItems.dye, 1, Short.MAX_VALUE), new ItemStack(ModItems.dye, 1, Short.MAX_VALUE), new ItemStack(ModItems.dye, 1, Short.MAX_VALUE), new ItemStack(ModItems.dye, 1, Short.MAX_VALUE)); recipeFertilizerPowder = BotaniaAPI.getLatestAddedRecipe(); GameRegistry.addShapelessRecipe(new ItemStack(ModItems.fertilizer), new ItemStack(Items.dye, 1, 15), new ItemStack(Items.dye, 1, 11), new ItemStack(Items.dye, 1, 11), new ItemStack(Items.dye, 1, 1), new ItemStack(Items.dye, 1, 1)); recipeFerilizerDye = BotaniaAPI.getLatestAddedRecipe(); @@ -1695,9 +1701,9 @@ public final class ModCraftingRecipes { // Blaze Light Recipe addOreDictRecipe(new ItemStack(ModBlocks.blazeBlock), "BBB", "BBB", "BBB", - 'B', "rodBlaze"); + 'B', Botania.gardenOfGlassLoaded ? "powderBlaze" : "rodBlaze"); recipeBlazeBlock = BotaniaAPI.getLatestAddedRecipe(); - addShapelessOreDictRecipe(new ItemStack(Items.blaze_rod, 9), LibOreDict.BLAZE_BLOCK); + addShapelessOreDictRecipe(new ItemStack(Botania.gardenOfGlassLoaded ? Items.blaze_powder : Items.blaze_rod, 9), LibOreDict.BLAZE_BLOCK); // Metamorphic Petal Apothecary Recipes for(int i = 0; i < 8; i++) @@ -1855,8 +1861,29 @@ public final class ModCraftingRecipes { // Misc Recipes GameRegistry.addShapelessRecipe(new ItemStack(Items.reeds, 9, 0), new ItemStack(ModBlocks.reedBlock)); GameRegistry.addShapelessRecipe(new ItemStack(Items.wheat, 4, 0), new ItemStack(ModBlocks.thatch)); + + if(Botania.gardenOfGlassLoaded) + initGardenOfGlass(); } + private static void initGardenOfGlass() { + // Root to Sapling + addShapelessOreDictRecipe(new ItemStack(Blocks.sapling), LibOreDict.ROOT, LibOreDict.ROOT, LibOreDict.ROOT, LibOreDict.ROOT); + recipeRootToSapling = BotaniaAPI.getLatestAddedRecipe(); + + // Root to Fertilizer + addShapelessOreDictRecipe(new ItemStack(ModItems.fertilizer), LibOreDict.ROOT); + recipeRootToFertilizer = BotaniaAPI.getLatestAddedRecipe(); + + // Pebble to Cobble + addShapelessOreDictRecipe(new ItemStack(Blocks.cobblestone), LibOreDict.PEBBLE, LibOreDict.PEBBLE, LibOreDict.PEBBLE, LibOreDict.PEBBLE); + recipePebbleCobblestone = BotaniaAPI.getLatestAddedRecipe(); + + // Magma Pearl to Slimeball + addShapelessOreDictRecipe(new ItemStack(Items.slime_ball), new ItemStack(Items.magma_cream), new ItemStack(Items.water_bucket)); + recipeMagmaToSlimeball = BotaniaAPI.getLatestAddedRecipe(); + } + private static void addStairsAndSlabs(Block block, int meta, Block stairs, Block slab) { GameRegistry.addRecipe(new ItemStack(slab, 6), "QQQ", diff --git a/src/main/java/vazkii/botania/common/crafting/ModManaAlchemyRecipes.java b/src/main/java/vazkii/botania/common/crafting/ModManaAlchemyRecipes.java index db4e7bef8..5d8f04648 100644 --- a/src/main/java/vazkii/botania/common/crafting/ModManaAlchemyRecipes.java +++ b/src/main/java/vazkii/botania/common/crafting/ModManaAlchemyRecipes.java @@ -49,6 +49,7 @@ public final class ModManaAlchemyRecipes { public static RecipeManaInfusion coarseDirtRecipe; public static RecipeManaInfusion prismarineRecipe; public static List stoneRecipes; + public static List tallgrassRecipes; public static void init() { leatherRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.leather), new ItemStack(Items.rotten_flesh), 600); @@ -135,5 +136,10 @@ public final class ModManaAlchemyRecipes { for(int i = 0; i < 4; i++) stoneRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(ModFluffBlocks.stone, 1, i), new ItemStack(ModFluffBlocks.stone, 1, i == 0 ? 3 : i - 1), 200)); } + + tallgrassRecipes = new ArrayList(); + tallgrassRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.deadbush), new ItemStack(Blocks.tallgrass, 1, 2), 500)); + tallgrassRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.tallgrass, 1, 1), new ItemStack(Blocks.deadbush), 500)); + tallgrassRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.tallgrass, 1, 2), new ItemStack(Blocks.tallgrass, 1, 1), 500)); } } diff --git a/src/main/java/vazkii/botania/common/crafting/ModManaInfusionRecipes.java b/src/main/java/vazkii/botania/common/crafting/ModManaInfusionRecipes.java index eee028b70..8c5e75398 100644 --- a/src/main/java/vazkii/botania/common/crafting/ModManaInfusionRecipes.java +++ b/src/main/java/vazkii/botania/common/crafting/ModManaInfusionRecipes.java @@ -43,6 +43,8 @@ public final class ModManaInfusionRecipes { public static RecipeManaInfusion managlassRecipe; public static RecipeManaInfusion manaStringRecipe; + public static RecipeManaInfusion sugarCaneRecipe; + public static void init() { poolRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModBlocks.pool), new ItemStack(ModBlocks.pool, 1, 2), 320); @@ -80,6 +82,9 @@ public final class ModManaInfusionRecipes { managlassRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModBlocks.manaGlass), new ItemStack(Blocks.glass), 150); manaStringRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaResource, 1, 16), new ItemStack(Items.string), 5000); + if(Botania.gardenOfGlassLoaded) + sugarCaneRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(Items.reeds), new ItemStack(Blocks.hay_block), 2000); + BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaBottle), new ItemStack(Items.glass_bottle), 5000); } diff --git a/src/main/java/vazkii/botania/common/crafting/ModPetalRecipes.java b/src/main/java/vazkii/botania/common/crafting/ModPetalRecipes.java index 151abbaba..85e967533 100644 --- a/src/main/java/vazkii/botania/common/crafting/ModPetalRecipes.java +++ b/src/main/java/vazkii/botania/common/crafting/ModPetalRecipes.java @@ -16,6 +16,7 @@ import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.recipe.RecipePetals; +import vazkii.botania.common.Botania; import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.item.block.ItemBlockSpecialFlower; @@ -94,7 +95,11 @@ public final class ModPetalRecipes { dreadthorneRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_DREADTHORN), blackMana, purpleMana, cyan, cyan, black, purple, redstoneRoot); heiseiDreamRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_HEISEI_DREAM), purpleMana, pinkMana, magentaMana, purple, pink, magenta, runeWrath, pixieDust); tigerseyeRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_TIGERSEYE), yellow, brownMana, orangeMana, lime, runeAutumn); - orechidRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_ORECHID), gray, grayMana, lightGray, lightGrayMana, lightBlue, yellow, green, red, runePride, runeSloth, redstoneRoot, pixieDust); + + if(Botania.gardenOfGlassLoaded) + orechidRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_ORECHID), gray, grayMana, lightGray, lightGrayMana, lightBlue, yellow, green, red); + else orechidRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_ORECHID), gray, grayMana, lightGray, lightGrayMana, lightBlue, yellow, green, red, runePride, runeSloth, redstoneRoot, pixieDust); + orechidIgnemRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_ORECHID_IGNEM), red, redMana, black, blackMana, white, white, blue, yellow, runePride, runeSloth, redstoneRoot, pixieDust); if(ConfigHandler.fallenKanadeEnabled) fallenKanadeRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_FALLEN_KANADE), white, whiteMana, whiteMana, yellowMana, orangeMana, brownMana, runeSpring); diff --git a/src/main/java/vazkii/botania/common/item/ModItems.java b/src/main/java/vazkii/botania/common/item/ModItems.java index 45c342ed9..c75307d0e 100644 --- a/src/main/java/vazkii/botania/common/item/ModItems.java +++ b/src/main/java/vazkii/botania/common/item/ModItems.java @@ -420,5 +420,6 @@ public final class ModItems { BotaniaAPI.blackListItemFromLoonium(Item.getItemById(i)); OreDictionary.registerOre("rodBlaze", Items.blaze_rod); + OreDictionary.registerOre("powderBlaze", Items.blaze_powder); } } diff --git a/src/main/java/vazkii/botania/common/lexicon/LexiconData.java b/src/main/java/vazkii/botania/common/lexicon/LexiconData.java index 06488c6c3..36647712b 100644 --- a/src/main/java/vazkii/botania/common/lexicon/LexiconData.java +++ b/src/main/java/vazkii/botania/common/lexicon/LexiconData.java @@ -425,8 +425,10 @@ public final class LexiconData { tigerseye = new BLexiconEntry(LibLexicon.FFLOWER_TIGERSEYE, categoryFunctionalFlowers); tigerseye.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.tigerseyeRecipe)); - orechid = new ALexiconEntry(LibLexicon.FFLOWER_ORECHID, categoryFunctionalFlowers); + orechid = Botania.gardenOfGlassLoaded ? new BLexiconEntry(LibLexicon.FFLOWER_ORECHID, categoryFunctionalFlowers) : new ALexiconEntry(LibLexicon.FFLOWER_ORECHID, categoryFunctionalFlowers); orechid.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.orechidRecipe)); + if(Botania.gardenOfGlassLoaded) + orechid.setPriority(); orechidIgnem = new ALexiconEntry(LibLexicon.FFLOWER_ORECHID_IGNEM, categoryFunctionalFlowers); orechidIgnem.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.orechidIgnemRecipe)); @@ -546,7 +548,7 @@ public final class LexiconData { new PageManaInfusionRecipe("10", ModManaAlchemyRecipes.fishRecipes), new PageManaInfusionRecipe("11", ModManaAlchemyRecipes.cropRecipes), new PageManaInfusionRecipe("12", ModManaAlchemyRecipes.potatoRecipe), new PageManaInfusionRecipe("13", ModManaAlchemyRecipes.netherWartRecipe), new PageManaInfusionRecipe("14", ModManaAlchemyRecipes.gunpowderAndFlintRecipes), new PageManaInfusionRecipe("15", ModManaAlchemyRecipes.nameTagRecipe), new PageManaInfusionRecipe("16", ModManaAlchemyRecipes.stringRecipes), new PageManaInfusionRecipe("17", ModManaAlchemyRecipes.slimeballCactusRecipes), new PageManaInfusionRecipe("18", ModManaAlchemyRecipes.enderPearlRecipe), new PageManaInfusionRecipe("19", ModManaAlchemyRecipes.redstoneToGlowstoneRecipes), new PageManaInfusionRecipe("20", ModManaAlchemyRecipes.sandRecipe), new PageManaInfusionRecipe("21", ModManaAlchemyRecipes.redSandRecipe), - new PageManaInfusionRecipe("22", ModManaAlchemyRecipes.clayBreakdownRecipes), new PageManaInfusionRecipe("23", ModManaAlchemyRecipes.coarseDirtRecipe)); + new PageManaInfusionRecipe("22", ModManaAlchemyRecipes.clayBreakdownRecipes), new PageManaInfusionRecipe("24", ModManaAlchemyRecipes.tallgrassRecipes), new PageManaInfusionRecipe("23", ModManaAlchemyRecipes.coarseDirtRecipe)); openCrate = new BLexiconEntry(LibLexicon.DEVICE_OPEN_CRATE, categoryDevices); openCrate.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeOpenCrate)); diff --git a/src/main/java/vazkii/botania/common/lib/LibOreDict.java b/src/main/java/vazkii/botania/common/lib/LibOreDict.java index 3af3e791a..ff4825353 100644 --- a/src/main/java/vazkii/botania/common/lib/LibOreDict.java +++ b/src/main/java/vazkii/botania/common/lib/LibOreDict.java @@ -38,7 +38,7 @@ public final class LibOreDict { public static final String MANASTEEL_NUGGET = "nuggetManasteel"; public static final String TERRASTEEL_NUGGET = "nuggetTerrasteel"; public static final String ELEMENTIUM_NUGGET = "nuggetElvenElementium"; - public static final String ROOT = "root"; + public static final String ROOT = "livingRoot"; public static final String PEBBLE = "pebble"; public static final String VIAL = "bVial"; diff --git a/src/main/java/vazkii/botania/common/world/SkyblockWorldEvents.java b/src/main/java/vazkii/botania/common/world/SkyblockWorldEvents.java new file mode 100644 index 000000000..9192f8812 --- /dev/null +++ b/src/main/java/vazkii/botania/common/world/SkyblockWorldEvents.java @@ -0,0 +1,114 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + * + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + * + * File Created @ [Jul 7, 2015, 6:14:18 PM (GMT)] + */ +package vazkii.botania.common.world; + +import java.awt.Color; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import net.minecraftforge.event.entity.player.PlayerInteractEvent; +import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action; +import net.minecraftforge.event.world.BlockEvent.HarvestDropsEvent; +import vazkii.botania.common.block.ModBlocks; +import vazkii.botania.common.block.tile.TileManaFlame; +import vazkii.botania.common.item.ModItems; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public final class SkyblockWorldEvents { + + @SubscribeEvent + public void onPlayerUpdate(LivingUpdateEvent event) { + if(event.entityLiving instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) event.entityLiving; + World world = player.worldObj; + if(WorldTypeSkyblock.isWorldSkyblock(world)) { + ChunkCoordinates coords = world.getSpawnPoint(); + if(world.getBlock(coords.posX, coords.posY - 4, coords.posZ) != Blocks.bedrock) { + createSkyblock(world, coords.posX, coords.posY, coords.posZ); + + if(player instanceof EntityPlayerMP) { + EntityPlayerMP pmp = (EntityPlayerMP) player; + pmp.setPositionAndUpdate(coords.posX + 0.5, coords.posY + 1.6, coords.posZ + 0.5); + pmp.inventory.addItemStackToInventory(new ItemStack(ModItems.lexicon)); + } + } + } + } + } + + @SubscribeEvent + public void onPlayerInteract(PlayerInteractEvent event) { + if(WorldTypeSkyblock.isWorldSkyblock(event.world) && event.action == Action.RIGHT_CLICK_BLOCK && event.entityPlayer.getCurrentEquippedItem() == null && event.entityPlayer.isSneaking()) { + Block block = event.world.getBlock(event.x, event.y, event.z); + if(block == Blocks.grass || block == Blocks.dirt) { + if(event.world.isRemote) + event.entityPlayer.swingItem(); + else event.world.playSoundEffect(event.x + 0.5, event.y + 0.5, event.z + 0.5, block.stepSound.getBreakSound(), block.stepSound.getVolume() * 0.4F, block.stepSound.getPitch() + (float) (Math.random() * 0.2 - 0.1)); + + if(event.world.rand.nextInt(3) == 0) + event.entityPlayer.inventory.addItemStackToInventory(new ItemStack(ModItems.manaResource, 1, 21)); + } + } + } + + @SubscribeEvent + public void onDrops(HarvestDropsEvent event) { + if(WorldTypeSkyblock.isWorldSkyblock(event.world) && event.block == Blocks.tallgrass) { + ItemStack stackToRemove = null; + for(ItemStack stack : event.drops) + if(stack.getItem() == Items.wheat_seeds && event.world.rand.nextInt(10) == 0) { + stackToRemove = stack; + break; + } + + if(stackToRemove != null) { + event.drops.remove(stackToRemove); + event.drops.add(new ItemStack(event.world.rand.nextBoolean() ? Items.pumpkin_seeds : Items.melon_seeds)); + } + } + } + + public void createSkyblock(World world, int x, int y, int z) { + for(int i = 0; i < 3; i++) + for(int j = 0; j < 4; j++) + for(int k = 0; k < 3; k++) + world.setBlock(x - 1 + i, y - 1 - j, z - 1 + k, j == 0 ? Blocks.grass : Blocks.dirt); + world.setBlock(x - 1, y - 2, z, Blocks.flowing_water); + world.setBlock(x + 1, y + 2, z + 1, ModBlocks.manaFlame); + ((TileManaFlame) world.getTileEntity(x + 1, y + 2, z + 1)).setColor(new Color(70 + world.rand.nextInt(185), 70 + world.rand.nextInt(185), 70 + world.rand.nextInt(185)).getRGB()); + + int[][] rootPositions = new int[][] { + { -1, -3, -1 }, + { -2, -4, -1 }, + { -2, -4, -2 }, + { +1, -4, -1 }, + { +1, -5, -1 }, + { +2, -5, -1 }, + { +2, -6, +0 }, + { +0, -4, +2 }, + { +0, -5, +2 }, + { +0, -5, +3 }, + { +0, -6, +3 }, + }; + for(int[] root : rootPositions) + world.setBlock(x + root[0], y + root[1], z + root[2], ModBlocks.root); + + world.setBlock(x, y - 4, z, Blocks.bedrock); + } + +} diff --git a/src/main/java/vazkii/botania/common/world/WorldTypeSkyblock.java b/src/main/java/vazkii/botania/common/world/WorldTypeSkyblock.java index 39df20308..bd1ac44da 100644 --- a/src/main/java/vazkii/botania/common/world/WorldTypeSkyblock.java +++ b/src/main/java/vazkii/botania/common/world/WorldTypeSkyblock.java @@ -29,7 +29,7 @@ public class WorldTypeSkyblock extends WorldType { public WorldTypeSkyblock() { super("botania-skyblock"); - MinecraftForge.EVENT_BUS.register(this); + MinecraftForge.EVENT_BUS.register(new SkyblockWorldEvents()); } public static boolean isWorldSkyblock(World world) { @@ -61,57 +61,9 @@ public class WorldTypeSkyblock extends WorldType { return 260f; } - @Override public IChunkProvider getChunkGenerator(World world, String generatorOptions) { return new ChunkProviderFlat(world, world.getSeed(), false, "2;1x0;"); } - @SubscribeEvent - public void onPlayerUpdate(LivingUpdateEvent event) { - if(event.entityLiving instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer) event.entityLiving; - World world = player.worldObj; - if(isWorldSkyblock(world)) { - ChunkCoordinates coords = world.getSpawnPoint(); - if(world.getBlock(coords.posX, coords.posY - 4, coords.posZ) != Blocks.bedrock) { - createSkyblock(world, coords.posX, coords.posY, coords.posZ); - - if(player instanceof EntityPlayerMP) { - EntityPlayerMP pmp = (EntityPlayerMP) player; - pmp.setPositionAndUpdate(coords.posX + 0.5, coords.posY + 1.6, coords.posZ + 0.5); - pmp.inventory.addItemStackToInventory(new ItemStack(ModItems.lexicon)); - } - } - } - } - } - - public void createSkyblock(World world, int x, int y, int z) { - for(int i = 0; i < 3; i++) - for(int j = 0; j < 4; j++) - for(int k = 0; k < 3; k++) - world.setBlock(x - 1 + i, y - 1 - j, z - 1 + k, j == 0 ? Blocks.grass : Blocks.dirt); - world.setBlock(x - 1, y - 2, z, Blocks.flowing_water); - world.setBlock(x + 1, y + 2, z + 1, ModBlocks.manaFlame); - - int[][] rootPositions = new int[][] { - { -1, -3, -1 }, - { -2, -4, -1 }, - { -2, -4, -2 }, - { +1, -4, -1 }, - { +1, -5, -1 }, - { +2, -5, -1 }, - { +2, -6, +0 }, - { +0, -4, +2 }, - { +0, -5, +2 }, - { +0, -5, +3 }, - { +0, -6, +3 }, - }; - for(int[] root : rootPositions) - world.setBlock(x + root[0], y + root[1], z + root[2], ModBlocks.root); - - world.setBlock(x, y - 4, z, Blocks.bedrock); - } - } diff --git a/src/main/resources/assets/botania/lang/en_US.lang b/src/main/resources/assets/botania/lang/en_US.lang index 07d7bc4ed..b413a33c1 100644 --- a/src/main/resources/assets/botania/lang/en_US.lang +++ b/src/main/resources/assets/botania/lang/en_US.lang @@ -1786,7 +1786,7 @@ botania.page.tigerseye1=&oRisin' up to the challenge of our rivals&r. # -- ORECHID botania.entry.orechid=Orechid -botania.page.orechid0=While going mining is all good, a renewable means of getting ore is due. The &1Orechid&0 will use (a massive amount of) &4Mana&0 to generate &4ores&0 in nearby &1Stone&0 blocks.
The ores it generates are random, but seem to be biased towards more common ores rather than rarer ones. +botania.page.orechid0=While going mining is all good, a renewable, sedentary, means of getting ore is due. The &1Orechid&0 will use &4Mana&0 to generate &4ores&0 in nearby &1Stone&0 blocks.
The ores it generates are random, but seem to be biased towards more common ores rather than rarer ones. botania.page.orechid1=&oNot dragon poop&r. # -- ORECHID IGNEM @@ -2024,6 +2024,7 @@ botania.page.manaAlchemy20=Breaking &1Cobblestone&0 into &1Sand&0 botania.page.manaAlchemy21=Breaking &1Hardened Clay&0 into &1Red Sand&0 botania.page.manaAlchemy22=Breaking down &1Clay&0 and &1Bricks&0 botania.page.manaAlchemy23=Making &1Coarse Dirt&0 +botania.page.manaAlchemy24=Transmuting &1Tall Grass&0 types # -- BOTANICAL BREWERY botania.entry.brewery=Botanical Brewery