Getting started in Relics.

This commit is contained in:
Lizbeth Rika committed 2015-03-29 23:15:03 +01:00
1 parent a541677db3
commit 804b57573f
23 files changed
+456 -19

No files matched your search

@@ -170,9 +170,16 @@ public final class BotaniaCreativeTab extends CreativeTabs {
addItem(ModItems.terrasteelChest);
addItem(ModItems.terrasteelLegs);
addItem(ModItems.terrasteelBoots);
addItem(ModItems.ancientWill);
addItem(ModItems.phantomInk);
addItem(ModItems.ancientWill);
addItem(ModItems.pinkinator);
addItem(ModItems.infiniteFruit);
addItem(ModItems.excaliber);
addItem(ModItems.flugelEye);
addItem(ModItems.thorRing);
addItem(ModItems.odinRing);
addItem(ModItems.lokiRing);
addItem(ModItems.aesirRing);
addItem(ModItems.tinyPlanet);
addBlock(ModBlocks.tinyPlanet);
@@ -82,6 +82,13 @@ import vazkii.botania.common.item.material.ItemPestleAndMortar;
import vazkii.botania.common.item.material.ItemPetal;
import vazkii.botania.common.item.material.ItemQuartz;
import vazkii.botania.common.item.material.ItemRune;
import vazkii.botania.common.item.relic.ItemAesirRing;
import vazkii.botania.common.item.relic.ItemExcaliber;
import vazkii.botania.common.item.relic.ItemFlugelEye;
import vazkii.botania.common.item.relic.ItemInfiniteFruit;
import vazkii.botania.common.item.relic.ItemLokiRing;
import vazkii.botania.common.item.relic.ItemOdinRing;
import vazkii.botania.common.item.relic.ItemThorRing;
import vazkii.botania.common.item.rod.ItemCobbleRod;
import vazkii.botania.common.item.rod.ItemDirtRod;
import vazkii.botania.common.item.rod.ItemDiviningRod;
@@ -214,6 +221,13 @@ public final class ModItems {
public static Item phantomInk;
public static Item poolMinecart;
public static Item pinkinator;
public static Item infiniteFruit;
public static Item excaliber;
public static Item flugelEye;
public static Item thorRing;
public static Item odinRing;
public static Item lokiRing;
public static Item aesirRing;
public static void init() {
lexicon = new ItemLexicon();
@@ -332,7 +346,14 @@ public final class ModItems {
phantomInk = new ItemPhantomInk();
poolMinecart = new ItemPoolMinecart();
pinkinator = new ItemPinkinator();
infiniteFruit = new ItemInfiniteFruit();
excaliber = new ItemExcaliber();
flugelEye = new ItemFlugelEye();
thorRing = new ItemThorRing();
odinRing = new ItemOdinRing();
lokiRing = new ItemLokiRing();
aesirRing = new ItemAesirRing();
OreDictionary.registerOre(LibOreDict.LEXICON, lexicon);
for(int i = 0; i < 16; i++) {
OreDictionary.registerOre(LibOreDict.PETAL[i], new ItemStack(petal, 1, i));
@@ -47,31 +47,33 @@ public abstract class ItemBauble extends ItemMod implements IBauble, ICosmeticAt
if(!EntityDoppleganger.isTruePlayer(par3EntityPlayer))
return par1ItemStack;
InventoryBaubles baubles = PlayerHandler.getPlayerBaubles(par3EntityPlayer);
for(int i = 0; i < baubles.getSizeInventory(); i++) {
if(baubles.isItemValidForSlot(i, par1ItemStack)) {
ItemStack stackInSlot = baubles.getStackInSlot(i);
if(stackInSlot == null || ((IBauble) stackInSlot.getItem()).canUnequip(stackInSlot, par3EntityPlayer)) {
if(!par2World.isRemote) {
baubles.setInventorySlotContents(i, par1ItemStack.copy());
if(!par3EntityPlayer.capabilities.isCreativeMode)
par3EntityPlayer.inventory.setInventorySlotContents(par3EntityPlayer.inventory.currentItem, null);
}
if(canEquip(par1ItemStack, par3EntityPlayer)) {
InventoryBaubles baubles = PlayerHandler.getPlayerBaubles(par3EntityPlayer);
for(int i = 0; i < baubles.getSizeInventory(); i++) {
if(baubles.isItemValidForSlot(i, par1ItemStack)) {
ItemStack stackInSlot = baubles.getStackInSlot(i);
if(stackInSlot == null || ((IBauble) stackInSlot.getItem()).canUnequip(stackInSlot, par3EntityPlayer)) {
if(!par2World.isRemote) {
baubles.setInventorySlotContents(i, par1ItemStack.copy());
if(!par3EntityPlayer.capabilities.isCreativeMode)
par3EntityPlayer.inventory.setInventorySlotContents(par3EntityPlayer.inventory.currentItem, null);
}
onEquipped(par1ItemStack, par3EntityPlayer);
onEquipped(par1ItemStack, par3EntityPlayer);
if(stackInSlot != null) {
((IBauble) stackInSlot.getItem()).onUnequipped(stackInSlot, par3EntityPlayer);
return stackInSlot.copy();
if(stackInSlot != null) {
((IBauble) stackInSlot.getItem()).onUnequipped(stackInSlot, par3EntityPlayer);
return stackInSlot.copy();
}
break;
}
break;
}
}
}
return par1ItemStack;
}
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
@@ -0,0 +1,24 @@
/**
* 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 @ [Mar 29, 2015, 7:17:41 PM (GMT)]
*/
package vazkii.botania.common.item.relic;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.Achievement;
public interface IRelic {
public String getSoulbindUsername(ItemStack stack);
public void setBindAchievement(Achievement achievement);
public Achievement getBindAchievement();
}
@@ -0,0 +1,28 @@
/**
* 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 @ [Mar 29, 2015, 10:16:29 PM (GMT)]
*/
package vazkii.botania.common.item.relic;
import net.minecraft.item.ItemStack;
import baubles.api.BaubleType;
import vazkii.botania.common.lib.LibItemNames;
public class ItemAesirRing extends ItemRelicBauble {
public ItemAesirRing() {
super(LibItemNames.AESIR_RING);
}
@Override
public BaubleType getBaubleType(ItemStack arg0) {
return BaubleType.RING;
}
}
@@ -0,0 +1,22 @@
/**
* 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 @ [Mar 29, 2015, 10:12:50 PM (GMT)]
*/
package vazkii.botania.common.item.relic;
import vazkii.botania.common.lib.LibItemNames;
import net.minecraft.stats.Achievement;
public class ItemExcaliber extends ItemRelic {
public ItemExcaliber() {
super(LibItemNames.EXCALIBER);
}
}
@@ -0,0 +1,21 @@
/**
* 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 @ [Mar 29, 2015, 10:13:26 PM (GMT)]
*/
package vazkii.botania.common.item.relic;
import vazkii.botania.common.lib.LibItemNames;
public class ItemFlugelEye extends ItemRelic {
public ItemFlugelEye() {
super(LibItemNames.FLUGEL_EYE);
}
}
@@ -0,0 +1,21 @@
/**
* 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 @ [Mar 29, 2015, 10:12:55 PM (GMT)]
*/
package vazkii.botania.common.item.relic;
import vazkii.botania.common.lib.LibItemNames;
public class ItemInfiniteFruit extends ItemRelic {
public ItemInfiniteFruit() {
super(LibItemNames.INFINITE_FRUIT);
}
}
@@ -0,0 +1,28 @@
/**
* 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 @ [Mar 29, 2015, 10:13:32 PM (GMT)]
*/
package vazkii.botania.common.item.relic;
import net.minecraft.item.ItemStack;
import baubles.api.BaubleType;
import vazkii.botania.common.lib.LibItemNames;
public class ItemLokiRing extends ItemRelicBauble {
public ItemLokiRing() {
super(LibItemNames.LOKI_RING);
}
@Override
public BaubleType getBaubleType(ItemStack arg0) {
return BaubleType.RING;
}
}
@@ -0,0 +1,28 @@
/**
* 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 @ [Mar 29, 2015, 10:13:41 PM (GMT)]
*/
package vazkii.botania.common.item.relic;
import net.minecraft.item.ItemStack;
import baubles.api.BaubleType;
import vazkii.botania.common.lib.LibItemNames;
public class ItemOdinRing extends ItemRelicBauble {
public ItemOdinRing() {
super(LibItemNames.ODIN_RING);
}
@Override
public BaubleType getBaubleType(ItemStack arg0) {
return BaubleType.RING;
}
}
@@ -0,0 +1,108 @@
/**
* 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 @ [Mar 29, 2015, 7:54:40 PM (GMT)]
*/
package vazkii.botania.common.item.relic;
import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.Achievement;
import net.minecraft.util.DamageSource;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import vazkii.botania.common.core.helper.ItemNBTHelper;
import vazkii.botania.common.item.ItemMod;
public class ItemRelic extends ItemMod implements IRelic {
private static final String TAG_SOULBIND = "soulbind";
Achievement achievement;
public ItemRelic(String name) {
setUnlocalizedName(name);
setMaxStackSize(1);
}
@Override
public void onUpdate(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) {
if(p_77663_3_ instanceof EntityPlayer)
updateRelic(p_77663_1_, (EntityPlayer) p_77663_3_);
}
@Override
public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) {
addBindInfo(p_77624_3_, p_77624_1_, p_77624_2_);
}
public static void addBindInfo(List list, ItemStack stack, EntityPlayer player) {
String bind = getSoulbindUsernameS(stack);
if(bind.isEmpty())
addStringToTooltip(StatCollector.translateToLocal("botaniamisc.relicUnbound"), list);
else {
addStringToTooltip(String.format(StatCollector.translateToLocal("botaniamisc.relicSoulbound"), bind), list);
if(!isRightPlayer(player, stack))
addStringToTooltip(String.format(StatCollector.translateToLocal("botaniamisc.notYourSagittarius"), bind), list);
}
}
static void addStringToTooltip(String s, List<String> tooltip) {
tooltip.add(s.replaceAll("&", "\u00a7"));
}
public static String getSoulbindUsernameS(ItemStack stack) {
return ItemNBTHelper.getString(stack, TAG_SOULBIND, "");
}
public static void updateRelic(ItemStack stack, EntityPlayer player) {
String soulbind = getSoulbindUsernameS(stack);
if(soulbind.isEmpty()) {
bindToPlayer(player, stack);
soulbind = getSoulbindUsernameS(stack);
}
if(!isRightPlayer(player, stack) && player.ticksExisted % 10 == 0)
player.attackEntityFrom(damageSource(), 6);
}
public static void bindToPlayer(EntityPlayer player, ItemStack stack) {
ItemNBTHelper.setString(stack, TAG_SOULBIND, player.getCommandSenderName());
}
public static boolean isRightPlayer(EntityPlayer player, ItemStack stack) {
return isRightPlayer(player.getCommandSenderName(), stack);
}
public static boolean isRightPlayer(String player, ItemStack stack) {
return getSoulbindUsernameS(stack).equals(player);
}
public static DamageSource damageSource() {
return new DamageSource("botania-relic");
}
@Override
public String getSoulbindUsername(ItemStack stack) {
return getSoulbindUsernameS(stack);
}
@Override
public Achievement getBindAchievement() {
return achievement;
}
@Override
public void setBindAchievement(Achievement achievement) {
this.achievement = achievement;
}
}
@@ -0,0 +1,78 @@
/**
* 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 @ [Mar 29, 2015, 7:56:27 PM (GMT)]
*/
package vazkii.botania.common.item.relic;
import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.Achievement;
import net.minecraft.world.World;
import vazkii.botania.common.item.equipment.bauble.ItemBauble;
public abstract class ItemRelicBauble extends ItemBauble implements IRelic {
Achievement achievement;
public ItemRelicBauble(String name) {
super(name);
}
@Override
public void onUpdate(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) {
if(p_77663_3_ instanceof EntityPlayer)
ItemRelic.updateRelic(p_77663_1_, (EntityPlayer) p_77663_3_);
}
@Override
public void onWornTick(ItemStack stack, EntityLivingBase player) {
super.onWornTick(stack, player);
if(player instanceof EntityPlayer) {
EntityPlayer ePlayer = (EntityPlayer) player;
ItemRelic.updateRelic(stack, ePlayer);
if(ItemRelic.isRightPlayer(ePlayer, stack))
onValidPlayerWornTick(stack, ePlayer);
}
}
@Override
public void addHiddenTooltip(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
super.addHiddenTooltip(par1ItemStack, par2EntityPlayer, par3List, par4);
ItemRelic.addBindInfo(par3List, par1ItemStack, par2EntityPlayer);
}
public void onValidPlayerWornTick(ItemStack stack, EntityPlayer player) {
// NO-OP
}
@Override
public boolean canEquip(ItemStack stack, EntityLivingBase player) {
return player instanceof EntityPlayer && ItemRelic.isRightPlayer((EntityPlayer) player, stack);
}
@Override
public String getSoulbindUsername(ItemStack stack) {
return ItemRelic.getSoulbindUsernameS(stack);
}
@Override
public Achievement getBindAchievement() {
return achievement;
}
@Override
public void setBindAchievement(Achievement achievement) {
this.achievement = achievement;
}
}
@@ -0,0 +1,28 @@
/**
* 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 @ [Mar 29, 2015, 10:13:37 PM (GMT)]
*/
package vazkii.botania.common.item.relic;
import net.minecraft.item.ItemStack;
import baubles.api.BaubleType;
import vazkii.botania.common.lib.LibItemNames;
public class ItemThorRing extends ItemRelicBauble {
public ItemThorRing() {
super(LibItemNames.THOR_RING);
}
@Override
public BaubleType getBaubleType(ItemStack arg0) {
return BaubleType.RING;
}
}
@@ -129,7 +129,14 @@ public final class LibItemNames {
public static final String PHANTOM_INK = "phantomInk";
public static final String POOL_MINECART = "poolMinecart";
public static final String PINKINATOR = "pinkinator";
public static final String INFINITE_FRUIT = "infiniteFruit";
public static final String EXCALIBER = "excaliber";
public static final String FLUGEL_EYE = "flugelEye";
public static final String THOR_RING = "thorRing";
public static final String ODIN_RING = "odinRing";
public static final String LOKI_RING = "lokiRing";
public static final String AESIR_RING = "aesirRing";
public static final String[] LENS_NAMES = new String[] {
"lensNormal",
"lensSpeed",
@@ -95,6 +95,9 @@ botaniamisc.lexiconOptions1=Configure Botania from ingame
botaniamisc.lexiconOptions2=Some options might need a game restart
botaniamisc.hasPhantomInk=&bTinged with Phantom Ink
botaniamisc.pinkinatorDesc=Apply directly to Wither
botaniamisc.relicUnbound=&6Relic&7, Unbound
botaniamisc.relicSoulbound=&6Relic&7, Soulbound to &f%s
botaniamisc.notYourSagittarius=&4This relic is not yours
# NEI INTEGRATION
botania.nei.brewery=Botanical Brewery
@@ -308,6 +311,9 @@ botania.baubletype.ring=Equippable in the &aRing&7 slot
botania.baubletype.belt=Equippable in the &aBelt&7 slot
botania.baubletooltip=Press &b%key%&7 to open the Baubles menu
# DEATH MESSAGES
death.attack.botania-relic=%s was punished for using a relic that isn't theirs
# ENTITY NAMES
entity.Botania.botania:manaBurst.name=Mana Burst
entity.Botania.botania:signalFlare.name=Signal Flare
@@ -1148,6 +1154,14 @@ item.botania:flowerBag.name=Flower Pouch
item.botania:phantomInk.name=Phantom Ink
item.botania:poolMinecart.name=Minecart with Mana Pool
item.botania:pinkinator.name=The Pinkinator
item.botania:infiniteFruit.name=The Fruit of Grisaia
item.botania:excaliber.name=Holy Sword Excaliber
item.botania:flugelEye.name=Eye of the Flügel
item.botania:thorRing.name=Ring of Thor
item.botania:odinRing.name=Ring of Odin
item.botania:lokiRing.name=Ring of Loki
item.botania:aesirRing.name=Ring of the Aesir
item.botania:relicDice.name=Dice of Fate
# BREW NAMES
botania.brew.fallback=Fallback
Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB