mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-20 04:09:40 +00:00
Added World Seeds.
This commit is contained in:
1 parent
1dd20a8a11
commit
091e8f0d3f
6 files changed
+55
No files matched your search
@@ -91,6 +91,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
|
||||
addItem(ModItems.slingshot);
|
||||
addItem(ModItems.vineBall);
|
||||
addItem(ModItems.regenIvy);
|
||||
addItem(ModItems.worldSeed);
|
||||
if(Botania.thaumcraftLoaded)
|
||||
addItem(ModItems.manaInkwell);
|
||||
addBlock(ModBlocks.forestDrum);
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* 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 a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* File Created @ [Jan 25, 2015, 12:27:31 AM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.item;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemWorldSeed extends ItemMod {
|
||||
|
||||
public ItemWorldSeed() {
|
||||
setUnlocalizedName(LibItemNames.WORLD_SEED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
ChunkCoordinates coords = world.getSpawnPoint();
|
||||
|
||||
if(MathHelper.pointDistanceSpace(coords.posX + 0.5, coords.posY + 0.5, coords.posZ + 0.5, player.posX, player.posY, player.posZ) > 24) {
|
||||
player.rotationPitch = 0F;
|
||||
player.rotationYaw = 0F;
|
||||
player.setPositionAndUpdate(coords.posX + 0.5, coords.posY + 1.6, coords.posZ + 0.5);
|
||||
|
||||
while(!world.getCollidingBoundingBoxes(player, player.boundingBox).isEmpty())
|
||||
player.setPositionAndUpdate(player.posX, player.posY + 1, player.posZ);
|
||||
|
||||
world.playSoundAtEntity(player, "mob.endermen.portal", 1F, 1F);
|
||||
for(int i = 0; i < 50; i++)
|
||||
Botania.proxy.sparkleFX(world, player.posX + Math.random() * player.width, player.posY - 1.6 + Math.random() * player.height, player.posZ + Math.random() * player.width, 0.25F, 1F, 0.25F, 1F, 10);
|
||||
|
||||
stack.stackSize--;
|
||||
}
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -196,6 +196,7 @@ public final class ModItems {
|
||||
public static Item clip;
|
||||
public static Item cobbleRod;
|
||||
public static Item smeltRod;
|
||||
public static Item worldSeed;
|
||||
|
||||
public static void init() {
|
||||
lexicon = new ItemLexicon();
|
||||
@@ -299,6 +300,7 @@ public final class ModItems {
|
||||
clip = new ItemClip();
|
||||
cobbleRod = new ItemCobbleRod();
|
||||
smeltRod = new ItemSmeltRod();
|
||||
worldSeed = new ItemWorldSeed();
|
||||
|
||||
OreDictionary.registerOre(LibOreDict.LEXICON, lexicon);
|
||||
for(int i = 0; i < 16; i++) {
|
||||
|
||||
@@ -115,6 +115,7 @@ public final class LibItemNames {
|
||||
public static final String CLIP = "clip";
|
||||
public static final String COBBLE_ROD = "cobbleRod";
|
||||
public static final String SMELT_ROD = "smeltRod";
|
||||
public static final String WORLD_SEED = "worldSeed";
|
||||
|
||||
public static final String[] LENS_NAMES = new String[] {
|
||||
"lensNormal",
|
||||
|
||||
Reference in new issue
Block a user