Update Botania API. Use ForgeGradle for some dependencies, update others. Actually runs in dev environment now. Add armor set bonus for mana reduction while wearing infinity armor.

This commit is contained in:
Mary committed 2015-09-01 10:12:21 -07:00
1 parent df4e6e2919
commit f4eb321fc2
132 files changed
+449 -60

No files matched your search

+35 -4
View File
@@ -15,18 +15,49 @@ buildscript {
}
}
repositories {
maven {
name 'DVS1 Maven FS'
url 'http://dvs1.progwml6.com/files/maven'
}
maven {
name 'CB Maven FS'
url "http://chickenbones.net/maven/"
}
ivy {
name "MineTweaker3"
artifactPattern "http://minetweaker3.powerofbytes.com/download/[module]-([classifier]-)[revision].[ext]"
}
}
apply plugin: 'forge'
version = "0.2"
group= "fox.spiteful.avaritia" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "Avaritia"
ext.configFile = file "build.properties"
configFile.withReader {
def prop = new Properties()
prop.load(it)
project.ext.config = new ConfigSlurper().parse prop
}
version = config.mc_version + "-" + config.mod_version + "-" + config.build_number
group= config.package_group
archivesBaseName = config.mod_name
minecraft {
version = "1.7.10-10.13.3.1408-1.7.10"
version = config.mc_version + "-" + config.forge_version
runDir = "eclipse"
}
dependencies {
compile name: "NotEnoughItems" , group: "codechicken", version: config.mc_version + "-" + config.nei_version, classifier: "dev"
runtime name: "CodeChickenLib" , group: "codechicken", version: config.mc_version + "-" + config.ccl_version, classifier: "dev"
runtime name: "CodeChickenCore" , group: "codechicken", version: config.mc_version + "-" + config.ccc_version, classifier: "dev"
compile name: "MineTweaker3" , group: "minetweaker", version: config.mc_version + "-" + config.minetweaker_version, classifier: "Dev"
compile "tconstruct:TConstruct:" + config.mc_version + "-" + config.tconstruct_version + ":deobf"
compile "mantle:Mantle:" + config.mc_version + "-" + config.mantle_version + ":deobf"
compile fileTree(dir: 'lib', include: '*.jar')
}
+12
View File
@@ -0,0 +1,12 @@
mod_name = Avaritia
package_group = fox.spiteful.avaritia
forge_version = 10.13.4.1448-1.7.10
nei_version = 1.0.4.107
ccc_version = 1.0.6.43
ccl_version = 1.1.3.140
mod_version = 0.2
build_number = 1
mc_version = 1.7.10
minetweaker_version = 3.0.9C
tconstruct_version = 1.8.7.build979
mantle_version = 0.3.2.jenkins188
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -94,9 +94,15 @@ public final class BotaniaAPI {
public static ArmorMaterial terrasteelArmorMaterial = EnumHelper.addArmorMaterial("TERRASTEEL", 34, new int[] {3, 8, 6, 3}, 26);
public static ToolMaterial terrasteelToolMaterial = EnumHelper.addToolMaterial("TERRASTEEL", 4, 2300, 9F, 3F, 26);
public static ArmorMaterial manaweaveArmorMaterial = EnumHelper.addArmorMaterial("MANAWEAVE", 5, new int[] { 1, 2, 2, 1 }, 18);
public static EnumRarity rarityRelic = EnumHelper.addRarity("RELIC", EnumChatFormatting.GOLD, "Relic");
public static KnowledgeType basicKnowledge, elvenKnowledge;
public static KnowledgeType basicKnowledge;
public static KnowledgeType elvenKnowledge;
// This is here for completeness sake, but you shouldn't use it
public static KnowledgeType relicKnowledge;
// All of these categories are initialized during botania's PreInit stage.
public static LexiconCategory categoryBasics;
@@ -117,6 +123,7 @@ public final class BotaniaAPI {
basicKnowledge = registerKnowledgeType("minecraft", EnumChatFormatting.RESET, true);
elvenKnowledge = registerKnowledgeType("alfheim", EnumChatFormatting.DARK_GREEN, false);
relicKnowledge = registerKnowledgeType("relic", EnumChatFormatting.DARK_PURPLE, false);
addOreWeight("oreAluminum", 3940); // Tinkers' Construct
addOreWeight("oreAmber", 2075); // Thaumcraft
@@ -128,7 +135,8 @@ public final class BotaniaAPI {
addOreWeight("oreCoal", 46525); // Vanilla
addOreWeight("oreCopper", 8325); // IC2, Thermal Expansion, Tinkers' Construct, etc.
addOreWeight("oreDark", 1350); // EvilCraft
addOreWeight("oreDarkIron", 1700); // Factorization
addOreWeight("oreDarkIron", 1700); // Factorization (older versions)
addOreWeight("oreFzDarkIron", 1700); // Factorization (newer versions)
addOreWeight("oreDiamond", 1265); // Vanilla
addOreWeight("oreEmerald", 780); // Vanilla
addOreWeight("oreGalena", 1000); // Factorization
@@ -143,8 +151,10 @@ public final class BotaniaAPI {
addOreWeight("oreLapis", 1285); // Vanilla
addOreWeight("oreLead", 7985); // IC2, Thermal Expansion, Factorization, etc.
addOreWeight("oreMCropsEssence", 3085); // Magical Crops
addOreWeight("oreMithril", 8); // Thermal Expansion
addOreWeight("oreNickel", 2275); // Thermal Expansion
addOreWeight("oreOlivine", 1100); // Project RED
addOreWeight("orePlatinum", 365); // Thermal Expansion
addOreWeight("oreRedstone", 6885); // Vanilla
addOreWeight("oreRuby", 1100); // Project RED
addOreWeight("oreSapphire", 1100); // Project RED
@@ -12,6 +12,7 @@ package vazkii.botania.api.boss;
import java.awt.Rectangle;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.entity.boss.IBossDisplayData;
import net.minecraft.util.ResourceLocation;
import cpw.mods.fml.relauncher.Side;
@@ -57,5 +58,5 @@ public interface IBotaniaBoss extends IBossDisplayData {
* here if needed.
*/
@SideOnly(Side.CLIENT)
public void bossBarRenderCallback();
public void bossBarRenderCallback(ScaledResolution res, int x, int y);
}
@@ -15,6 +15,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.WeakHashMap;
import java.util.regex.Pattern;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
@@ -31,6 +32,8 @@ public final class CorporeaHelper {
private static final WeakHashMap<List<ICorporeaSpark>, List<IInventory>> cachedNetworks = new WeakHashMap();
private static final List<ICorporeaAutoCompleteController> autoCompleteControllers = new ArrayList<ICorporeaAutoCompleteController>();
private static final Pattern patternControlCode = Pattern.compile("(?i)\\u00A7[0-9A-FK-OR]");
public static final String[] WILDCARD_STRINGS = new String[] {
"...", "~", "+", "?" , "*"
};
@@ -291,7 +294,7 @@ public final class CorporeaHelper {
}
String name = stack.getDisplayName().toLowerCase().trim();
String name = stripControlCodes(stack.getDisplayName().toLowerCase().trim());
return equalOrContain(name, s, contains) || equalOrContain(name + "s", s, contains) || equalOrContain(name + "es", s, contains) || name.endsWith("y") && equalOrContain(name.substring(0, name.length() - 1) + "ies", s, contains);
}
@@ -337,4 +340,9 @@ public final class CorporeaHelper {
return true;
return false;
}
// Copy from StringUtils
public static String stripControlCodes(String str) {
return patternControlCode.matcher(str).replaceAll("");
}
}
@@ -32,6 +32,7 @@ import vazkii.botania.api.recipe.RecipeElvenTrade;
import vazkii.botania.api.recipe.RecipeManaInfusion;
import vazkii.botania.api.recipe.RecipePetals;
import vazkii.botania.api.recipe.RecipeRuneAltar;
import vazkii.botania.api.subtile.SubTileEntity;
public class DummyMethodHandler implements IInternalMethodHandler {
@@ -149,6 +150,16 @@ public class DummyMethodHandler implements IInternalMethodHandler {
// NO-OP
}
@Override
public void drawComplexManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res, ItemStack bindDisplay, boolean properlyBound) {
// NO-OP
}
@Override
public ItemStack getBindDisplayForFlowerType(SubTileEntity e) {
return new ItemStack(Blocks.stone, 0, 0);
}
@Override
public void renderLexiconText(int x, int y, int width, int height, String unlocalizedText) {
// NO-OP
@@ -205,4 +216,9 @@ public class DummyMethodHandler implements IInternalMethodHandler {
return false;
}
@Override
public void sendBaubleUpdatePacket(EntityPlayer player, int slot) {
// NO-OP
}
}
@@ -31,6 +31,7 @@ import vazkii.botania.api.recipe.RecipeElvenTrade;
import vazkii.botania.api.recipe.RecipeManaInfusion;
import vazkii.botania.api.recipe.RecipePetals;
import vazkii.botania.api.recipe.RecipeRuneAltar;
import vazkii.botania.api.subtile.SubTileEntity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -96,6 +97,12 @@ public interface IInternalMethodHandler {
@SideOnly(Side.CLIENT)
public void drawSimpleManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res);
@SideOnly(Side.CLIENT)
public void drawComplexManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res, ItemStack bindDisplay, boolean properlyBound);
@SideOnly(Side.CLIENT)
public ItemStack getBindDisplayForFlowerType(SubTileEntity e);
@SideOnly(Side.CLIENT)
public void renderLexiconText(int x, int y, int width, int height, String unlocalizedText);
@@ -113,4 +120,6 @@ public interface IInternalMethodHandler {
public boolean isBotaniaFlower(World world, int x, int y, int z);
public void sendBaubleUpdatePacket(EntityPlayer player, int slot);
}
@@ -0,0 +1,40 @@
/**
* 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 20, 2015, 10:31:54 PM (GMT)]
*/
package vazkii.botania.api.item;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
/**
* An Item that implements this can provide blocks to other items that use them.
* For example, the Black Hole Talisman implements this in order to allow for
* the Rod of the Shifting Crust to pull blocks from it.
*/
public interface IBlockProvider {
/**
* Provides the requested item. The doit paremeter specifies whether this is
* just a test (false) or if the item should actually be removed (true).
* If you need to use calls to ManaItemHandler.requestMana[Exact], use
* the requestor as the ItemStack passed in.
*/
public boolean provideBlock(EntityPlayer player, ItemStack requestor, ItemStack stack, Block block, int meta, boolean doit);
/**
* Gets the amount of blocks of the type passed stored in this item. You must
* check for the block passed in to not give the counter for a wrong block. Returning
* -1 states that the item can provide infinite of the item passed in (for example,
* the Rod of the Lands would return -1 if the block is dirt).
*/
public int getBlockCount(EntityPlayer player, ItemStack requestor, ItemStack stack, Block block, int meta);
}
@@ -0,0 +1,44 @@
/**
* 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 28, 2015, 9:04:53 PM (GMT)]
*/
package vazkii.botania.api.item;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
/**
* An armor item that implements this gives the player wearing it mana proficiency, by
* which it makes Rods the player use have a stronger effect. This is a boolean, and only
* one armor piece with this returning true is required for the player to be considered
* to be having proficiency, by which it's suggested that this is used alongside an
* armor set, where only one piece implements it.
*/
public interface IManaProficiencyArmor {
public boolean shouldGiveProficiency(ItemStack stack, int slot, EntityPlayer player);
public final static class Helper {
public static boolean hasProficiency(EntityPlayer player) {
for(int i = 0; i < 4; i++) {
ItemStack armor = player.getCurrentArmor(i);
if(armor != null) {
Item item = armor.getItem();
if(item instanceof IManaProficiencyArmor && ((IManaProficiencyArmor) item).shouldGiveProficiency(armor, i, player))
return true;
}
}
return false;
}
}
}
@@ -15,6 +15,8 @@ import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChunkCoordinates;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
/**
* An item that implements this will allow for various wireframes to be drawn
@@ -27,6 +29,7 @@ public interface IWireframeCoordinateListProvider {
* Returns a list of ChunkCoordinates for the wireframes to draw.
* Can be null.
*/
@SideOnly(Side.CLIENT)
public List<ChunkCoordinates> getWireframesToDraw(EntityPlayer player, ItemStack stack);
}
@@ -0,0 +1,38 @@
/**
* 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 @ [Jul 25, 2015, 8:02:41 PM (GMT)]
*/
package vazkii.botania.api.item;
import net.minecraft.tileentity.TileEntity;
import cpw.mods.fml.common.eventhandler.Event;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
/**
* Why would you ever want this ._.
*/
@SideOnly(Side.CLIENT)
public class TinyPotatoRenderEvent extends Event {
public final TileEntity tile;
public final String name;
public final double x, y, z;
public final float partTicks;
public TinyPotatoRenderEvent(TileEntity tile, String name, double x, double y, double z, float partTicks) {
this.tile = tile;
this.name = name;
this.x = x;
this.y = y;
this.z = z;
this.partTicks = partTicks;
}
}
@@ -17,6 +17,8 @@ import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import vazkii.botania.api.BotaniaAPI;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class LexiconEntry implements Comparable<LexiconEntry> {
@@ -77,6 +79,11 @@ public class LexiconEntry implements Comparable<LexiconEntry> {
return unlocalizedName;
}
@SideOnly(Side.CLIENT)
public boolean isVisible() {
return true;
}
/**
* Sets what pages you want this entry to have.
*/
@@ -15,7 +15,8 @@ import net.minecraft.item.ItemStack;
/**
* An armor item that implements this can provide a mana discount for mana tools.
* Mana tools are the ones on the main toolset (Pick, Shovel, Axe, Sword and Shovel).
* Mana tools are the ones on the main toolset (Pick, Shovel, Axe, Sword and Shovel)
* as well as Rods.
*/
public interface IManaDiscountArmor {
@@ -39,7 +39,8 @@ public final class ManaItemHandler {
for(int i = 0; i < size; i++) {
boolean useBaubles = i >= invSize;
IInventory inv = useBaubles ? baublesInv : mainInv;
ItemStack stackInSlot = inv.getStackInSlot(i - (useBaubles ? invSize : 0));
int slot = i - (useBaubles ? invSize : 0);
ItemStack stackInSlot = inv.getStackInSlot(slot);
if(stackInSlot == stack)
continue;
@@ -53,6 +54,8 @@ public final class ManaItemHandler {
if(remove)
manaItem.addMana(stackInSlot, -mana);
if(useBaubles)
BotaniaAPI.internalHandler.sendBaubleUpdatePacket(player, slot);
return mana;
}
@@ -84,7 +87,8 @@ public final class ManaItemHandler {
for(int i = 0; i < size; i++) {
boolean useBaubles = i >= invSize;
IInventory inv = useBaubles ? baublesInv : mainInv;
ItemStack stackInSlot = inv.getStackInSlot(i - (useBaubles ? invSize : 0));
int slot = i - (useBaubles ? invSize : 0);
ItemStack stackInSlot = inv.getStackInSlot(slot);
if(stackInSlot == stack)
continue;
@@ -96,6 +100,8 @@ public final class ManaItemHandler {
if(remove)
manaItemSlot.addMana(stackInSlot, -manaToGet);
if(useBaubles)
BotaniaAPI.internalHandler.sendBaubleUpdatePacket(player, slot);
return true;
}
@@ -127,7 +133,8 @@ public final class ManaItemHandler {
for(int i = 0; i < size; i++) {
boolean useBaubles = i >= invSize;
IInventory inv = useBaubles ? baublesInv : mainInv;
ItemStack stackInSlot = inv.getStackInSlot(i - (useBaubles ? invSize : 0));
int slot = i - (useBaubles ? invSize : 0);
ItemStack stackInSlot = inv.getStackInSlot(slot);
if(stackInSlot == stack)
continue;
@@ -146,6 +153,8 @@ public final class ManaItemHandler {
if(add)
manaItemSlot.addMana(stackInSlot, manaToSend);
if(useBaubles)
BotaniaAPI.internalHandler.sendBaubleUpdatePacket(player, slot);
return received;
}
@@ -177,7 +186,8 @@ public final class ManaItemHandler {
for(int i = 0; i < size; i++) {
boolean useBaubles = i >= invSize;
IInventory inv = useBaubles ? baublesInv : mainInv;
ItemStack stackInSlot = inv.getStackInSlot(i - (useBaubles ? invSize : 0));
int slot = i - (useBaubles ? invSize : 0);
ItemStack stackInSlot = inv.getStackInSlot(slot);
if(stackInSlot == stack)
continue;
@@ -189,6 +199,8 @@ public final class ManaItemHandler {
if(add)
manaItemSlot.addMana(stackInSlot, manaToSend);
if(useBaubles)
BotaniaAPI.internalHandler.sendBaubleUpdatePacket(player, slot);
return true;
}
Loaded 100 of 132 files, more files were not shown because too many files have changed in this diff. Show more