Minor Tweaks

This commit is contained in:
Jeremy Diamond committed 2015-09-06 11:02:33 -07:00
1 parent 6ebd1305af
commit 198fe8b728
25 files changed
+381 -64

No files matched your search

@@ -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;
}
@@ -1,4 +1,4 @@
@API(owner = "Botania", apiVersion = "56", provides = "BotaniaAPI")
@API(owner = "Botania", apiVersion = "61", provides = "BotaniaAPI")
package vazkii.botania.api;
import cpw.mods.fml.common.API;
@@ -60,7 +60,7 @@ public class RecipePureDaisy {
ores = OreDictionary.getOres(entry);
oreMap.put(entry, ores);
}
for(ItemStack ostack : ores) {
ItemStack cstack = ostack.copy();
if(cstack.getItemDamage() == Short.MAX_VALUE)
@@ -30,6 +30,8 @@ import vazkii.botania.api.mana.IManaPool;
*/
public class SubTileFunctional extends SubTileEntity {
public static final int RANGE = 10;
private static final String TAG_MANA = "mana";
private static final String TAG_POOL_X = "poolX";
@@ -59,7 +61,7 @@ public class SubTileFunctional extends SubTileEntity {
linkPool();
if(linkedPool != null) {
if(linkedPool != null && isValidBinding()) {
IManaPool pool = (IManaPool) linkedPool;
int manaInPool = pool.getCurrentMana();
int manaMissing = getMaxMana() - mana;
@@ -85,8 +87,6 @@ public class SubTileFunctional extends SubTileEntity {
}
public void linkPool() {
final int range = 10;
boolean needsNew = false;
if(linkedPool == null) {
needsNew = true;
@@ -103,32 +103,27 @@ public class SubTileFunctional extends SubTileEntity {
cachedPoolCoordinates = null;
}
}
} else {
TileEntity tileAt = supertile.getWorldObj().getTileEntity(linkedPool.xCoord, linkedPool.yCoord, linkedPool.zCoord);
if(tileAt != null && tileAt instanceof IManaPool)
linkedPool = tileAt;
}
if(!needsNew && linkedPool != null) {
if(supertile.getWorldObj().blockExists(linkedPool.xCoord, linkedPool.yCoord, linkedPool.zCoord) && !linkedPool.isInvalid()) {
TileEntity tileAt = supertile.getWorldObj().getTileEntity(linkedPool.xCoord, linkedPool.yCoord, linkedPool.zCoord);
if(!(tileAt instanceof IManaPool) || tileAt.isInvalid()) {
linkedPool = null;
needsNew = true;
} else linkedPool = tileAt;
} else {
cachedPoolCoordinates = new ChunkCoordinates(linkedPool.xCoord, linkedPool.yCoord, linkedPool.zCoord);
linkedPool = null;
}
}
if(needsNew) {
if(needsNew && ticksExisted == 1) { // Only for new flowers
IManaNetwork network = BotaniaAPI.internalHandler.getManaNetworkInstance();
int size = network.getAllPoolsInWorld(supertile.getWorldObj()).size();
if(BotaniaAPI.internalHandler.shouldForceCheck() || size != sizeLastCheck) {
ChunkCoordinates coords = new ChunkCoordinates(supertile.xCoord, supertile.yCoord, supertile.zCoord);
linkedPool = network.getClosestPool(coords, supertile.getWorldObj(), range);
linkedPool = network.getClosestPool(coords, supertile.getWorldObj(), RANGE);
sizeLastCheck = size;
}
}
}
public void linkToForcefully(TileEntity pool) {
linkedPool = pool;
}
public void addMana(int mana) {
this.mana = Math.min(getMaxMana(), this.mana + mana);
}
@@ -211,11 +206,15 @@ public class SubTileFunctional extends SubTileEntity {
return false;
}
public boolean isValidBinding() {
return linkedPool != null && !linkedPool.isInvalid() && supertile.getWorldObj().getTileEntity(linkedPool.xCoord, linkedPool.yCoord, linkedPool.zCoord) == linkedPool;
}
@Override
public void renderHUD(Minecraft mc, ScaledResolution res) {
String name = StatCollector.translateToLocal("tile.botania:flower." + getUnlocalizedName() + ".name");
int color = getColor();
BotaniaAPI.internalHandler.drawSimpleManaHUD(color, knownMana, getMaxMana(), name, res);
BotaniaAPI.internalHandler.drawComplexManaHUD(color, knownMana, getMaxMana(), name, res, BotaniaAPI.internalHandler.getBindDisplayForFlowerType(this), isValidBinding());
}
}
@@ -16,11 +16,13 @@ import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.StatCollector;
import net.minecraftforge.common.util.ForgeDirection;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.internal.IManaNetwork;
import vazkii.botania.api.mana.IManaCollector;
@@ -30,6 +32,8 @@ import vazkii.botania.api.mana.IManaCollector;
*/
public class SubTileGenerating extends SubTileEntity {
public static final int RANGE = 6;
private static final String TAG_MANA = "mana";
private static final String TAG_COLLECTOR_X = "collectorX";
@@ -72,14 +76,14 @@ public class SubTileGenerating extends SubTileEntity {
if(isPassiveFlower() && muhBalance > 0 && ticksExisted > muhBalance) {
supertile.getWorldObj().playAuxSFX(2001, supertile.xCoord, supertile.yCoord, supertile.zCoord, Block.getIdFromBlock(supertile.getBlockType()));
supertile.getWorldObj().setBlockToAir(supertile.xCoord, supertile.yCoord, supertile.zCoord);
if(supertile.getWorldObj().getBlock(supertile.xCoord, supertile.yCoord - 1, supertile.zCoord).isSideSolid(supertile.getWorldObj(), supertile.xCoord, supertile.yCoord - 1, supertile.zCoord, ForgeDirection.UP))
supertile.getWorldObj().setBlock(supertile.xCoord, supertile.yCoord, supertile.zCoord, Blocks.deadbush);
else supertile.getWorldObj().setBlockToAir(supertile.xCoord, supertile.yCoord, supertile.zCoord);
}
}
}
public void linkCollector() {
final int range = 6;
boolean needsNew = false;
if(linkedCollector == null) {
needsNew = true;
@@ -96,38 +100,33 @@ public class SubTileGenerating extends SubTileEntity {
cachedCollectorCoordinates = null;
}
}
} else {
TileEntity tileAt = supertile.getWorldObj().getTileEntity(linkedCollector.xCoord, linkedCollector.yCoord, linkedCollector.zCoord);
if(tileAt != null && tileAt instanceof IManaCollector)
linkedCollector = tileAt;
}
if(!needsNew && linkedCollector != null) {
if(supertile.getWorldObj().blockExists(linkedCollector.xCoord, linkedCollector.yCoord, linkedCollector.zCoord) && !linkedCollector.isInvalid()) {
TileEntity tileAt = supertile.getWorldObj().getTileEntity(linkedCollector.xCoord, linkedCollector.yCoord, linkedCollector.zCoord);
if(!(tileAt instanceof IManaCollector) || tileAt.isInvalid()) {
linkedCollector = null;
needsNew = true;
} else linkedCollector = tileAt;
} else {
cachedCollectorCoordinates = new ChunkCoordinates(linkedCollector.xCoord, linkedCollector.yCoord, linkedCollector.zCoord);
linkedCollector = null;
}
}
if(needsNew) {
if(needsNew && ticksExisted == 1) { // New flowers only
IManaNetwork network = BotaniaAPI.internalHandler.getManaNetworkInstance();
int size = network.getAllCollectorsInWorld(supertile.getWorldObj()).size();
if(BotaniaAPI.internalHandler.shouldForceCheck() || size != sizeLastCheck) {
ChunkCoordinates coords = new ChunkCoordinates(supertile.xCoord, supertile.yCoord, supertile.zCoord);
linkedCollector = network.getClosestCollector(coords, supertile.getWorldObj(), range);
linkedCollector = network.getClosestCollector(coords, supertile.getWorldObj(), RANGE);
sizeLastCheck = size;
}
}
}
public void linkToForcefully(TileEntity collector) {
linkedCollector = collector;
}
public void addMana(int mana) {
this.mana = Math.min(getMaxMana(), this.mana + mana);
}
public void emptyManaIntoCollector() {
if(linkedCollector != null) {
if(linkedCollector != null && isValidBinding()) {
IManaCollector collector = (IManaCollector) linkedCollector;
if(!collector.isFull() && mana > 0) {
int manaval = Math.min(mana, collector.getMaxMana() - collector.getCurrentMana());
@@ -239,11 +238,16 @@ public class SubTileGenerating extends SubTileEntity {
return false;
}
public boolean isValidBinding() {
return linkedCollector != null && !linkedCollector.isInvalid() && supertile.getWorldObj().getTileEntity(linkedCollector.xCoord, linkedCollector.yCoord, linkedCollector.zCoord) == linkedCollector;
}
@Override
public void renderHUD(Minecraft mc, ScaledResolution res) {
String name = StatCollector.translateToLocal("tile.botania:flower." + getUnlocalizedName() + ".name");
int color = getColor();
BotaniaAPI.internalHandler.drawSimpleManaHUD(color, knownMana, getMaxMana(), name, res);
BotaniaAPI.internalHandler.drawComplexManaHUD(color, knownMana, getMaxMana(), name, res, BotaniaAPI.internalHandler.getBindDisplayForFlowerType(this), isValidBinding());
}
}
@@ -4,6 +4,7 @@ import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.registry.GameRegistry;
import fox.spiteful.avaritia.Config;
import fox.spiteful.avaritia.Lumberjack;
import fox.spiteful.avaritia.blocks.LudicrousBlocks;
import fox.spiteful.avaritia.compat.bloodmagic.Bloody;
import fox.spiteful.avaritia.compat.botania.Tsundere;
import fox.spiteful.avaritia.compat.forestry.Ranger;
@@ -11,8 +12,11 @@ import fox.spiteful.avaritia.compat.modtweaker.Tweak;
import fox.spiteful.avaritia.compat.nei.NotEnough;
import fox.spiteful.avaritia.compat.thaumcraft.Lucrum;
import fox.spiteful.avaritia.compat.ticon.Tonkers;
import fox.spiteful.avaritia.crafting.ExtremeCraftingManager;
import fox.spiteful.avaritia.crafting.Grinder;
import fox.spiteful.avaritia.items.LudicrousItems;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
@@ -35,6 +39,7 @@ public class Compat {
public static boolean mfr = false;
public static boolean am2 = false;
public static boolean forestry = false;
public static boolean te = false;
public static void census(){
nei = Loader.isModLoaded("NotEnoughItems");
@@ -52,6 +57,7 @@ public class Compat {
mfr = Loader.isModLoaded("MineFactoryReloaded") && Config.mfr;
am2 = Loader.isModLoaded("arsmagica2") && Config.am2;
forestry = Loader.isModLoaded("Forestry") && Config.forestry;
te = Loader.isModLoaded("ThermalExpansion") && Config.te;
}
public static void compatify(){
@@ -358,6 +364,29 @@ public class Compat {
}
}
if(te){
try {
Block cell = getBlock("ThermalExpansion", "Cell");
ExtremeCraftingManager.getInstance().addExtremeShapedOreRecipe(new ItemStack(cell, 1, 0),
"IIIIRIIII",
"IEEEREEEI",
"IERRRRREI",
"IERRRRREI",
"RRRRXRRRR",
"IERRRRREI",
"IERRRRREI",
"IEEEREEEI",
"IIIIRIIII",
'X', new ItemStack(LudicrousItems.resource, 1, 5),
'E', "blockEnderium",
'I', new ItemStack(LudicrousItems.resource, 1, 6),
'R', new ItemStack(LudicrousItems.singularity, 1, 3));
}
catch (Throwable e){
Lumberjack.log(Level.INFO, e, "Avaritia forgot one of Thermal Expansion's 500 prerequisites.");
}
}
}
public static Block getBlock(String mod, String block) throws ItemNotFoundException {
@@ -48,7 +48,8 @@ public class TileInfinitato extends TileLudicrous {
ent.addPotionEffect(new PotionEffect(Potion.fireResistance.id, time, 0));
ent.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, time, 0));
ent.addPotionEffect(new PotionEffect(Potion.nightVision.id, time, 0));
ent.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, time, 4)); // absorb
ent.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, time, 4)); // absorb
ent.addPotionEffect(new PotionEffect(Potion.field_76443_y.id, time, 4)); // saturation
}
}
}
@@ -11,17 +11,21 @@ public class Gregorizer {
public static void balance(){
if(Loader.isModLoaded("magicalcrops"))
multiplier += 1;
if(Loader.isModLoaded("AgriCraft"))
multiplier += 1;
if(Loader.isModLoaded("MineFactoryReloaded"))
multiplier += 1;
if(Loader.isModLoaded("BigReactors"))
modifier += 100;
if(Loader.isModLoaded("EE3")||Loader.isModLoaded("ProjectE"))
multiplier += 2;
if(Loader.isModLoaded("EE3"))
multiplier += 1;
else if(Loader.isModLoaded("ProjectE"))
multiplier += 3;
if(Loader.isModLoaded("Botania"))
modifier += 50;
if(Loader.isModLoaded("IC2"))
modifier += 300;
if(Loader.isModLoaded("ThermalExpansion"))
if(Loader.isModLoaded("ThermalExpansion") || Loader.isModLoaded("TSteelworks"))
modifier += 300;
if(Loader.isModLoaded("technom"))
modifier += 500;
@@ -31,8 +35,6 @@ public class Gregorizer {
modifier += 100;
if(Loader.isModLoaded("appliedenergistics2"))
modifier += 200;
if(Loader.isModLoaded("TSteelworks"))
modifier += 300;
if(Loader.isModLoaded("ImmersiveEngineering"))
modifier += 400;
if(Loader.isModLoaded("Mekanism")) {
@@ -40,8 +42,8 @@ public class Gregorizer {
multiplier += 1;
}
modifier += Config.modifier;
multiplier += Config.multiplier;
modifier = Math.max(modifier + Config.modifier, 0);
multiplier = Math.max(multiplier + Config.multiplier, 0);
}
public static int balanceCost(int cost){
@@ -20,7 +20,7 @@ public class Mincer {
public static ShapelessOreRecipe meatballRecipe;
// here's where all the food magic goes on
private static final String[] sacredCropNames = new String[]{"cropWheat", "cropCarrot", "cropPotato", "cropApple", "cropMelon", "cropPumpkin", "cropCactus", "cropMushroomRed", "cropMushroomBrown"};
private static final String[] sacredCropNames = new String[]{"cropWheat", "cropCarrot", "cropPotato", "cropApple", "cropMelon", "cropPumpkin", "cropCactus", "cropMushroomRed", "cropMushroomBrown", "cropCherry"};
private static final String[] forbiddenCropNames = new String[] {"cropEdibleroot", "cropWhitemushroom", "cropBeet", "cropCotton", "cropPoppy", "cropTulipRed", "cropTulipWhite", "cropDaisy",
"cropTulipPink", "cropAllium", "cropOrchid", "cropTulipOrange", "cropDandelion", "cropShroomRed", "cropShroomBrown",
"cropFerranium", "cropAurigold", "cropDiamahlia", "cropLapender", "cropEmeryllis", "cropRedstodendron", "cropCuprosia",
@@ -3,7 +3,6 @@ package fox.spiteful.avaritia.items;
import com.google.common.collect.Multimap;
import fox.spiteful.avaritia.Avaritia;
import fox.spiteful.avaritia.LudicrousText;
import fox.spiteful.avaritia.Lumberjack;
import fox.spiteful.avaritia.compat.Compat;
import fox.spiteful.avaritia.entity.EntityImmortalItem;
import fox.spiteful.avaritia.render.ICosmicRenderItem;
@@ -14,8 +13,6 @@ import net.minecraft.client.renderer.texture.IIconRegister;
import fox.spiteful.avaritia.PotionHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemArmor;
@@ -39,7 +36,9 @@ import thaumcraft.api.IGoggles;
import thaumcraft.api.IVisDiscountGear;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.nodes.IRevealer;
import vazkii.botania.api.item.IManaProficiencyArmor;
import vazkii.botania.api.item.IPhantomInkable;
import vazkii.botania.api.mana.IManaDiscountArmor;
import java.util.ArrayList;
import java.util.Collection;
@@ -49,9 +48,12 @@ import java.util.List;
@Optional.Interface(iface = "thaumcraft.api.IGoggles", modid = "Thaumcraft"),
@Optional.Interface(iface = "thaumcraft.api.nodes.IRevealer", modid = "Thaumcraft"),
@Optional.Interface(iface = "thaumcraft.api.IVisDiscountGear", modid = "Thaumcraft"),
@Optional.Interface(iface = "vazkii.botania.api.item.IPhantomInkable", modid = "Botania")
@Optional.Interface(iface = "vazkii.botania.api.item.IPhantomInkable", modid = "Botania"),
@Optional.Interface(iface = "vazkii.botania.api.mana.IManaDiscountArmor", modid = "Botania"),
@Optional.Interface(iface = "vazkii.botania.api.item.IManaProficiencyArmor", modid = "Botania")
})
public class ItemArmorInfinity extends ItemArmor implements ICosmicRenderItem, IGoggles, IRevealer, IVisDiscountGear, IPhantomInkable {
public class ItemArmorInfinity extends ItemArmor implements ICosmicRenderItem, IGoggles, IRevealer, IVisDiscountGear, IPhantomInkable,
IManaDiscountArmor, IManaProficiencyArmor {
public static final ArmorMaterial infinite_armor = EnumHelper.addArmorMaterial("infinity", 9999, new int[]{6, 16, 12, 6}, 1000);
public IIcon cosmicMask;
@@ -188,6 +190,18 @@ public class ItemArmorInfinity extends ItemArmor implements ICosmicRenderItem, I
tag.setBoolean("phantomInk", ink);
}
@Optional.Method(modid = "Botania")
@Override
public float getDiscount(ItemStack stack, int slot, EntityPlayer player){
return 0.25F;
}
@Optional.Method(modid = "Botania")
@Override
public boolean shouldGiveProficiency(ItemStack itemStack, int i, EntityPlayer player){
return true;
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister ir) {
@@ -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;
}
}
}
@@ -0,0 +1,31 @@
/**
* 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 @ [Jan 28, 2015, 9:22:53 PM (GMT)]
*/
package vazkii.botania.api.mana;
import net.minecraft.entity.player.EntityPlayer;
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)
* as well as Rods.
*/
public interface IManaDiscountArmor {
/**
* Gets the mana discount that this piece of armor provides. This is added
* together to create the full discount.
* Value is to be from 0.0 to 1.0. 0.1 is 10% discount, as an example.
* You can also return negative values to make tools cost more.
*/
public float getDiscount(ItemStack stack, int slot, EntityPlayer player);
}
@@ -0,0 +1,4 @@
@API(owner = "Botania", apiVersion = "61", provides = "BotaniaAPI")
package vazkii.botania.api;
import cpw.mods.fml.common.API;