mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-18 11:19:19 +00:00
Astrolabe recipe/docs and hud
This commit is contained in:
1 parent
9a0440f38a
commit
3b5f4b89a1
5 files changed
+41
-4
No files matched your search
@@ -304,6 +304,7 @@ public final class ModCraftingRecipes {
|
||||
public static IRecipe recipeCloudPendant;
|
||||
public static IRecipe recipeSuperCloudPendant;
|
||||
public static IRecipe recipeThirdEye;
|
||||
public static IRecipe recipeAstrolabe;
|
||||
|
||||
// Garden of Glass
|
||||
public static IRecipe recipeRootToSapling;
|
||||
@@ -2072,6 +2073,14 @@ public final class ModCraftingRecipes {
|
||||
'D', LibOreDict.MANA_DIAMOND);
|
||||
recipeThirdEye = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
// Astrolabe Recipe
|
||||
addOreDictRecipe(new ItemStack(ModItems.astrolabe),
|
||||
" EG", "EEE", "GED",
|
||||
'E', LibOreDict.ELEMENTIUM,
|
||||
'G', LibOreDict.LIFE_ESSENCE,
|
||||
'D', LibOreDict.DREAM_WOOD);
|
||||
recipeAstrolabe = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Storage Block/Nugget Recipes
|
||||
|
||||
@@ -38,6 +38,7 @@ import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.client.core.handler.ItemsRemainingRenderHandler;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.item.equipment.tool.ToolCommons;
|
||||
import vazkii.botania.common.item.rod.ItemExchangeRod;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemAstrolabe extends ItemMod {
|
||||
@@ -58,12 +59,18 @@ public class ItemAstrolabe extends ItemMod {
|
||||
int meta = block.getMetaFromState(state);
|
||||
|
||||
if(playerIn.isSneaking()) {
|
||||
if(setBlock(stack, block, meta))
|
||||
if(setBlock(stack, block, meta)) {
|
||||
displayRemainderCounter(playerIn, stack);
|
||||
return EnumActionResult.SUCCESS;
|
||||
}
|
||||
} else {
|
||||
boolean did = placeAllBlocks(stack, playerIn);
|
||||
if(!worldIn.isRemote)
|
||||
playerIn.swingArm(hand);
|
||||
if(did) {
|
||||
displayRemainderCounter(playerIn, stack);
|
||||
if(!worldIn.isRemote)
|
||||
playerIn.swingArm(hand);
|
||||
}
|
||||
|
||||
return did ? EnumActionResult.SUCCESS : EnumActionResult.FAIL;
|
||||
}
|
||||
|
||||
@@ -221,6 +228,15 @@ public class ItemAstrolabe extends ItemMod {
|
||||
|
||||
return coords.toArray(new BlockPos[coords.size()]);
|
||||
}
|
||||
|
||||
|
||||
public void displayRemainderCounter(EntityPlayer player, ItemStack stack) {
|
||||
Block block = getBlock(stack);
|
||||
int meta = getBlockMeta(stack);
|
||||
int count = ItemExchangeRod.getInventoryItemCount(player, stack, block, meta);
|
||||
if(!player.worldObj.isRemote)
|
||||
ItemsRemainingRenderHandler.set(new ItemStack(block, 1, meta), count);
|
||||
}
|
||||
|
||||
private boolean setBlock(ItemStack stack, Block block, int meta) {
|
||||
if(Item.getItemFromBlock(block) != null) {
|
||||
|
||||
@@ -203,6 +203,7 @@ public final class LexiconData {
|
||||
public static LexiconEntry manaweave;
|
||||
public static LexiconEntry autocraftingHalo;
|
||||
public static LexiconEntry sextant;
|
||||
public static LexiconEntry astrolabe;
|
||||
|
||||
public static LexiconEntry enderAir;
|
||||
public static LexiconEntry enderEyeBlock;
|
||||
@@ -1034,6 +1035,10 @@ public final class LexiconData {
|
||||
sextant.setLexiconPages(new PageText("0"), new PageText("1"),
|
||||
new PageCraftingRecipe("2", ModCraftingRecipes.recipeSextant));
|
||||
|
||||
astrolabe = new AlfheimLexiconEntry(LibLexicon.TOOL_ASTROLABE, categoryTools);
|
||||
astrolabe.setLexiconPages(new PageText("0"), new PageText("1"),
|
||||
new PageCraftingRecipe("2", ModCraftingRecipes.recipeAstrolabe));
|
||||
|
||||
// ENDER ENTRIES
|
||||
enderAir = new BasicLexiconEntry(LibLexicon.ENDER_AIR, categoryEnder);
|
||||
enderAir.setPriority().setLexiconPages(new PageText("0"));
|
||||
|
||||
@@ -178,6 +178,7 @@ public final class LibLexicon {
|
||||
public static final String TOOL_MANAWEAVE = "manaweave";
|
||||
public static final String TOOL_AUTOCRAFTING_HALO = "autocraftingHalo";
|
||||
public static final String TOOL_SEXTANT = "sextant";
|
||||
public static final String TOOL_ASTROLABE = "astrolabe";
|
||||
|
||||
public static final String ENDER_AIR = "enderAir";
|
||||
public static final String ENDER_ENDER_EYE_BLOCK = "enderEyeBlock";
|
||||
|
||||
Reference in new issue
Block a user