mirror of
https://github.com/GTNewHorizons/BloodMagic.git
synced 2026-11-27 15:23:06 +00:00
Compare commits
29
Commits
master
...
1.7.12-pre
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d8650bed6 | ||
|
|
e362e6dbae | ||
|
|
f0596f1670 | ||
|
|
180c7c0f3e | ||
|
|
60b0d380bf | ||
|
|
22137e5ae1 | ||
|
|
57fa14baf2 | ||
|
|
13748db6db | ||
|
|
a29a4084ed | ||
|
|
78b0acad7e | ||
|
|
d24de9e13d | ||
|
|
ff8466ae00 | ||
|
|
caca7c5fc7 | ||
|
|
efc0c52bc8 | ||
|
|
fc589690d0 | ||
|
|
3e40aa9708 | ||
|
|
8da3db4e65 | ||
|
|
b0096a3279 | ||
|
|
681fa92af5 | ||
|
|
e153c70116 | ||
|
|
1ea6d9c700 | ||
|
|
38a7bbbe55 | ||
|
|
082b41cb8c | ||
|
|
5a6c998070 | ||
|
|
b14aded91f | ||
|
|
46a8c566d7 | ||
|
|
ac59510594 | ||
|
|
d5a33f6f81 | ||
|
|
aad613b221 |
No files matched your search
+1
-1
@@ -37,7 +37,7 @@ remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/co
|
|||||||
|
|
||||||
# Select a default username for testing your mod. You can always override this per-run by running
|
# Select a default username for testing your mod. You can always override this per-run by running
|
||||||
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
|
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
|
||||||
developmentEnvironmentUserName = "Developer"
|
developmentEnvironmentUserName = Developer
|
||||||
|
|
||||||
# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8.
|
# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8.
|
||||||
# See https://github.com/bsideup/jabel for details on how this works.
|
# See https://github.com/bsideup/jabel for details on how this works.
|
||||||
|
|||||||
@@ -1,4 +1,185 @@
|
|||||||
package WayofTime.alchemicalWizardry.api.items.interfaces;
|
package WayofTime.alchemicalWizardry.api.items.interfaces;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
|
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||||
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
|
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||||
|
|
||||||
public interface IBindable {
|
public interface IBindable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used by bound tools and the energy blaster/bazooka to check if they should skip their right click function.
|
||||||
|
* Drains the soul network by the amount returned by rightClickCost.
|
||||||
|
*/
|
||||||
|
default boolean checkRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
|
if (toggle(par1ItemStack, par2World, par3EntityPlayer)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (par2World.isRemote) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isActive(par1ItemStack) || SpellHelper.isFakePlayer(par2World, par3EntityPlayer)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isBoundTool() && AlchemicalWizardry.disableBoundToolsRightClick) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (par3EntityPlayer.isPotionActive(AlchemicalWizardry.customPotionInhibit)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(par3EntityPlayer.capabilities.isCreativeMode
|
||||||
|
|| EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, rightClickCost()))) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds the active state and owner information to an item if it has the relevant tags.
|
||||||
|
*/
|
||||||
|
default void addBindingInformation(ItemStack par1ItemStack, List par3List) {
|
||||||
|
NBTTagCompound itemTag = getTag(par1ItemStack);
|
||||||
|
if (itemTag.getBoolean("isActive")) {
|
||||||
|
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
||||||
|
} else if (itemTag.hasKey("isActive")) { // Only if present and set to false rather than not present at all
|
||||||
|
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!itemTag.getString("ownerName").equals("")) {
|
||||||
|
par3List.add(
|
||||||
|
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
||||||
|
+ itemTag.getString("ownerName"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void setActive(ItemStack par1ItemStack, boolean state) {
|
||||||
|
NBTTagCompound itemTag = getTag(par1ItemStack);
|
||||||
|
itemTag.setBoolean("isActive", state);
|
||||||
|
}
|
||||||
|
|
||||||
|
static boolean isActive(ItemStack par1ItemStack) {
|
||||||
|
NBTTagCompound itemTag = getTag(par1ItemStack);
|
||||||
|
return itemTag.getBoolean("isActive");
|
||||||
|
}
|
||||||
|
|
||||||
|
static NBTTagCompound getTag(ItemStack par1ItemStack) {
|
||||||
|
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||||
|
|
||||||
|
if (itemTag == null) {
|
||||||
|
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||||
|
itemTag = par1ItemStack.getTagCompound();
|
||||||
|
}
|
||||||
|
return itemTag;
|
||||||
|
}
|
||||||
|
|
||||||
|
default boolean toggle(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
|
if (!checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
|
setActive(par1ItemStack, !isActive(par1ItemStack));
|
||||||
|
setDrainTick(par1ItemStack, par2World);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the current tick is the proper tick to do a passive drain based on getDrainTicks. If it is, it runs
|
||||||
|
* doPassiveDrain and returns true. Otherwise, returns false.
|
||||||
|
*/
|
||||||
|
default boolean checkPassiveDrain(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
|
NBTTagCompound itemTag = getTag(par1ItemStack);
|
||||||
|
if (par2World.getTotalWorldTime() % this.drainTicks() == itemTag.getInteger("worldTimeDelay")
|
||||||
|
&& itemTag.getBoolean("isActive")) {
|
||||||
|
this.doPassiveDrain(par1ItemStack, par3EntityPlayer);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The action to take when checkPassiveDrain is run on the proper tick based on getDrainTicks.
|
||||||
|
*/
|
||||||
|
default void doPassiveDrain(ItemStack par1ItemStack, EntityPlayer par3EntityPlayer) {
|
||||||
|
if (!par3EntityPlayer.capabilities.isCreativeMode) {
|
||||||
|
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, drainCost())) {
|
||||||
|
setActive(par1ItemStack, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the drain tick delay based on the current world age and getDrainTicks().
|
||||||
|
*/
|
||||||
|
default void setDrainTick(ItemStack par1ItemStack, World par2World) {
|
||||||
|
getTag(par1ItemStack)
|
||||||
|
.setInteger("worldTimeDelay", (int) (par2World.getTotalWorldTime() - 1) % this.drainTicks());
|
||||||
|
}
|
||||||
|
|
||||||
|
static boolean checkAndSetItemOwner(ItemStack item, EntityPlayer player) {
|
||||||
|
return !SpellHelper.isFakePlayer(player) && SoulNetworkHandler.checkAndSetItemPlayer(item, player);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the item's owner even if it already has one.
|
||||||
|
*/
|
||||||
|
static void setItemOwner(ItemStack item, String ownerName) {
|
||||||
|
NBTTagCompound tag = IBindable.getTag(item);
|
||||||
|
tag.setString("ownerName", ownerName);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the item's owner only if it does not already have one.
|
||||||
|
*/
|
||||||
|
static void checkAndSetItemOwner(ItemStack item, String ownerName) {
|
||||||
|
NBTTagCompound tag = IBindable.getTag(item);
|
||||||
|
if (tag.getString("ownerName").isEmpty()) {
|
||||||
|
tag.setString("ownerName", ownerName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static String getOwnerName(ItemStack item) {
|
||||||
|
NBTTagCompound tag = IBindable.getTag(item);
|
||||||
|
return tag.getString("ownerName");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The number of ticks between passive drains from the soul network while the item is active.
|
||||||
|
*/
|
||||||
|
default int drainTicks() {
|
||||||
|
return 200;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return true if the right click function should be disabled with the config disableBoundToolsRightClick.
|
||||||
|
*/
|
||||||
|
default boolean isBoundTool() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The cost to use the right click function of this item. Used by bound tools and the Energy Blaster/Bazooka.
|
||||||
|
*/
|
||||||
|
default int rightClickCost() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The amount of LP drained from the soul network for each passive drain while the item is active.
|
||||||
|
*/
|
||||||
|
default int drainCost() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,39 @@
|
|||||||
package WayofTime.alchemicalWizardry.api.items.interfaces;
|
package WayofTime.alchemicalWizardry.api.items.interfaces;
|
||||||
|
|
||||||
public interface ISigil {
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
|
|
||||||
|
public interface ISigil extends IBindable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Toggles the state of the sigil. Returns true if the sigil is active after the toggle or false if it is inactive
|
||||||
|
* after the toggle.
|
||||||
|
*/
|
||||||
|
default boolean toggleSigil(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
|
IBindable.setActive(par1ItemStack, !IBindable.isActive(par1ItemStack));
|
||||||
|
|
||||||
|
if (!par3EntityPlayer.capabilities.isCreativeMode
|
||||||
|
&& !EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, this.drainCost())) {
|
||||||
|
IBindable.setActive(par1ItemStack, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IBindable.isActive(par1ItemStack)) {
|
||||||
|
par1ItemStack.setItemDamage(1);
|
||||||
|
this.setDrainTick(par1ItemStack, par2World);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return false if this sigil should not be able to be put in the Sigil of Holding.
|
||||||
|
*/
|
||||||
|
default boolean canBeStored() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -14,6 +14,7 @@ import WayofTime.alchemicalWizardry.api.event.AddToNetworkEvent;
|
|||||||
import WayofTime.alchemicalWizardry.api.event.ItemBindEvent;
|
import WayofTime.alchemicalWizardry.api.event.ItemBindEvent;
|
||||||
import WayofTime.alchemicalWizardry.api.event.ItemDrainInContainerEvent;
|
import WayofTime.alchemicalWizardry.api.event.ItemDrainInContainerEvent;
|
||||||
import WayofTime.alchemicalWizardry.api.event.ItemDrainNetworkEvent;
|
import WayofTime.alchemicalWizardry.api.event.ItemDrainNetworkEvent;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
import cpw.mods.fml.common.eventhandler.Event;
|
import cpw.mods.fml.common.eventhandler.Event;
|
||||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||||
@@ -340,14 +341,9 @@ public class SoulNetworkHandler {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public static void checkAndSetItemOwner(ItemStack item, String ownerName) {
|
public static void checkAndSetItemOwner(ItemStack item, String ownerName) {
|
||||||
if (item.getTagCompound() == null) {
|
IBindable.checkAndSetItemOwner(item, ownerName);
|
||||||
item.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.getTagCompound().getString("ownerName").equals("")) {
|
|
||||||
item.getTagCompound().setString("ownerName", ownerName);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getUsername(EntityPlayer player) {
|
public static String getUsername(EntityPlayer player) {
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import net.minecraft.world.World;
|
|||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
import WayofTime.alchemicalWizardry.api.items.ItemSpellMultiTool;
|
import WayofTime.alchemicalWizardry.api.items.ItemSpellMultiTool;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||||
|
|
||||||
public class SpellParadigmTool extends SpellParadigm {
|
public class SpellParadigmTool extends SpellParadigm {
|
||||||
@@ -159,7 +160,7 @@ public class SpellParadigmTool extends SpellParadigm {
|
|||||||
itemTool.setDuration(toolStack, world, this.duration);
|
itemTool.setDuration(toolStack, world, this.duration);
|
||||||
itemTool.loadParadigmIntoStack(toolStack, this.bufferedEffectList);
|
itemTool.loadParadigmIntoStack(toolStack, this.bufferedEffectList);
|
||||||
|
|
||||||
SoulNetworkHandler.checkAndSetItemOwner(toolStack, SoulNetworkHandler.getOwnerName(crystalStack));
|
IBindable.checkAndSetItemOwner(toolStack, SoulNetworkHandler.getOwnerName(crystalStack));
|
||||||
|
|
||||||
itemTool.setContainedCrystal(toolStack, crystalStack);
|
itemTool.setContainedCrystal(toolStack, crystalStack);
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,9 @@ import cpw.mods.fml.common.event.FMLInterModComms;
|
|||||||
public class IMCForNEI {
|
public class IMCForNEI {
|
||||||
|
|
||||||
public static void IMCSender() {
|
public static void IMCSender() {
|
||||||
sendHandler("alchemicalwizardry.meteor", "AWWayofTime:masterStone", 130);
|
sendHandler("alchemicalwizardry.meteor", "AWWayofTime:masterStone", 181);
|
||||||
sendCatalyst("alchemicalwizardry.meteor", "AWWayofTime:masterStone");
|
sendCatalyst("alchemicalwizardry.meteor", "AWWayofTime:masterStone");
|
||||||
|
sendCatalyst("alchemicalwizardry.bindingritual", "AWWayofTime:masterStone");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void sendHandler(String handlerName, String stack, int height) {
|
private static void sendHandler(String handlerName, String stack, int height) {
|
||||||
|
|||||||
@@ -1,14 +1,22 @@
|
|||||||
package WayofTime.alchemicalWizardry.client.nei;
|
package WayofTime.alchemicalWizardry.client.nei;
|
||||||
|
|
||||||
|
import java.awt.Point;
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
|
|
||||||
import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRecipe;
|
import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRecipe;
|
||||||
import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRegistry;
|
import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRegistry;
|
||||||
|
import WayofTime.alchemicalWizardry.client.nei.widgets.ReagentInfo;
|
||||||
|
import WayofTime.alchemicalWizardry.client.nei.widgets.RitualInfo;
|
||||||
|
import codechicken.lib.gui.GuiDraw;
|
||||||
import codechicken.nei.NEIServerUtils;
|
import codechicken.nei.NEIServerUtils;
|
||||||
import codechicken.nei.PositionedStack;
|
import codechicken.nei.PositionedStack;
|
||||||
|
import codechicken.nei.guihook.GuiContainerManager;
|
||||||
|
import codechicken.nei.recipe.GuiRecipe;
|
||||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -16,6 +24,9 @@ import codechicken.nei.recipe.TemplateRecipeHandler;
|
|||||||
*/
|
*/
|
||||||
public class NEIBindingRitualHandler extends TemplateRecipeHandler {
|
public class NEIBindingRitualHandler extends TemplateRecipeHandler {
|
||||||
|
|
||||||
|
private static final RitualInfo ritualInfo = new RitualInfo("AW006Binding", 1f);
|
||||||
|
private static final ReagentInfo reagentInfo = new ReagentInfo(1f);
|
||||||
|
|
||||||
public class CachedBindingRecipe extends CachedRecipe {
|
public class CachedBindingRecipe extends CachedRecipe {
|
||||||
|
|
||||||
PositionedStack input, output;
|
PositionedStack input, output;
|
||||||
@@ -53,7 +64,7 @@ public class NEIBindingRitualHandler extends TemplateRecipeHandler {
|
|||||||
public void loadCraftingRecipes(ItemStack result) {
|
public void loadCraftingRecipes(ItemStack result) {
|
||||||
for (BindingRecipe recipe : BindingRegistry.bindingRecipes) {
|
for (BindingRecipe recipe : BindingRegistry.bindingRecipes) {
|
||||||
if (NEIServerUtils.areStacksSameTypeCraftingWithNBT(recipe.outputItem, result)) {
|
if (NEIServerUtils.areStacksSameTypeCraftingWithNBT(recipe.outputItem, result)) {
|
||||||
if (recipe != null && recipe.outputItem != null) {
|
if (recipe.outputItem != null) {
|
||||||
arecipes.add(new CachedBindingRecipe(recipe));
|
arecipes.add(new CachedBindingRecipe(recipe));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -64,13 +75,45 @@ public class NEIBindingRitualHandler extends TemplateRecipeHandler {
|
|||||||
public void loadUsageRecipes(ItemStack ingredient) {
|
public void loadUsageRecipes(ItemStack ingredient) {
|
||||||
for (BindingRecipe recipe : BindingRegistry.bindingRecipes) {
|
for (BindingRecipe recipe : BindingRegistry.bindingRecipes) {
|
||||||
if (NEIServerUtils.areStacksSameTypeCraftingWithNBT(recipe.requiredItem, ingredient)) {
|
if (NEIServerUtils.areStacksSameTypeCraftingWithNBT(recipe.requiredItem, ingredient)) {
|
||||||
if (recipe != null && recipe.outputItem != null) {
|
if (recipe.outputItem != null) {
|
||||||
arecipes.add(new CachedBindingRecipe(recipe));
|
arecipes.add(new CachedBindingRecipe(recipe));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawExtras(int recipe) {
|
||||||
|
super.drawExtras(recipe);
|
||||||
|
|
||||||
|
// Only shows these for the first result
|
||||||
|
if (recipe == 0) {
|
||||||
|
ritualInfo.onDraw(0, 0);
|
||||||
|
reagentInfo.onDraw(150, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> handleTooltip(GuiRecipe<?> gui, List<String> list, int recipeIndex) {
|
||||||
|
if (GuiContainerManager.shouldShowTooltip(gui) && list.isEmpty()) {
|
||||||
|
CachedRecipe cRecipe = arecipes.get(recipeIndex);
|
||||||
|
Point mousePos = GuiDraw.getMousePosition();
|
||||||
|
|
||||||
|
if (recipeIndex == 0 && cRecipe instanceof NEIBindingRitualHandler.CachedBindingRecipe) {
|
||||||
|
Rectangle rect = ritualInfo.getRect(gui);
|
||||||
|
if (rect.contains(mousePos)) {
|
||||||
|
ritualInfo.onHover(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
rect = reagentInfo.getRect(gui);
|
||||||
|
if (rect.contains(mousePos)) {
|
||||||
|
list.add(StatCollector.translateToLocal("nei.recipe.reagent.none"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return super.handleTooltip(gui, list, recipeIndex);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getOverlayIdentifier() {
|
public String getOverlayIdentifier() {
|
||||||
return "alchemicalwizardry.bindingritual";
|
return "alchemicalwizardry.bindingritual";
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import codechicken.nei.api.IConfigureNEI;
|
|||||||
public class NEIConfig implements IConfigureNEI {
|
public class NEIConfig implements IConfigureNEI {
|
||||||
|
|
||||||
private static ArrayList<Item> bloodOrbs = null;
|
private static ArrayList<Item> bloodOrbs = null;
|
||||||
|
private static ArrayList<Item> byCapacity = null;
|
||||||
|
|
||||||
public static ArrayList<Item> getBloodOrbs() {
|
public static ArrayList<Item> getBloodOrbs() {
|
||||||
if (bloodOrbs == null) {
|
if (bloodOrbs == null) {
|
||||||
@@ -44,6 +45,19 @@ public class NEIConfig implements IConfigureNEI {
|
|||||||
return bloodOrbsTemp;
|
return bloodOrbsTemp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static ArrayList<Item> getOrbsByCapacity() {
|
||||||
|
if (byCapacity == null) {
|
||||||
|
byCapacity = new ArrayList<>(getBloodOrbs());
|
||||||
|
byCapacity.sort((a, b) -> {
|
||||||
|
if (a instanceof IBloodOrb && b instanceof IBloodOrb) {
|
||||||
|
return Integer.compare(((IBloodOrb) a).getMaxEssence(), ((IBloodOrb) b).getMaxEssence());
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return byCapacity;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadConfig() {
|
public void loadConfig() {
|
||||||
API.registerRecipeHandler(new NEIAlchemyRecipeHandler());
|
API.registerRecipeHandler(new NEIAlchemyRecipeHandler());
|
||||||
|
|||||||
+130
-15
@@ -1,51 +1,70 @@
|
|||||||
package WayofTime.alchemicalWizardry.client.nei;
|
package WayofTime.alchemicalWizardry.client.nei;
|
||||||
|
|
||||||
|
import static WayofTime.alchemicalWizardry.client.ClientUtils.mc;
|
||||||
|
|
||||||
import java.awt.Point;
|
import java.awt.Point;
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
import net.minecraftforge.oredict.OreDictionary;
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import com.google.common.base.Joiner;
|
import com.google.common.base.Joiner;
|
||||||
|
|
||||||
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
|
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
|
||||||
|
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||||
|
import WayofTime.alchemicalWizardry.client.nei.widgets.CostInfo;
|
||||||
|
import WayofTime.alchemicalWizardry.client.nei.widgets.RadiusInfo;
|
||||||
|
import WayofTime.alchemicalWizardry.client.nei.widgets.ReagentInfo;
|
||||||
|
import WayofTime.alchemicalWizardry.client.nei.widgets.RitualInfo;
|
||||||
import WayofTime.alchemicalWizardry.common.summoning.meteor.Meteor;
|
import WayofTime.alchemicalWizardry.common.summoning.meteor.Meteor;
|
||||||
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorComponent;
|
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorComponent;
|
||||||
|
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorReagent;
|
||||||
|
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorReagentRegistry;
|
||||||
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorRegistry;
|
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorRegistry;
|
||||||
import codechicken.lib.gui.GuiDraw;
|
import codechicken.lib.gui.GuiDraw;
|
||||||
import codechicken.nei.NEIServerUtils;
|
import codechicken.nei.NEIServerUtils;
|
||||||
import codechicken.nei.PositionedStack;
|
import codechicken.nei.PositionedStack;
|
||||||
|
import codechicken.nei.guihook.GuiContainerManager;
|
||||||
import codechicken.nei.recipe.GuiRecipe;
|
import codechicken.nei.recipe.GuiRecipe;
|
||||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||||
|
|
||||||
public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
|
public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
|
||||||
|
|
||||||
|
private static final RitualInfo ritualInfo = new RitualInfo("AW019FallingTower", 0.75f);
|
||||||
|
private static final ReagentInfo reagentInfo = new ReagentInfo(0.75f);
|
||||||
|
|
||||||
public class CachedMeteorRecipe extends CachedRecipe {
|
public class CachedMeteorRecipe extends CachedRecipe {
|
||||||
|
|
||||||
private final List<PositionedStack> input = new ArrayList<>();
|
private final List<PositionedStack> input = new ArrayList<>();
|
||||||
private final List<PositionedStack> outputs = new ArrayList<>();
|
private final List<PositionedStack> outputs = new ArrayList<>();
|
||||||
private final int cost;
|
private final CostInfo costInfo;
|
||||||
private final int radius;
|
private final RadiusInfo radiusInfo;
|
||||||
private Point focus;
|
private Point focus;
|
||||||
|
|
||||||
|
public float fillerChance;
|
||||||
|
|
||||||
public CachedMeteorRecipe(Meteor meteor, ItemStack focusStack) {
|
public CachedMeteorRecipe(Meteor meteor, ItemStack focusStack) {
|
||||||
this.input.add(new PositionedStack(meteor.focusItem, 74, 4));
|
this.input.add(new PositionedStack(meteor.focusItem, 75, 4));
|
||||||
int row = 0;
|
int row = 0;
|
||||||
int col = 0;
|
int col = 0;
|
||||||
|
|
||||||
float totalComponentWeight = MeteorComponent.getTotalListWeight(meteor.ores);
|
float totalComponentWeight = MeteorComponent.getTotalListWeight(meteor.ores);
|
||||||
float fillerChance = meteor.fillerChance;
|
fillerChance = meteor.fillerChance;
|
||||||
List<MeteorComponent> sortedComponents = new ArrayList<>(meteor.ores);
|
List<MeteorComponent> sortedComponents = new ArrayList<>(meteor.ores);
|
||||||
sortedComponents.sort(Comparator.comparingInt(c -> -c.getWeight()));
|
sortedComponents.sort(Comparator.comparingInt(c -> -c.getWeight()));
|
||||||
|
|
||||||
@@ -115,8 +134,8 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.radius = meteor.radius;
|
this.costInfo = new CostInfo(meteor.cost);
|
||||||
this.cost = meteor.cost;
|
this.radiusInfo = new RadiusInfo(meteor.radius);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getReagentStrings(MeteorComponent component) {
|
private String getReagentStrings(MeteorComponent component) {
|
||||||
@@ -144,11 +163,11 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getCost() {
|
public int getCost() {
|
||||||
return cost;
|
return costInfo.getCost();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getRadius() {
|
public int getRadius() {
|
||||||
return radius;
|
return radiusInfo.getRadius();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -238,12 +257,10 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
|
|||||||
@Override
|
@Override
|
||||||
public void drawExtras(int recipe) {
|
public void drawExtras(int recipe) {
|
||||||
CachedMeteorRecipe meteorRecipe = (CachedMeteorRecipe) this.arecipes.get(recipe);
|
CachedMeteorRecipe meteorRecipe = (CachedMeteorRecipe) this.arecipes.get(recipe);
|
||||||
int cost = meteorRecipe.getCost();
|
meteorRecipe.costInfo.onDraw(30, 4);
|
||||||
int radius = meteorRecipe.getRadius();
|
meteorRecipe.radiusInfo.onDraw(120, 4);
|
||||||
Minecraft.getMinecraft().fontRenderer
|
ritualInfo.onDraw(0, 0);
|
||||||
.drawString(I18n.format("nei.recipe.meteor.cost", String.format("%,d", cost)), 2, 168, 0x000000);
|
reagentInfo.onDraw(153, 0);
|
||||||
Minecraft.getMinecraft().fontRenderer
|
|
||||||
.drawString(I18n.format("nei.recipe.meteor.radius", radius), 2, 179, 0x000000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -275,6 +292,96 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
|
|||||||
return currenttip;
|
return currenttip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> handleTooltip(GuiRecipe<?> gui, List<String> list, int recipeIndex) {
|
||||||
|
if (GuiContainerManager.shouldShowTooltip(gui) && list.isEmpty()) {
|
||||||
|
CachedRecipe cRecipe = arecipes.get(recipeIndex);
|
||||||
|
Point mousePos = GuiDraw.getMousePosition();
|
||||||
|
|
||||||
|
if (cRecipe instanceof CachedMeteorRecipe) {
|
||||||
|
CachedMeteorRecipe cachedRecipe = (CachedMeteorRecipe) cRecipe;
|
||||||
|
Rectangle rect = cachedRecipe.costInfo.getRect(gui);
|
||||||
|
if (rect.contains(mousePos)) {
|
||||||
|
list.add(StatCollector.translateToLocal("nei.recipe.meteor.cost"));
|
||||||
|
if (SoulNetworkHandler.getCurrentEssence(mc.thePlayer.getDisplayName()) < cachedRecipe.getCost()) {
|
||||||
|
list.add(
|
||||||
|
EnumChatFormatting.RED
|
||||||
|
+ StatCollector.translateToLocal("nei.recipe.meteor.tooExpensive"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rect = cachedRecipe.radiusInfo.getRect(gui);
|
||||||
|
if (rect.contains(mousePos)) {
|
||||||
|
list.add(
|
||||||
|
StatCollector.translateToLocalFormatted(
|
||||||
|
"nei.recipe.meteor.diameter",
|
||||||
|
2 * cachedRecipe.radiusInfo.getRadius() + 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
rect = ritualInfo.getRect(gui);
|
||||||
|
if (rect.contains(mousePos)) {
|
||||||
|
ritualInfo.onHover(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
rect = reagentInfo.getRect(gui);
|
||||||
|
if (rect.contains(mousePos)) {
|
||||||
|
reagentInfo.onHover(list);
|
||||||
|
addMeteorReagentInfo(list, cachedRecipe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return super.handleTooltip(gui, list, recipeIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addMeteorReagentInfo(List<String> list, CachedMeteorRecipe cachedRecipe) {
|
||||||
|
DecimalFormat fmt = new DecimalFormat("###.##");
|
||||||
|
for (Map.Entry<Reagent, MeteorReagent> entry : MeteorReagentRegistry.reagents.entrySet()) {
|
||||||
|
ArrayList<String> l = new ArrayList<>();
|
||||||
|
Reagent r = entry.getKey();
|
||||||
|
MeteorReagent mr = entry.getValue();
|
||||||
|
|
||||||
|
if (mr.radiusChange != 0) {
|
||||||
|
l.add(
|
||||||
|
StatCollector.translateToLocalFormatted(
|
||||||
|
"nei.recipe.reagent.meteor.radius",
|
||||||
|
mr.radiusChange,
|
||||||
|
Meteor.getNewRadius(cachedRecipe.getRadius(), Collections.singletonList(r))));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cachedRecipe.fillerChance > 0) {
|
||||||
|
if (mr.fillerChanceChange != 0 || mr.rawFillerChanceChange != 0) {
|
||||||
|
l.add(
|
||||||
|
StatCollector.translateToLocalFormatted(
|
||||||
|
"nei.recipe.reagent.meteor.filler.chance",
|
||||||
|
fmt.format(
|
||||||
|
Meteor.getNewFillerChance(
|
||||||
|
cachedRecipe.fillerChance,
|
||||||
|
Collections.singletonList(r)))));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!mr.filler.isEmpty()) {
|
||||||
|
l.add(
|
||||||
|
StatCollector.translateToLocalFormatted(
|
||||||
|
"nei.recipe.reagent.meteor.filler.blocks",
|
||||||
|
reagentFillerBlockNames(mr)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mr.disableExplosions) {
|
||||||
|
l.add(StatCollector.translateToLocal("nei.recipe.reagent.meteor.explosions"));
|
||||||
|
} else if (mr.invertExplosionBlockDamage && AlchemicalWizardry.doMeteorsDestroyBlocks) {
|
||||||
|
l.add(StatCollector.translateToLocal("nei.recipe.reagent.meteor.blockDamage.off"));
|
||||||
|
} else if (mr.invertExplosionBlockDamage) {
|
||||||
|
l.add(StatCollector.translateToLocal("nei.recipe.reagent.meteor.blockDamage.on"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!l.isEmpty()) {
|
||||||
|
list.add(r.name + ":");
|
||||||
|
list.addAll(l);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRecipeName() {
|
public String getRecipeName() {
|
||||||
return I18n.format("nei.recipe.meteor.category");
|
return I18n.format("nei.recipe.meteor.category");
|
||||||
@@ -292,4 +399,12 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
|
|||||||
private int getEstimatedAmount(float chance, int radius) {
|
private int getEstimatedAmount(float chance, int radius) {
|
||||||
return (int) Math.ceil(4f / 3 * Math.PI * Math.pow(radius + 0.5, 3) * chance);
|
return (int) Math.ceil(4f / 3 * Math.PI * Math.pow(radius + 0.5, 3) * chance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String reagentFillerBlockNames(MeteorReagent mr) {
|
||||||
|
ArrayList<String> blockNames = new ArrayList<>();
|
||||||
|
for (MeteorComponent mc : mr.filler) {
|
||||||
|
blockNames.add(mc.getBlock().getDisplayName());
|
||||||
|
}
|
||||||
|
return Joiner.on(", ").join(blockNames);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
package WayofTime.alchemicalWizardry.client.nei.widgets;
|
||||||
|
|
||||||
|
import static WayofTime.alchemicalWizardry.client.ClientUtils.mc;
|
||||||
|
import static WayofTime.alchemicalWizardry.client.nei.NEIConfig.getBloodOrbs;
|
||||||
|
import static WayofTime.alchemicalWizardry.client.nei.NEIConfig.getOrbsByCapacity;
|
||||||
|
|
||||||
|
import java.awt.Rectangle;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import net.minecraft.client.gui.FontRenderer;
|
||||||
|
import net.minecraft.client.renderer.entity.RenderItem;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
|
||||||
|
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||||
|
import codechicken.nei.recipe.GuiRecipe;
|
||||||
|
|
||||||
|
public class CostInfo {
|
||||||
|
|
||||||
|
private final int cost;
|
||||||
|
private int prevX, prevY;
|
||||||
|
private final int orbLP;
|
||||||
|
private final ItemStack orbStack;
|
||||||
|
private static final RenderItem renderItem = new RenderItem();
|
||||||
|
static {
|
||||||
|
renderItem.renderWithColor = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CostInfo(int cost) {
|
||||||
|
this.cost = cost;
|
||||||
|
|
||||||
|
Item orb = null;
|
||||||
|
getOrbsByCapacity();
|
||||||
|
ArrayList<Item> orbList = getBloodOrbs();
|
||||||
|
for (Item o : orbList) {
|
||||||
|
if (((IBloodOrb) o).getMaxEssence() >= cost) {
|
||||||
|
orb = o;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (orb == null) {
|
||||||
|
orb = orbList.get(orbList.size() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
orbLP = ((IBloodOrb) orb).getMaxEssence();
|
||||||
|
orbStack = new ItemStack(orb);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCost() {
|
||||||
|
return cost;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onDraw(int x, int y) {
|
||||||
|
prevX = x;
|
||||||
|
prevY = y;
|
||||||
|
|
||||||
|
int currentLP = SoulNetworkHandler.getCurrentEssence(mc.thePlayer.getDisplayName());
|
||||||
|
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glEnable(GL11.GL_BLEND);
|
||||||
|
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
|
||||||
|
if (orbLP > currentLP) {
|
||||||
|
GL11.glColor4f(0.4f, 0.4f, 0.4f, 1.0f);
|
||||||
|
} else {
|
||||||
|
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderItem.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.getTextureManager(), orbStack, x, y);
|
||||||
|
|
||||||
|
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||||
|
GL11.glDisable(GL11.GL_BLEND);
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
|
||||||
|
String costText = String.format("%,d", cost);
|
||||||
|
FontRenderer fontRenderer = mc.fontRenderer;
|
||||||
|
|
||||||
|
int textWidth = fontRenderer.getStringWidth(costText);
|
||||||
|
int textX = x + 9 - (textWidth / 2);
|
||||||
|
int textY = y + 18;
|
||||||
|
|
||||||
|
fontRenderer.drawString(costText, textX, textY, 0x000000);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Rectangle getRect(GuiRecipe<?> gui) {
|
||||||
|
return new Rectangle(gui.guiLeft + prevX + 4, gui.guiTop + prevY + 14, 18, 18);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package WayofTime.alchemicalWizardry.client.nei.widgets;
|
||||||
|
|
||||||
|
import static WayofTime.alchemicalWizardry.client.ClientUtils.mc;
|
||||||
|
|
||||||
|
import java.awt.Rectangle;
|
||||||
|
|
||||||
|
import net.minecraft.client.gui.FontRenderer;
|
||||||
|
import net.minecraft.client.renderer.entity.RenderItem;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
|
|
||||||
|
import WayofTime.alchemicalWizardry.ModItems;
|
||||||
|
import codechicken.nei.recipe.GuiRecipe;
|
||||||
|
|
||||||
|
public class RadiusInfo {
|
||||||
|
|
||||||
|
private final int radius;
|
||||||
|
private int prevX, prevY;
|
||||||
|
private static final RenderItem renderItem = new RenderItem();
|
||||||
|
// It's a circle with a dot in the center. Couldn't ask for a better item!
|
||||||
|
private static final ItemStack item = new ItemStack(ModItems.demonPlacer);
|
||||||
|
|
||||||
|
public RadiusInfo(int radius) {
|
||||||
|
this.radius = radius;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRadius() {
|
||||||
|
return radius;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onDraw(int x, int y) {
|
||||||
|
prevX = x;
|
||||||
|
prevY = y;
|
||||||
|
|
||||||
|
renderItem.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.getTextureManager(), item, x, y);
|
||||||
|
|
||||||
|
String costText = StatCollector.translateToLocalFormatted("nei.recipe.meteor.radius", radius);
|
||||||
|
FontRenderer fontRenderer = mc.fontRenderer;
|
||||||
|
|
||||||
|
int textWidth = fontRenderer.getStringWidth(costText);
|
||||||
|
int textX = x + 9 - (textWidth / 2);
|
||||||
|
int textY = y + 18;
|
||||||
|
|
||||||
|
fontRenderer.drawString(costText, textX, textY, 0x000000);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Rectangle getRect(GuiRecipe<?> gui) {
|
||||||
|
return new Rectangle(gui.guiLeft + prevX + 5, gui.guiTop + prevY + 15, 16, 16);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package WayofTime.alchemicalWizardry.client.nei.widgets;
|
||||||
|
|
||||||
|
import static WayofTime.alchemicalWizardry.client.ClientUtils.mc;
|
||||||
|
|
||||||
|
import java.awt.Rectangle;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.entity.RenderItem;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||||
|
import codechicken.nei.recipe.GuiRecipe;
|
||||||
|
|
||||||
|
public class ReagentInfo {
|
||||||
|
|
||||||
|
private final float scale;
|
||||||
|
private int prevX, prevY;
|
||||||
|
private static final RenderItem renderItem = new RenderItem();
|
||||||
|
private static final ItemStack item = new ItemStack(ModBlocks.blockReagentConduit);
|
||||||
|
|
||||||
|
public ReagentInfo(float scale) {
|
||||||
|
this.scale = scale;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onDraw(int x, int y) {
|
||||||
|
prevX = x;
|
||||||
|
prevY = y;
|
||||||
|
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glTranslatef(x, y, 0);
|
||||||
|
GL11.glScalef(scale, scale, 1.0f);
|
||||||
|
renderItem.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.getTextureManager(), item, 0, 0);
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Rectangle getRect(GuiRecipe<?> gui) {
|
||||||
|
return new Rectangle(gui.guiLeft + prevX + 4, gui.guiTop + prevY + 14, (int) (18 * scale), (int) (18 * scale));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds the text Reagent effects: to the tooltip list.
|
||||||
|
*/
|
||||||
|
public void onHover(List<String> list) {
|
||||||
|
list.add(StatCollector.translateToLocal("nei.recipe.reagent.text"));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package WayofTime.alchemicalWizardry.client.nei.widgets;
|
||||||
|
|
||||||
|
import static WayofTime.alchemicalWizardry.client.ClientUtils.mc;
|
||||||
|
|
||||||
|
import java.awt.Rectangle;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.entity.RenderItem;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import WayofTime.alchemicalWizardry.ModItems;
|
||||||
|
import WayofTime.alchemicalWizardry.api.rituals.Rituals;
|
||||||
|
import codechicken.nei.recipe.GuiRecipe;
|
||||||
|
|
||||||
|
public class RitualInfo {
|
||||||
|
|
||||||
|
private final String id;
|
||||||
|
private final int cost;
|
||||||
|
private final float scale;
|
||||||
|
private final ItemStack crystal;
|
||||||
|
private int prevX, prevY;
|
||||||
|
private static final RenderItem renderItem = new RenderItem();
|
||||||
|
|
||||||
|
public RitualInfo(String id, float scale) {
|
||||||
|
this.id = id;
|
||||||
|
this.scale = scale;
|
||||||
|
this.cost = Rituals.getCostForActivation(id);
|
||||||
|
Rituals r = Rituals.ritualMap.get(id);
|
||||||
|
|
||||||
|
// This is hardcoded unlike the orbs. I'm not aware of any addon that makes tier 3 rituals or crystals.
|
||||||
|
if (r == null || r.crystalLevel == 1) {
|
||||||
|
crystal = new ItemStack(ModItems.activationCrystal);
|
||||||
|
} else {
|
||||||
|
crystal = new ItemStack(ModItems.activationCrystal, 1, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCost() {
|
||||||
|
return cost;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onDraw(int x, int y) {
|
||||||
|
prevX = x;
|
||||||
|
prevY = y;
|
||||||
|
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glTranslatef(x, y, 0);
|
||||||
|
GL11.glScalef(scale, scale, 1.0f);
|
||||||
|
renderItem.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.getTextureManager(), crystal, 0, 0);
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Rectangle getRect(GuiRecipe<?> gui) {
|
||||||
|
return new Rectangle(gui.guiLeft + prevX + 4, gui.guiTop + prevY + 14, (int) (18 * scale), (int) (18 * scale));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onHover(List<String> list) {
|
||||||
|
list.add(
|
||||||
|
StatCollector
|
||||||
|
.translateToLocalFormatted("nei.recipe.ritual.name", Rituals.getLocalizedNameOfRitual(id)));
|
||||||
|
list.add(StatCollector.translateToLocalFormatted("nei.recipe.ritual.cost", this.cost));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,6 +11,7 @@ import net.minecraft.world.Explosion;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.common.items.ActivationCrystal;
|
import WayofTime.alchemicalWizardry.common.items.ActivationCrystal;
|
||||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
|
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
@@ -79,7 +80,7 @@ public class BlockMasterStone extends BlockContainer {
|
|||||||
acItem.getCrystalLevel(playerItem),
|
acItem.getCrystalLevel(playerItem),
|
||||||
playerItem,
|
playerItem,
|
||||||
player,
|
player,
|
||||||
acItem.getOwnerName(playerItem));
|
IBindable.getOwnerName(playerItem));
|
||||||
world.markBlockForUpdate(x, y, z);
|
world.markBlockForUpdate(x, y, z);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import net.minecraft.item.ItemStack;
|
|||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
|
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
|
||||||
|
|
||||||
public class CommandBind extends CommandBase {
|
public class CommandBind extends CommandBase {
|
||||||
|
|
||||||
@@ -38,8 +37,8 @@ public class CommandBind extends CommandBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (item != null && item.getItem() instanceof IBindable) {
|
if (item != null && item.getItem() instanceof IBindable) {
|
||||||
if (EnergyItems.getOwnerName(item).isEmpty()) {
|
if (IBindable.getOwnerName(item).isEmpty()) {
|
||||||
EnergyItems.checkAndSetItemOwner(item, targetPlayer);
|
IBindable.checkAndSetItemOwner(item, targetPlayer);
|
||||||
func_152373_a(iCommandSender, this, "commands.bind.success");
|
func_152373_a(iCommandSender, this, "commands.bind.success");
|
||||||
} else {
|
} else {
|
||||||
throw new CommandException("commands.bind.failed.alreadyBound");
|
throw new CommandException("commands.bind.failed.alreadyBound");
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import net.minecraft.entity.player.EntityPlayerMP;
|
|||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
|
||||||
|
|
||||||
public class CommandUnbind extends CommandBase {
|
public class CommandUnbind extends CommandBase {
|
||||||
|
|
||||||
@@ -30,7 +29,7 @@ public class CommandUnbind extends CommandBase {
|
|||||||
ItemStack item = entityplayermp.getCurrentEquippedItem();
|
ItemStack item = entityplayermp.getCurrentEquippedItem();
|
||||||
|
|
||||||
if (item != null && item.getItem() instanceof IBindable) {
|
if (item != null && item.getItem() instanceof IBindable) {
|
||||||
if (!EnergyItems.getOwnerName(item).isEmpty()) {
|
if (!IBindable.getOwnerName(item).isEmpty()) {
|
||||||
item.getTagCompound().removeTag("ownerName");
|
item.getTagCompound().removeTag("ownerName");
|
||||||
func_152373_a(iCommandSender, this, "commands.unbind.success");
|
func_152373_a(iCommandSender, this, "commands.unbind.success");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import net.minecraft.util.StatCollector;
|
|||||||
|
|
||||||
import WayofTime.alchemicalWizardry.api.command.SubCommandBase;
|
import WayofTime.alchemicalWizardry.api.command.SubCommandBase;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
|
||||||
|
|
||||||
public class SubCommandBind extends SubCommandBase {
|
public class SubCommandBind extends SubCommandBase {
|
||||||
|
|
||||||
@@ -56,10 +55,10 @@ public class SubCommandBind extends SubCommandBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (bind) {
|
if (bind) {
|
||||||
EnergyItems.setItemOwner(held, playerName);
|
IBindable.setItemOwner(held, playerName);
|
||||||
commandSender.addChatMessage(new ChatComponentTranslation("commands.bind.success"));
|
commandSender.addChatMessage(new ChatComponentTranslation("commands.bind.success"));
|
||||||
} else {
|
} else {
|
||||||
if (!EnergyItems.getOwnerName(held).isEmpty()) {
|
if (!IBindable.getOwnerName(held).isEmpty()) {
|
||||||
held.stackTagCompound.removeTag("ownerName");
|
held.stackTagCompound.removeTag("ownerName");
|
||||||
commandSender.addChatMessage(new ChatComponentTranslation("commands.bind.remove.success"));
|
commandSender.addChatMessage(new ChatComponentTranslation("commands.bind.remove.success"));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import org.lwjgl.input.Keyboard;
|
|||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
|
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
@@ -92,16 +93,12 @@ public class ActivationCrystal extends EnergyItems {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,7 +110,7 @@ public class ActivationCrystal extends EnergyItems {
|
|||||||
public String getUnlocalizedName(ItemStack itemStack) {
|
public String getUnlocalizedName(ItemStack itemStack) {
|
||||||
// This is what will do all the localisation things on the alchemy components so you dont have to set it :D
|
// This is what will do all the localisation things on the alchemy components so you dont have to set it :D
|
||||||
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, ACTIVATION_CRYSTAL_NAMES.length - 1);
|
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, ACTIVATION_CRYSTAL_NAMES.length - 1);
|
||||||
return ("" + "item.activationCrystal" + ACTIVATION_CRYSTAL_NAMES[meta]);
|
return ("item.activationCrystal" + ACTIVATION_CRYSTAL_NAMES[meta]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
|||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.potion.PotionEffect;
|
import net.minecraft.potion.PotionEffect;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.util.StatCollector;
|
import net.minecraft.util.StatCollector;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
@@ -24,8 +24,6 @@ public class ArmourInhibitor extends EnergyItems {
|
|||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
private IIcon passiveIcon;
|
private IIcon passiveIcon;
|
||||||
|
|
||||||
private int tickDelay = 200;
|
|
||||||
|
|
||||||
public ArmourInhibitor() {
|
public ArmourInhibitor() {
|
||||||
super();
|
super();
|
||||||
this.maxStackSize = 1;
|
this.maxStackSize = 1;
|
||||||
@@ -37,18 +35,7 @@ public class ArmourInhibitor extends EnergyItems {
|
|||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.armorinhibitor.desc1"));
|
par3List.add(StatCollector.translateToLocal("tooltip.armorinhibitor.desc1"));
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.armorinhibitor.desc2"));
|
par3List.add(StatCollector.translateToLocal("tooltip.armorinhibitor.desc2"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
|
||||||
if (par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
|
||||||
} else {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated"));
|
|
||||||
}
|
|
||||||
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -61,13 +48,7 @@ public class ArmourInhibitor extends EnergyItems {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
||||||
if (stack.getTagCompound() == null) {
|
if (IBindable.isActive(stack)) {
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound tag = stack.getTagCompound();
|
|
||||||
|
|
||||||
if (tag.getBoolean("isActive")) {
|
|
||||||
return this.activeIcon;
|
return this.activeIcon;
|
||||||
} else {
|
} else {
|
||||||
return this.passiveIcon;
|
return this.passiveIcon;
|
||||||
@@ -86,20 +67,15 @@ public class ArmourInhibitor extends EnergyItems {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par1ItemStack.getTagCompound() == null) {
|
IBindable.setActive(par1ItemStack, !IBindable.isActive(par1ItemStack));
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound tag = par1ItemStack.getTagCompound();
|
if (IBindable.isActive(par1ItemStack)) {
|
||||||
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
|
|
||||||
|
|
||||||
if (tag.getBoolean("isActive")) {
|
|
||||||
par1ItemStack.setItemDamage(1);
|
par1ItemStack.setItemDamage(1);
|
||||||
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % tickDelay);
|
this.setDrainTick(par1ItemStack, par2World);
|
||||||
} else {
|
} else {
|
||||||
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
|
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
|
||||||
}
|
}
|
||||||
@@ -115,14 +91,7 @@ public class ArmourInhibitor extends EnergyItems {
|
|||||||
|
|
||||||
EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity;
|
EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity;
|
||||||
|
|
||||||
if (par1ItemStack.getTagCompound() == null) {
|
if (IBindable.isActive(par1ItemStack)) {
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
|
||||||
if (par2World.getWorldTime() % tickDelay == par1ItemStack.getTagCompound().getInteger("worldTimeDelay")) {}
|
|
||||||
|
|
||||||
// TODO Do stuff
|
|
||||||
par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionInhibit.id, 2, 0));
|
par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionInhibit.id, 2, 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import net.minecraft.world.World;
|
|||||||
import net.minecraftforge.common.DimensionManager;
|
import net.minecraftforge.common.DimensionManager;
|
||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEHomHeart;
|
import WayofTime.alchemicalWizardry.common.tileEntity.TEHomHeart;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
@@ -33,16 +34,11 @@ public class BlankSpell extends EnergyItems {
|
|||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.blankspell.desc"));
|
par3List.add(StatCollector.translateToLocal("tooltip.blankspell.desc"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
|
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
if (!(par1ItemStack.getTagCompound() == null)) {
|
||||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||||
|
|
||||||
if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) {
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
|
|
||||||
par3List.add(
|
par3List.add(
|
||||||
StatCollector.translateToLocal("tooltip.alchemy.coords") + " "
|
StatCollector.translateToLocal("tooltip.alchemy.coords") + " "
|
||||||
+ itemTag.getInteger("xCoord")
|
+ itemTag.getInteger("xCoord")
|
||||||
@@ -57,7 +53,7 @@ public class BlankSpell extends EnergyItems {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ public class BoundAxe extends ItemAxe implements IBindable {
|
|||||||
|
|
||||||
public float efficiencyOnProperMaterial = 12.0F;
|
public float efficiencyOnProperMaterial = 12.0F;
|
||||||
public float damageVsEntity;
|
public float damageVsEntity;
|
||||||
|
public int rightClickCost = 10000;
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
private IIcon activeIcon;
|
private IIcon activeIcon;
|
||||||
@@ -59,23 +60,15 @@ public class BoundAxe extends ItemAxe implements IBindable {
|
|||||||
return this.energyUsed;
|
return this.energyUsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int drainCost() {
|
||||||
|
return this.energyUsed;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.boundaxe.desc"));
|
par3List.add(StatCollector.translateToLocal("tooltip.boundaxe.desc"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
|
||||||
if (par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
|
||||||
} else {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) {
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -88,13 +81,7 @@ public class BoundAxe extends ItemAxe implements IBindable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
||||||
if (stack.getTagCompound() == null) {
|
if (IBindable.isActive(stack)) {
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound tag = stack.getTagCompound();
|
|
||||||
|
|
||||||
if (tag.getBoolean("isActive")) {
|
|
||||||
return this.activeIcon;
|
return this.activeIcon;
|
||||||
} else {
|
} else {
|
||||||
return this.passiveIcon;
|
return this.passiveIcon;
|
||||||
@@ -103,29 +90,7 @@ public class BoundAxe extends ItemAxe implements IBindable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (checkRightClick(par1ItemStack, par2World, par3EntityPlayer)) {
|
||||||
this.setActivated(par1ItemStack, !getActivated(par1ItemStack));
|
|
||||||
par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (par2World.isRemote) {
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!getActivated(par1ItemStack) || SpellHelper.isFakePlayer(par2World, par3EntityPlayer)) {
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (AlchemicalWizardry.disableBoundToolsRightClick) {
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (par3EntityPlayer.isPotionActive(AlchemicalWizardry.customPotionInhibit)) {
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 10000)) {
|
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -185,45 +150,18 @@ public class BoundAxe extends ItemAxe implements IBindable {
|
|||||||
if (par1ItemStack.getTagCompound() == null) {
|
if (par1ItemStack.getTagCompound() == null) {
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||||
}
|
}
|
||||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay")
|
checkPassiveDrain(par1ItemStack, par2World, par3EntityPlayer);
|
||||||
&& par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
|
||||||
if (!par3EntityPlayer.capabilities.isCreativeMode) {
|
|
||||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 20)) {
|
|
||||||
this.setActivated(par1ItemStack, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
par1ItemStack.setItemDamage(0);
|
par1ItemStack.setItemDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setActivated(ItemStack par1ItemStack, boolean newActivated) {
|
|
||||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
|
||||||
|
|
||||||
if (itemTag == null) {
|
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
itemTag.setBoolean("isActive", newActivated);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getActivated(ItemStack par1ItemStack) {
|
|
||||||
if (!par1ItemStack.hasTagCompound()) {
|
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
|
||||||
|
|
||||||
return itemTag.getBoolean("isActive");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
|
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
|
||||||
* sword
|
* sword
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public float func_150893_a(ItemStack par1ItemStack, Block par2Block) {
|
public float func_150893_a(ItemStack par1ItemStack, Block par2Block) {
|
||||||
if (!getActivated(par1ItemStack)) {
|
if (!IBindable.isActive(par1ItemStack)) {
|
||||||
return 0.0F;
|
return 0.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,7 +174,7 @@ public class BoundAxe extends ItemAxe implements IBindable {
|
|||||||
*/
|
*/
|
||||||
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase,
|
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase,
|
||||||
EntityLivingBase par3EntityLivingBase) {
|
EntityLivingBase par3EntityLivingBase) {
|
||||||
return getActivated(par1ItemStack);
|
return IBindable.isActive(par1ItemStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3, int par4, int par5, int par6,
|
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3, int par4, int par5, int par6,
|
||||||
@@ -266,7 +204,7 @@ public class BoundAxe extends ItemAxe implements IBindable {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public float getDigSpeed(ItemStack stack, Block block, int meta) {
|
public float getDigSpeed(ItemStack stack, Block block, int meta) {
|
||||||
if (!getActivated(stack)) {
|
if (!IBindable.isActive(stack)) {
|
||||||
return 0.0F;
|
return 0.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -279,11 +217,21 @@ public class BoundAxe extends ItemAxe implements IBindable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
|
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
|
||||||
return !getActivated(stack);
|
return !IBindable.isActive(stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getHarvestLevel(ItemStack stack, String toolClass) {
|
public int getHarvestLevel(ItemStack stack, String toolClass) {
|
||||||
return getActivated(stack) ? super.getHarvestLevel(stack, toolClass) : -1;
|
return IBindable.isActive(stack) ? super.getHarvestLevel(stack, toolClass) : -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isBoundTool() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int rightClickCost() {
|
||||||
|
return rightClickCost;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -33,6 +33,7 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable {
|
|||||||
|
|
||||||
public float efficiencyOnProperMaterial = 12.0F;
|
public float efficiencyOnProperMaterial = 12.0F;
|
||||||
public float damageVsEntity;
|
public float damageVsEntity;
|
||||||
|
public int rightClickCost = 10000;
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
private IIcon activeIcon;
|
private IIcon activeIcon;
|
||||||
@@ -60,24 +61,16 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable {
|
|||||||
return this.energyUsed;
|
return this.energyUsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int drainCost() {
|
||||||
|
return this.energyUsed;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.boundpickaxe.desc1"));
|
par3List.add(StatCollector.translateToLocal("tooltip.boundpickaxe.desc1"));
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.boundpickaxe.desc2"));
|
par3List.add(StatCollector.translateToLocal("tooltip.boundpickaxe.desc2"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
|
||||||
if (par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
|
||||||
} else {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) {
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -90,13 +83,7 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
||||||
if (stack.getTagCompound() == null) {
|
if (IBindable.isActive(stack)) {
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound tag = stack.getTagCompound();
|
|
||||||
|
|
||||||
if (tag.getBoolean("isActive")) {
|
|
||||||
return this.activeIcon;
|
return this.activeIcon;
|
||||||
} else {
|
} else {
|
||||||
return this.passiveIcon;
|
return this.passiveIcon;
|
||||||
@@ -105,32 +92,9 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (checkRightClick(par1ItemStack, par2World, par3EntityPlayer)) {
|
||||||
this.setActivated(par1ItemStack, !getActivated(par1ItemStack));
|
|
||||||
par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
|
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par2World.isRemote) {
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!getActivated(par1ItemStack) || SpellHelper.isFakePlayer(par2World, par3EntityPlayer)) {
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (AlchemicalWizardry.disableBoundToolsRightClick) {
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (par3EntityPlayer.isPotionActive(AlchemicalWizardry.customPotionInhibit)) {
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 10000)) {
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
Vec3 blockVec = SpellHelper.getEntityBlockVector(par3EntityPlayer);
|
Vec3 blockVec = SpellHelper.getEntityBlockVector(par3EntityPlayer);
|
||||||
int posX = (int) (blockVec.xCoord);
|
int posX = (int) (blockVec.xCoord);
|
||||||
int posY = (int) (blockVec.yCoord);
|
int posY = (int) (blockVec.yCoord);
|
||||||
@@ -203,38 +167,11 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable {
|
|||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay")
|
checkPassiveDrain(par1ItemStack, par2World, par3EntityPlayer);
|
||||||
&& par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
|
||||||
if (!par3EntityPlayer.capabilities.isCreativeMode) {
|
|
||||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 20)) {
|
|
||||||
this.setActivated(par1ItemStack, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
par1ItemStack.setItemDamage(0);
|
par1ItemStack.setItemDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setActivated(ItemStack par1ItemStack, boolean newActivated) {
|
|
||||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
|
||||||
|
|
||||||
if (itemTag == null) {
|
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
itemTag.setBoolean("isActive", newActivated);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getActivated(ItemStack par1ItemStack) {
|
|
||||||
if (!par1ItemStack.hasTagCompound()) {
|
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
|
||||||
|
|
||||||
return itemTag.getBoolean("isActive");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
|
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
|
||||||
* sword
|
* sword
|
||||||
@@ -242,7 +179,7 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable {
|
|||||||
@Override
|
@Override
|
||||||
public float func_150893_a(ItemStack par1ItemStack, Block par2Block) // getStrVsBlock
|
public float func_150893_a(ItemStack par1ItemStack, Block par2Block) // getStrVsBlock
|
||||||
{
|
{
|
||||||
if (!getActivated(par1ItemStack)) {
|
if (!IBindable.isActive(par1ItemStack)) {
|
||||||
return 0.0F;
|
return 0.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,9 +190,10 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable {
|
|||||||
* Current implementations of this method in child classes do not use the entry argument beside ev. They just raise
|
* Current implementations of this method in child classes do not use the entry argument beside ev. They just raise
|
||||||
* the damage on the stack.
|
* the damage on the stack.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase,
|
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase,
|
||||||
EntityLivingBase par3EntityLivingBase) {
|
EntityLivingBase par3EntityLivingBase) {
|
||||||
return getActivated(par1ItemStack);
|
return IBindable.isActive(par1ItemStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -263,7 +201,7 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable {
|
|||||||
EntityLivingBase par7EntityLivingBase) {
|
EntityLivingBase par7EntityLivingBase) {
|
||||||
|
|
||||||
if (par7EntityLivingBase instanceof EntityPlayer) {
|
if (par7EntityLivingBase instanceof EntityPlayer) {
|
||||||
EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par7EntityLivingBase, getEnergyUsed());
|
EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par7EntityLivingBase, drainCost());
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -290,7 +228,7 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public float getDigSpeed(ItemStack stack, Block block, int meta) {
|
public float getDigSpeed(ItemStack stack, Block block, int meta) {
|
||||||
if (!getActivated(stack)) {
|
if (!IBindable.isActive(stack)) {
|
||||||
return 0.0F;
|
return 0.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -303,11 +241,21 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
|
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
|
||||||
return !getActivated(stack);
|
return !IBindable.isActive(stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getHarvestLevel(ItemStack stack, String toolClass) {
|
public int getHarvestLevel(ItemStack stack, String toolClass) {
|
||||||
return getActivated(stack) ? super.getHarvestLevel(stack, toolClass) : -1;
|
return IBindable.isActive(stack) ? super.getHarvestLevel(stack, toolClass) : -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isBoundTool() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int rightClickCost() {
|
||||||
|
return rightClickCost;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -34,6 +34,7 @@ public class BoundShovel extends ItemSpade implements IBindable {
|
|||||||
|
|
||||||
public float efficiencyOnProperMaterial = 12.0F;
|
public float efficiencyOnProperMaterial = 12.0F;
|
||||||
public float damageVsEntity;
|
public float damageVsEntity;
|
||||||
|
public int rightClickCost = 10000;
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
private IIcon activeIcon;
|
private IIcon activeIcon;
|
||||||
@@ -61,23 +62,15 @@ public class BoundShovel extends ItemSpade implements IBindable {
|
|||||||
return this.energyUsed;
|
return this.energyUsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int drainCost() {
|
||||||
|
return this.energyUsed;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.boundshovel.desc"));
|
par3List.add(StatCollector.translateToLocal("tooltip.boundshovel.desc"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
|
||||||
if (par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
|
||||||
} else {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) {
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -90,13 +83,7 @@ public class BoundShovel extends ItemSpade implements IBindable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
||||||
if (stack.getTagCompound() == null) {
|
if (IBindable.isActive(stack)) {
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound tag = stack.getTagCompound();
|
|
||||||
|
|
||||||
if (tag.getBoolean("isActive")) {
|
|
||||||
return this.activeIcon;
|
return this.activeIcon;
|
||||||
} else {
|
} else {
|
||||||
return this.passiveIcon;
|
return this.passiveIcon;
|
||||||
@@ -105,29 +92,7 @@ public class BoundShovel extends ItemSpade implements IBindable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (checkRightClick(par1ItemStack, par2World, par3EntityPlayer)) {
|
||||||
this.setActivated(par1ItemStack, !getActivated(par1ItemStack));
|
|
||||||
par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (par2World.isRemote) {
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!getActivated(par1ItemStack) || SpellHelper.isFakePlayer(par2World, par3EntityPlayer)) {
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (AlchemicalWizardry.disableBoundToolsRightClick) {
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (par3EntityPlayer.isPotionActive(AlchemicalWizardry.customPotionInhibit)) {
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 10000)) {
|
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,45 +151,19 @@ public class BoundShovel extends ItemSpade implements IBindable {
|
|||||||
if (par1ItemStack.getTagCompound() == null) {
|
if (par1ItemStack.getTagCompound() == null) {
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||||
}
|
}
|
||||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay")
|
|
||||||
&& par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
checkPassiveDrain(par1ItemStack, par2World, par3EntityPlayer);
|
||||||
if (!par3EntityPlayer.capabilities.isCreativeMode) {
|
|
||||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 20)) {
|
|
||||||
this.setActivated(par1ItemStack, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
par1ItemStack.setItemDamage(0);
|
par1ItemStack.setItemDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setActivated(ItemStack par1ItemStack, boolean newActivated) {
|
|
||||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
|
||||||
|
|
||||||
if (itemTag == null) {
|
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
itemTag.setBoolean("isActive", newActivated);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getActivated(ItemStack par1ItemStack) {
|
|
||||||
if (!par1ItemStack.hasTagCompound()) {
|
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
|
||||||
|
|
||||||
return itemTag.getBoolean("isActive");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
|
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
|
||||||
* sword
|
* sword
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public float func_150893_a(ItemStack par1ItemStack, Block par2Block) {
|
public float func_150893_a(ItemStack par1ItemStack, Block par2Block) {
|
||||||
if (!getActivated(par1ItemStack)) {
|
if (!IBindable.isActive(par1ItemStack)) {
|
||||||
return 0.0F;
|
return 0.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -237,7 +176,7 @@ public class BoundShovel extends ItemSpade implements IBindable {
|
|||||||
*/
|
*/
|
||||||
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase,
|
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase,
|
||||||
EntityLivingBase par3EntityLivingBase) {
|
EntityLivingBase par3EntityLivingBase) {
|
||||||
return getActivated(par1ItemStack);
|
return IBindable.isActive(par1ItemStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6,
|
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6,
|
||||||
@@ -275,7 +214,7 @@ public class BoundShovel extends ItemSpade implements IBindable {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public float getDigSpeed(ItemStack stack, Block block, int meta) {
|
public float getDigSpeed(ItemStack stack, Block block, int meta) {
|
||||||
if (!getActivated(stack)) {
|
if (!IBindable.isActive(stack)) {
|
||||||
return 0.0F;
|
return 0.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -288,11 +227,21 @@ public class BoundShovel extends ItemSpade implements IBindable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
|
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
|
||||||
return !getActivated(stack);
|
return !IBindable.isActive(stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getHarvestLevel(ItemStack stack, String toolClass) {
|
public int getHarvestLevel(ItemStack stack, String toolClass) {
|
||||||
return getActivated(stack) ? super.getHarvestLevel(stack, toolClass) : -1;
|
return IBindable.isActive(stack) ? super.getHarvestLevel(stack, toolClass) : -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isBoundTool() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int rightClickCost() {
|
||||||
|
return rightClickCost;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -39,18 +39,13 @@ public class CheatyItem extends Item implements IBindable {
|
|||||||
par3List.add(StatCollector.translateToLocal("tooltip.mode.creative"));
|
par3List.add(StatCollector.translateToLocal("tooltip.mode.creative"));
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.cheatyitem.desc1"));
|
par3List.add(StatCollector.translateToLocal("tooltip.cheatyitem.desc1"));
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.cheatyitem.desc2"));
|
par3List.add(StatCollector.translateToLocal("tooltip.cheatyitem.desc2"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
World world = par3EntityPlayer.worldObj;
|
World world = par3EntityPlayer.worldObj;
|
||||||
|
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer)
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer)
|
||||||
|| par3EntityPlayer instanceof FakePlayer) {
|
|| par3EntityPlayer instanceof FakePlayer) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-19
@@ -8,6 +8,7 @@ import net.minecraft.item.ItemStack;
|
|||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.StatCollector;
|
import net.minecraft.util.StatCollector;
|
||||||
|
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
@@ -27,25 +28,16 @@ public class DemonicTelepositionFocus extends TelepositionFocus {
|
|||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.demonictelepfocus.desc1"));
|
par3List.add(StatCollector.translateToLocal("tooltip.demonictelepfocus.desc1"));
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.demonictelepfocus.desc2"));
|
par3List.add(StatCollector.translateToLocal("tooltip.demonictelepfocus.desc2"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
|
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
NBTTagCompound itemTag = IBindable.getTag(par1ItemStack);
|
||||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
par3List.add(
|
||||||
|
StatCollector.translateToLocal("tooltip.alchemy.coords") + " "
|
||||||
if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) {
|
+ itemTag.getInteger("xCoord")
|
||||||
par3List.add(
|
+ ", "
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
+ itemTag.getInteger("yCoord")
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
+ ", "
|
||||||
}
|
+ itemTag.getInteger("zCoord"));
|
||||||
|
par3List.add(StatCollector.translateToLocal("tooltip.alchemy.dimension") + " " + getDimensionID(par1ItemStack));
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.alchemy.coords") + " "
|
|
||||||
+ itemTag.getInteger("xCoord")
|
|
||||||
+ ", "
|
|
||||||
+ itemTag.getInteger("yCoord")
|
|
||||||
+ ", "
|
|
||||||
+ itemTag.getInteger("zCoord"));
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.alchemy.dimension") + " " + getDimensionID(par1ItemStack));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -43,15 +43,11 @@ public class EnergyBattery extends Item implements ArmourUpgrade, IBindable, IBl
|
|||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.energybattery.desc"));
|
par3List.add(StatCollector.translateToLocal("tooltip.energybattery.desc"));
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer)) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer)) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,11 +3,8 @@ package WayofTime.alchemicalWizardry.common.items;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.util.IIcon;
|
|
||||||
import net.minecraft.util.StatCollector;
|
import net.minecraft.util.StatCollector;
|
||||||
import net.minecraft.util.Vec3;
|
import net.minecraft.util.Vec3;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
@@ -17,30 +14,10 @@ import WayofTime.alchemicalWizardry.common.entity.projectile.EntityEnergyBazooka
|
|||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class EnergyBazooka extends EnergyItems {
|
public class EnergyBazooka extends EnergyBlast {
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
private IIcon activeIcon;
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
private IIcon activeIconTier2;
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
private IIcon activeIconTier3;
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
private IIcon passiveIcon;
|
|
||||||
|
|
||||||
private int tier;
|
|
||||||
private int damage;
|
|
||||||
|
|
||||||
public EnergyBazooka(int tier) {
|
public EnergyBazooka(int tier) {
|
||||||
super();
|
super(tier);
|
||||||
setMaxStackSize(1);
|
|
||||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
|
||||||
setFull3D();
|
|
||||||
setMaxDamage(250);
|
|
||||||
this.tier = tier;
|
|
||||||
switch (this.tier) {
|
switch (this.tier) {
|
||||||
case 1:
|
case 1:
|
||||||
this.setEnergyUsed(AlchemicalWizardry.energyBazookaLPPerShot);
|
this.setEnergyUsed(AlchemicalWizardry.energyBazookaLPPerShot);
|
||||||
@@ -68,134 +45,61 @@ public class EnergyBazooka extends EnergyItems {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
public void shoot(World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (stack.getTagCompound() == null) {
|
par2World.spawnEntityInWorld(new EntityEnergyBazookaMainProjectile(par2World, par3EntityPlayer, this.damage));
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound tag = stack.getTagCompound();
|
|
||||||
|
|
||||||
if (tag.getBoolean("isActive")) {
|
|
||||||
switch (this.tier) {
|
|
||||||
case 1:
|
|
||||||
return this.activeIcon;
|
|
||||||
case 2:
|
|
||||||
return this.activeIconTier2;
|
|
||||||
case 3:
|
|
||||||
return this.activeIconTier3;
|
|
||||||
}
|
|
||||||
return this.activeIcon;
|
|
||||||
} else {
|
|
||||||
return this.passiveIcon;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
|
||||||
int maxDelay = 1;
|
|
||||||
int maxDelayAfterActivation = 1;
|
|
||||||
switch (this.tier) {
|
|
||||||
case 1:
|
|
||||||
maxDelay = AlchemicalWizardry.energyBazookaMaxDelay;
|
|
||||||
maxDelayAfterActivation = AlchemicalWizardry.energyBazookaMaxDelayAfterActivation + 1;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
maxDelay = AlchemicalWizardry.energyBazookaSecondTierMaxDelay;
|
|
||||||
maxDelayAfterActivation = AlchemicalWizardry.energyBazookaSecondTierMaxDelayAfterActivation + 1;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
maxDelay = AlchemicalWizardry.energyBazookaThirdTierMaxDelay;
|
|
||||||
maxDelayAfterActivation = AlchemicalWizardry.energyBazookaThirdTierMaxDelayAfterActivation + 1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
|
||||||
this.setActivated(par1ItemStack, !getActivated(par1ItemStack));
|
|
||||||
par1ItemStack.getTagCompound()
|
|
||||||
.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % maxDelayAfterActivation);
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!getActivated(par1ItemStack)) {
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.getDelay(par1ItemStack) > 0) {
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!par3EntityPlayer.capabilities.isCreativeMode) {
|
|
||||||
if (!syphonBatteries(par1ItemStack, par3EntityPlayer, this.getEnergyUsed())) {
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
|
||||||
|
|
||||||
if (!par2World.isRemote) {
|
|
||||||
par2World.spawnEntityInWorld(
|
|
||||||
new EntityEnergyBazookaMainProjectile(par2World, par3EntityPlayer, this.damage));
|
|
||||||
this.setDelay(par1ItemStack, maxDelay);
|
|
||||||
}
|
|
||||||
|
|
||||||
Vec3 vec = par3EntityPlayer.getLookVec();
|
Vec3 vec = par3EntityPlayer.getLookVec();
|
||||||
double wantedVelocity = (double) this.tier * 2.0D;
|
double wantedVelocity = this.tier * 2.0D;
|
||||||
par3EntityPlayer.motionX = -vec.xCoord * wantedVelocity;
|
par3EntityPlayer.motionX = -vec.xCoord * wantedVelocity;
|
||||||
par3EntityPlayer.motionY = -vec.yCoord * wantedVelocity;
|
par3EntityPlayer.motionY = -vec.yCoord * wantedVelocity;
|
||||||
par3EntityPlayer.motionZ = -vec.zCoord * wantedVelocity;
|
par3EntityPlayer.motionZ = -vec.zCoord * wantedVelocity;
|
||||||
par2World.playSoundEffect(
|
par2World.playSoundEffect(
|
||||||
(double) ((float) par3EntityPlayer.posX + 0.5F),
|
par3EntityPlayer.posX + 0.5F,
|
||||||
(double) ((float) par3EntityPlayer.posY + 0.5F),
|
par3EntityPlayer.posY + 0.5F,
|
||||||
(double) ((float) par3EntityPlayer.posZ + 0.5F),
|
par3EntityPlayer.posZ + 0.5F,
|
||||||
"random.fizz",
|
"random.fizz",
|
||||||
0.5F,
|
0.5F,
|
||||||
2.6F + (par2World.rand.nextFloat() - par2World.rand.nextFloat()) * 0.8F);
|
2.6F + (par2World.rand.nextFloat() - par2World.rand.nextFloat()) * 0.8F);
|
||||||
par3EntityPlayer.fallDistance = 0;
|
par3EntityPlayer.fallDistance = 0;
|
||||||
return par1ItemStack;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
|
public int getShotDelay() {
|
||||||
if (!(par3Entity instanceof EntityPlayer)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity;
|
|
||||||
|
|
||||||
if (par1ItemStack.getTagCompound() == null) {
|
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
int delay = this.getDelay(par1ItemStack);
|
|
||||||
|
|
||||||
if (!par2World.isRemote && delay > 0) {
|
|
||||||
this.setDelay(par1ItemStack, delay - 1);
|
|
||||||
}
|
|
||||||
int lpPerActivation = 0;
|
|
||||||
int maxDelayAfterActivation = 1;
|
|
||||||
switch (this.tier) {
|
switch (this.tier) {
|
||||||
case 1:
|
case 1:
|
||||||
lpPerActivation = AlchemicalWizardry.energyBazookaLPPerActivation;
|
return AlchemicalWizardry.energyBazookaMaxDelay;
|
||||||
maxDelayAfterActivation = AlchemicalWizardry.energyBazookaMaxDelayAfterActivation + 1;
|
|
||||||
break;
|
|
||||||
case 2:
|
case 2:
|
||||||
lpPerActivation = AlchemicalWizardry.energyBazookaSecondTierLPPerActivation;
|
return AlchemicalWizardry.energyBazookaSecondTierMaxDelay;
|
||||||
maxDelayAfterActivation = AlchemicalWizardry.energyBazookaSecondTierMaxDelayAfterActivation + 1;
|
|
||||||
break;
|
|
||||||
case 3:
|
case 3:
|
||||||
lpPerActivation = AlchemicalWizardry.energyBazookaThirdTierLPPerActivation;
|
return AlchemicalWizardry.energyBazookaThirdTierMaxDelay;
|
||||||
maxDelayAfterActivation = AlchemicalWizardry.energyBazookaThirdTierMaxDelayAfterActivation + 1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (par2World.getWorldTime() % maxDelayAfterActivation
|
|
||||||
== par1ItemStack.getTagCompound().getInteger("worldTimeDelay")
|
|
||||||
&& par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
|
||||||
if (!par3EntityPlayer.capabilities.isCreativeMode) {
|
|
||||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, lpPerActivation)) {
|
|
||||||
this.setActivated(par1ItemStack, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
par1ItemStack.setItemDamage(0);
|
@Override
|
||||||
|
public int drainTicks() {
|
||||||
|
switch (this.tier) {
|
||||||
|
case 1:
|
||||||
|
return AlchemicalWizardry.energyBazookaMaxDelayAfterActivation;
|
||||||
|
case 2:
|
||||||
|
return AlchemicalWizardry.energyBazookaSecondTierMaxDelayAfterActivation;
|
||||||
|
case 3:
|
||||||
|
return AlchemicalWizardry.energyBazookaThirdTierMaxDelayAfterActivation;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int drainCost() {
|
||||||
|
switch (this.tier) {
|
||||||
|
case 1:
|
||||||
|
return AlchemicalWizardry.energyBazookaLPPerActivation;
|
||||||
|
case 2:
|
||||||
|
return AlchemicalWizardry.energyBazookaSecondTierLPPerActivation;
|
||||||
|
case 3:
|
||||||
|
return AlchemicalWizardry.energyBazookaThirdTierLPPerActivation;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -204,45 +108,6 @@ public class EnergyBazooka extends EnergyItems {
|
|||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.energybazooka.desc"));
|
par3List.add(StatCollector.translateToLocal("tooltip.energybazooka.desc"));
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.alchemy.damage") + " " + this.damage);
|
par3List.add(StatCollector.translateToLocal("tooltip.alchemy.damage") + " " + this.damage);
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
if (par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
|
||||||
} else {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated"));
|
|
||||||
}
|
|
||||||
if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) {
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setActivated(ItemStack par1ItemStack, boolean newActivated) {
|
|
||||||
if (par1ItemStack.getTagCompound() == null) {
|
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
par1ItemStack.getTagCompound().setBoolean("isActive", newActivated);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getActivated(ItemStack par1ItemStack) {
|
|
||||||
if (par1ItemStack.getTagCompound() == null) {
|
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
return par1ItemStack.getTagCompound().getBoolean("isActive");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDelay(ItemStack par1ItemStack, int newDelay) {
|
|
||||||
if (par1ItemStack.getTagCompound() == null) {
|
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
par1ItemStack.getTagCompound().setInteger("delay", newDelay);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getDelay(ItemStack par1ItemStack) {
|
|
||||||
if (par1ItemStack.getTagCompound() == null) {
|
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
return par1ItemStack.getTagCompound().getInteger("delay");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,12 +6,12 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
|||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.util.StatCollector;
|
import net.minecraft.util.StatCollector;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile;
|
import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
@@ -19,19 +19,19 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||||||
public class EnergyBlast extends EnergyItems {
|
public class EnergyBlast extends EnergyItems {
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
private IIcon activeIcon;
|
public IIcon activeIcon;
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
private IIcon activeIconTier2;
|
public IIcon activeIconTier2;
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
private IIcon activeIconTier3;
|
public IIcon activeIconTier3;
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
private IIcon passiveIcon;
|
public IIcon passiveIcon;
|
||||||
|
|
||||||
private int tier;
|
public int tier;
|
||||||
private int damage;
|
public int damage;
|
||||||
|
|
||||||
public EnergyBlast(int tier) {
|
public EnergyBlast(int tier) {
|
||||||
super();
|
super();
|
||||||
@@ -70,13 +70,7 @@ public class EnergyBlast extends EnergyItems {
|
|||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
||||||
if (stack.getTagCompound() == null) {
|
if (IBindable.isActive(stack)) {
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound tag = stack.getTagCompound();
|
|
||||||
|
|
||||||
if (tag.getBoolean("isActive")) {
|
|
||||||
switch (this.tier) {
|
switch (this.tier) {
|
||||||
case 1:
|
case 1:
|
||||||
return this.activeIcon;
|
return this.activeIcon;
|
||||||
@@ -93,53 +87,29 @@ public class EnergyBlast extends EnergyItems {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
int maxDelay = 1;
|
if (getDelay(par1ItemStack) > 0 && IBindable.isActive(par1ItemStack) && !par3EntityPlayer.isSneaking()) {
|
||||||
int maxDelayAfterActivation = 1;
|
|
||||||
switch (this.tier) {
|
|
||||||
case 1:
|
|
||||||
maxDelay = AlchemicalWizardry.energyBlastMaxDelay;
|
|
||||||
maxDelayAfterActivation = AlchemicalWizardry.energyBlastMaxDelayAfterActivation + 1;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
maxDelay = AlchemicalWizardry.energyBlastSecondTierMaxDelay;
|
|
||||||
maxDelayAfterActivation = AlchemicalWizardry.energyBlastSecondTierMaxDelayAfterActivation + 1;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
maxDelay = AlchemicalWizardry.energyBlastThirdTierMaxDelay;
|
|
||||||
maxDelayAfterActivation = AlchemicalWizardry.energyBlastThirdTierMaxDelayAfterActivation + 1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
|
||||||
this.setActivated(par1ItemStack, !getActivated(par1ItemStack));
|
|
||||||
par1ItemStack.getTagCompound()
|
|
||||||
.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % maxDelayAfterActivation);
|
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!getActivated(par1ItemStack)) {
|
if (checkRightClick(par1ItemStack, par2World, par3EntityPlayer)) {
|
||||||
|
setDelay(par1ItemStack, drainTicks());
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.getDelay(par1ItemStack) > 0) {
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!par3EntityPlayer.capabilities.isCreativeMode) {
|
|
||||||
if (!syphonBatteries(par1ItemStack, par3EntityPlayer, this.getEnergyUsed())) {
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||||
|
|
||||||
if (!par2World.isRemote) {
|
if (!par2World.isRemote) {
|
||||||
par2World.spawnEntityInWorld(new EnergyBlastProjectile(par2World, par3EntityPlayer, this.damage));
|
shoot(par2World, par3EntityPlayer);
|
||||||
this.setDelay(par1ItemStack, maxDelay);
|
this.setDelay(par1ItemStack, getShotDelay());
|
||||||
}
|
}
|
||||||
|
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void shoot(World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
|
par2World.spawnEntityInWorld(new EnergyBlastProjectile(par2World, par3EntityPlayer, this.damage));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
|
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
|
||||||
if (!(par3Entity instanceof EntityPlayer)) {
|
if (!(par3Entity instanceof EntityPlayer)) {
|
||||||
@@ -147,43 +117,66 @@ public class EnergyBlast extends EnergyItems {
|
|||||||
}
|
}
|
||||||
EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity;
|
EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity;
|
||||||
|
|
||||||
if (par1ItemStack.getTagCompound() == null) {
|
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
int delay = this.getDelay(par1ItemStack);
|
int delay = this.getDelay(par1ItemStack);
|
||||||
|
|
||||||
if (!par2World.isRemote && delay > 0) {
|
if (!par2World.isRemote && delay > 0) {
|
||||||
this.setDelay(par1ItemStack, delay - 1);
|
this.setDelay(par1ItemStack, delay - 1);
|
||||||
}
|
}
|
||||||
int lpPerActivation = 0;
|
|
||||||
int maxDelayAfterActivation = 1;
|
checkPassiveDrain(par1ItemStack, par2World, par3EntityPlayer);
|
||||||
switch (this.tier) {
|
|
||||||
case 1:
|
|
||||||
lpPerActivation = AlchemicalWizardry.energyBlastLPPerActivation;
|
|
||||||
maxDelayAfterActivation = AlchemicalWizardry.energyBlastMaxDelayAfterActivation + 1;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
lpPerActivation = AlchemicalWizardry.energyBlastSecondTierLPPerActivation;
|
|
||||||
maxDelayAfterActivation = AlchemicalWizardry.energyBlastSecondTierMaxDelayAfterActivation + 1;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
lpPerActivation = AlchemicalWizardry.energyBlastThirdTierLPPerActivation;
|
|
||||||
maxDelayAfterActivation = AlchemicalWizardry.energyBlastThirdTierMaxDelayAfterActivation + 1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (par2World.getWorldTime() % maxDelayAfterActivation
|
|
||||||
== par1ItemStack.getTagCompound().getInteger("worldTimeDelay")
|
|
||||||
&& par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
|
||||||
if (!par3EntityPlayer.capabilities.isCreativeMode) {
|
|
||||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, lpPerActivation)) {
|
|
||||||
this.setActivated(par1ItemStack, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
par1ItemStack.setItemDamage(0);
|
par1ItemStack.setItemDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The delay between firing multiple shots.
|
||||||
|
*/
|
||||||
|
public int getShotDelay() {
|
||||||
|
switch (this.tier) {
|
||||||
|
case 1:
|
||||||
|
return AlchemicalWizardry.energyBlastMaxDelay;
|
||||||
|
case 2:
|
||||||
|
return AlchemicalWizardry.energyBlastSecondTierMaxDelay;
|
||||||
|
case 3:
|
||||||
|
return AlchemicalWizardry.energyBlastThirdTierMaxDelay;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used for the warmup delay as well as for passive draining.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int drainTicks() {
|
||||||
|
switch (this.tier) {
|
||||||
|
case 1:
|
||||||
|
return AlchemicalWizardry.energyBlastMaxDelayAfterActivation;
|
||||||
|
case 2:
|
||||||
|
return AlchemicalWizardry.energyBlastSecondTierMaxDelayAfterActivation;
|
||||||
|
case 3:
|
||||||
|
return AlchemicalWizardry.energyBlastThirdTierMaxDelayAfterActivation;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int drainCost() {
|
||||||
|
switch (this.tier) {
|
||||||
|
case 1:
|
||||||
|
return AlchemicalWizardry.energyBlastLPPerActivation;
|
||||||
|
case 2:
|
||||||
|
return AlchemicalWizardry.energyBlastSecondTierLPPerActivation;
|
||||||
|
case 3:
|
||||||
|
return AlchemicalWizardry.energyBlastThirdTierLPPerActivation;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int rightClickCost() {
|
||||||
|
return getEnergyUsed();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||||
@@ -191,45 +184,14 @@ public class EnergyBlast extends EnergyItems {
|
|||||||
par3List.add(StatCollector.translateToLocal("tooltip.energyblast.desc1"));
|
par3List.add(StatCollector.translateToLocal("tooltip.energyblast.desc1"));
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.energyblast.desc2"));
|
par3List.add(StatCollector.translateToLocal("tooltip.energyblast.desc2"));
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.alchemy.damage") + " " + this.damage);
|
par3List.add(StatCollector.translateToLocal("tooltip.alchemy.damage") + " " + this.damage);
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
if (par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
|
||||||
} else {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated"));
|
|
||||||
}
|
|
||||||
if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) {
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setActivated(ItemStack par1ItemStack, boolean newActivated) {
|
public void setDelay(ItemStack par1ItemStack, int delay) {
|
||||||
if (par1ItemStack.getTagCompound() == null) {
|
IBindable.getTag(par1ItemStack).setInteger("delay", delay);
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
par1ItemStack.getTagCompound().setBoolean("isActive", newActivated);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getActivated(ItemStack par1ItemStack) {
|
|
||||||
if (par1ItemStack.getTagCompound() == null) {
|
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
return par1ItemStack.getTagCompound().getBoolean("isActive");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDelay(ItemStack par1ItemStack, int newDelay) {
|
|
||||||
if (par1ItemStack.getTagCompound() == null) {
|
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
par1ItemStack.getTagCompound().setInteger("delay", newDelay);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getDelay(ItemStack par1ItemStack) {
|
public int getDelay(ItemStack par1ItemStack) {
|
||||||
if (par1ItemStack.getTagCompound() == null) {
|
return IBindable.getTag(par1ItemStack).getInteger("delay");
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
return par1ItemStack.getTagCompound().getInteger("delay");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,6 @@ package WayofTime.alchemicalWizardry.common.items;
|
|||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
import net.minecraft.util.DamageSource;
|
import net.minecraft.util.DamageSource;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
@@ -23,11 +22,16 @@ public class EnergyItems extends Item implements IBindable {
|
|||||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setEnergyUsed(int par1int) {
|
public void setEnergyUsed(int par1int) {
|
||||||
this.energyUsed = par1int;
|
this.energyUsed = par1int;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected int getEnergyUsed() {
|
public int getEnergyUsed() {
|
||||||
|
return this.energyUsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int drainCost() {
|
||||||
return this.energyUsed;
|
return this.energyUsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,9 +94,9 @@ public class EnergyItems extends Item implements IBindable {
|
|||||||
posY,
|
posY,
|
||||||
posZ);
|
posZ);
|
||||||
world.playSoundEffect(
|
world.playSoundEffect(
|
||||||
(double) ((float) player.posX + 0.5F),
|
((float) player.posX + 0.5F),
|
||||||
(double) ((float) player.posY + 0.5F),
|
((float) player.posY + 0.5F),
|
||||||
(double) ((float) player.posZ + 0.5F),
|
((float) player.posZ + 0.5F),
|
||||||
"random.fizz",
|
"random.fizz",
|
||||||
0.5F,
|
0.5F,
|
||||||
2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
|
2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
|
||||||
@@ -181,35 +185,28 @@ public class EnergyItems extends Item implements IBindable {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Global static methods
|
// Used by some addon mods like Blood Arsenal
|
||||||
|
@Deprecated
|
||||||
public static boolean checkAndSetItemOwner(ItemStack item, EntityPlayer player) {
|
public static boolean checkAndSetItemOwner(ItemStack item, EntityPlayer player) {
|
||||||
return !SpellHelper.isFakePlayer(player) && SoulNetworkHandler.checkAndSetItemPlayer(item, player);
|
return IBindable.checkAndSetItemOwner(item, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Used by some addon mods like Blood Arsenal
|
||||||
|
@Deprecated
|
||||||
public static void setItemOwner(ItemStack item, String ownerName) {
|
public static void setItemOwner(ItemStack item, String ownerName) {
|
||||||
if (item.getTagCompound() == null) {
|
IBindable.setItemOwner(item, ownerName);
|
||||||
item.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
item.getTagCompound().setString("ownerName", ownerName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Used by some addon mods like Blood Arsenal
|
||||||
|
@Deprecated
|
||||||
public static void checkAndSetItemOwner(ItemStack item, String ownerName) {
|
public static void checkAndSetItemOwner(ItemStack item, String ownerName) {
|
||||||
if (item.getTagCompound() == null) {
|
IBindable.checkAndSetItemOwner(item, ownerName);
|
||||||
item.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.getTagCompound().getString("ownerName").equals("")) {
|
|
||||||
item.getTagCompound().setString("ownerName", ownerName);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Used by some addon mods like Blood Arsenal
|
||||||
|
@Deprecated
|
||||||
public static String getOwnerName(ItemStack item) {
|
public static String getOwnerName(ItemStack item) {
|
||||||
if (item.getTagCompound() == null) {
|
return IBindable.getOwnerName(item);
|
||||||
item.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
return item.getTagCompound().getString("ownerName");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
|||||||
@@ -19,12 +19,13 @@ import net.minecraft.util.StatCollector;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.common.omega.OmegaParadigm;
|
import WayofTime.alchemicalWizardry.common.omega.OmegaParadigm;
|
||||||
import WayofTime.alchemicalWizardry.common.omega.OmegaRegistry;
|
import WayofTime.alchemicalWizardry.common.omega.OmegaRegistry;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class EnergySword extends ItemSword {
|
public class EnergySword extends ItemSword implements IBindable {
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
private IIcon activeIcon;
|
private IIcon activeIcon;
|
||||||
@@ -51,6 +52,11 @@ public class EnergySword extends ItemSword {
|
|||||||
return this.energyUsed;
|
return this.energyUsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int drainCost() {
|
||||||
|
return this.energyUsed;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerIcons(IIconRegister iconRegister) {
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
@@ -61,13 +67,7 @@ public class EnergySword extends ItemSword {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
||||||
if (stack.getTagCompound() == null) {
|
if (IBindable.isActive(stack)) {
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound tag = stack.getTagCompound();
|
|
||||||
|
|
||||||
if (tag.getBoolean("isActive")) {
|
|
||||||
return this.activeIcon;
|
return this.activeIcon;
|
||||||
} else {
|
} else {
|
||||||
return this.passiveIcon;
|
return this.passiveIcon;
|
||||||
@@ -80,7 +80,7 @@ public class EnergySword extends ItemSword {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
|
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
|
||||||
boolean isActive = getActivated(stack);
|
boolean isActive = IBindable.isActive(stack);
|
||||||
if (isActive && !player.worldObj.isRemote) {
|
if (isActive && !player.worldObj.isRemote) {
|
||||||
OmegaParadigm parad = this.getOmegaParadigmOfWeilder(player);
|
OmegaParadigm parad = this.getOmegaParadigmOfWeilder(player);
|
||||||
|
|
||||||
@@ -97,8 +97,8 @@ public class EnergySword extends ItemSword {
|
|||||||
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase,
|
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase,
|
||||||
EntityLivingBase par3EntityLivingBase) {
|
EntityLivingBase par3EntityLivingBase) {
|
||||||
if (par3EntityLivingBase instanceof EntityPlayer) {
|
if (par3EntityLivingBase instanceof EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, (EntityPlayer) par3EntityLivingBase) || !EnergyItems
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, (EntityPlayer) par3EntityLivingBase) || !EnergyItems
|
||||||
.syphonBatteries(par1ItemStack, (EntityPlayer) par3EntityLivingBase, this.getEnergyUsed())) {
|
.syphonBatteries(par1ItemStack, (EntityPlayer) par3EntityLivingBase, this.drainCost())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -110,15 +110,8 @@ public class EnergySword extends ItemSword {
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
super.onItemRightClick(par1ItemStack, par2World, par3EntityPlayer);
|
super.onItemRightClick(par1ItemStack, par2World, par3EntityPlayer);
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
|
||||||
this.setActivated(par1ItemStack, !getActivated(par1ItemStack));
|
|
||||||
par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 100);
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!getActivated(par1ItemStack)) {
|
this.toggle(par1ItemStack, par2World, par3EntityPlayer);
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
@@ -140,38 +133,11 @@ public class EnergySword extends ItemSword {
|
|||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par2World.getWorldTime() % 100 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay")
|
checkPassiveDrain(par1ItemStack, par2World, par3EntityPlayer);
|
||||||
&& par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
|
||||||
if (!par3EntityPlayer.capabilities.isCreativeMode) {
|
|
||||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 50)) {
|
|
||||||
this.setActivated(par1ItemStack, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
par1ItemStack.setItemDamage(0);
|
par1ItemStack.setItemDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setActivated(ItemStack par1ItemStack, boolean newActivated) {
|
|
||||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
|
||||||
|
|
||||||
if (itemTag == null) {
|
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
itemTag.setBoolean("isActive", newActivated);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getActivated(ItemStack par1ItemStack) {
|
|
||||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
|
||||||
|
|
||||||
if (itemTag == null) {
|
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
return itemTag.getBoolean("isActive");
|
|
||||||
}
|
|
||||||
|
|
||||||
public float func_82803_g() {
|
public float func_82803_g() {
|
||||||
return 4.0F;
|
return 4.0F;
|
||||||
}
|
}
|
||||||
@@ -180,20 +146,7 @@ public class EnergySword extends ItemSword {
|
|||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.caution.desc1"));
|
par3List.add(StatCollector.translateToLocal("tooltip.caution.desc1"));
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.caution.desc2"));
|
par3List.add(StatCollector.translateToLocal("tooltip.caution.desc2"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
|
||||||
if (par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
|
||||||
} else {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) {
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+11
-19
@@ -8,6 +8,7 @@ import net.minecraft.item.ItemStack;
|
|||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.StatCollector;
|
import net.minecraft.util.StatCollector;
|
||||||
|
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
@@ -26,25 +27,16 @@ public class EnhancedTelepositionFocus extends TelepositionFocus {
|
|||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.enhancedtelepfocus.desc"));
|
par3List.add(StatCollector.translateToLocal("tooltip.enhancedtelepfocus.desc"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
|
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
NBTTagCompound itemTag = IBindable.getTag(par1ItemStack);
|
||||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
par3List.add(
|
||||||
|
StatCollector.translateToLocal("tooltip.alchemy.coords") + " "
|
||||||
if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) {
|
+ itemTag.getInteger("xCoord")
|
||||||
par3List.add(
|
+ ", "
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
+ itemTag.getInteger("yCoord")
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
+ ", "
|
||||||
}
|
+ itemTag.getInteger("zCoord"));
|
||||||
|
par3List.add(StatCollector.translateToLocal("tooltip.alchemy.dimension") + " " + getDimensionID(par1ItemStack));
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.alchemy.coords") + " "
|
|
||||||
+ itemTag.getInteger("xCoord")
|
|
||||||
+ ", "
|
|
||||||
+ itemTag.getInteger("yCoord")
|
|
||||||
+ ", "
|
|
||||||
+ itemTag.getInteger("zCoord"));
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.alchemy.dimension") + " " + getDimensionID(par1ItemStack));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -129,7 +129,7 @@ public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade, IAl
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (world.getWorldTime() % tickRate == 0) {
|
if (world.getTotalWorldTime() % tickRate == 0) {
|
||||||
boolean shouldExecute = player.getHealth() / player.getMaxHealth() > activationPoint
|
boolean shouldExecute = player.getHealth() / player.getMaxHealth() > activationPoint
|
||||||
&& this.getStoredLP(itemStack) < maxStored;
|
&& this.getStoredLP(itemStack) < maxStored;
|
||||||
|
|
||||||
|
|||||||
+3
-7
@@ -12,6 +12,7 @@ import net.minecraft.world.World;
|
|||||||
import net.minecraftforge.common.DimensionManager;
|
import net.minecraftforge.common.DimensionManager;
|
||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock;
|
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
@@ -33,16 +34,11 @@ public class ItemComplexSpellCrystal extends EnergyItems {
|
|||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.complexspellcrystal.desc"));
|
par3List.add(StatCollector.translateToLocal("tooltip.complexspellcrystal.desc"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
|
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
if (!(par1ItemStack.getTagCompound() == null)) {
|
||||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||||
|
|
||||||
if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) {
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
|
|
||||||
par3List.add(
|
par3List.add(
|
||||||
StatCollector.translateToLocal("tooltip.alchemy.coords") + " "
|
StatCollector.translateToLocal("tooltip.alchemy.coords") + " "
|
||||||
+ itemTag.getInteger("xCoord")
|
+ itemTag.getInteger("xCoord")
|
||||||
@@ -57,7 +53,7 @@ public class ItemComplexSpellCrystal extends EnergyItems {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,16 +38,12 @@ public class ItemDiabloKey extends EnergyItems {
|
|||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.diablokey.desc"));
|
par3List.add(StatCollector.translateToLocal("tooltip.diablokey.desc"));
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
World world = par3EntityPlayer.worldObj;
|
World world = par3EntityPlayer.worldObj;
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer)
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer)
|
||||||
|| par3EntityPlayer instanceof FakePlayer) {
|
|| par3EntityPlayer instanceof FakePlayer) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
@@ -105,7 +101,7 @@ public class ItemDiabloKey extends EnergyItems {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (item instanceof IBindable) {
|
if (item instanceof IBindable) {
|
||||||
EnergyItems.checkAndSetItemOwner(itemStack, ownerName);
|
IBindable.checkAndSetItemOwner(itemStack, ownerName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
par3EntityPlayer.inventoryContainer.detectAndSendChanges();
|
par3EntityPlayer.inventoryContainer.detectAndSendChanges();
|
||||||
@@ -118,7 +114,7 @@ public class ItemDiabloKey extends EnergyItems {
|
|||||||
public void getSubItems(Item id, CreativeTabs creativeTab, List list) {
|
public void getSubItems(Item id, CreativeTabs creativeTab, List list) {
|
||||||
list.add(new ItemStack(ModItems.itemKeyOfDiablo));
|
list.add(new ItemStack(ModItems.itemKeyOfDiablo));
|
||||||
ItemStack boundKey = new ItemStack(ModItems.itemKeyOfDiablo);
|
ItemStack boundKey = new ItemStack(ModItems.itemKeyOfDiablo);
|
||||||
EnergyItems.checkAndSetItemOwner(boundKey, "Server-wide Soul Network");
|
IBindable.checkAndSetItemOwner(boundKey, "Server-wide Soul Network");
|
||||||
list.add(boundKey);
|
list.add(boundKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12,6 +12,7 @@ import net.minecraft.world.World;
|
|||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
|
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
|
||||||
import WayofTime.alchemicalWizardry.api.rituals.Rituals;
|
import WayofTime.alchemicalWizardry.api.rituals.Rituals;
|
||||||
import WayofTime.alchemicalWizardry.common.block.RitualStone;
|
import WayofTime.alchemicalWizardry.common.block.RitualStone;
|
||||||
@@ -36,15 +37,13 @@ public class ItemRitualDismantler extends EnergyItems {
|
|||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List par3List, boolean x) {
|
public void addInformation(ItemStack stack, EntityPlayer player, List par3List, boolean x) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.dismatler.desc"));
|
par3List.add(StatCollector.translateToLocal("tooltip.dismatler.desc"));
|
||||||
if (stack.hasTagCompound()) par3List.add(
|
addBindingInformation(stack, par3List);
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ stack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7,
|
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7,
|
||||||
float par8, float par9, float par10) {
|
float par8, float par9, float par10) {
|
||||||
return EnergyItems.checkAndSetItemOwner(stack, player)
|
return IBindable.checkAndSetItemOwner(stack, player)
|
||||||
&& breakRitualStoneAtMasterStone(stack, player, world, x, y, z);
|
&& breakRitualStoneAtMasterStone(stack, player, world, x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import org.lwjgl.input.Keyboard;
|
|||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||||
import WayofTime.alchemicalWizardry.api.Int3;
|
import WayofTime.alchemicalWizardry.api.Int3;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IRitualDiviner;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IRitualDiviner;
|
||||||
import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
|
import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
|
||||||
import WayofTime.alchemicalWizardry.api.rituals.IRitualStone;
|
import WayofTime.alchemicalWizardry.api.rituals.IRitualStone;
|
||||||
@@ -74,9 +75,7 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner {
|
|||||||
if (!(stack.getTagCompound() == null)) {
|
if (!(stack.getTagCompound() == null)) {
|
||||||
String ritualID = this.getCurrentRitual(stack);
|
String ritualID = this.getCurrentRitual(stack);
|
||||||
// TODO
|
// TODO
|
||||||
par3List.add(
|
addBindingInformation(stack, par3List);
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ stack.getTagCompound().getString("ownerName"));
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.alchemy.ritualid") + " " + ritualID);
|
par3List.add(StatCollector.translateToLocal("tooltip.alchemy.ritualid") + " " + ritualID);
|
||||||
List<RitualComponent> ritualList = Rituals.getRitualList(this.getCurrentRitual(stack));
|
List<RitualComponent> ritualList = Rituals.getRitualList(this.getCurrentRitual(stack));
|
||||||
if (ritualList == null) {
|
if (ritualList == null) {
|
||||||
@@ -191,7 +190,7 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7,
|
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7,
|
||||||
float par8, float par9, float par10) {
|
float par8, float par9, float par10) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(stack, player)) return false;
|
if (!IBindable.checkAndSetItemOwner(stack, player)) return false;
|
||||||
|
|
||||||
if (placeRitualStoneAtMasterStone(stack, player, world, x, y, z)) {
|
if (placeRitualStoneAtMasterStone(stack, player, world, x, y, z)) {
|
||||||
this.setStoredLocation(stack, new Int3(x, y, z));
|
this.setStoredLocation(stack, new Int3(x, y, z));
|
||||||
@@ -304,7 +303,7 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) {
|
public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) {
|
||||||
if (entity instanceof EntityPlayer && hasStoredLocation(stack) && world.getWorldTime() % 5 == 0) {
|
if (entity instanceof EntityPlayer && hasStoredLocation(stack) && world.getTotalWorldTime() % 5 == 0) {
|
||||||
Int3 loc = getStoredLocation(stack);
|
Int3 loc = getStoredLocation(stack);
|
||||||
|
|
||||||
int x = loc.xCoord;
|
int x = loc.xCoord;
|
||||||
@@ -369,7 +368,7 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack stack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack stack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (EnergyItems.checkAndSetItemOwner(stack, par3EntityPlayer) && par3EntityPlayer.isSneaking()) {
|
if (IBindable.checkAndSetItemOwner(stack, par3EntityPlayer) && par3EntityPlayer.isSneaking()) {
|
||||||
rotateRituals(par2World, par3EntityPlayer, stack, true);
|
rotateRituals(par2World, par3EntityPlayer, stack, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -381,7 +380,7 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner {
|
|||||||
if (entityLiving instanceof EntityPlayer) {
|
if (entityLiving instanceof EntityPlayer) {
|
||||||
EntityPlayer player = (EntityPlayer) entityLiving;
|
EntityPlayer player = (EntityPlayer) entityLiving;
|
||||||
|
|
||||||
if (!EnergyItems.checkAndSetItemOwner(stack, player)) return true;
|
if (!IBindable.checkAndSetItemOwner(stack, player)) return true;
|
||||||
|
|
||||||
if (!player.isSwingInProgress) {
|
if (!player.isSwingInProgress) {
|
||||||
if (player.isSneaking()) {
|
if (player.isSneaking()) {
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import net.minecraft.world.WorldProvider;
|
|||||||
import net.minecraftforge.common.DimensionManager;
|
import net.minecraftforge.common.DimensionManager;
|
||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
|
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
@@ -52,7 +53,7 @@ public class LavaCrystal extends EnergyItems {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,12 +61,7 @@ public class LavaCrystal extends EnergyItems {
|
|||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.lavacrystal.desc1"));
|
par3List.add(StatCollector.translateToLocal("tooltip.lavacrystal.desc1"));
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.lavacrystal.desc2"));
|
par3List.add(StatCollector.translateToLocal("tooltip.lavacrystal.desc2"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasEnoughEssence(ItemStack itemStack) {
|
public boolean hasEnoughEssence(ItemStack itemStack) {
|
||||||
|
|||||||
+11
-19
@@ -8,6 +8,7 @@ import net.minecraft.item.ItemStack;
|
|||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.StatCollector;
|
import net.minecraft.util.StatCollector;
|
||||||
|
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
@@ -27,25 +28,16 @@ public class ReinforcedTelepositionFocus extends TelepositionFocus {
|
|||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.reinforcedtelepfocus.desc1"));
|
par3List.add(StatCollector.translateToLocal("tooltip.reinforcedtelepfocus.desc1"));
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.reinforcedtelepfocus.desc2"));
|
par3List.add(StatCollector.translateToLocal("tooltip.reinforcedtelepfocus.desc2"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
|
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
NBTTagCompound itemTag = IBindable.getTag(par1ItemStack);
|
||||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
par3List.add(
|
||||||
|
StatCollector.translateToLocal("tooltip.alchemy.coords") + " "
|
||||||
if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) {
|
+ itemTag.getInteger("xCoord")
|
||||||
par3List.add(
|
+ ", "
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
+ itemTag.getInteger("yCoord")
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
+ ", "
|
||||||
}
|
+ itemTag.getInteger("zCoord"));
|
||||||
|
par3List.add(StatCollector.translateToLocal("tooltip.alchemy.dimension") + " " + getDimensionID(par1ItemStack));
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.alchemy.coords") + " "
|
|
||||||
+ itemTag.getInteger("xCoord")
|
|
||||||
+ ", "
|
|
||||||
+ itemTag.getInteger("yCoord")
|
|
||||||
+ ", "
|
|
||||||
+ itemTag.getInteger("zCoord"));
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.alchemy.dimension") + " " + getDimensionID(par1ItemStack));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,6 +8,7 @@ import net.minecraft.util.StatCollector;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
|
|
||||||
public class ScribeTool extends EnergyItems {
|
public class ScribeTool extends EnergyItems {
|
||||||
|
|
||||||
@@ -25,17 +26,12 @@ public class ScribeTool extends EnergyItems {
|
|||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.scribetool.desc"));
|
par3List.add(StatCollector.translateToLocal("tooltip.scribetool.desc"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer)) {
|
if (IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer)) {
|
||||||
if (par1ItemStack.getItemDamage() > 0) {
|
if (par1ItemStack.getItemDamage() > 0) {
|
||||||
par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() - 1);
|
par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() - 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import net.minecraft.util.StatCollector;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
@@ -34,31 +35,22 @@ public class TelepositionFocus extends EnergyItems {
|
|||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.telepositionfocus.desc"));
|
par3List.add(StatCollector.translateToLocal("tooltip.telepositionfocus.desc"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
|
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
NBTTagCompound itemTag = IBindable.getTag(par1ItemStack);
|
||||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
par3List.add(
|
||||||
|
StatCollector.translateToLocal("tooltip.alchemy.coords") + " "
|
||||||
if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) {
|
+ itemTag.getInteger("xCoord")
|
||||||
par3List.add(
|
+ ", "
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
+ itemTag.getInteger("yCoord")
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
+ ", "
|
||||||
}
|
+ itemTag.getInteger("zCoord"));
|
||||||
|
par3List.add(StatCollector.translateToLocal("tooltip.alchemy.dimension") + " " + getDimensionID(par1ItemStack));
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.alchemy.coords") + " "
|
|
||||||
+ itemTag.getInteger("xCoord")
|
|
||||||
+ ", "
|
|
||||||
+ itemTag.getInteger("yCoord")
|
|
||||||
+ ", "
|
|
||||||
+ itemTag.getInteger("zCoord"));
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.alchemy.dimension") + " " + getDimensionID(par1ItemStack));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer)) {
|
if (IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer)) {
|
||||||
if (par3EntityPlayer.isSneaking()) {
|
if (par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ public class BoundArmour extends ItemArmor
|
|||||||
@Override
|
@Override
|
||||||
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {
|
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {
|
||||||
if (entity instanceof EntityPlayer) {
|
if (entity instanceof EntityPlayer) {
|
||||||
EnergyItems.checkAndSetItemOwner(stack, (EntityPlayer) entity);
|
IBindable.checkAndSetItemOwner(stack, (EntityPlayer) entity);
|
||||||
|
|
||||||
if (((EntityPlayer) entity).capabilities.isCreativeMode) {
|
if (((EntityPlayer) entity).capabilities.isCreativeMode) {
|
||||||
return;
|
return;
|
||||||
@@ -275,14 +275,9 @@ public class BoundArmour extends ItemArmor
|
|||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.boundarmor.devprotect"));
|
par3List.add(StatCollector.translateToLocal("tooltip.boundarmor.devprotect"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
|
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
if (!(par1ItemStack.getTagCompound() == null)) {
|
||||||
if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) {
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
|
|
||||||
ItemStack[] inv = getInternalInventory(par1ItemStack);
|
ItemStack[] inv = getInternalInventory(par1ItemStack);
|
||||||
|
|
||||||
if (inv == null) {
|
if (inv == null) {
|
||||||
@@ -332,7 +327,7 @@ public class BoundArmour extends ItemArmor
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||||
return super.onItemRightClick(par1ItemStack, par2World, par3EntityPlayer);
|
return super.onItemRightClick(par1ItemStack, par2World, par3EntityPlayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -353,7 +348,7 @@ public class BoundArmour extends ItemArmor
|
|||||||
|
|
||||||
public void repairArmour(World world, EntityPlayer player, ItemStack itemStack) {
|
public void repairArmour(World world, EntityPlayer player, ItemStack itemStack) {
|
||||||
if (itemStack.getItemDamage() > 0) {
|
if (itemStack.getItemDamage() > 0) {
|
||||||
EnergyItems.checkAndSetItemOwner(itemStack, player);
|
IBindable.checkAndSetItemOwner(itemStack, player);
|
||||||
|
|
||||||
if (!player.capabilities.isCreativeMode) {
|
if (!player.capabilities.isCreativeMode) {
|
||||||
if (EnergyItems.syphonBatteries(itemStack, player, itemStack.getItemDamage() * 75)) {
|
if (EnergyItems.syphonBatteries(itemStack, player, itemStack.getItemDamage() * 75)) {
|
||||||
@@ -383,7 +378,7 @@ public class BoundArmour extends ItemArmor
|
|||||||
blood--;
|
blood--;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par2World.getWorldTime() % 200 == 0) {
|
if (par2World.getTotalWorldTime() % 200 == 0) {
|
||||||
if (getUpgradeCostMultiplier(par1ItemStack) > 0.02f) {
|
if (getUpgradeCostMultiplier(par1ItemStack) > 0.02f) {
|
||||||
EnergyItems.syphonBatteries(
|
EnergyItems.syphonBatteries(
|
||||||
par1ItemStack,
|
par1ItemStack,
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import net.minecraft.world.World;
|
|||||||
import net.minecraft.world.biome.BiomeGenBase;
|
import net.minecraft.world.biome.BiomeGenBase;
|
||||||
|
|
||||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
|
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||||
import WayofTime.alchemicalWizardry.api.spell.APISpellHelper;
|
import WayofTime.alchemicalWizardry.api.spell.APISpellHelper;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
@@ -79,7 +80,7 @@ public abstract class OmegaArmour extends BoundArmour {
|
|||||||
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
||||||
super.onArmorTick(world, player, itemStack);
|
super.onArmorTick(world, player, itemStack);
|
||||||
|
|
||||||
if (world.getWorldTime() % 50 == 0) {
|
if (world.getTotalWorldTime() % 50 == 0) {
|
||||||
if (this.storeBiomeID()) {
|
if (this.storeBiomeID()) {
|
||||||
int xCoord = (int) Math.floor(player.posX);
|
int xCoord = (int) Math.floor(player.posX);
|
||||||
int zCoord = (int) Math.floor(player.posZ);
|
int zCoord = (int) Math.floor(player.posZ);
|
||||||
@@ -137,7 +138,7 @@ public abstract class OmegaArmour extends BoundArmour {
|
|||||||
omegaStack.setTagCompound(tag);
|
omegaStack.setTagCompound(tag);
|
||||||
}
|
}
|
||||||
this.setContainedArmourStack(omegaStack, boundStack);
|
this.setContainedArmourStack(omegaStack, boundStack);
|
||||||
SoulNetworkHandler.checkAndSetItemOwner(omegaStack, SoulNetworkHandler.getOwnerName(boundStack));
|
IBindable.checkAndSetItemOwner(omegaStack, SoulNetworkHandler.getOwnerName(boundStack));
|
||||||
this.setItemEnchantability(omegaStack, Math.min(enchantability, 70));
|
this.setItemEnchantability(omegaStack, Math.min(enchantability, 70));
|
||||||
|
|
||||||
EnchantmentHelper.setEnchantments(new HashMap(), omegaStack);
|
EnchantmentHelper.setEnchantments(new HashMap(), omegaStack);
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import net.minecraft.world.World;
|
|||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
@@ -30,12 +31,7 @@ public class SigilAir extends EnergyItems implements ArmourUpgrade, ISigil {
|
|||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.airsigil.desc"));
|
par3List.add(StatCollector.translateToLocal("tooltip.airsigil.desc"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -46,7 +42,7 @@ public class SigilAir extends EnergyItems implements ArmourUpgrade, ISigil {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import net.minecraft.world.World;
|
|||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||||
import WayofTime.alchemicalWizardry.common.entity.projectile.EntityBloodLightProjectile;
|
import WayofTime.alchemicalWizardry.common.entity.projectile.EntityBloodLightProjectile;
|
||||||
@@ -33,12 +34,7 @@ public class SigilBloodLight extends EnergyItems implements IHolding, ArmourUpgr
|
|||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.bloodlightsigil.desc"));
|
par3List.add(StatCollector.translateToLocal("tooltip.bloodlightsigil.desc"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -50,7 +46,7 @@ public class SigilBloodLight extends EnergyItems implements IHolding, ArmourUpgr
|
|||||||
@Override
|
@Override
|
||||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4,
|
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4,
|
||||||
int par5, int par6, int par7, float par8, float par9, float par10) {
|
int par5, int par6, int par7, float par8, float par9, float par10) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par2EntityPlayer)
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par2EntityPlayer)
|
||||||
|| !EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, getEnergyUsed())) {
|
|| !EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, getEnergyUsed())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -88,7 +84,7 @@ public class SigilBloodLight extends EnergyItems implements IHolding, ArmourUpgr
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
|||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.ChatComponentText;
|
import net.minecraft.util.ChatComponentText;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
@@ -45,19 +44,14 @@ public class SigilDivination extends Item implements ArmourUpgrade, IReagentMani
|
|||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.divinationsigil.desc1"));
|
par3List.add(StatCollector.translateToLocal("tooltip.divinationsigil.desc1"));
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.divinationsigil.desc2"));
|
par3List.add(StatCollector.translateToLocal("tooltip.divinationsigil.desc2"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||||
|
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.worldObj.isRemote) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.worldObj.isRemote) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,13 +59,7 @@ public class SigilDivination extends Item implements ArmourUpgrade, IReagentMani
|
|||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
String ownerName = IBindable.getOwnerName(par1ItemStack);
|
||||||
|
|
||||||
if (itemTag == null || itemTag.getString("ownerName").equals("")) {
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
String ownerName = itemTag.getString("ownerName");
|
|
||||||
|
|
||||||
MovingObjectPosition movingobjectposition = this
|
MovingObjectPosition movingobjectposition = this
|
||||||
.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, false);
|
.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, false);
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import net.minecraft.world.World;
|
|||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
import WayofTime.alchemicalWizardry.api.harvest.HarvestRegistry;
|
import WayofTime.alchemicalWizardry.api.harvest.HarvestRegistry;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
@@ -38,18 +39,7 @@ public class SigilHarvest extends EnergyItems implements IHolding, ArmourUpgrade
|
|||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.harvestsigil.desc"));
|
par3List.add(StatCollector.translateToLocal("tooltip.harvestsigil.desc"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
|
||||||
if (par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
|
||||||
} else {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated"));
|
|
||||||
}
|
|
||||||
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -62,13 +52,7 @@ public class SigilHarvest extends EnergyItems implements IHolding, ArmourUpgrade
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
||||||
if (stack.getTagCompound() == null) {
|
if (IBindable.isActive(stack)) {
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound tag = stack.getTagCompound();
|
|
||||||
|
|
||||||
if (tag.getBoolean("isActive")) {
|
|
||||||
return this.activeIcon;
|
return this.activeIcon;
|
||||||
} else {
|
} else {
|
||||||
return this.passiveIcon;
|
return this.passiveIcon;
|
||||||
@@ -87,29 +71,11 @@ public class SigilHarvest extends EnergyItems implements IHolding, ArmourUpgrade
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par1ItemStack.getTagCompound() == null) {
|
toggleSigil(par1ItemStack, par2World, par3EntityPlayer);
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound tag = par1ItemStack.getTagCompound();
|
|
||||||
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
|
|
||||||
|
|
||||||
if (tag.getBoolean("isActive")) {
|
|
||||||
par1ItemStack.setItemDamage(1);
|
|
||||||
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
|
|
||||||
|
|
||||||
if (!par3EntityPlayer.capabilities.isCreativeMode) {
|
|
||||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) {
|
|
||||||
tag.setBoolean("isActive", false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
|
|
||||||
}
|
|
||||||
|
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
@@ -126,7 +92,7 @@ public class SigilHarvest extends EnergyItems implements IHolding, ArmourUpgrade
|
|||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
if (IBindable.isActive(par1ItemStack)) {
|
||||||
int range = 3;
|
int range = 3;
|
||||||
int verticalRange = 1;
|
int verticalRange = 1;
|
||||||
int posX = (int) Math.round(par3Entity.posX - 0.5f);
|
int posX = (int) Math.round(par3Entity.posX - 0.5f);
|
||||||
@@ -141,14 +107,8 @@ public class SigilHarvest extends EnergyItems implements IHolding, ArmourUpgrade
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay")
|
|
||||||
&& par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
checkPassiveDrain(par1ItemStack, par2World, par3EntityPlayer);
|
||||||
if (!par3EntityPlayer.capabilities.isCreativeMode) {
|
|
||||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) {
|
|
||||||
par1ItemStack.getTagCompound().setBoolean("isActive", false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import net.minecraftforge.fluids.IFluidHandler;
|
|||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyBattery;
|
import WayofTime.alchemicalWizardry.common.items.EnergyBattery;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
@@ -62,12 +63,7 @@ public class SigilLava extends ItemBucket implements ArmourUpgrade, ISigil {
|
|||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.lavasigil.desc1"));
|
par3List.add(StatCollector.translateToLocal("tooltip.lavasigil.desc1"));
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.lavasigil.desc2"));
|
par3List.add(StatCollector.translateToLocal("tooltip.lavasigil.desc2"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -80,7 +76,7 @@ public class SigilLava extends ItemBucket implements ArmourUpgrade, ISigil {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||||
float hitX, float hitY, float hitZ) {
|
float hitX, float hitY, float hitZ) {
|
||||||
if (world.isRemote || !EnergyItems.checkAndSetItemOwner(stack, player) || player.isSneaking()) {
|
if (world.isRemote || !IBindable.checkAndSetItemOwner(stack, player) || player.isSneaking()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+7
-42
@@ -14,6 +14,7 @@ import net.minecraft.util.StatCollector;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
@@ -38,18 +39,7 @@ public class SigilOfElementalAffinity extends EnergyItems implements ISigil {
|
|||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigilofelementalaffinity.desc1"));
|
par3List.add(StatCollector.translateToLocal("tooltip.sigilofelementalaffinity.desc1"));
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigilofelementalaffinity.desc2"));
|
par3List.add(StatCollector.translateToLocal("tooltip.sigilofelementalaffinity.desc2"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
|
||||||
if (par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
|
||||||
} else {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated"));
|
|
||||||
}
|
|
||||||
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -62,13 +52,7 @@ public class SigilOfElementalAffinity extends EnergyItems implements ISigil {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
||||||
if (stack.getTagCompound() == null) {
|
if (IBindable.isActive(stack)) {
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound tag = stack.getTagCompound();
|
|
||||||
|
|
||||||
if (tag.getBoolean("isActive")) {
|
|
||||||
return this.activeIcon;
|
return this.activeIcon;
|
||||||
} else {
|
} else {
|
||||||
return this.passiveIcon;
|
return this.passiveIcon;
|
||||||
@@ -87,25 +71,13 @@ public class SigilOfElementalAffinity extends EnergyItems implements ISigil {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par1ItemStack.getTagCompound() == null) {
|
if (toggleSigil(par1ItemStack, par2World, par3EntityPlayer)) {
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound tag = par1ItemStack.getTagCompound();
|
|
||||||
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
|
|
||||||
|
|
||||||
if (tag.getBoolean("isActive")
|
|
||||||
&& EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) {
|
|
||||||
par1ItemStack.setItemDamage(1);
|
|
||||||
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
|
|
||||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 0, true));
|
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 0, true));
|
||||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 0, true));
|
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 0, true));
|
||||||
} else {
|
|
||||||
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
@@ -123,19 +95,12 @@ public class SigilOfElementalAffinity extends EnergyItems implements ISigil {
|
|||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
if (IBindable.isActive(par1ItemStack)) {
|
||||||
par3EntityPlayer.fallDistance = 0;
|
par3EntityPlayer.fallDistance = 0;
|
||||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 0, true));
|
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 0, true));
|
||||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 0, true));
|
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 0, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay")
|
checkPassiveDrain(par1ItemStack, par2World, par3EntityPlayer);
|
||||||
&& par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
|
||||||
if (!par3EntityPlayer.capabilities.isCreativeMode) {
|
|
||||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) {
|
|
||||||
par1ItemStack.getTagCompound().setBoolean("isActive", false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+7
-49
@@ -14,6 +14,7 @@ import net.minecraft.util.StatCollector;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
@@ -39,18 +40,7 @@ public class SigilOfEnderSeverance extends EnergyItems implements IHolding, ISig
|
|||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigilofenderseverance.desc"));
|
par3List.add(StatCollector.translateToLocal("tooltip.sigilofenderseverance.desc"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
|
||||||
if (par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
|
||||||
} else {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated"));
|
|
||||||
}
|
|
||||||
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -63,13 +53,7 @@ public class SigilOfEnderSeverance extends EnergyItems implements IHolding, ISig
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
||||||
if (stack.getTagCompound() == null) {
|
if (IBindable.isActive(stack)) {
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound tag = stack.getTagCompound();
|
|
||||||
|
|
||||||
if (tag.getBoolean("isActive")) {
|
|
||||||
return this.activeIcon;
|
return this.activeIcon;
|
||||||
} else {
|
} else {
|
||||||
return this.passiveIcon;
|
return this.passiveIcon;
|
||||||
@@ -88,29 +72,11 @@ public class SigilOfEnderSeverance extends EnergyItems implements IHolding, ISig
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par1ItemStack.getTagCompound() == null) {
|
toggleSigil(par1ItemStack, par2World, par3EntityPlayer);
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound tag = par1ItemStack.getTagCompound();
|
|
||||||
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
|
|
||||||
|
|
||||||
if (tag.getBoolean("isActive")) {
|
|
||||||
par1ItemStack.setItemDamage(1);
|
|
||||||
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
|
|
||||||
|
|
||||||
if (!par3EntityPlayer.capabilities.isCreativeMode) {
|
|
||||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) {
|
|
||||||
tag.setBoolean("isActive", false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
|
|
||||||
}
|
|
||||||
|
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
@@ -127,7 +93,7 @@ public class SigilOfEnderSeverance extends EnergyItems implements IHolding, ISig
|
|||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
if (IBindable.isActive(par1ItemStack)) {
|
||||||
List<Entity> list = SpellHelper
|
List<Entity> list = SpellHelper
|
||||||
.getEntitiesInRange(par2World, par3Entity.posX, par3Entity.posY, par3Entity.posZ, 4.5, 4.5);
|
.getEntitiesInRange(par2World, par3Entity.posX, par3Entity.posY, par3Entity.posZ, 4.5, 4.5);
|
||||||
for (Entity entity : list) {
|
for (Entity entity : list) {
|
||||||
@@ -137,15 +103,7 @@ public class SigilOfEnderSeverance extends EnergyItems implements IHolding, ISig
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay")
|
|
||||||
&& par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
|
||||||
if (!par3EntityPlayer.capabilities.isCreativeMode) {
|
|
||||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) {
|
|
||||||
par1ItemStack.getTagCompound().setBoolean("isActive", false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
checkPassiveDrain(par1ItemStack, par2World, par3EntityPlayer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,7 @@ import net.minecraftforge.event.entity.player.BonemealEvent;
|
|||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||||
@@ -32,8 +33,6 @@ public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade, ISigil
|
|||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
private IIcon passiveIcon;
|
private IIcon passiveIcon;
|
||||||
|
|
||||||
private int tickDelay = 100;
|
|
||||||
|
|
||||||
public SigilOfGrowth() {
|
public SigilOfGrowth() {
|
||||||
super();
|
super();
|
||||||
this.maxStackSize = 1;
|
this.maxStackSize = 1;
|
||||||
@@ -45,18 +44,7 @@ public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade, ISigil
|
|||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigilofgrowth.desc1"));
|
par3List.add(StatCollector.translateToLocal("tooltip.sigilofgrowth.desc1"));
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigilofgrowth.desc2"));
|
par3List.add(StatCollector.translateToLocal("tooltip.sigilofgrowth.desc2"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
|
||||||
if (par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
|
||||||
} else {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated"));
|
|
||||||
}
|
|
||||||
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -69,13 +57,7 @@ public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade, ISigil
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
||||||
if (stack.getTagCompound() == null) {
|
if (IBindable.isActive(stack)) {
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound tag = stack.getTagCompound();
|
|
||||||
|
|
||||||
if (tag.getBoolean("isActive")) {
|
|
||||||
return this.activeIcon;
|
return this.activeIcon;
|
||||||
} else {
|
} else {
|
||||||
return this.passiveIcon;
|
return this.passiveIcon;
|
||||||
@@ -95,7 +77,7 @@ public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade, ISigil
|
|||||||
@Override
|
@Override
|
||||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4,
|
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4,
|
||||||
int par5, int par6, int par7, float par8, float par9, float par10) {
|
int par5, int par6, int par7, float par8, float par9, float par10) {
|
||||||
if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par2EntityPlayer)) {
|
if (IBindable.checkAndSetItemOwner(par1ItemStack, par2EntityPlayer)) {
|
||||||
if (applyBonemeal(par1ItemStack, par3World, par4, par5, par6, par2EntityPlayer)) {
|
if (applyBonemeal(par1ItemStack, par3World, par4, par5, par6, par2EntityPlayer)) {
|
||||||
EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, getEnergyUsed());
|
EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, getEnergyUsed());
|
||||||
|
|
||||||
@@ -112,7 +94,7 @@ public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade, ISigil
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,20 +102,7 @@ public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade, ISigil
|
|||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par1ItemStack.getTagCompound() == null) {
|
toggleSigil(par1ItemStack, par2World, par3EntityPlayer);
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound tag = par1ItemStack.getTagCompound();
|
|
||||||
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
|
|
||||||
|
|
||||||
if (tag.getBoolean("isActive")
|
|
||||||
&& EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) {
|
|
||||||
par1ItemStack.setItemDamage(1);
|
|
||||||
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % tickDelay);
|
|
||||||
} else {
|
|
||||||
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
|
|
||||||
}
|
|
||||||
|
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
@@ -148,12 +117,9 @@ public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade, ISigil
|
|||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
if (IBindable.isActive(par1ItemStack)) {
|
||||||
if (par2World.getWorldTime() % tickDelay == par1ItemStack.getTagCompound().getInteger("worldTimeDelay")) {
|
|
||||||
if (!EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, getEnergyUsed())) {
|
checkPassiveDrain(par1ItemStack, par2World, (EntityPlayer) par3Entity);
|
||||||
par1ItemStack.getTagCompound().setBoolean("isActive", false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
int range = 3;
|
int range = 3;
|
||||||
int verticalRange = 2;
|
int verticalRange = 2;
|
||||||
int posX = (int) Math.round(par3Entity.posX - 0.5f);
|
int posX = (int) Math.round(par3Entity.posX - 0.5f);
|
||||||
@@ -206,6 +172,11 @@ public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade, ISigil
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int drainTicks() {
|
||||||
|
return 100;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) {
|
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) {
|
||||||
if (world.isRemote) {
|
if (world.isRemote) {
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import net.minecraft.world.World;
|
|||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
@@ -37,18 +38,7 @@ public class SigilOfHaste extends EnergyItems implements ArmourUpgrade, ISigil {
|
|||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigilofhaste.desc"));
|
par3List.add(StatCollector.translateToLocal("tooltip.sigilofhaste.desc"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
|
||||||
if (par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
|
||||||
} else {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated"));
|
|
||||||
}
|
|
||||||
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -61,13 +51,7 @@ public class SigilOfHaste extends EnergyItems implements ArmourUpgrade, ISigil {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
||||||
if (stack.getTagCompound() == null) {
|
if (IBindable.isActive(stack)) {
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound tag = stack.getTagCompound();
|
|
||||||
|
|
||||||
if (tag.getBoolean("isActive")) {
|
|
||||||
return this.activeIcon;
|
return this.activeIcon;
|
||||||
} else {
|
} else {
|
||||||
return this.passiveIcon;
|
return this.passiveIcon;
|
||||||
@@ -86,24 +70,12 @@ public class SigilOfHaste extends EnergyItems implements ArmourUpgrade, ISigil {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par1ItemStack.getTagCompound() == null) {
|
if (toggleSigil(par1ItemStack, par2World, par3EntityPlayer)) {
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound tag = par1ItemStack.getTagCompound();
|
|
||||||
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
|
|
||||||
|
|
||||||
if (tag.getBoolean("isActive")
|
|
||||||
&& EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) {
|
|
||||||
par1ItemStack.setItemDamage(1);
|
|
||||||
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
|
|
||||||
par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionBoost.id, 3, 1));
|
par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionBoost.id, 3, 1));
|
||||||
} else {
|
|
||||||
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
@@ -121,18 +93,11 @@ public class SigilOfHaste extends EnergyItems implements ArmourUpgrade, ISigil {
|
|||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
if (IBindable.isActive(par1ItemStack)) {
|
||||||
par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionBoost.id, 3, 1));
|
par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionBoost.id, 3, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay")
|
checkPassiveDrain(par1ItemStack, par2World, par3EntityPlayer);
|
||||||
&& par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
|
||||||
if (!par3EntityPlayer.capabilities.isCreativeMode) {
|
|
||||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) {
|
|
||||||
par1ItemStack.getTagCompound().setBoolean("isActive", false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+13
-42
@@ -16,6 +16,7 @@ import net.minecraft.world.World;
|
|||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
@@ -30,8 +31,6 @@ public class SigilOfMagnetism extends EnergyItems implements ArmourUpgrade, IHol
|
|||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
private IIcon passiveIcon;
|
private IIcon passiveIcon;
|
||||||
|
|
||||||
private int tickDelay = 300;
|
|
||||||
|
|
||||||
public SigilOfMagnetism() {
|
public SigilOfMagnetism() {
|
||||||
super();
|
super();
|
||||||
this.maxStackSize = 1;
|
this.maxStackSize = 1;
|
||||||
@@ -42,18 +41,7 @@ public class SigilOfMagnetism extends EnergyItems implements ArmourUpgrade, IHol
|
|||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigilofmagnetism.desc"));
|
par3List.add(StatCollector.translateToLocal("tooltip.sigilofmagnetism.desc"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
|
||||||
if (par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
|
||||||
} else {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated"));
|
|
||||||
}
|
|
||||||
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -66,13 +54,7 @@ public class SigilOfMagnetism extends EnergyItems implements ArmourUpgrade, IHol
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
||||||
if (stack.getTagCompound() == null) {
|
if (IBindable.isActive(stack)) {
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound tag = stack.getTagCompound();
|
|
||||||
|
|
||||||
if (tag.getBoolean("isActive")) {
|
|
||||||
return this.activeIcon;
|
return this.activeIcon;
|
||||||
} else {
|
} else {
|
||||||
return this.passiveIcon;
|
return this.passiveIcon;
|
||||||
@@ -91,24 +73,11 @@ public class SigilOfMagnetism extends EnergyItems implements ArmourUpgrade, IHol
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par1ItemStack.getTagCompound() == null) {
|
toggleSigil(par1ItemStack, par2World, par3EntityPlayer);
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound tag = par1ItemStack.getTagCompound();
|
|
||||||
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
|
|
||||||
|
|
||||||
if (tag.getBoolean("isActive")
|
|
||||||
&& EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) {
|
|
||||||
par1ItemStack.setItemDamage(1);
|
|
||||||
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % tickDelay);
|
|
||||||
} else {
|
|
||||||
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
|
|
||||||
}
|
|
||||||
|
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
@@ -125,12 +94,9 @@ public class SigilOfMagnetism extends EnergyItems implements ArmourUpgrade, IHol
|
|||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
if (IBindable.isActive(par1ItemStack)) {
|
||||||
if (par2World.getWorldTime() % tickDelay == par1ItemStack.getTagCompound().getInteger("worldTimeDelay")) {
|
|
||||||
if (!EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, getEnergyUsed())) {
|
checkPassiveDrain(par1ItemStack, par2World, par3EntityPlayer);
|
||||||
par1ItemStack.getTagCompound().setBoolean("isActive", false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int range = 5;
|
int range = 5;
|
||||||
int verticalRange = 5;
|
int verticalRange = 5;
|
||||||
@@ -170,6 +136,11 @@ public class SigilOfMagnetism extends EnergyItems implements ArmourUpgrade, IHol
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int drainTicks() {
|
||||||
|
return 300;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) {
|
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) {
|
||||||
int range = 5;
|
int range = 5;
|
||||||
|
|||||||
+9
-53
@@ -16,6 +16,7 @@ import net.minecraft.world.World;
|
|||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||||
@@ -44,18 +45,7 @@ public class SigilOfSupression extends EnergyItems implements ArmourUpgrade, ISi
|
|||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigilofsupression.desc"));
|
par3List.add(StatCollector.translateToLocal("tooltip.sigilofsupression.desc"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
|
||||||
if (par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
|
||||||
} else {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated"));
|
|
||||||
}
|
|
||||||
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -68,16 +58,10 @@ public class SigilOfSupression extends EnergyItems implements ArmourUpgrade, ISi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
||||||
if (stack.getTagCompound() == null) {
|
if (IBindable.isActive(stack)) {
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
return this.activeIcon;
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound tag = stack.getTagCompound();
|
|
||||||
|
|
||||||
if (tag.getBoolean("isActive")) {
|
|
||||||
return activeIcon;
|
|
||||||
} else {
|
} else {
|
||||||
return passiveIcon;
|
return this.passiveIcon;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,9 +77,7 @@ public class SigilOfSupression extends EnergyItems implements ArmourUpgrade, ISi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
int tickDelay = 200;
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer)
|
||||||
|
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer)
|
|
||||||
|| SpellHelper.isFakePlayer(par2World, par3EntityPlayer)) {
|
|| SpellHelper.isFakePlayer(par2World, par3EntityPlayer)) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
@@ -104,25 +86,7 @@ public class SigilOfSupression extends EnergyItems implements ArmourUpgrade, ISi
|
|||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par1ItemStack.getTagCompound() == null) {
|
toggleSigil(par1ItemStack, par2World, par3EntityPlayer);
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound tag = par1ItemStack.getTagCompound();
|
|
||||||
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
|
|
||||||
|
|
||||||
if (tag.getBoolean("isActive")) {
|
|
||||||
par1ItemStack.setItemDamage(1);
|
|
||||||
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % tickDelay);
|
|
||||||
|
|
||||||
if (!par3EntityPlayer.capabilities.isCreativeMode) {
|
|
||||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) {
|
|
||||||
tag.setBoolean("isActive", false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
|
|
||||||
}
|
|
||||||
|
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
@@ -143,7 +107,7 @@ public class SigilOfSupression extends EnergyItems implements ArmourUpgrade, ISi
|
|||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par1ItemStack.getTagCompound().getBoolean("isActive") && (!par2World.isRemote)) {
|
if (IBindable.isActive(par1ItemStack) && (!par2World.isRemote)) {
|
||||||
Vec3 blockVec = SpellHelper.getEntityBlockVector(par3EntityPlayer);
|
Vec3 blockVec = SpellHelper.getEntityBlockVector(par3EntityPlayer);
|
||||||
int x = (int) blockVec.xCoord;
|
int x = (int) blockVec.xCoord;
|
||||||
int y = (int) blockVec.yCoord;
|
int y = (int) blockVec.yCoord;
|
||||||
@@ -173,15 +137,7 @@ public class SigilOfSupression extends EnergyItems implements ArmourUpgrade, ISi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
checkPassiveDrain(par1ItemStack, par2World, par3EntityPlayer);
|
||||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay")
|
|
||||||
&& par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
|
||||||
if (!par3EntityPlayer.capabilities.isCreativeMode) {
|
|
||||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) {
|
|
||||||
par1ItemStack.getTagCompound().setBoolean("isActive", false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+3
-7
@@ -22,6 +22,7 @@ import net.minecraftforge.event.entity.living.EnderTeleportEvent;
|
|||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||||
@@ -62,19 +63,14 @@ public class SigilOfTheAssassin extends EnergyItems implements ArmourUpgrade, IS
|
|||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigiloftheassassin.desc"));
|
par3List.add(StatCollector.translateToLocal("tooltip.sigiloftheassassin.desc"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
|
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
|
||||||
*/
|
*/
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+7
-45
@@ -16,6 +16,7 @@ import net.minecraft.world.World;
|
|||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralBlock;
|
import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralBlock;
|
||||||
@@ -30,8 +31,6 @@ public class SigilOfTheBridge extends EnergyItems implements ArmourUpgrade, ISig
|
|||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
private IIcon passiveIcon;
|
private IIcon passiveIcon;
|
||||||
|
|
||||||
private int tickDelay = 200;
|
|
||||||
|
|
||||||
public SigilOfTheBridge() {
|
public SigilOfTheBridge() {
|
||||||
super();
|
super();
|
||||||
this.maxStackSize = 1;
|
this.maxStackSize = 1;
|
||||||
@@ -43,18 +42,7 @@ public class SigilOfTheBridge extends EnergyItems implements ArmourUpgrade, ISig
|
|||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigilofthebridge.desc1"));
|
par3List.add(StatCollector.translateToLocal("tooltip.sigilofthebridge.desc1"));
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigilofthebridge.desc2"));
|
par3List.add(StatCollector.translateToLocal("tooltip.sigilofthebridge.desc2"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
|
||||||
if (par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
|
||||||
} else {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated"));
|
|
||||||
}
|
|
||||||
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -67,13 +55,7 @@ public class SigilOfTheBridge extends EnergyItems implements ArmourUpgrade, ISig
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
||||||
if (stack.getTagCompound() == null) {
|
if (IBindable.isActive(stack)) {
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound tag = stack.getTagCompound();
|
|
||||||
|
|
||||||
if (tag.getBoolean("isActive")) {
|
|
||||||
return this.activeIcon;
|
return this.activeIcon;
|
||||||
} else {
|
} else {
|
||||||
return this.passiveIcon;
|
return this.passiveIcon;
|
||||||
@@ -92,24 +74,11 @@ public class SigilOfTheBridge extends EnergyItems implements ArmourUpgrade, ISig
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par1ItemStack.getTagCompound() == null) {
|
toggleSigil(par1ItemStack, par2World, par3EntityPlayer);
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound tag = par1ItemStack.getTagCompound();
|
|
||||||
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
|
|
||||||
|
|
||||||
if (tag.getBoolean("isActive")
|
|
||||||
&& EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) {
|
|
||||||
par1ItemStack.setItemDamage(1);
|
|
||||||
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % tickDelay);
|
|
||||||
} else {
|
|
||||||
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
|
|
||||||
}
|
|
||||||
|
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
@@ -126,15 +95,8 @@ public class SigilOfTheBridge extends EnergyItems implements ArmourUpgrade, ISig
|
|||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
if (IBindable.isActive(par1ItemStack)) {
|
||||||
if (par2World.getWorldTime() % tickDelay == par1ItemStack.getTagCompound().getInteger("worldTimeDelay")) {
|
checkPassiveDrain(par1ItemStack, par2World, par3EntityPlayer);
|
||||||
if (EnergyItems
|
|
||||||
.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, this.getLPUsed(par1ItemStack))) {
|
|
||||||
this.setLPUsed(par1ItemStack, 0);
|
|
||||||
} else {
|
|
||||||
par1ItemStack.getTagCompound().setBoolean("isActive", false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!par3EntityPlayer.onGround && !par3EntityPlayer.isSneaking()) {
|
if (!par3EntityPlayer.onGround && !par3EntityPlayer.isSneaking()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-42
@@ -15,6 +15,7 @@ import net.minecraft.world.World;
|
|||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
@@ -38,18 +39,7 @@ public class SigilOfTheFastMiner extends EnergyItems implements ArmourUpgrade, I
|
|||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigilofthefastminer.desc"));
|
par3List.add(StatCollector.translateToLocal("tooltip.sigilofthefastminer.desc"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
|
||||||
if (par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
|
||||||
} else {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated"));
|
|
||||||
}
|
|
||||||
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -62,13 +52,7 @@ public class SigilOfTheFastMiner extends EnergyItems implements ArmourUpgrade, I
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
||||||
if (stack.getTagCompound() == null) {
|
if (IBindable.isActive(stack)) {
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound tag = stack.getTagCompound();
|
|
||||||
|
|
||||||
if (tag.getBoolean("isActive")) {
|
|
||||||
return this.activeIcon;
|
return this.activeIcon;
|
||||||
} else {
|
} else {
|
||||||
return this.passiveIcon;
|
return this.passiveIcon;
|
||||||
@@ -87,24 +71,12 @@ public class SigilOfTheFastMiner extends EnergyItems implements ArmourUpgrade, I
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par1ItemStack.getTagCompound() == null) {
|
if (toggleSigil(par1ItemStack, par2World, par3EntityPlayer)) {
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound tag = par1ItemStack.getTagCompound();
|
|
||||||
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
|
|
||||||
|
|
||||||
if (tag.getBoolean("isActive")
|
|
||||||
&& EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) {
|
|
||||||
par1ItemStack.setItemDamage(1);
|
|
||||||
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
|
|
||||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 2, 1, true));
|
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 2, 1, true));
|
||||||
} else {
|
|
||||||
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
@@ -122,18 +94,11 @@ public class SigilOfTheFastMiner extends EnergyItems implements ArmourUpgrade, I
|
|||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
if (IBindable.isActive(par1ItemStack)) {
|
||||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 2, 1, true));
|
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 2, 1, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay")
|
checkPassiveDrain(par1ItemStack, par2World, par3EntityPlayer);
|
||||||
&& par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
|
||||||
if (!par3EntityPlayer.capabilities.isCreativeMode) {
|
|
||||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) {
|
|
||||||
par1ItemStack.getTagCompound().setBoolean("isActive", false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import net.minecraft.world.World;
|
|||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
@@ -37,18 +38,7 @@ public class SigilOfWind extends EnergyItems implements ArmourUpgrade, ISigil {
|
|||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigilofwind.desc"));
|
par3List.add(StatCollector.translateToLocal("tooltip.sigilofwind.desc"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
|
||||||
if (par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
|
||||||
} else {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated"));
|
|
||||||
}
|
|
||||||
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -61,13 +51,7 @@ public class SigilOfWind extends EnergyItems implements ArmourUpgrade, ISigil {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
||||||
if (stack.getTagCompound() == null) {
|
if (IBindable.isActive(stack)) {
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound tag = stack.getTagCompound();
|
|
||||||
|
|
||||||
if (tag.getBoolean("isActive")) {
|
|
||||||
return this.activeIcon;
|
return this.activeIcon;
|
||||||
} else {
|
} else {
|
||||||
return this.passiveIcon;
|
return this.passiveIcon;
|
||||||
@@ -86,24 +70,12 @@ public class SigilOfWind extends EnergyItems implements ArmourUpgrade, ISigil {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par1ItemStack.getTagCompound() == null) {
|
if (toggleSigil(par1ItemStack, par2World, par3EntityPlayer)) {
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound tag = par1ItemStack.getTagCompound();
|
|
||||||
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
|
|
||||||
|
|
||||||
if (tag.getBoolean("isActive")
|
|
||||||
&& EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) {
|
|
||||||
par1ItemStack.setItemDamage(1);
|
|
||||||
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
|
|
||||||
par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 2, 1));
|
par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 2, 1));
|
||||||
} else {
|
|
||||||
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
@@ -121,18 +93,11 @@ public class SigilOfWind extends EnergyItems implements ArmourUpgrade, ISigil {
|
|||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
if (IBindable.isActive(par1ItemStack)) {
|
||||||
par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 2, 1));
|
par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 2, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay")
|
checkPassiveDrain(par1ItemStack, par2World, par3EntityPlayer);
|
||||||
&& par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
|
||||||
if (!par3EntityPlayer.capabilities.isCreativeMode) {
|
|
||||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) {
|
|
||||||
par1ItemStack.getTagCompound().setBoolean("isActive", false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import net.minecraft.world.World;
|
|||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
import WayofTime.alchemicalWizardry.api.compress.CompressionRegistry;
|
import WayofTime.alchemicalWizardry.api.compress.CompressionRegistry;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
@@ -39,18 +40,7 @@ public class SigilPackRat extends EnergyItems implements IHolding, ArmourUpgrade
|
|||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.packratsigil.desc"));
|
par3List.add(StatCollector.translateToLocal("tooltip.packratsigil.desc"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
|
||||||
if (par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
|
||||||
} else {
|
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated"));
|
|
||||||
}
|
|
||||||
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -63,13 +53,7 @@ public class SigilPackRat extends EnergyItems implements IHolding, ArmourUpgrade
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
||||||
if (stack.getTagCompound() == null) {
|
if (IBindable.isActive(stack)) {
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound tag = stack.getTagCompound();
|
|
||||||
|
|
||||||
if (tag.getBoolean("isActive")) {
|
|
||||||
return this.activeIcon;
|
return this.activeIcon;
|
||||||
} else {
|
} else {
|
||||||
return this.passiveIcon;
|
return this.passiveIcon;
|
||||||
@@ -88,29 +72,11 @@ public class SigilPackRat extends EnergyItems implements IHolding, ArmourUpgrade
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par1ItemStack.getTagCompound() == null) {
|
toggleSigil(par1ItemStack, par2World, par3EntityPlayer);
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound tag = par1ItemStack.getTagCompound();
|
|
||||||
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
|
|
||||||
|
|
||||||
if (tag.getBoolean("isActive")) {
|
|
||||||
par1ItemStack.setItemDamage(1);
|
|
||||||
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
|
|
||||||
|
|
||||||
if (!par3EntityPlayer.capabilities.isCreativeMode) {
|
|
||||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) {
|
|
||||||
tag.setBoolean("isActive", false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
|
|
||||||
}
|
|
||||||
|
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
@@ -127,7 +93,7 @@ public class SigilPackRat extends EnergyItems implements IHolding, ArmourUpgrade
|
|||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
if (IBindable.isActive(par1ItemStack)) {
|
||||||
ItemStack stack = CompressionRegistry
|
ItemStack stack = CompressionRegistry
|
||||||
.compressInventory(par3EntityPlayer.inventory.mainInventory, par2World);
|
.compressInventory(par3EntityPlayer.inventory.mainInventory, par2World);
|
||||||
if (stack != null) {
|
if (stack != null) {
|
||||||
@@ -140,14 +106,8 @@ public class SigilPackRat extends EnergyItems implements IHolding, ArmourUpgrade
|
|||||||
par2World.spawnEntityInWorld(entityItem);
|
par2World.spawnEntityInWorld(entityItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay")
|
|
||||||
&& par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
checkPassiveDrain(par1ItemStack, par2World, par3EntityPlayer);
|
||||||
if (!par3EntityPlayer.capabilities.isCreativeMode) {
|
|
||||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) {
|
|
||||||
par1ItemStack.getTagCompound().setBoolean("isActive", false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ import net.minecraft.world.World;
|
|||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
@@ -35,17 +35,12 @@ public class SigilSeer extends Item implements IHolding, ArmourUpgrade, ISigil {
|
|||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.seersigil.desc"));
|
par3List.add(StatCollector.translateToLocal("tooltip.seersigil.desc"));
|
||||||
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.worldObj.isRemote) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.worldObj.isRemote) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import net.minecraftforge.fluids.IFluidHandler;
|
|||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||||
@@ -43,12 +44,7 @@ public class SigilVoid extends ItemBucket implements ArmourUpgrade, ISigil {
|
|||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.voidsigil.desc"));
|
par3List.add(StatCollector.translateToLocal("tooltip.voidsigil.desc"));
|
||||||
|
addBindingInformation(stack, par3List);
|
||||||
if (!(stack.getTagCompound() == null)) {
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ stack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -74,7 +70,7 @@ public class SigilVoid extends ItemBucket implements ArmourUpgrade, ISigil {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||||
float hitX, float hitY, float hitZ) {
|
float hitX, float hitY, float hitZ) {
|
||||||
if (world.isRemote || !EnergyItems.checkAndSetItemOwner(stack, player) || player.isSneaking()) {
|
if (world.isRemote || !IBindable.checkAndSetItemOwner(stack, player) || player.isSneaking()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import net.minecraftforge.fluids.IFluidHandler;
|
|||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESocket;
|
import WayofTime.alchemicalWizardry.common.tileEntity.TESocket;
|
||||||
@@ -60,12 +61,7 @@ public class SigilWater extends ItemBucket implements ArmourUpgrade, ISigil {
|
|||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.watersigil.desc"));
|
par3List.add(StatCollector.translateToLocal("tooltip.watersigil.desc"));
|
||||||
|
addBindingInformation(stack, par3List);
|
||||||
if (!(stack.getTagCompound() == null)) {
|
|
||||||
par3List.add(
|
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ stack.getTagCompound().getString("ownerName"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -78,7 +74,7 @@ public class SigilWater extends ItemBucket implements ArmourUpgrade, ISigil {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||||
float hitX, float hitY, float hitZ) {
|
float hitX, float hitY, float hitZ) {
|
||||||
if (world.isRemote || !EnergyItems.checkAndSetItemOwner(stack, player) || player.isSneaking()) {
|
if (world.isRemote || !IBindable.checkAndSetItemOwner(stack, player) || player.isSneaking()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -153,7 +153,7 @@ public class InventoryHolding implements IInventory {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isItemValidForSlot(int slotIndex, ItemStack itemStack) {
|
public boolean isItemValidForSlot(int slotIndex, ItemStack itemStack) {
|
||||||
return itemStack.getItem() instanceof ISigil;
|
return itemStack.getItem() instanceof ISigil && ((ISigil) itemStack.getItem()).canBeStored();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void readFromNBT(NBTTagCompound nbtTagCompound) {
|
public void readFromNBT(NBTTagCompound nbtTagCompound) {
|
||||||
|
|||||||
+13
-7
@@ -14,11 +14,13 @@ import net.minecraft.util.StatCollector;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class SigilOfHolding extends EnergyItems {
|
public class SigilOfHolding extends EnergyItems implements ISigil {
|
||||||
|
|
||||||
private static int invSize = 5;
|
private static int invSize = 5;
|
||||||
|
|
||||||
@@ -60,9 +62,8 @@ public class SigilOfHolding extends EnergyItems {
|
|||||||
par3List.add(StatCollector.translateToLocal("tooltip.sigilofholding.desc"));
|
par3List.add(StatCollector.translateToLocal("tooltip.sigilofholding.desc"));
|
||||||
|
|
||||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
if (!(par1ItemStack.getTagCompound() == null)) {
|
||||||
par3List.add(
|
addBindingInformation(par1ItemStack, par3List);
|
||||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
|
||||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
|
||||||
ItemStack[] inv = getInternalInventory(par1ItemStack);
|
ItemStack[] inv = getInternalInventory(par1ItemStack);
|
||||||
|
|
||||||
if (inv == null) {
|
if (inv == null) {
|
||||||
@@ -91,7 +92,7 @@ public class SigilOfHolding extends EnergyItems {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4,
|
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4,
|
||||||
int par5, int par6, int par7, float par8, float par9, float par10) {
|
int par5, int par6, int par7, float par8, float par9, float par10) {
|
||||||
if (checkAndSetItemOwner(par1ItemStack, par2EntityPlayer)) {
|
if (IBindable.checkAndSetItemOwner(par1ItemStack, par2EntityPlayer)) {
|
||||||
int currentSlot = getCurrentItem(par1ItemStack);
|
int currentSlot = getCurrentItem(par1ItemStack);
|
||||||
ItemStack[] inv = getInternalInventory(par1ItemStack);
|
ItemStack[] inv = getInternalInventory(par1ItemStack);
|
||||||
|
|
||||||
@@ -118,7 +119,7 @@ public class SigilOfHolding extends EnergyItems {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (checkAndSetItemOwner(par1ItemStack, par3EntityPlayer)) {
|
if (IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer)) {
|
||||||
if (par3EntityPlayer.isSneaking()) {
|
if (par3EntityPlayer.isSneaking()) {
|
||||||
InventoryHolding.setUUID(par1ItemStack);
|
InventoryHolding.setUUID(par1ItemStack);
|
||||||
par3EntityPlayer.openGui(
|
par3EntityPlayer.openGui(
|
||||||
@@ -153,7 +154,7 @@ public class SigilOfHolding extends EnergyItems {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||||
float hitX, float hitY, float hitZ) {
|
float hitX, float hitY, float hitZ) {
|
||||||
if (checkAndSetItemOwner(stack, player)) {
|
if (IBindable.checkAndSetItemOwner(stack, player)) {
|
||||||
int currentSlot = getCurrentItem(stack);
|
int currentSlot = getCurrentItem(stack);
|
||||||
ItemStack[] inv = getInternalInventory(stack);
|
ItemStack[] inv = getInternalInventory(stack);
|
||||||
|
|
||||||
@@ -305,4 +306,9 @@ public class SigilOfHolding extends EnergyItems {
|
|||||||
inv[i].getItem().onUpdate(inv[i], par2World, par3Entity, par4, par5);
|
inv[i].getItem().onUpdate(inv[i], par2World, par3Entity, par4, par5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canBeStored() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+1
-2
@@ -24,7 +24,6 @@ import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
|
|||||||
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
|
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
|
||||||
import WayofTime.alchemicalWizardry.api.rituals.RitualEffect;
|
import WayofTime.alchemicalWizardry.api.rituals.RitualEffect;
|
||||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
|
||||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||||
import WayofTime.alchemicalWizardry.common.spell.simple.SpellTeleport;
|
import WayofTime.alchemicalWizardry.common.spell.simple.SpellTeleport;
|
||||||
|
|
||||||
@@ -74,7 +73,7 @@ public class RitualEffectExpulsion extends RitualEffect {
|
|||||||
for (int i = 0; i < inventoryTile.getSizeInventory(); i++) {
|
for (int i = 0; i < inventoryTile.getSizeInventory(); i++) {
|
||||||
ItemStack stack = inventoryTile.getStackInSlot(i);
|
ItemStack stack = inventoryTile.getStackInSlot(i);
|
||||||
if (stack != null && stack.getItem() instanceof IBindable
|
if (stack != null && stack.getItem() instanceof IBindable
|
||||||
&& EnergyItems.getOwnerName(stack).equals(playerString)) {
|
&& IBindable.getOwnerName(stack).equals(playerString)) {
|
||||||
test = true;
|
test = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-3
@@ -20,7 +20,6 @@ import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
|
|||||||
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
|
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
|
||||||
import WayofTime.alchemicalWizardry.api.rituals.RitualEffect;
|
import WayofTime.alchemicalWizardry.api.rituals.RitualEffect;
|
||||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
|
||||||
import WayofTime.alchemicalWizardry.common.items.armour.BoundArmour;
|
import WayofTime.alchemicalWizardry.common.items.armour.BoundArmour;
|
||||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||||
|
|
||||||
@@ -65,13 +64,13 @@ public class RitualEffectUnbinding extends RitualEffect {
|
|||||||
boolean hasSanctus = this
|
boolean hasSanctus = this
|
||||||
.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, false);
|
.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, false);
|
||||||
if (hasSanctus) {
|
if (hasSanctus) {
|
||||||
if (itemStack.getItem() instanceof IBindable && !EnergyItems.getOwnerName(itemStack).equals("")) {
|
if (itemStack.getItem() instanceof IBindable && !IBindable.getOwnerName(itemStack).equals("")) {
|
||||||
world.addWeatherEffect(new EntityLightningBolt(world, x, y + 1, z - 5));
|
world.addWeatherEffect(new EntityLightningBolt(world, x, y + 1, z - 5));
|
||||||
world.addWeatherEffect(new EntityLightningBolt(world, x, y + 1, z + 5));
|
world.addWeatherEffect(new EntityLightningBolt(world, x, y + 1, z + 5));
|
||||||
world.addWeatherEffect(new EntityLightningBolt(world, x - 5, y + 1, z));
|
world.addWeatherEffect(new EntityLightningBolt(world, x - 5, y + 1, z));
|
||||||
world.addWeatherEffect(new EntityLightningBolt(world, x + 5, y + 1, z));
|
world.addWeatherEffect(new EntityLightningBolt(world, x + 5, y + 1, z));
|
||||||
|
|
||||||
EnergyItems.setItemOwner(itemStack, "");
|
IBindable.setItemOwner(itemStack, "");
|
||||||
this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, true);
|
this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, true);
|
||||||
drain = true;
|
drain = true;
|
||||||
ritualStone.setActive(false);
|
ritualStone.setActive(false);
|
||||||
|
|||||||
+5
-4
@@ -8,6 +8,7 @@ import net.minecraft.init.Blocks;
|
|||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.common.entity.projectile.MudProjectile;
|
import WayofTime.alchemicalWizardry.common.entity.projectile.MudProjectile;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||||
@@ -24,7 +25,7 @@ public class SpellEarthBender extends HomSpell {
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World,
|
public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World,
|
||||||
EntityPlayer par3EntityPlayer) {
|
EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,7 +42,7 @@ public class SpellEarthBender extends HomSpell {
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World,
|
public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World,
|
||||||
EntityPlayer par3EntityPlayer) {
|
EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,7 +75,7 @@ public class SpellEarthBender extends HomSpell {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,7 +144,7 @@ public class SpellEarthBender extends HomSpell {
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World,
|
public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World,
|
||||||
EntityPlayer par3EntityPlayer) {
|
EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.common.entity.projectile.ExplosionProjectile;
|
import WayofTime.alchemicalWizardry.common.entity.projectile.ExplosionProjectile;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
|
|
||||||
@@ -21,7 +22,7 @@ public class SpellExplosions extends HomSpell {
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World,
|
public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World,
|
||||||
EntityPlayer par3EntityPlayer) {
|
EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,7 +43,7 @@ public class SpellExplosions extends HomSpell {
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World,
|
public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World,
|
||||||
EntityPlayer par3EntityPlayer) {
|
EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,7 +67,7 @@ public class SpellExplosions extends HomSpell {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,7 +89,7 @@ public class SpellExplosions extends HomSpell {
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World,
|
public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World,
|
||||||
EntityPlayer par3EntityPlayer) {
|
EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import net.minecraft.util.AxisAlignedBB;
|
|||||||
import net.minecraft.util.DamageSource;
|
import net.minecraft.util.DamageSource;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.common.entity.projectile.FireProjectile;
|
import WayofTime.alchemicalWizardry.common.entity.projectile.FireProjectile;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
|
|
||||||
@@ -27,7 +28,7 @@ public class SpellFireBurst extends HomSpell {
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World,
|
public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World,
|
||||||
EntityPlayer par3EntityPlayer) {
|
EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,7 +50,7 @@ public class SpellFireBurst extends HomSpell {
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World,
|
public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World,
|
||||||
EntityPlayer par3EntityPlayer) {
|
EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,7 +84,7 @@ public class SpellFireBurst extends HomSpell {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,7 +122,7 @@ public class SpellFireBurst extends HomSpell {
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World,
|
public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World,
|
||||||
EntityPlayer par3EntityPlayer) {
|
EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-3
@@ -8,6 +8,7 @@ import net.minecraft.init.Blocks;
|
|||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.common.entity.projectile.IceProjectile;
|
import WayofTime.alchemicalWizardry.common.entity.projectile.IceProjectile;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
|
|
||||||
@@ -23,7 +24,7 @@ public class SpellFrozenWater extends HomSpell {
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World,
|
public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World,
|
||||||
EntityPlayer par3EntityPlayer) {
|
EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,7 +45,7 @@ public class SpellFrozenWater extends HomSpell {
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World,
|
public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World,
|
||||||
EntityPlayer par3EntityPlayer) {
|
EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -184,7 +185,7 @@ public class SpellFrozenWater extends HomSpell {
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World,
|
public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World,
|
||||||
EntityPlayer par3EntityPlayer) {
|
EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import net.minecraft.util.AxisAlignedBB;
|
|||||||
import net.minecraft.util.DamageSource;
|
import net.minecraft.util.DamageSource;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.common.entity.projectile.HolyProjectile;
|
import WayofTime.alchemicalWizardry.common.entity.projectile.HolyProjectile;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||||
@@ -27,7 +28,7 @@ public class SpellHolyBlast extends HomSpell {
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World,
|
public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World,
|
||||||
EntityPlayer par3EntityPlayer) {
|
EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,7 +49,7 @@ public class SpellHolyBlast extends HomSpell {
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World,
|
public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World,
|
||||||
EntityPlayer par3EntityPlayer) {
|
EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,7 +116,7 @@ public class SpellHolyBlast extends HomSpell {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,7 +146,7 @@ public class SpellHolyBlast extends HomSpell {
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World,
|
public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World,
|
||||||
EntityPlayer par3EntityPlayer) {
|
EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-4
@@ -7,6 +7,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.common.entity.projectile.LightningBoltProjectile;
|
import WayofTime.alchemicalWizardry.common.entity.projectile.LightningBoltProjectile;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||||
@@ -23,7 +24,7 @@ public class SpellLightningBolt extends HomSpell {
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World,
|
public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World,
|
||||||
EntityPlayer par3EntityPlayer) {
|
EntityPlayer par3EntityPlayer) {
|
||||||
if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,7 +46,7 @@ public class SpellLightningBolt extends HomSpell {
|
|||||||
public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World,
|
public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World,
|
||||||
EntityPlayer par3EntityPlayer) {
|
EntityPlayer par3EntityPlayer) {
|
||||||
// TODO Make it work better...?
|
// TODO Make it work better...?
|
||||||
if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,7 +89,7 @@ public class SpellLightningBolt extends HomSpell {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,7 +133,7 @@ public class SpellLightningBolt extends HomSpell {
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World,
|
public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World,
|
||||||
EntityPlayer par3EntityPlayer) {
|
EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import net.minecraft.world.World;
|
|||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.event.entity.living.EnderTeleportEvent;
|
import net.minecraftforge.event.entity.living.EnderTeleportEvent;
|
||||||
|
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.common.entity.projectile.TeleportProjectile;
|
import WayofTime.alchemicalWizardry.common.entity.projectile.TeleportProjectile;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||||
@@ -31,7 +32,7 @@ public class SpellTeleport extends HomSpell {
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World,
|
public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World,
|
||||||
EntityPlayer par3EntityPlayer) {
|
EntityPlayer par3EntityPlayer) {
|
||||||
if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,7 +49,7 @@ public class SpellTeleport extends HomSpell {
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World,
|
public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World,
|
||||||
EntityPlayer par3EntityPlayer) {
|
EntityPlayer par3EntityPlayer) {
|
||||||
if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,7 +64,7 @@ public class SpellTeleport extends HomSpell {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,7 +100,7 @@ public class SpellTeleport extends HomSpell {
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World,
|
public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World,
|
||||||
EntityPlayer par3EntityPlayer) {
|
EntityPlayer par3EntityPlayer) {
|
||||||
if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-4
@@ -14,6 +14,7 @@ import net.minecraft.util.DamageSource;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.common.entity.projectile.WaterProjectile;
|
import WayofTime.alchemicalWizardry.common.entity.projectile.WaterProjectile;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||||
@@ -30,7 +31,7 @@ public class SpellWateryGrave extends HomSpell {
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World,
|
public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World,
|
||||||
EntityPlayer par3EntityPlayer) {
|
EntityPlayer par3EntityPlayer) {
|
||||||
if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,7 +48,7 @@ public class SpellWateryGrave extends HomSpell {
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World,
|
public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World,
|
||||||
EntityPlayer par3EntityPlayer) {
|
EntityPlayer par3EntityPlayer) {
|
||||||
if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,7 +80,7 @@ public class SpellWateryGrave extends HomSpell {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,7 +145,7 @@ public class SpellWateryGrave extends HomSpell {
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World,
|
public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World,
|
||||||
EntityPlayer par3EntityPlayer) {
|
EntityPlayer par3EntityPlayer) {
|
||||||
if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import net.minecraft.util.AxisAlignedBB;
|
|||||||
import net.minecraft.util.Vec3;
|
import net.minecraft.util.Vec3;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||||
import WayofTime.alchemicalWizardry.common.entity.projectile.WindGustProjectile;
|
import WayofTime.alchemicalWizardry.common.entity.projectile.WindGustProjectile;
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||||
@@ -27,7 +28,7 @@ public class SpellWindGust extends HomSpell {
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World,
|
public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World,
|
||||||
EntityPlayer par3EntityPlayer) {
|
EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,7 +49,7 @@ public class SpellWindGust extends HomSpell {
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World,
|
public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World,
|
||||||
EntityPlayer par3EntityPlayer) {
|
EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,7 +108,7 @@ public class SpellWindGust extends HomSpell {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,7 +162,7 @@ public class SpellWindGust extends HomSpell {
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World,
|
public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World,
|
||||||
EntityPlayer par3EntityPlayer) {
|
EntityPlayer par3EntityPlayer) {
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -87,13 +87,13 @@ public class Meteor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getNewRadius(int radius, List<Reagent> reagents) {
|
public static int getNewRadius(int radius, List<Reagent> reagents) {
|
||||||
radius += MeteorReagentRegistry.getLargestRadiusIncrease(reagents);
|
radius += MeteorReagentRegistry.getLargestRadiusIncrease(reagents);
|
||||||
radius += MeteorReagentRegistry.getLargestRadiusDecrease(reagents);
|
radius += MeteorReagentRegistry.getLargestRadiusDecrease(reagents);
|
||||||
return Math.max(radius, 1);
|
return Math.max(radius, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private float getNewFillerChance(float fillerChance, List<Reagent> reagents) {
|
public static float getNewFillerChance(float fillerChance, List<Reagent> reagents) {
|
||||||
// Don't add filler to meteors that have none
|
// Don't add filler to meteors that have none
|
||||||
if (fillerChance <= 0) {
|
if (fillerChance <= 0) {
|
||||||
return 0;
|
return 0;
|
||||||
@@ -120,7 +120,7 @@ public class Meteor {
|
|||||||
* @return a new filler list. The original list is entirely replaced if any of the supplied reagents have a filler
|
* @return a new filler list. The original list is entirely replaced if any of the supplied reagents have a filler
|
||||||
* config.
|
* config.
|
||||||
*/
|
*/
|
||||||
private List<MeteorComponent> getNewFillerList(List<MeteorComponent> fillerList, List<Reagent> reagents) {
|
public static List<MeteorComponent> getNewFillerList(List<MeteorComponent> fillerList, List<Reagent> reagents) {
|
||||||
List<MeteorComponent> reagentFillers = getFillerList(reagents);
|
List<MeteorComponent> reagentFillers = getFillerList(reagents);
|
||||||
reagentFillers = removeBlocksMissingRequiredReagents(reagentFillers, reagents);
|
reagentFillers = removeBlocksMissingRequiredReagents(reagentFillers, reagents);
|
||||||
if (!reagentFillers.isEmpty() && reagentFillers.get(0) != defaultMeteorBlock) {
|
if (!reagentFillers.isEmpty() && reagentFillers.get(0) != defaultMeteorBlock) {
|
||||||
@@ -129,7 +129,7 @@ public class Meteor {
|
|||||||
return removeBlocksMissingRequiredReagents(fillerList, reagents);
|
return removeBlocksMissingRequiredReagents(fillerList, reagents);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<MeteorComponent> removeBlocksMissingRequiredReagents(List<MeteorComponent> blockList,
|
public static List<MeteorComponent> removeBlocksMissingRequiredReagents(List<MeteorComponent> blockList,
|
||||||
List<Reagent> reagents) {
|
List<Reagent> reagents) {
|
||||||
ArrayList<MeteorComponent> newList = new ArrayList<>();
|
ArrayList<MeteorComponent> newList = new ArrayList<>();
|
||||||
for (MeteorComponent component : blockList) {
|
for (MeteorComponent component : blockList) {
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -275,12 +275,24 @@ text.recipe.altar.tier=Tier: %s
|
|||||||
text.recipe.altar.bloodRequired=LP: %s
|
text.recipe.altar.bloodRequired=LP: %s
|
||||||
text.recipe.shapedOrb=Shaped Orb Recipe
|
text.recipe.shapedOrb=Shaped Orb Recipe
|
||||||
nei.recipe.meteor.category=Meteor Ritual
|
nei.recipe.meteor.category=Meteor Ritual
|
||||||
nei.recipe.meteor.cost=Cost: %s LP
|
nei.recipe.meteor.cost=LP cost to summon this meteor
|
||||||
|
nei.recipe.meteor.tooExpensive=Insufficient LP in Soul Network
|
||||||
nei.recipe.meteor.radius=Radius: %s
|
nei.recipe.meteor.radius=Radius: %s
|
||||||
|
nei.recipe.meteor.diameter=Diameter: %d (2r + 1)
|
||||||
nei.recipe.meteor.chance=Chance: %s%%
|
nei.recipe.meteor.chance=Chance: %s%%
|
||||||
nei.recipe.meteor.amount=Estimated amount: %s
|
nei.recipe.meteor.amount=Estimated amount: %s
|
||||||
nei.recipe.meteor.filler=§7Filler block
|
nei.recipe.meteor.filler=§7Filler block
|
||||||
nei.recipe.meteor.reagent=§nRequired reagent§r: %s
|
nei.recipe.meteor.reagent=§nRequired reagent§r: %s
|
||||||
|
nei.recipe.ritual.name=Ritual Name: %s
|
||||||
|
nei.recipe.ritual.cost=Activation Cost: %,d
|
||||||
|
nei.recipe.reagent.text=Reagent Effects:
|
||||||
|
nei.recipe.reagent.meteor.radius= %+d radius (%s)
|
||||||
|
nei.recipe.reagent.meteor.filler.chance= Changes chance for filler block to %f%%
|
||||||
|
nei.recipe.reagent.meteor.filler.blocks= Replaces filler with %s
|
||||||
|
nei.recipe.reagent.meteor.explosions= Entirely disables meteor explosions
|
||||||
|
nei.recipe.reagent.meteor.blockDamage.on= Enables meteor block damage
|
||||||
|
nei.recipe.reagent.meteor.blockDamage.off= Disables meteor block damage
|
||||||
|
nei.recipe.reagent.none=No reagents can be added to this ritual.
|
||||||
|
|
||||||
#Rituals
|
#Rituals
|
||||||
ritual.AW001Water.name=Ritual of the Full Spring
|
ritual.AW001Water.name=Ritual of the Full Spring
|
||||||
|
|||||||
Reference in new issue
Block a user