Added some new rings.

This commit is contained in:
Vasco Lavos committed 2014-05-17 17:24:08 +01:00
1 parent d5110e7f64
commit 7b5c6b1ef6
11 files changed
+231 -1

No files matched your search

@@ -98,12 +98,14 @@ public final class BotaniaCreativeTab extends CreativeTabs {
addItem(ModItems.auraRing);
addItem(ModItems.manaRingGreater);
addItem(ModItems.auraRingGreater);
addItem(ModItems.waterRing);
addItem(ModItems.miningRing);
addItem(ModItems.magnetRing);
addItem(ModItems.travelBelt);
addItem(ModItems.knockbackBelt);
addItem(ModItems.icePendant);
addItem(ModItems.lavaPendant);
addItem(ModItems.goldLaurel);
addItem(ModItems.manaTablet);
addItem(ModItems.manaMirror);
addBlock(ModBlocks.pool);
@@ -11,6 +11,12 @@
*/
package vazkii.botania.common.core.proxy;
import java.util.List;
import baubles.common.Baubles;
import baubles.common.Config;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
@@ -70,6 +76,13 @@ public class CommonProxy {
public void postInit(FMLPostInitializationEvent event) {
ModBlocks.addDispenserBehaviours();
List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
for(IRecipe recipe : recipes)
if(recipe.getRecipeOutput() != null && recipe.getRecipeOutput().getItem() == Config.itemRing) {
recipes.remove(recipe);
break;
}
}
public void setEntryToOpen(LexiconEntry entry) {
@@ -30,9 +30,12 @@ import vazkii.botania.common.item.equipment.bauble.ItemGreaterManaRing;
import vazkii.botania.common.item.equipment.bauble.ItemIcePendant;
import vazkii.botania.common.item.equipment.bauble.ItemKnockbackBelt;
import vazkii.botania.common.item.equipment.bauble.ItemLavaPendant;
import vazkii.botania.common.item.equipment.bauble.ItemMagnetRing;
import vazkii.botania.common.item.equipment.bauble.ItemManaRing;
import vazkii.botania.common.item.equipment.bauble.ItemMiningRing;
import vazkii.botania.common.item.equipment.bauble.ItemTinyPlanet;
import vazkii.botania.common.item.equipment.bauble.ItemTravelBelt;
import vazkii.botania.common.item.equipment.bauble.ItemWaterRing;
import vazkii.botania.common.item.equipment.tool.ItemManasteelAxe;
import vazkii.botania.common.item.equipment.tool.ItemManasteelPick;
import vazkii.botania.common.item.equipment.tool.ItemManasteelShears;
@@ -86,6 +89,9 @@ public final class ModItems {
public static Item icePendant;
public static Item lavaPendant;
public static Item goldLaurel;
public static Item magnetRing;
public static Item waterRing;
public static Item miningRing;
public static void init() {
lexicon = new ItemLexicon();
@@ -131,6 +137,9 @@ public final class ModItems {
icePendant = new ItemIcePendant();
lavaPendant = new ItemLavaPendant();
goldLaurel = new ItemGoldenLaurel();
magnetRing = new ItemMagnetRing();
waterRing = new ItemWaterRing();
miningRing = new ItemMiningRing();
OreDictionary.registerOre(LibOreDict.LEXICON, lexicon);
for(int i = 0; i < 16; i++) {
@@ -0,0 +1,59 @@
/**
* 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 @ [May 17, 2014, 3:16:36 PM (GMT)]
*/
package vazkii.botania.common.item.equipment.bauble;
import java.util.List;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import vazkii.botania.common.Botania;
import vazkii.botania.common.core.helper.MathHelper;
import vazkii.botania.common.core.helper.Vector3;
import vazkii.botania.common.lib.LibItemNames;
import baubles.api.BaubleType;
public class ItemMagnetRing extends ItemBauble {
public ItemMagnetRing() {
super(LibItemNames.MAGNET_RING);
}
@Override
public void onWornTick(ItemStack stack, EntityLivingBase player) {
super.onWornTick(stack, player);
if(!player.isSneaking()) {
int range = 6;
double x = player.posX + 0.5;
double y = player.posY -(player.worldObj.isRemote ? 1.62 : 0) + 0.75;
double z = player.posZ + 0.5;
List<EntityItem> items = player.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x - range, y - range, z - range, x + range, y + range, z + range));
for(EntityItem item : items) {
MathHelper.setEntityMotionFromVector(item, new Vector3(x, y, z), 0.45F);
if(player.worldObj.isRemote) {
boolean red = player.worldObj.rand.nextBoolean();
Botania.proxy.sparkleFX(player.worldObj, item.posX, item.posY, item.posZ, red ? 1F : 0F, 0F, red ? 0F : 1F, 1F, 3);
}
}
}
}
@Override
public BaubleType getBaubleType(ItemStack arg0) {
return BaubleType.RING;
}
}
@@ -0,0 +1,65 @@
/**
* 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 @ [May 17, 2014, 4:12:46 PM (GMT)]
*/
package vazkii.botania.common.item.equipment.bauble;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
import vazkii.botania.api.mana.ManaItemHandler;
import vazkii.botania.common.lib.LibItemNames;
import baubles.api.BaubleType;
public class ItemMiningRing extends ItemBauble {
public ItemMiningRing() {
super(LibItemNames.MINING_RING);
}
@Override
public void onWornTick(ItemStack stack, EntityLivingBase player) {
super.onWornTick(stack, player);
if(player instanceof EntityPlayer && !player.worldObj.isRemote) {
int manaCost = 5;
boolean hasMana = ManaItemHandler.requestManaExact(stack, (EntityPlayer) player, manaCost, false);
if(!hasMana)
onUnequipped(stack, player);
else {
if(player.getActivePotionEffect(Potion.digSpeed) != null)
player.removePotionEffect(Potion.digSpeed.id);
player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, Integer.MAX_VALUE, 1, true));
}
if(player.swingProgress == 0.25F) {
ManaItemHandler.requestManaExact(stack, (EntityPlayer) player, manaCost, true);
}
}
}
@Override
public void onUnequipped(ItemStack stack, EntityLivingBase player) {
PotionEffect effect = player.getActivePotionEffect(Potion.digSpeed);
if(effect != null && effect.getAmplifier() == 1)
player.removePotionEffect(Potion.digSpeed.id);
}
@Override
public BaubleType getBaubleType(ItemStack arg0) {
return BaubleType.RING;
}
}
@@ -0,0 +1,76 @@
/**
* 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 @ [May 17, 2014, 3:44:24 PM (GMT)]
*/
package vazkii.botania.common.item.equipment.bauble;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import vazkii.botania.api.mana.ManaItemHandler;
import vazkii.botania.common.lib.LibItemNames;
import baubles.api.BaubleType;
public class ItemWaterRing extends ItemBauble {
public ItemWaterRing() {
super(LibItemNames.WATER_RING);
}
@Override
public void onWornTick(ItemStack stack, EntityLivingBase player) {
super.onWornTick(stack, player);
if(player.isInsideOfMaterial(Material.water)) {
double motionX = player.motionX * 1.2;
double motionY = player.motionY * 1.2;
double motionZ = player.motionZ * 1.2;
boolean changeX = Math.min(1.3, Math.abs(motionX)) == Math.abs(motionX);
boolean changeY = Math.min(1.3, Math.abs(motionY)) == Math.abs(motionY);
boolean changeZ = Math.min(1.3, Math.abs(motionZ)) == Math.abs(motionZ);
if(changeX)
player.motionX = motionX;
if(changeY)
player.motionY = motionY;
if(changeZ)
player.motionZ = motionZ;
PotionEffect effect = player.getActivePotionEffect(Potion.nightVision);
if(effect == null) {
PotionEffect neweffect = new PotionEffect(Potion.nightVision.id, Integer.MAX_VALUE, -42, true);
neweffect.setPotionDurationMax(true);
player.addPotionEffect(neweffect);
}
if(player.getAir() == 1 && player instanceof EntityPlayer) {
int mana = ManaItemHandler.requestMana(stack, (EntityPlayer) player, 300, true);
player.setAir(mana);
}
} else onUnequipped(stack, player);
}
@Override
public void onUnequipped(ItemStack stack, EntityLivingBase player) {
PotionEffect effect = player.getActivePotionEffect(Potion.nightVision);
if(effect != null && effect.getAmplifier() == -42)
player.removePotionEffect(Potion.nightVision.id);
}
@Override
public BaubleType getBaubleType(ItemStack arg0) {
return BaubleType.RING;
}
}
@@ -58,6 +58,9 @@ public final class LibItemNames {
public static final String ICE_PENDANT = "icePendant";
public static final String LAVA_PENDANT = "lavaPendant";
public static final String GOLDEN_LAUREL = "goldenLaurel";
public static final String MAGNET_RING = "magnetRing";
public static final String WATER_RING = "waterRing";
public static final String MINING_RING = "miningRing";
public static final String[] LENS_NAMES = new String[] {
"lensNormal",
+3
View File
@@ -323,6 +323,9 @@ item.botania:lavaPendant.name=Pyroclast Pendant
item.botania:lifeEssence.name=Essence of Eternal Life
item.botania:goldenLaurel.name=Golden Laurel Crown
item.botania:redstoneRoot.name=Redstone Root
item.botania:magnetRing.name=Ring of Magnetization
item.botania:waterRing.name=Ring of Chordata
item.botania:miningRing.name=Ring of the Mantle
# GUI TEXT
botania.gui.lexicon.header=Lexica Botania Index - Pick which category you would like to study:
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB