mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-14 01:04:16 +00:00
Finish up the Garden of Glass worldgen.
This commit is contained in:
1 parent
730b1d6e48
commit
e15a448be1
13 files changed
+99
-12
No files matched your search
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. 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, 4:27:47 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockRoot extends BlockMod {
|
||||
|
||||
public BlockRoot() {
|
||||
super(Material.plants);
|
||||
setHardness(1.2F);
|
||||
setStepSound(soundTypeWood);
|
||||
setBlockName(LibBlockNames.ROOT);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
|
||||
return ModItems.manaResource;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int p_149692_1_) {
|
||||
return 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random r) {
|
||||
return 2 + r.nextInt(2);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -231,6 +231,7 @@ public final class ModBlocks {
|
||||
public static Block hourglass;
|
||||
public static Block ghostRail;
|
||||
public static Block sparkChanger;
|
||||
public static Block root;
|
||||
|
||||
public static void init() {
|
||||
flower = new BlockModFlower();
|
||||
@@ -305,7 +306,8 @@ public final class ModBlocks {
|
||||
hourglass = new BlockHourglass();
|
||||
ghostRail = new BlockGhostRail();
|
||||
sparkChanger = new BlockSparkChanger();
|
||||
|
||||
root = new BlockRoot();
|
||||
|
||||
ModFluffBlocks.init();
|
||||
|
||||
for(int i = 0; i < 16; i++)
|
||||
|
||||
@@ -107,6 +107,8 @@ public final class BotaniaCreativeTab extends CreativeTabs {
|
||||
addBlock(ModBlocks.spawnerClaw);
|
||||
addItem(ModItems.blackHoleTalisman);
|
||||
|
||||
if(Botania.gardenOfGlassLoaded)
|
||||
addBlock(ModBlocks.root);
|
||||
addBlock(ModBlocks.livingrock);
|
||||
addBlock(ModBlocks.livingwood);
|
||||
addBlock(ModBlocks.openCrate);
|
||||
|
||||
@@ -405,6 +405,8 @@ public final class ModItems {
|
||||
OreDictionary.registerOre(LibOreDict.MANASTEEL_NUGGET, new ItemStack(manaResource, 1, 17));
|
||||
OreDictionary.registerOre(LibOreDict.TERRASTEEL_NUGGET, new ItemStack(manaResource, 1, 18));
|
||||
OreDictionary.registerOre(LibOreDict.ELEMENTIUM_NUGGET, new ItemStack(manaResource, 1, 19));
|
||||
OreDictionary.registerOre(LibOreDict.ROOT, new ItemStack(manaResource, 1, 20));
|
||||
OreDictionary.registerOre(LibOreDict.PEBBLE, new ItemStack(manaResource, 1, 21));
|
||||
|
||||
OreDictionary.registerOre(LibOreDict.VIAL, new ItemStack(vial, 1, 0));
|
||||
OreDictionary.registerOre(LibOreDict.FLASK, new ItemStack(vial, 1, 1));
|
||||
|
||||
@@ -45,7 +45,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemManaResource extends ItemMod implements IFlowerComponent, IElvenItem, IPickupAchievement {
|
||||
|
||||
final int types = 20;
|
||||
final int types = 22;
|
||||
IIcon[] icons;
|
||||
|
||||
public IIcon tailIcon = null;
|
||||
@@ -115,7 +115,8 @@ public class ItemManaResource extends ItemMod implements IFlowerComponent, IElve
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for(int i = 0; i < types; i++)
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
if(Botania.gardenOfGlassLoaded || (i != 20 && i != 21))
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -87,6 +87,7 @@ public final class LibBlockNames {
|
||||
public static final String HOURGLASS = "hourglass";
|
||||
public static final String GHOST_RAIL = "ghostRail";
|
||||
public static final String SPARK_CHANGER = "sparkChanger";
|
||||
public static final String ROOT = "root";
|
||||
|
||||
public static final String SUBTILE_PUREDAISY = "puredaisy";
|
||||
public static final String SUBTILE_MANASTAR = "manastar";
|
||||
|
||||
@@ -187,6 +187,8 @@ public final class LibItemNames {
|
||||
"manaString",
|
||||
"manasteelNugget",
|
||||
"terrasteelNugget",
|
||||
"elementiumNugget"
|
||||
"elementiumNugget",
|
||||
"root",
|
||||
"pebble"
|
||||
};
|
||||
}
|
||||
@@ -38,6 +38,8 @@ 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 PEBBLE = "pebble";
|
||||
|
||||
public static final String VIAL = "bVial";
|
||||
public static final String FLASK = "bFlask";
|
||||
|
||||
@@ -13,15 +13,16 @@ package vazkii.botania.common.world;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldType;
|
||||
import net.minecraft.world.biome.WorldChunkManager;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.ChunkProviderFlat;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public class WorldTypeSkyblock extends WorldType {
|
||||
@@ -74,20 +75,43 @@ public class WorldTypeSkyblock extends WorldType {
|
||||
if(isWorldSkyblock(world)) {
|
||||
ChunkCoordinates coords = world.getSpawnPoint();
|
||||
if(world.getBlock(coords.posX, coords.posY - 4, coords.posZ) != Blocks.bedrock) {
|
||||
for(int i = 0; i < 3; i++)
|
||||
for(int j = 0; j < 4; j++)
|
||||
for(int k = 0; k < 3; k++)
|
||||
world.setBlock(coords.posX - 1 + i, coords.posY - 1 - j, coords.posZ - 1 + k, j == 0 ? Blocks.grass : Blocks.dirt);
|
||||
world.setBlock(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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user