mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 19:05:16 +00:00
Setting up for Manaweave, Rods are now affected by armor set mana discounts.
This commit is contained in:
1 parent
258655bc91
commit
2acb6da1f6
25 files changed
+33
-28
No files matched your search
@@ -427,6 +427,7 @@ public final class ModItems {
|
||||
OreDictionary.registerOre(LibOreDict.ELEMENTIUM_NUGGET, new ItemStack(manaResource, 1, 19));
|
||||
OreDictionary.registerOre(LibOreDict.ROOT, new ItemStack(manaResource, 1, 20));
|
||||
OreDictionary.registerOre(LibOreDict.PEBBLE, new ItemStack(manaResource, 1, 21));
|
||||
OreDictionary.registerOre(LibOreDict.MANAWEAVE_CLOTH, new ItemStack(manaResource, 1, 22));
|
||||
|
||||
OreDictionary.registerOre(LibOreDict.VIAL, new ItemStack(vial, 1, 0));
|
||||
OreDictionary.registerOre(LibOreDict.FLASK, new ItemStack(vial, 1, 1));
|
||||
|
||||
@@ -45,7 +45,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemManaResource extends ItemMod implements IFlowerComponent, IElvenItem, IPickupAchievement {
|
||||
|
||||
final int types = 22;
|
||||
final int types = 23;
|
||||
IIcon[] icons;
|
||||
|
||||
// begin dank_memes
|
||||
|
||||
@@ -48,7 +48,7 @@ public class ItemCobbleRod extends ItemMod implements IManaUsingItem, IBlockProv
|
||||
@Override
|
||||
public boolean provideBlock(EntityPlayer player, ItemStack requestor, ItemStack stack, Block block, int meta, boolean doit) {
|
||||
if(block == Blocks.cobblestone && meta == 0)
|
||||
return !doit || ManaItemHandler.requestManaExact(requestor, player, COST, true);
|
||||
return !doit || ManaItemHandler.requestManaExactForTool(requestor, player, COST, true);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public class ItemDirtRod extends ItemMod implements IManaUsingItem, ICraftAchiev
|
||||
}
|
||||
|
||||
public static boolean place(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10, Block block, int cost, float r, float g, float b) {
|
||||
if(ManaItemHandler.requestManaExact(par1ItemStack, par2EntityPlayer, cost, false)) {
|
||||
if(ManaItemHandler.requestManaExactForTool(par1ItemStack, par2EntityPlayer, cost, false)) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(par7);
|
||||
int entities = par3World.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(par4 + dir.offsetX, par5 + dir.offsetY, par6 + dir.offsetZ, par4 + dir.offsetX + 1, par5 + dir.offsetY + 1, par6 + dir.offsetZ + 1)).size();
|
||||
|
||||
@@ -58,7 +58,7 @@ public class ItemDirtRod extends ItemMod implements IManaUsingItem, ICraftAchiev
|
||||
stackToPlace.tryPlaceItemIntoWorld(par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
|
||||
|
||||
if(stackToPlace.stackSize == 0) {
|
||||
ManaItemHandler.requestManaExact(par1ItemStack, par2EntityPlayer, cost, true);
|
||||
ManaItemHandler.requestManaExactForTool(par1ItemStack, par2EntityPlayer, cost, true);
|
||||
for(int i = 0; i < 6; i++)
|
||||
Botania.proxy.sparkleFX(par3World, par4 + dir.offsetX + Math.random(), par5 + dir.offsetY + Math.random(), par6 + dir.offsetZ + Math.random(), r, g, b, 1F, 5);
|
||||
}
|
||||
@@ -86,7 +86,7 @@ public class ItemDirtRod extends ItemMod implements IManaUsingItem, ICraftAchiev
|
||||
@Override
|
||||
public boolean provideBlock(EntityPlayer player, ItemStack requestor, ItemStack stack, Block block, int meta, boolean doit) {
|
||||
if(block == Blocks.dirt && meta == 0)
|
||||
return !doit || ManaItemHandler.requestManaExact(requestor, player, COST, true);
|
||||
return !doit || ManaItemHandler.requestManaExactForTool(requestor, player, COST, true);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class ItemDiviningRod extends ItemMod implements IManaUsingItem {
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer p) {
|
||||
if(ManaItemHandler.requestManaExact(stack, p, COST, true)) {
|
||||
if(ManaItemHandler.requestManaExactForTool(stack, p, COST, true)) {
|
||||
if(world.isRemote) {
|
||||
int x = MathHelper.floor_double(p.posX);
|
||||
int y = MathHelper.floor_double(p.posY);
|
||||
|
||||
@@ -121,7 +121,7 @@ public class ItemExchangeRod extends ItemMod implements IManaUsingItem, IWirefra
|
||||
Block block = getBlock(stack);
|
||||
int meta = getBlockMeta(stack);
|
||||
if(ItemNBTHelper.getBoolean(stack, TAG_SWAPPING, false)) {
|
||||
if(!ManaItemHandler.requestManaExact(stack, player, COST, false)) {
|
||||
if(!ManaItemHandler.requestManaExactForTool(stack, player, COST, false)) {
|
||||
ItemNBTHelper.setBoolean(stack, TAG_SWAPPING, false);
|
||||
return;
|
||||
}
|
||||
@@ -140,7 +140,7 @@ public class ItemExchangeRod extends ItemMod implements IManaUsingItem, IWirefra
|
||||
ChunkCoordinates coords = swap.get(world.rand.nextInt(swap.size()));
|
||||
boolean exchange = exchange(world, player, coords.posX, coords.posY, coords.posZ, stack, block, meta);
|
||||
if(exchange)
|
||||
ManaItemHandler.requestManaExact(stack, player, COST, true);
|
||||
ManaItemHandler.requestManaExactForTool(stack, player, COST, true);
|
||||
else ItemNBTHelper.setBoolean(stack, TAG_SWAPPING, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,13 +33,13 @@ public class ItemFireRod extends ItemMod implements IManaUsingItem {
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer player, World par3World, int x, int y, int z, int par7, float par8, float par9, float par10) {
|
||||
if(!par3World.isRemote && par1ItemStack.getItemDamage() == 0 && ManaItemHandler.requestManaExact(par1ItemStack, player, COST, false)) {
|
||||
if(!par3World.isRemote && par1ItemStack.getItemDamage() == 0 && ManaItemHandler.requestManaExactForTool(par1ItemStack, player, COST, false)) {
|
||||
EntityFlameRing entity = new EntityFlameRing(player.worldObj);
|
||||
entity.setPosition(x + 0.5, y + 1, z + 0.5);
|
||||
player.worldObj.spawnEntityInWorld(entity);
|
||||
|
||||
par1ItemStack.setItemDamage(COOLDOWN);
|
||||
ManaItemHandler.requestManaExact(par1ItemStack, player, COST, true);
|
||||
ManaItemHandler.requestManaExactForTool(par1ItemStack, player, COST, true);
|
||||
par3World.playSoundAtEntity(player, "mob.blaze.breathe", 1F, 1F);
|
||||
}
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ public class ItemGravityRod extends ItemMod implements IManaUsingItem {
|
||||
}
|
||||
}
|
||||
|
||||
if(ManaItemHandler.requestManaExact(stack, player, COST, true) && item != null) {
|
||||
if(ManaItemHandler.requestManaExactForTool(stack, player, COST, true) && item != null) {
|
||||
if(item instanceof EntityItem)
|
||||
((EntityItem)item).delayBeforeCanPickup = 5;
|
||||
|
||||
|
||||
@@ -43,13 +43,13 @@ public class ItemMissileRod extends ItemMod implements IManaUsingItem {
|
||||
|
||||
@Override
|
||||
public void onUsingTick(ItemStack stack, EntityPlayer player, int count) {
|
||||
if(count != getMaxItemUseDuration(stack) && count % 2 == 0 && !player.worldObj.isRemote && ManaItemHandler.requestManaExact(stack, player, COST_PER, false)) {
|
||||
if(count != getMaxItemUseDuration(stack) && count % 2 == 0 && !player.worldObj.isRemote && ManaItemHandler.requestManaExactForTool(stack, player, COST_PER, false)) {
|
||||
EntityMagicMissile missile = new EntityMagicMissile(player, false);
|
||||
missile.setPosition(player.posX + (Math.random() - 0.5 * 0.1), player.posY + 2.4 + (Math.random() - 0.5 * 0.1), player.posZ + (Math.random() - 0.5 * 0.1));
|
||||
if(missile.getTarget()) {
|
||||
player.worldObj.playSoundAtEntity(player, "botania:missile", 0.6F, 0.8F + (float) Math.random() * 0.2F);
|
||||
player.worldObj.spawnEntityInWorld(missile);
|
||||
ManaItemHandler.requestManaExact(stack, player, COST_PER, true);
|
||||
ManaItemHandler.requestManaExactForTool(stack, player, COST_PER, true);
|
||||
}
|
||||
Botania.proxy.sparkleFX(player.worldObj, player.posX, player.posY + 2.4, player.posZ, 1F, 0.4F, 1F, 6F, 6);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class ItemRainbowRod extends ItemMod implements IManaUsingItem {
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||
if(!par2World.isRemote && par1ItemStack.getItemDamage() == 0 && ManaItemHandler.requestManaExact(par1ItemStack, par3EntityPlayer, MANA_COST, false)) {
|
||||
if(!par2World.isRemote && par1ItemStack.getItemDamage() == 0 && ManaItemHandler.requestManaExactForTool(par1ItemStack, par3EntityPlayer, MANA_COST, false)) {
|
||||
Block place = ModBlocks.bifrost;
|
||||
Vector3 vector = new Vector3(par3EntityPlayer.getLookVec()).normalize();
|
||||
|
||||
@@ -79,7 +79,7 @@ public class ItemRainbowRod extends ItemMod implements IManaUsingItem {
|
||||
|
||||
if(count > 0) {
|
||||
par2World.playSoundAtEntity(par3EntityPlayer, "botania:bifrostRod", 0.5F, 0.25F);
|
||||
ManaItemHandler.requestManaExact(par1ItemStack, par3EntityPlayer, MANA_COST, false);
|
||||
ManaItemHandler.requestManaExactForTool(par1ItemStack, par3EntityPlayer, MANA_COST, false);
|
||||
par1ItemStack.setItemDamage(TIME);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class ItemSkyDirtRod extends ItemDirtRod {
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
if(!world.isRemote && ManaItemHandler.requestManaExact(stack, player, COST * 2, false)) {
|
||||
if(!world.isRemote && ManaItemHandler.requestManaExactForTool(stack, player, COST * 2, false)) {
|
||||
Vector3 playerVec = Vector3.fromEntityCenter(player);
|
||||
Vector3 lookVec = new Vector3(player.getLookVec()).multiply(3);
|
||||
Vector3 placeVec = playerVec.copy().add(lookVec);
|
||||
@@ -46,7 +46,7 @@ public class ItemSkyDirtRod extends ItemDirtRod {
|
||||
stackToPlace.tryPlaceItemIntoWorld(player, world, x, y, z, 0, 0F, 0F, 0F);
|
||||
|
||||
if(stackToPlace.stackSize == 0) {
|
||||
ManaItemHandler.requestManaExact(stack, player, COST * 2, true);
|
||||
ManaItemHandler.requestManaExactForTool(stack, player, COST * 2, true);
|
||||
for(int i = 0; i < 6; i++)
|
||||
Botania.proxy.sparkleFX(world, x + Math.random(), y + Math.random(), z + Math.random(), 0.35F, 0.2F, 0.05F, 1F, 5);
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public class ItemSmeltRod extends ItemMod implements IManaUsingItem {
|
||||
|
||||
@Override
|
||||
public void onUsingTick(ItemStack stack, EntityPlayer p, int time) {
|
||||
if(!ManaItemHandler.requestManaExact(stack, p, COST_PER_TICK, false))
|
||||
if(!ManaItemHandler.requestManaExactForTool(stack, p, COST_PER_TICK, false))
|
||||
return;
|
||||
|
||||
MovingObjectPosition pos = ToolCommons.raytraceFromEntity(p.worldObj, p, false, 32);
|
||||
@@ -86,7 +86,7 @@ public class ItemSmeltRod extends ItemMod implements IManaUsingItem {
|
||||
p.worldObj.playSoundAtEntity(p, "fire.ignite", 0.6F, 1F);
|
||||
p.worldObj.playSoundAtEntity(p, "fire.fire", 1F, 1F);
|
||||
|
||||
ManaItemHandler.requestManaExact(stack, p, COST_PER_TICK, true);
|
||||
ManaItemHandler.requestManaExactForTool(stack, p, COST_PER_TICK, true);
|
||||
playerData.remove(p.getGameProfile().getName());
|
||||
decremented = false;
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ public class ItemTerraformRod extends ItemMod implements IManaUsingItem, IBlockP
|
||||
|
||||
int cost = COST_PER * blocks.size();
|
||||
|
||||
if(par2World.isRemote || ManaItemHandler.requestManaExact(par1ItemStack, par3EntityPlayer, cost, true)) {
|
||||
if(par2World.isRemote || ManaItemHandler.requestManaExactForTool(par1ItemStack, par3EntityPlayer, cost, true)) {
|
||||
if(!par2World.isRemote)
|
||||
for(CoordsWithBlock block : blocks)
|
||||
par2World.setBlock(block.posX, block.posY, block.posZ, block.block);
|
||||
@@ -178,7 +178,7 @@ public class ItemTerraformRod extends ItemMod implements IManaUsingItem, IBlockP
|
||||
@Override
|
||||
public boolean provideBlock(EntityPlayer player, ItemStack requestor, ItemStack stack, Block block, int meta, boolean doit) {
|
||||
if(block == Blocks.dirt && meta == 0)
|
||||
return !doit || ManaItemHandler.requestManaExact(requestor, player, ItemDirtRod.COST, true);
|
||||
return !doit || ManaItemHandler.requestManaExactForTool(requestor, player, ItemDirtRod.COST, true);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -79,11 +79,11 @@ public class ItemTornadoRod extends ItemMod implements IManaUsingItem {
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||
int meta = par1ItemStack.getItemDamage();
|
||||
if(meta != 0 || ManaItemHandler.requestManaExact(par1ItemStack, par3EntityPlayer, COST, false)) {
|
||||
if(meta != 0 || ManaItemHandler.requestManaExactForTool(par1ItemStack, par3EntityPlayer, COST, false)) {
|
||||
par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack));
|
||||
if(meta == 0) {
|
||||
setFlying(par1ItemStack, true);
|
||||
ManaItemHandler.requestManaExact(par1ItemStack, par3EntityPlayer, COST, true);
|
||||
ManaItemHandler.requestManaExactForTool(par1ItemStack, par3EntityPlayer, COST, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,14 +23,14 @@ public class ItemWaterRod extends ItemMod implements IManaUsingItem {
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
|
||||
if(ManaItemHandler.requestManaExact(par1ItemStack, par2EntityPlayer, COST, false) && !par3World.provider.isHellWorld) {
|
||||
if(ManaItemHandler.requestManaExactForTool(par1ItemStack, par2EntityPlayer, COST, false) && !par3World.provider.isHellWorld) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(par7);
|
||||
|
||||
ItemStack stackToPlace = new ItemStack(Blocks.flowing_water);
|
||||
stackToPlace.tryPlaceItemIntoWorld(par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
|
||||
|
||||
if(stackToPlace.stackSize == 0) {
|
||||
ManaItemHandler.requestManaExact(par1ItemStack, par2EntityPlayer, COST, true);
|
||||
ManaItemHandler.requestManaExactForTool(par1ItemStack, par2EntityPlayer, COST, true);
|
||||
for(int i = 0; i < 6; i++)
|
||||
Botania.proxy.sparkleFX(par3World, par4 + dir.offsetX + Math.random(), par5 + dir.offsetY + Math.random(), par6 + dir.offsetZ + Math.random(), 0.2F, 0.2F, 1F, 1F, 5);
|
||||
}
|
||||
|
||||
@@ -197,6 +197,7 @@ public final class LibItemNames {
|
||||
"terrasteelNugget",
|
||||
"elementiumNugget",
|
||||
"root",
|
||||
"pebble"
|
||||
"pebble",
|
||||
"manaweaveCloth"
|
||||
};
|
||||
}
|
||||
@@ -40,6 +40,7 @@ public final class LibOreDict {
|
||||
public static final String ELEMENTIUM_NUGGET = "nuggetElvenElementium";
|
||||
public static final String ROOT = "livingRoot";
|
||||
public static final String PEBBLE = "pebble";
|
||||
public static final String MANAWEAVE_CLOTH = "clothManaweave";
|
||||
|
||||
public static final String VIAL = "bVial";
|
||||
public static final String FLASK = "bFlask";
|
||||
|
||||
Reference in new issue
Block a user