mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-19 03:39:17 +00:00
Slime in a bottle
This commit is contained in:
1 parent
7f6a9f0a5e
commit
148926490d
12 files changed
+80
-1
No files matched your search
@@ -91,7 +91,7 @@ public class SubTileNarslimmus extends SubTileGenerating {
|
||||
event.entityLiving.getEntityData().setBoolean(TAG_WORLD_SPAWNED, true);
|
||||
}
|
||||
|
||||
public boolean isSlimeChunk(World world, int x, int z) {
|
||||
public static boolean isSlimeChunk(World world, int x, int z) {
|
||||
Chunk chunk = world.getChunkFromBlockCoords(x, z);
|
||||
return chunk.getRandomWithSeed(987234911L).nextInt(10) == 0;
|
||||
}
|
||||
|
||||
@@ -108,6 +108,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
|
||||
addItem(ModItems.spawnerMover);
|
||||
addBlock(ModBlocks.spawnerClaw);
|
||||
addBlock(ModBlocks.cocoon);
|
||||
addItem(ModItems.slimeBottle);
|
||||
addItem(ModItems.blackHoleTalisman);
|
||||
|
||||
if(Botania.gardenOfGlassLoaded) {
|
||||
|
||||
@@ -275,6 +275,7 @@ public final class ModCraftingRecipes {
|
||||
public static IRecipe recipeCacophonium;
|
||||
public static IRecipe recipeManaBomb;
|
||||
public static IRecipe recipeCobweb;
|
||||
public static IRecipe recipeSlimeBottle;
|
||||
|
||||
// Garden of Glass
|
||||
public static IRecipe recipeRootToSapling;
|
||||
@@ -1867,6 +1868,14 @@ public final class ModCraftingRecipes {
|
||||
'M', LibOreDict.MANA_STRING);
|
||||
recipeCobweb = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
// Slime in a Bottle Recipe
|
||||
addOreDictRecipe(new ItemStack(ModItems.slimeBottle),
|
||||
"EGE", "ESE", " E ",
|
||||
'E', LibOreDict.ELEMENTIUM,
|
||||
'G', new ItemStack(ModBlocks.elfGlass),
|
||||
'S', new ItemStack(Items.slime_ball));
|
||||
recipeSlimeBottle = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
// Storage Block/Nugget Recipes
|
||||
addOreDictRecipe(new ItemStack(ModBlocks.storage, 1, 0),
|
||||
"III", "III", "III",
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* 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 @ [Aug 17, 2015, 1:32:58 AM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.item;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.block.subtile.generating.SubTileNarslimmus;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemSlimeBottle extends ItemMod {
|
||||
|
||||
IIcon activeIcon;
|
||||
|
||||
public ItemSlimeBottle() {
|
||||
setUnlocalizedName(LibItemNames.SLIME_BOTTLE);
|
||||
setMaxStackSize(1);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
itemIcon = IconHelper.forItem(par1IconRegister, this, 0);
|
||||
activeIcon = IconHelper.forItem(par1IconRegister, this, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIconFromDamage(int dmg) {
|
||||
return dmg == 0 ? itemIcon : activeIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack stack, World world, Entity entity, int something, boolean somethingelse) {
|
||||
int x = MathHelper.floor_double(entity.posX);
|
||||
int z = MathHelper.floor_double(entity.posZ);
|
||||
boolean slime = SubTileNarslimmus.SpawnIntercepter.isSlimeChunk(world, x, z);
|
||||
int meta = stack.getItemDamage();
|
||||
int newMeta = slime ? 1 : 0;
|
||||
if(meta != newMeta)
|
||||
stack.setItemDamage(newMeta);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -246,6 +246,7 @@ public final class ModItems {
|
||||
public static Item waterBowl;
|
||||
public static Item obedienceStick;
|
||||
public static Item cacophonium;
|
||||
public static Item slimeBottle;
|
||||
|
||||
public static void init() {
|
||||
lexicon = new ItemLexicon();
|
||||
@@ -382,6 +383,7 @@ public final class ModItems {
|
||||
waterBowl = new ItemWaterBowl();
|
||||
obedienceStick = new ItemObedienceStick();
|
||||
cacophonium = new ItemCacophonium();
|
||||
slimeBottle = new ItemSlimeBottle();
|
||||
|
||||
OreDictionary.registerOre(LibOreDict.LEXICON, lexicon);
|
||||
for(int i = 0; i < 16; i++) {
|
||||
|
||||
@@ -194,6 +194,7 @@ public final class LexiconData {
|
||||
public static LexiconEntry temperanceStone;
|
||||
public static LexiconEntry terraAxe;
|
||||
public static LexiconEntry obedienceStick;
|
||||
public static LexiconEntry slimeBottle;
|
||||
|
||||
public static LexiconEntry enderAir;
|
||||
public static LexiconEntry enderEyeBlock;
|
||||
@@ -749,6 +750,9 @@ public final class LexiconData {
|
||||
obedienceStick = new BLexiconEntry(LibLexicon.TOOL_OBEDIENCE_STICK, categoryTools);
|
||||
obedienceStick.setPriority().setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeObedienceStick));
|
||||
|
||||
slimeBottle = new ALexiconEntry(LibLexicon.TOOL_SLIME_BOTTLE, categoryTools);
|
||||
slimeBottle.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeSlimeBottle));
|
||||
|
||||
// ENDER ENTRIES
|
||||
enderAir = new BLexiconEntry(LibLexicon.ENDER_AIR, categoryEnder);
|
||||
enderAir.setPriority().setLexiconPages(new PageText("0"));
|
||||
|
||||
@@ -147,6 +147,7 @@ public final class LibItemNames {
|
||||
public static final String WATER_BOWL = "waterBowl";
|
||||
public static final String OBEDIENCE_STICK = "obedienceStick";
|
||||
public static final String CACOPHONIUM = "cacophonium";
|
||||
public static final String SLIME_BOTTLE = "slimeBottle";
|
||||
|
||||
public static final String[] LENS_NAMES = new String[] {
|
||||
"lensNormal",
|
||||
|
||||
@@ -163,6 +163,7 @@ public final class LibLexicon {
|
||||
public static final String TOOL_TEMPERANCE_STONE = "temperanceStone";
|
||||
public static final String TOOL_TERRA_AXE = "terraAxe";
|
||||
public static final String TOOL_OBEDIENCE_STICK = "obedienceStick";
|
||||
public static final String TOOL_SLIME_BOTTLE = "slimeBottle";
|
||||
|
||||
public static final String ENDER_AIR = "enderAir";
|
||||
public static final String ENDER_ENDER_EYE_BLOCK = "enderEyeBlock";
|
||||
|
||||
Reference in new issue
Block a user