Hope this works

This commit is contained in:
Arcaratus 2015-07-29 09:27:45 -04:00
commit 45e8c57ac9
45 changed files with 1135 additions and 1113 deletions

View file

@ -9,6 +9,8 @@ import java.util.Map.Entry;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLivingBase;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.relauncher.Side;
import WayofTime.alchemicalWizardry.api.rituals.Rituals;
import WayofTime.alchemicalWizardry.client.renderer.ColourThreshold;
import WayofTime.alchemicalWizardry.client.renderer.RenderHelper;
@ -16,8 +18,6 @@ import WayofTime.alchemicalWizardry.common.demonVillage.DemonVillagePath;
import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal;
import WayofTime.alchemicalWizardry.common.items.armour.BoundArmour;
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorParadigm;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
/**
* Created with IntelliJ IDEA.

View file

@ -1,11 +1,53 @@
package WayofTime.alchemicalWizardry;
import WayofTime.alchemicalWizardry.common.items.*;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraftforge.fml.common.registry.GameRegistry;
import WayofTime.alchemicalWizardry.api.items.ItemSpellMultiTool;
import WayofTime.alchemicalWizardry.api.spell.SpellParadigmTool;
import WayofTime.alchemicalWizardry.common.items.AWBaseItems;
import WayofTime.alchemicalWizardry.common.items.ActivationCrystal;
import WayofTime.alchemicalWizardry.common.items.AirScribeTool;
import WayofTime.alchemicalWizardry.common.items.ApprenticeBloodOrb;
import WayofTime.alchemicalWizardry.common.items.ArchmageBloodOrb;
import WayofTime.alchemicalWizardry.common.items.ArmourInhibitor;
import WayofTime.alchemicalWizardry.common.items.BlankSpell;
import WayofTime.alchemicalWizardry.common.items.BloodShard;
import WayofTime.alchemicalWizardry.common.items.BoundAxe;
import WayofTime.alchemicalWizardry.common.items.BoundPickaxe;
import WayofTime.alchemicalWizardry.common.items.BoundShovel;
import WayofTime.alchemicalWizardry.common.items.CheatyItem;
import WayofTime.alchemicalWizardry.common.items.CreativeDagger;
import WayofTime.alchemicalWizardry.common.items.DaggerOfSacrifice;
import WayofTime.alchemicalWizardry.common.items.DawnScribeTool;
import WayofTime.alchemicalWizardry.common.items.DemonPlacer;
import WayofTime.alchemicalWizardry.common.items.DemonicTelepositionFocus;
import WayofTime.alchemicalWizardry.common.items.DuskScribeTool;
import WayofTime.alchemicalWizardry.common.items.EarthScribeTool;
import WayofTime.alchemicalWizardry.common.items.EnergyBattery;
import WayofTime.alchemicalWizardry.common.items.EnergyBazooka;
import WayofTime.alchemicalWizardry.common.items.EnergyBlast;
import WayofTime.alchemicalWizardry.common.items.EnergySword;
import WayofTime.alchemicalWizardry.common.items.EnhancedTelepositionFocus;
import WayofTime.alchemicalWizardry.common.items.FireScribeTool;
import WayofTime.alchemicalWizardry.common.items.ItemAlchemyBase;
import WayofTime.alchemicalWizardry.common.items.ItemBloodLetterPack;
import WayofTime.alchemicalWizardry.common.items.ItemComplexSpellCrystal;
import WayofTime.alchemicalWizardry.common.items.ItemComponents;
import WayofTime.alchemicalWizardry.common.items.ItemDiabloKey;
import WayofTime.alchemicalWizardry.common.items.ItemIncense;
import WayofTime.alchemicalWizardry.common.items.ItemRitualDismantler;
import WayofTime.alchemicalWizardry.common.items.ItemRitualDiviner;
import WayofTime.alchemicalWizardry.common.items.LavaCrystal;
import WayofTime.alchemicalWizardry.common.items.LifeBucket;
import WayofTime.alchemicalWizardry.common.items.MagicianBloodOrb;
import WayofTime.alchemicalWizardry.common.items.MasterBloodOrb;
import WayofTime.alchemicalWizardry.common.items.ReinforcedTelepositionFocus;
import WayofTime.alchemicalWizardry.common.items.SacrificialDagger;
import WayofTime.alchemicalWizardry.common.items.TelepositionFocus;
import WayofTime.alchemicalWizardry.common.items.TranscendentBloodOrb;
import WayofTime.alchemicalWizardry.common.items.WaterScribeTool;
import WayofTime.alchemicalWizardry.common.items.armour.BoundArmour;
import WayofTime.alchemicalWizardry.common.items.armour.OmegaArmourEarth;
import WayofTime.alchemicalWizardry.common.items.armour.OmegaArmourFire;
@ -51,7 +93,6 @@ import WayofTime.alchemicalWizardry.common.items.sigil.SigilSeer;
import WayofTime.alchemicalWizardry.common.items.sigil.SigilVoid;
import WayofTime.alchemicalWizardry.common.items.sigil.SigilWater;
import WayofTime.alchemicalWizardry.common.items.sigil.holding.SigilOfHolding;
import cpw.mods.fml.common.registry.GameRegistry;
/**
* Created with IntelliJ IDEA.

View file

@ -1,13 +1,13 @@
package WayofTime.alchemicalWizardry.api;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraft.util.EnumFacing;
public class RoutingFocusPosAndFacing
{
public Int3 location;
public ForgeDirection facing;
public EnumFacing facing;
public RoutingFocusPosAndFacing(Int3 location, ForgeDirection facing)
public RoutingFocusPosAndFacing(Int3 location, EnumFacing facing)
{
this.location = location;
this.facing = facing;

View file

@ -2,7 +2,7 @@ package WayofTime.alchemicalWizardry.api.event;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.eventhandler.Cancelable;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
@Cancelable
public class ItemDrainNetworkEvent extends PlayerDrainNetworkEvent

View file

@ -2,7 +2,7 @@ package WayofTime.alchemicalWizardry.api.event;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.eventhandler.Cancelable;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
@Cancelable
public class PlayerAddToNetworkEvent extends AddToNetworkEvent

View file

@ -1,7 +1,7 @@
package WayofTime.alchemicalWizardry.api.event;
import net.minecraft.entity.player.EntityPlayer;
import cpw.mods.fml.common.eventhandler.Cancelable;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
@Cancelable
public class PlayerDrainNetworkEvent extends SoulNetworkEvent

View file

@ -1,8 +1,8 @@
package WayofTime.alchemicalWizardry.api.event;
import net.minecraft.entity.player.EntityPlayer;
import cpw.mods.fml.common.eventhandler.Cancelable;
import cpw.mods.fml.common.eventhandler.Event;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
import net.minecraftforge.fml.common.eventhandler.Event;
@Cancelable
public class SacrificeKnifeUsedEvent extends Event

View file

@ -9,7 +9,6 @@ import java.util.Set;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
@ -25,7 +24,6 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.util.Constants;
import net.minecraftforge.common.util.ForgeDirection;
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.api.spell.APISpellHelper;
import WayofTime.alchemicalWizardry.api.spell.SpellEffect;

View file

@ -19,10 +19,10 @@ import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.GameRegistry;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
public class APISpellHelper
{

View file

@ -22,8 +22,8 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.util.Constants;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class EntitySpellProjectile extends Entity implements IProjectile
{

View file

@ -1,10 +1,13 @@
package WayofTime.alchemicalWizardry.client;
import WayofTime.alchemicalWizardry.common.thread.GAPIChecker;
import net.minecraft.item.ItemBlock;
import net.minecraft.world.World;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.client.FMLClientHandler;
import net.minecraftforge.fml.client.registry.ClientRegistry;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.common.FMLCommonHandler;
import WayofTime.alchemicalWizardry.ModBlocks;
import WayofTime.alchemicalWizardry.api.spell.EntitySpellProjectile;
import WayofTime.alchemicalWizardry.client.renderer.RitualDivinerRender;
@ -85,6 +88,7 @@ import WayofTime.alchemicalWizardry.common.renderer.model.ModelWingedFireDemon;
import WayofTime.alchemicalWizardry.common.renderer.projectile.RenderEnergyBazookaMainProjectile;
import WayofTime.alchemicalWizardry.common.renderer.projectile.RenderEnergyBlastProjectile;
import WayofTime.alchemicalWizardry.common.renderer.projectile.RenderMeteor;
import WayofTime.alchemicalWizardry.common.thread.GAPIChecker;
import WayofTime.alchemicalWizardry.common.tileEntity.TEAlchemicCalcinator;
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
import WayofTime.alchemicalWizardry.common.tileEntity.TEBellJar;
@ -98,10 +102,6 @@ import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEnhancementBlock;
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellModifierBlock;
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock;
import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.FMLCommonHandler;
public class ClientProxy extends CommonProxy
{

View file

@ -1,10 +1,10 @@
package WayofTime.alchemicalWizardry.client.gui;
import cpw.mods.fml.client.IModGuiFactory;
import java.util.Set;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import java.util.Set;
import net.minecraftforge.fml.client.IModGuiFactory;
public class ConfigGuiFactory implements IModGuiFactory {

View file

@ -42,7 +42,6 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.oredict.OreDictionary;
import vazkii.botania.api.internal.IManaBurst;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.BloodMagicConfiguration;
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
@ -817,11 +816,11 @@ public class AlchemicalWizardryEventHooks
@Optional.Method(modid = "Botania")
private boolean isManaBurst(Entity entity)
{
if(entity instanceof IManaBurst) {
ItemStack lens = ((IManaBurst)entity).getSourceLens();
return !(lens.getItemDamage()!=8 && lens.getItemDamage()!=11);
}
else
// if(entity instanceof IManaBurst) {
// ItemStack lens = ((IManaBurst)entity).getSourceLens();
// return !(lens.getItemDamage()!=8 && lens.getItemDamage()!=11);
// }
// else
return false;
}
}

View file

@ -1,8 +1,8 @@
package WayofTime.alchemicalWizardry.common;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import cpw.mods.fml.relauncher.Side;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import net.minecraftforge.fml.relauncher.Side;
public class ClientToServerPacketHandler
{

View file

@ -1,6 +1,8 @@
package WayofTime.alchemicalWizardry.common;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.EntityRegistry;
import net.minecraftforge.fml.common.registry.GameRegistry;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.spell.EntitySpellProjectile;
import WayofTime.alchemicalWizardry.common.entity.mob.BookEntityItem;
@ -22,8 +24,6 @@ import WayofTime.alchemicalWizardry.common.entity.projectile.WaterProjectile;
import WayofTime.alchemicalWizardry.common.entity.projectile.WindGustProjectile;
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
public class CommonProxy
{

View file

@ -3,10 +3,10 @@ package WayofTime.alchemicalWizardry.common;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
import WayofTime.alchemicalWizardry.common.items.armour.OmegaArmour;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
public class MessageKeyPressed implements IMessage, IMessageHandler<MessageKeyPressed, IMessage>
{

View file

@ -1,11 +1,11 @@
package WayofTime.alchemicalWizardry.common;
import WayofTime.alchemicalWizardry.ModItems;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraftforge.event.entity.living.LivingDropsEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import WayofTime.alchemicalWizardry.ModItems;
public class ModLivingDropsEvent
{

View file

@ -19,6 +19,13 @@ import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.network.FMLEmbeddedChannel;
import net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec;
import net.minecraftforge.fml.common.network.FMLOutboundHandler;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.ColourAndCoords;
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
@ -33,13 +40,6 @@ import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit;
import WayofTime.alchemicalWizardry.common.tileEntity.TESocket;
import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer;
import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.network.FMLEmbeddedChannel;
import cpw.mods.fml.common.network.FMLIndexedMessageToMessageCodec;
import cpw.mods.fml.common.network.FMLOutboundHandler;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public enum NewPacketHandler
{

View file

@ -1,10 +1,10 @@
package WayofTime.alchemicalWizardry.common.achievements;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.Achievement;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.PlayerEvent;
public class AchievementTrigger
{

View file

@ -3,8 +3,8 @@ package WayofTime.alchemicalWizardry.common.achievements;
import net.minecraft.stats.Achievement;
import net.minecraft.util.StatCollector;
import net.minecraftforge.common.AchievementPage;
import net.minecraftforge.fml.common.FMLCommonHandler;
import WayofTime.alchemicalWizardry.ModItems;
import cpw.mods.fml.common.FMLCommonHandler;
public class ModAchievements
{

View file

@ -17,13 +17,13 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.common.registry.GameRegistry.UniqueIdentifier;
import WayofTime.alchemicalWizardry.api.Int3;
import WayofTime.alchemicalWizardry.common.demonVillage.loot.DemonVillageLootRegistry;
import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.IBlockPortalNode;
import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.ITilePortalNode;
import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier;
public class BlockSet
{

View file

@ -20,10 +20,10 @@ import net.minecraft.util.BlockPos;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.ModItems;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class EntityElemental extends EntityDemon
{

View file

@ -5,8 +5,8 @@ import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.Optional;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import cpw.mods.fml.common.Optional;
public class MailOrderEntityItem extends EntityItem
{

View file

@ -17,10 +17,10 @@ import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.IThrowableEntity;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import cpw.mods.fml.common.registry.IThrowableEntity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
//Shamelessly ripped off from x3n0ph0b3
public class EnergyBlastProjectile extends Entity implements IProjectile, IThrowableEntity

View file

@ -1,145 +1,145 @@
package WayofTime.alchemicalWizardry.common.items.forestry;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import forestry.api.apiculture.IBee;
import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing;
import forestry.api.apiculture.IHiveFrame;
public class ItemBloodFrame extends EnergyItems implements IHiveFrame
{
public ItemBloodFrame()
{
super();
this.maxStackSize = 1;
this.setMaxDamage(10);
setEnergyUsed(1000);
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
par3List.add(StatCollector.translateToLocal("tooltip.bloodframe.desc"));
if (!(par1ItemStack.getTagCompound() == null))
{
par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + par1ItemStack.getTagCompound().getString("ownerName"));
}
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodFrame");
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer))
{
if (par1ItemStack.getItemDamage() > 0)
{
if(EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
{
par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() - 1);
}
}
}
return par1ItemStack;
}
@Override public float getTerritoryModifier(IBeeGenome genome, float currentModifier)
{
// TODO Auto-generated method stub
return 1;
}
@Override public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
{
// TODO Auto-generated method stub
return 1;
}
@Override public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
{
// TODO Auto-generated method stub
return 0.0001f;
}
@Override public float getProductionModifier(IBeeGenome genome, float currentModifier)
{
// TODO Auto-generated method stub
return 0;
}
@Override public float getFloweringModifier(IBeeGenome genome, float currentModifier)
{
// TODO Auto-generated method stub
return 1;
}
@Override public float getGeneticDecay(IBeeGenome genome, float currentModifier)
{
// TODO Auto-generated method stub
return 1;
}
@Override public boolean isSealed()
{
// TODO Auto-generated method stub
return false;
}
@Override public boolean isSelfLighted()
{
// TODO Auto-generated method stub
return false;
}
@Override public boolean isSunlightSimulated()
{
// TODO Auto-generated method stub
return false;
}
@Override public boolean isHellish()
{
// TODO Auto-generated method stub
return false;
}
@Override public ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear)
{
// TODO Auto-generated method stub
if(EnergyItems.canSyphonInContainer(frame, getEnergyUsed()*wear))
{
EnergyItems.syphonWhileInContainer(frame, getEnergyUsed()*wear);
return frame;
}else
{
frame.setItemDamage(frame.getItemDamage() + wear);
if(frame.getItemDamage()>=frame.getMaxDamage())
{
return null;
}
return frame;
}
}
}
//package WayofTime.alchemicalWizardry.common.items.forestry;
//
//import java.util.List;
//
//import net.minecraft.client.renderer.texture.IIconRegister;
//import net.minecraft.entity.player.EntityPlayer;
//import net.minecraft.item.ItemStack;
//import net.minecraft.util.StatCollector;
//import net.minecraft.world.World;
//import WayofTime.alchemicalWizardry.AlchemicalWizardry;
//import WayofTime.alchemicalWizardry.common.items.EnergyItems;
//import cpw.mods.fml.relauncher.Side;
//import cpw.mods.fml.relauncher.SideOnly;
//import forestry.api.apiculture.IBee;
//import forestry.api.apiculture.IBeeGenome;
//import forestry.api.apiculture.IBeeHousing;
//import forestry.api.apiculture.IHiveFrame;
//
//public class ItemBloodFrame extends EnergyItems implements IHiveFrame
//{
// public ItemBloodFrame()
// {
// super();
// this.maxStackSize = 1;
// this.setMaxDamage(10);
// setEnergyUsed(1000);
// setCreativeTab(AlchemicalWizardry.tabBloodMagic);
// }
//
// @Override
// public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
// {
// par3List.add(StatCollector.translateToLocal("tooltip.bloodframe.desc"));
//
// if (!(par1ItemStack.getTagCompound() == null))
// {
// par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + par1ItemStack.getTagCompound().getString("ownerName"));
// }
// }
//
// @Override
// @SideOnly(Side.CLIENT)
// public void registerIcons(IIconRegister iconRegister)
// {
// this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodFrame");
// }
//
// @Override
// public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
// {
// if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer))
// {
// if (par1ItemStack.getItemDamage() > 0)
// {
// if(EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
// {
// par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() - 1);
// }
// }
// }
// return par1ItemStack;
// }
//
// @Override public float getTerritoryModifier(IBeeGenome genome, float currentModifier)
// {
// // TODO Auto-generated method stub
// return 1;
// }
//
// @Override public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
// {
// // TODO Auto-generated method stub
// return 1;
// }
//
// @Override public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
// {
// // TODO Auto-generated method stub
// return 0.0001f;
// }
//
// @Override public float getProductionModifier(IBeeGenome genome, float currentModifier)
// {
// // TODO Auto-generated method stub
// return 0;
// }
//
// @Override public float getFloweringModifier(IBeeGenome genome, float currentModifier)
// {
// // TODO Auto-generated method stub
// return 1;
// }
//
// @Override public float getGeneticDecay(IBeeGenome genome, float currentModifier)
// {
// // TODO Auto-generated method stub
// return 1;
// }
//
// @Override public boolean isSealed()
// {
// // TODO Auto-generated method stub
// return false;
// }
//
// @Override public boolean isSelfLighted()
// {
// // TODO Auto-generated method stub
// return false;
// }
//
// @Override public boolean isSunlightSimulated()
// {
// // TODO Auto-generated method stub
// return false;
// }
//
// @Override public boolean isHellish()
// {
// // TODO Auto-generated method stub
// return false;
// }
//
// @Override public ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear)
// {
// // TODO Auto-generated method stub
// if(EnergyItems.canSyphonInContainer(frame, getEnergyUsed()*wear))
// {
// EnergyItems.syphonWhileInContainer(frame, getEnergyUsed()*wear);
// return frame;
// }else
// {
// frame.setItemDamage(frame.getItemDamage() + wear);
// if(frame.getItemDamage()>=frame.getMaxDamage())
// {
// return null;
// }
// return frame;
// }
//
// }
//
//
//
//}

View file

@ -8,7 +8,7 @@ import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraft.util.EnumFacing;
import org.lwjgl.opengl.GL11;
@ -122,7 +122,7 @@ public class TEAltarRenderer extends TileEntitySpecialRenderer
return scaleFactor;
}
private void translateGhostItemByOrientation(ItemStack ghostItemStack, double x, double y, double z, ForgeDirection forgeDirection)
private void translateGhostItemByOrientation(ItemStack ghostItemStack, double x, double y, double z, EnumFacing forgeDirection)
{
if (ghostItemStack != null)
{
@ -166,11 +166,6 @@ public class TEAltarRenderer extends TileEntitySpecialRenderer
return;
}
case UNKNOWN:
{
return;
}
default:
{
return;
@ -216,11 +211,6 @@ public class TEAltarRenderer extends TileEntitySpecialRenderer
return;
}
case UNKNOWN:
{
return;
}
default:
{
return;

View file

@ -6,14 +6,12 @@ import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom;
import net.minecraftforge.fml.client.FMLClientHandler;
import org.lwjgl.opengl.GL11;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
import cpw.mods.fml.client.FMLClientHandler;
public class ModelBloodAltar extends ModelBase
{

View file

@ -9,7 +9,7 @@ package WayofTime.alchemicalWizardry.common.renderer.model;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraft.util.EnumFacing;
public class ModelConduit extends ModelBase
{
@ -147,7 +147,7 @@ public class ModelConduit extends ModelBase
setRotation(spacer8, 0F, 0F, 0F);
}
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, ForgeDirection input, ForgeDirection output)
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, EnumFacing input, EnumFacing output)
{
super.render(entity, f, f1, f2, f3, f4, f5);
setRotationAngles(f, f1, f2, f3, f4, f5, entity);

View file

@ -3,7 +3,7 @@ package WayofTime.alchemicalWizardry.common.renderer.model;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraft.util.EnumFacing;
public class ModelSpellEffectBlock extends ModelBase
{
@ -184,7 +184,7 @@ public class ModelSpellEffectBlock extends ModelBase
setRotation(outputSpacer4, 0F, 0F, 0F);
}
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, ForgeDirection input, ForgeDirection output)
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, EnumFacing input, EnumFacing output)
{
super.render(entity, f, f1, f2, f3, f4, f5);
setRotationAngles(f, f1, f2, f3, f4, f5, entity);

View file

@ -3,7 +3,7 @@ package WayofTime.alchemicalWizardry.common.renderer.model;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraft.util.EnumFacing;
public class ModelSpellEnhancementBlock extends ModelBase
@ -185,7 +185,7 @@ public class ModelSpellEnhancementBlock extends ModelBase
setRotation(outputSecond, 0F, 0F, 0F);
}
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, ForgeDirection input, ForgeDirection output)
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, EnumFacing input, EnumFacing output)
{
super.render(entity, f, f1, f2, f3, f4, f5);
setRotationAngles(f, f1, f2, f3, f4, f5, entity);

View file

@ -3,7 +3,7 @@ package WayofTime.alchemicalWizardry.common.renderer.model;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraft.util.EnumFacing;
public class ModelSpellModifierBlock extends ModelBase
{
@ -149,7 +149,7 @@ public class ModelSpellModifierBlock extends ModelBase
setRotation(output4, 0F, 0F, 0F);
}
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, ForgeDirection input, ForgeDirection output)
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, EnumFacing input, EnumFacing output)
{
super.render(entity, f, f1, f2, f3, f4, f5);
setRotationAngles(f, f1, f2, f3, f4, f5, entity);

View file

@ -10,7 +10,7 @@ package WayofTime.alchemicalWizardry.common.renderer.model;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraft.util.EnumFacing;
public class ModelSpellParadigmBlock extends ModelBase
{
@ -100,7 +100,7 @@ public class ModelSpellParadigmBlock extends ModelBase
setRotation(Shape5, 0F, 0F, 0F);
}
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, ForgeDirection input, ForgeDirection output)
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, EnumFacing input, EnumFacing output)
{
super.render(entity, f, f1, f2, f3, f4, f5);
setRotationAngles(f, f1, f2, f3, f4, f5, entity);

View file

@ -1,19 +1,19 @@
package WayofTime.alchemicalWizardry.common.rituals;
import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
import WayofTime.alchemicalWizardry.api.rituals.RitualEffect;
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
import java.util.ArrayList;
import java.util.List;
import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
import WayofTime.alchemicalWizardry.api.rituals.RitualEffect;
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
public class RitualEffectApiaryOverclock extends RitualEffect
{

View file

@ -2,8 +2,8 @@ package WayofTime.alchemicalWizardry.common.routing;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.registry.GameData;
import WayofTime.alchemicalWizardry.api.RoutingFocusLogic;
import cpw.mods.fml.common.registry.GameData;
public class RoutingFocusLogicModItems extends RoutingFocusLogic
{

View file

@ -43,6 +43,7 @@ import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.fluids.IFluidBlock;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.oredict.OreDictionary;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.alchemy.energy.IAlchemyGoggles;
@ -52,7 +53,6 @@ import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.api.spell.APISpellHelper;
import WayofTime.alchemicalWizardry.common.NewPacketHandler;
import WayofTime.alchemicalWizardry.common.items.sigil.SigilDivination;
import cpw.mods.fml.common.FMLCommonHandler;
public class SpellHelper extends APISpellHelper
{

View file

@ -19,6 +19,7 @@ import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
import net.minecraftforge.fml.relauncher.FMLInjectionData;
public class GAPIChecker
{
@ -34,7 +35,7 @@ public class GAPIChecker
public void init()
{
FMLCommonHandler.instance().bus().register(this);
File mcDir = (File)cpw.mods.fml.relauncher.FMLInjectionData.data()[6];
File mcDir = (File)FMLInjectionData.data()[6];
this.modsDir = new File(mcDir, "mods");

View file

@ -19,6 +19,8 @@ import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
import net.minecraftforge.common.util.Constants;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import WayofTime.alchemicalWizardry.api.ColourAndCoords;
import WayofTime.alchemicalWizardry.api.Int3;
import WayofTime.alchemicalWizardry.api.alchemy.energy.IReagentHandler;
@ -29,8 +31,6 @@ import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack;
import WayofTime.alchemicalWizardry.api.alchemy.energy.TileSegmentedReagentHandler;
import WayofTime.alchemicalWizardry.common.entity.projectile.EntityParticleBeam;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class TEReagentConduit extends TileSegmentedReagentHandler implements IUpdatePlayerListBox
{

View file

@ -1,131 +1,126 @@
package WayofTime.alchemicalWizardry.common.tweaker;
import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStack;
import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStacks;
import minetweaker.IUndoableAction;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IItemStack;
import net.minecraft.item.ItemStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipe;
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
/**
* MineTweaker3 Alchemy Recipe Handler by joshie *
*/
@ZenClass("mods.bloodmagic.Alchemy")
public class Alchemy
{
@ZenMethod
public static void addRecipe(IItemStack output, IItemStack[] input, int tier, int lp) {
MineTweakerAPI.apply(new Add(new AlchemyRecipe(toStack(output), (int) (((double) lp) / 100), toStacks(input), tier)));
}
private static class Add implements IUndoableAction
{
private final AlchemyRecipe recipe;
public Add(AlchemyRecipe recipe)
{
this.recipe = recipe;
}
@Override
public void apply()
{
AlchemyRecipeRegistry.recipes.add(recipe);
}
@Override
public boolean canUndo()
{
return AlchemyRecipeRegistry.recipes != null;
}
@Override
public void undo()
{
AlchemyRecipeRegistry.recipes.remove(recipe);
}
@Override
public String describe()
{
return "Adding Alchemy Recipe for " + ((AlchemyRecipe) recipe).getResult().getDisplayName();
}
@Override
public String describeUndo()
{
return "Removing Alchemy Recipe for " + ((AlchemyRecipe) recipe).getResult().getDisplayName();
}
@Override
public Object getOverrideKey()
{
return null;
}
}
@ZenMethod
public static void removeRecipe(IItemStack output) {
MineTweakerAPI.apply(new Remove(toStack(output)));
}
private static class Remove implements IUndoableAction
{
private final ItemStack output;
private AlchemyRecipe recipe;
public Remove(ItemStack output)
{
this.output = output;
}
@Override
public void apply()
{
for (AlchemyRecipe r : AlchemyRecipeRegistry.recipes)
{
if (r.getResult() != null && r.getResult().isItemEqual(output))
{
recipe = r;
break;
}
}
AlchemyRecipeRegistry.recipes.remove(recipe);
}
@Override
public boolean canUndo()
{
return AlchemyRecipeRegistry.recipes != null && recipe != null;
}
@Override
public void undo()
{
AlchemyRecipeRegistry.recipes.add(recipe);
}
@Override
public String describe()
{
return "Removing Alchemy Recipe for " + output.getDisplayName();
}
@Override
public String describeUndo()
{
return "Restoring Alchemy Recipe for " + output.getDisplayName();
}
@Override
public Object getOverrideKey()
{
return null;
}
}
}
//package WayofTime.alchemicalWizardry.common.tweaker;
//
//import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStack;
//import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStacks;
//import net.minecraft.item.ItemStack;
//import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipe;
//import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
//
///**
// * MineTweaker3 Alchemy Recipe Handler by joshie *
// */
//@ZenClass("mods.bloodmagic.Alchemy")
//public class Alchemy
//{
// @ZenMethod
// public static void addRecipe(IItemStack output, IItemStack[] input, int tier, int lp) {
// MineTweakerAPI.apply(new Add(new AlchemyRecipe(toStack(output), (int) (((double) lp) / 100), toStacks(input), tier)));
// }
//
// private static class Add implements IUndoableAction
// {
// private final AlchemyRecipe recipe;
//
// public Add(AlchemyRecipe recipe)
// {
// this.recipe = recipe;
// }
//
// @Override
// public void apply()
// {
// AlchemyRecipeRegistry.recipes.add(recipe);
// }
//
// @Override
// public boolean canUndo()
// {
// return AlchemyRecipeRegistry.recipes != null;
// }
//
// @Override
// public void undo()
// {
// AlchemyRecipeRegistry.recipes.remove(recipe);
// }
//
// @Override
// public String describe()
// {
// return "Adding Alchemy Recipe for " + ((AlchemyRecipe) recipe).getResult().getDisplayName();
// }
//
// @Override
// public String describeUndo()
// {
// return "Removing Alchemy Recipe for " + ((AlchemyRecipe) recipe).getResult().getDisplayName();
// }
//
// @Override
// public Object getOverrideKey()
// {
// return null;
// }
// }
//
// @ZenMethod
// public static void removeRecipe(IItemStack output) {
// MineTweakerAPI.apply(new Remove(toStack(output)));
// }
//
// private static class Remove implements IUndoableAction
// {
// private final ItemStack output;
// private AlchemyRecipe recipe;
//
// public Remove(ItemStack output)
// {
// this.output = output;
// }
//
// @Override
// public void apply()
// {
// for (AlchemyRecipe r : AlchemyRecipeRegistry.recipes)
// {
// if (r.getResult() != null && r.getResult().isItemEqual(output))
// {
// recipe = r;
// break;
// }
// }
//
// AlchemyRecipeRegistry.recipes.remove(recipe);
// }
//
// @Override
// public boolean canUndo()
// {
// return AlchemyRecipeRegistry.recipes != null && recipe != null;
// }
//
// @Override
// public void undo()
// {
// AlchemyRecipeRegistry.recipes.add(recipe);
// }
//
// @Override
// public String describe()
// {
// return "Removing Alchemy Recipe for " + output.getDisplayName();
// }
//
// @Override
// public String describeUndo()
// {
// return "Restoring Alchemy Recipe for " + output.getDisplayName();
// }
//
// @Override
// public Object getOverrideKey()
// {
// return null;
// }
// }
//}

View file

@ -1,130 +1,130 @@
package WayofTime.alchemicalWizardry.common.tweaker;
import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStack;
import minetweaker.IUndoableAction;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IItemStack;
import net.minecraft.item.ItemStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRecipe;
import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRegistry;
/**
* MineTweaker3 Binding Recipe Handler by joshie *
*/
@ZenClass("mods.bloodmagic.Binding")
public class Binding
{
@ZenMethod
public static void addRecipe(IItemStack input, IItemStack output) {
MineTweakerAPI.apply(new Add(new BindingRecipe(toStack(output), toStack(input))));
}
private static class Add implements IUndoableAction
{
private final BindingRecipe recipe;
public Add(BindingRecipe recipe)
{
this.recipe = recipe;
}
@Override
public void apply()
{
BindingRegistry.bindingRecipes.add(recipe);
}
@Override
public boolean canUndo()
{
return BindingRegistry.bindingRecipes != null;
}
@Override
public void undo()
{
BindingRegistry.bindingRecipes.remove(recipe);
}
@Override
public String describe()
{
return "Adding Binding Recipe for " + ((BindingRecipe) recipe).getResult().getDisplayName();
}
@Override
public String describeUndo()
{
return "Removing Binding Recipe for " + ((BindingRecipe) recipe).getResult().getDisplayName();
}
@Override
public Object getOverrideKey()
{
return null;
}
}
@ZenMethod
public static void removeRecipe(IItemStack output) {
MineTweakerAPI.apply(new Remove(toStack(output)));
}
private static class Remove implements IUndoableAction
{
private final ItemStack output;
private BindingRecipe recipe;
public Remove(ItemStack output)
{
this.output = output;
}
@Override
public void apply()
{
for (BindingRecipe r : BindingRegistry.bindingRecipes)
{
if (r.getResult() != null && r.getResult().isItemEqual(output))
{
recipe = r;
break;
}
}
BindingRegistry.bindingRecipes.remove(recipe);
}
@Override
public boolean canUndo()
{
return BindingRegistry.bindingRecipes != null && recipe != null;
}
@Override
public void undo()
{
BindingRegistry.bindingRecipes.add(recipe);
}
@Override
public String describe()
{
return "Removing Binding Recipe for " + output.getDisplayName();
}
@Override
public String describeUndo()
{
return "Restoring Binding Recipe for " + output.getDisplayName();
}
@Override
public Object getOverrideKey()
{
return null;
}
}
}
//package WayofTime.alchemicalWizardry.common.tweaker;
//
//import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStack;
//import minetweaker.IUndoableAction;
//import minetweaker.MineTweakerAPI;
//import minetweaker.api.item.IItemStack;
//import net.minecraft.item.ItemStack;
//import stanhebben.zenscript.annotations.ZenClass;
//import stanhebben.zenscript.annotations.ZenMethod;
//import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRecipe;
//import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRegistry;
//
///**
// * MineTweaker3 Binding Recipe Handler by joshie *
// */
//@ZenClass("mods.bloodmagic.Binding")
//public class Binding
//{
// @ZenMethod
// public static void addRecipe(IItemStack input, IItemStack output) {
// MineTweakerAPI.apply(new Add(new BindingRecipe(toStack(output), toStack(input))));
// }
//
// private static class Add implements IUndoableAction
// {
// private final BindingRecipe recipe;
//
// public Add(BindingRecipe recipe)
// {
// this.recipe = recipe;
// }
//
// @Override
// public void apply()
// {
// BindingRegistry.bindingRecipes.add(recipe);
// }
//
// @Override
// public boolean canUndo()
// {
// return BindingRegistry.bindingRecipes != null;
// }
//
// @Override
// public void undo()
// {
// BindingRegistry.bindingRecipes.remove(recipe);
// }
//
// @Override
// public String describe()
// {
// return "Adding Binding Recipe for " + ((BindingRecipe) recipe).getResult().getDisplayName();
// }
//
// @Override
// public String describeUndo()
// {
// return "Removing Binding Recipe for " + ((BindingRecipe) recipe).getResult().getDisplayName();
// }
//
// @Override
// public Object getOverrideKey()
// {
// return null;
// }
// }
//
// @ZenMethod
// public static void removeRecipe(IItemStack output) {
// MineTweakerAPI.apply(new Remove(toStack(output)));
// }
//
// private static class Remove implements IUndoableAction
// {
// private final ItemStack output;
// private BindingRecipe recipe;
//
// public Remove(ItemStack output)
// {
// this.output = output;
// }
//
// @Override
// public void apply()
// {
// for (BindingRecipe r : BindingRegistry.bindingRecipes)
// {
// if (r.getResult() != null && r.getResult().isItemEqual(output))
// {
// recipe = r;
// break;
// }
// }
//
// BindingRegistry.bindingRecipes.remove(recipe);
// }
//
// @Override
// public boolean canUndo()
// {
// return BindingRegistry.bindingRecipes != null && recipe != null;
// }
//
// @Override
// public void undo()
// {
// BindingRegistry.bindingRecipes.add(recipe);
// }
//
// @Override
// public String describe()
// {
// return "Removing Binding Recipe for " + output.getDisplayName();
// }
//
// @Override
// public String describeUndo()
// {
// return "Restoring Binding Recipe for " + output.getDisplayName();
// }
//
// @Override
// public Object getOverrideKey()
// {
// return null;
// }
// }
//}

View file

@ -1,133 +1,133 @@
package WayofTime.alchemicalWizardry.common.tweaker;
import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStack;
import minetweaker.IUndoableAction;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IItemStack;
import net.minecraft.item.ItemStack;
import stanhebben.zenscript.annotations.Optional;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipe;
import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipeRegistry;
/**
* MineTweaker3 Blood Altar Recipe Handler by joshie *
*/
@ZenClass("mods.bloodmagic.Altar")
public class BloodAltar
{
@ZenMethod
public static void addRecipe(IItemStack output, IItemStack input, int tier, int lp, @Optional int consume, @Optional int drain) {
consume = consume > 0 ? consume : 20;
drain = drain > 0 ? drain : 20;
MineTweakerAPI.apply(new Add(new AltarRecipe(toStack(output), toStack(input), tier, lp, consume, drain, false)));
}
private static class Add implements IUndoableAction
{
private final AltarRecipe recipe;
public Add(AltarRecipe recipe)
{
this.recipe = recipe;
}
@Override
public void apply()
{
AltarRecipeRegistry.altarRecipes.add(recipe);
}
@Override
public boolean canUndo()
{
return AltarRecipeRegistry.altarRecipes != null;
}
@Override
public void undo()
{
AltarRecipeRegistry.altarRecipes.remove(recipe);
}
@Override
public String describe()
{
return "Adding Blood Altar Recipe for " + ((AltarRecipe) recipe).getResult().getDisplayName();
}
@Override
public String describeUndo()
{
return "Removing Blood Altar Recipe for " + ((AltarRecipe) recipe).getResult().getDisplayName();
}
@Override
public Object getOverrideKey()
{
return null;
}
}
@ZenMethod
public static void removeRecipe(IItemStack output) {
MineTweakerAPI.apply(new Remove(toStack(output)));
}
private static class Remove implements IUndoableAction
{
private final ItemStack output;
private AltarRecipe recipe;
public Remove(ItemStack output)
{
this.output = output;
}
@Override
public void apply()
{
for (AltarRecipe r : AltarRecipeRegistry.altarRecipes)
{
if (r.getResult() != null && r.getResult().isItemEqual(output))
{
recipe = r;
break;
}
}
AltarRecipeRegistry.altarRecipes.remove(recipe);
}
@Override
public boolean canUndo()
{
return AltarRecipeRegistry.altarRecipes != null && recipe != null;
}
@Override
public void undo()
{
AltarRecipeRegistry.altarRecipes.add(recipe);
}
@Override
public String describe()
{
return "Removing Blood Altar Recipe for " + output.getDisplayName();
}
@Override
public String describeUndo()
{
return "Restoring Blood Altar Recipe for " + output.getDisplayName();
}
@Override
public Object getOverrideKey()
{
return null;
}
}
}
//package WayofTime.alchemicalWizardry.common.tweaker;
//
//import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStack;
//import minetweaker.IUndoableAction;
//import minetweaker.MineTweakerAPI;
//import minetweaker.api.item.IItemStack;
//import net.minecraft.item.ItemStack;
//import stanhebben.zenscript.annotations.Optional;
//import stanhebben.zenscript.annotations.ZenClass;
//import stanhebben.zenscript.annotations.ZenMethod;
//import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipe;
//import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipeRegistry;
//
///**
// * MineTweaker3 Blood Altar Recipe Handler by joshie *
// */
//@ZenClass("mods.bloodmagic.Altar")
//public class BloodAltar
//{
// @ZenMethod
// public static void addRecipe(IItemStack output, IItemStack input, int tier, int lp, @Optional int consume, @Optional int drain) {
// consume = consume > 0 ? consume : 20;
// drain = drain > 0 ? drain : 20;
// MineTweakerAPI.apply(new Add(new AltarRecipe(toStack(output), toStack(input), tier, lp, consume, drain, false)));
// }
//
// private static class Add implements IUndoableAction
// {
// private final AltarRecipe recipe;
//
// public Add(AltarRecipe recipe)
// {
// this.recipe = recipe;
// }
//
// @Override
// public void apply()
// {
// AltarRecipeRegistry.altarRecipes.add(recipe);
// }
//
// @Override
// public boolean canUndo()
// {
// return AltarRecipeRegistry.altarRecipes != null;
// }
//
// @Override
// public void undo()
// {
// AltarRecipeRegistry.altarRecipes.remove(recipe);
// }
//
// @Override
// public String describe()
// {
// return "Adding Blood Altar Recipe for " + ((AltarRecipe) recipe).getResult().getDisplayName();
// }
//
// @Override
// public String describeUndo()
// {
// return "Removing Blood Altar Recipe for " + ((AltarRecipe) recipe).getResult().getDisplayName();
// }
//
// @Override
// public Object getOverrideKey()
// {
// return null;
// }
// }
//
// @ZenMethod
// public static void removeRecipe(IItemStack output) {
// MineTweakerAPI.apply(new Remove(toStack(output)));
// }
//
// private static class Remove implements IUndoableAction
// {
// private final ItemStack output;
// private AltarRecipe recipe;
//
// public Remove(ItemStack output)
// {
// this.output = output;
// }
//
// @Override
// public void apply()
// {
// for (AltarRecipe r : AltarRecipeRegistry.altarRecipes)
// {
// if (r.getResult() != null && r.getResult().isItemEqual(output))
// {
// recipe = r;
// break;
// }
// }
//
// AltarRecipeRegistry.altarRecipes.remove(recipe);
// }
//
// @Override
// public boolean canUndo()
// {
// return AltarRecipeRegistry.altarRecipes != null && recipe != null;
// }
//
// @Override
// public void undo()
// {
// AltarRecipeRegistry.altarRecipes.add(recipe);
// }
//
// @Override
// public String describe()
// {
// return "Removing Blood Altar Recipe for " + output.getDisplayName();
// }
//
// @Override
// public String describeUndo()
// {
// return "Restoring Blood Altar Recipe for " + output.getDisplayName();
// }
//
// @Override
// public Object getOverrideKey()
// {
// return null;
// }
// }
//}

View file

@ -1,147 +1,147 @@
package WayofTime.alchemicalWizardry.common.tweaker;
import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toObjects;
import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toShapedObjects;
import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStack;
import java.util.List;
import WayofTime.alchemicalWizardry.api.items.ShapelessBloodOrbRecipe;
import minetweaker.IUndoableAction;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IIngredient;
import minetweaker.api.item.IItemStack;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import WayofTime.alchemicalWizardry.api.items.ShapedBloodOrbRecipe;
/**
* MineTweaker3 Blood Orb Recipe Handler by joshie *
*/
@ZenClass("mods.bloodmagic.BloodOrb")
public class BloodOrb
{
@ZenMethod
public static void addShaped(IItemStack output, IIngredient[][] ingredients)
{
MineTweakerAPI.apply(new Add(false, toStack(output), toShapedObjects(ingredients)));
}
@ZenMethod
public static void addShapeless(IItemStack output, IIngredient[] ingredients)
{
MineTweakerAPI.apply(new Add(true, toStack(output), toObjects(ingredients)));
}
private static class Add implements IUndoableAction {
private IRecipe iRecipe;
private final boolean isShapeless;
private final ItemStack output;
private final Object[] recipe;
public Add(boolean isShapeless, ItemStack output, Object... recipe)
{
this.isShapeless = isShapeless;
this.output = output;
this.recipe = recipe;
}
@Override
public void apply()
{
if (isShapeless) iRecipe = new ShapelessBloodOrbRecipe(output, recipe);
else iRecipe = new ShapedBloodOrbRecipe(output, recipe);
CraftingManager.getInstance().getRecipeList().add(iRecipe);
}
@Override
public boolean canUndo()
{
return CraftingManager.getInstance().getRecipeList() != null;
}
@Override
public void undo()
{
CraftingManager.getInstance().getRecipeList().remove(iRecipe);
}
@Override
public String describe() {
return "Adding Blood Orb Recipe for " + output.getDisplayName();
}
@Override
public String describeUndo()
{
return "Removing Blood Orb Recipe for " + output.getDisplayName();
}
@Override
public Object getOverrideKey()
{
return null;
}
}
@ZenMethod
public static void removeRecipe(IItemStack output) {
MineTweakerAPI.apply(new Remove(toStack(output)));
}
private static class Remove implements IUndoableAction {
private final ItemStack output;
private IRecipe iRecipe;
public Remove(ItemStack output)
{
this.output = output;
}
@Override
public void apply()
{
for (IRecipe r : (List<IRecipe>) CraftingManager.getInstance().getRecipeList())
{
if((r instanceof ShapedBloodOrbRecipe || r instanceof ShapelessBloodOrbRecipe) && r.getRecipeOutput() != null && r.getRecipeOutput().isItemEqual(output)) {
iRecipe = r;
break;
}
}
CraftingManager.getInstance().getRecipeList().remove(iRecipe);
}
@Override
public boolean canUndo()
{
return CraftingManager.getInstance().getRecipeList() != null && iRecipe != null;
}
@Override
public void undo()
{
CraftingManager.getInstance().getRecipeList().add(iRecipe);
}
@Override
public String describe() {
return "Removing Blood Orb Recipe for " + output.getDisplayName();
}
@Override
public String describeUndo()
{
return "Restoring Blood Orb Recipe for " + output.getDisplayName();
}
@Override
public Object getOverrideKey()
{
return null;
}
}
}
//package WayofTime.alchemicalWizardry.common.tweaker;
//
//import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toObjects;
//import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toShapedObjects;
//import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStack;
//
//import java.util.List;
//
//import WayofTime.alchemicalWizardry.api.items.ShapelessBloodOrbRecipe;
//import minetweaker.IUndoableAction;
//import minetweaker.MineTweakerAPI;
//import minetweaker.api.item.IIngredient;
//import minetweaker.api.item.IItemStack;
//import net.minecraft.item.ItemStack;
//import net.minecraft.item.crafting.CraftingManager;
//import net.minecraft.item.crafting.IRecipe;
//import stanhebben.zenscript.annotations.ZenClass;
//import stanhebben.zenscript.annotations.ZenMethod;
//import WayofTime.alchemicalWizardry.api.items.ShapedBloodOrbRecipe;
//
///**
// * MineTweaker3 Blood Orb Recipe Handler by joshie *
// */
//@ZenClass("mods.bloodmagic.BloodOrb")
//public class BloodOrb
//{
// @ZenMethod
// public static void addShaped(IItemStack output, IIngredient[][] ingredients)
// {
// MineTweakerAPI.apply(new Add(false, toStack(output), toShapedObjects(ingredients)));
// }
//
// @ZenMethod
// public static void addShapeless(IItemStack output, IIngredient[] ingredients)
// {
// MineTweakerAPI.apply(new Add(true, toStack(output), toObjects(ingredients)));
// }
//
// private static class Add implements IUndoableAction {
// private IRecipe iRecipe;
// private final boolean isShapeless;
// private final ItemStack output;
// private final Object[] recipe;
//
// public Add(boolean isShapeless, ItemStack output, Object... recipe)
// {
// this.isShapeless = isShapeless;
// this.output = output;
// this.recipe = recipe;
// }
//
// @Override
// public void apply()
// {
// if (isShapeless) iRecipe = new ShapelessBloodOrbRecipe(output, recipe);
// else iRecipe = new ShapedBloodOrbRecipe(output, recipe);
// CraftingManager.getInstance().getRecipeList().add(iRecipe);
// }
//
// @Override
// public boolean canUndo()
// {
// return CraftingManager.getInstance().getRecipeList() != null;
// }
//
// @Override
// public void undo()
// {
// CraftingManager.getInstance().getRecipeList().remove(iRecipe);
// }
//
// @Override
// public String describe() {
// return "Adding Blood Orb Recipe for " + output.getDisplayName();
// }
//
// @Override
// public String describeUndo()
// {
// return "Removing Blood Orb Recipe for " + output.getDisplayName();
// }
//
// @Override
// public Object getOverrideKey()
// {
// return null;
// }
// }
//
// @ZenMethod
// public static void removeRecipe(IItemStack output) {
// MineTweakerAPI.apply(new Remove(toStack(output)));
// }
//
// private static class Remove implements IUndoableAction {
// private final ItemStack output;
// private IRecipe iRecipe;
//
// public Remove(ItemStack output)
// {
// this.output = output;
// }
//
// @Override
// public void apply()
// {
// for (IRecipe r : (List<IRecipe>) CraftingManager.getInstance().getRecipeList())
// {
// if((r instanceof ShapedBloodOrbRecipe || r instanceof ShapelessBloodOrbRecipe) && r.getRecipeOutput() != null && r.getRecipeOutput().isItemEqual(output)) {
// iRecipe = r;
// break;
// }
// }
//
// CraftingManager.getInstance().getRecipeList().remove(iRecipe);
// }
//
// @Override
// public boolean canUndo()
// {
// return CraftingManager.getInstance().getRecipeList() != null && iRecipe != null;
// }
//
// @Override
// public void undo()
// {
// CraftingManager.getInstance().getRecipeList().add(iRecipe);
// }
//
// @Override
// public String describe() {
// return "Removing Blood Orb Recipe for " + output.getDisplayName();
// }
//
// @Override
// public String describeUndo()
// {
// return "Restoring Blood Orb Recipe for " + output.getDisplayName();
// }
//
// @Override
// public Object getOverrideKey()
// {
// return null;
// }
// }
//}

View file

@ -1,139 +1,139 @@
package WayofTime.alchemicalWizardry.common.tweaker;
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorParadigm;
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorRegistry;
import minetweaker.IUndoableAction;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IItemStack;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import java.util.Iterator;
import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStack;
/**
* MineTweaker3 Falling Tower Paradigm Handler by hilburn *
*/
@ZenClass("mods.bloodmagic.FallingTower")
public class FallingTower
{
@ZenMethod
public static void addFocus(IItemStack stack, int radius, String[] components)
{
MineTweakerAPI.apply(new Add(toStack(stack),radius, components));
}
@ZenMethod
public static void addFocus(IItemStack stack, int radius, String components)
{
MineTweakerAPI.apply(new Add(toStack(stack),radius, components.split("\\s*,\\s*")));
}
@ZenMethod
public static void removeFocus(IItemStack output) {
MineTweakerAPI.apply(new Remove(toStack(output)));
}
private static class Add implements IUndoableAction
{
private MeteorParadigm paradigm;
public Add(ItemStack stack, int radius, String[] components)
{
paradigm = new MeteorParadigm(stack,radius);
paradigm.parseStringArray(components);
}
@Override
public void apply()
{
MeteorRegistry.registerMeteorParadigm(paradigm);
}
@Override
public boolean canUndo()
{
return MeteorRegistry.paradigmList!= null;
}
@Override
public void undo()
{
MeteorRegistry.paradigmList.remove(paradigm);
}
@Override
public String describe() {
return "Adding Falling Tower Focus for " + paradigm.focusStack.getDisplayName();
}
@Override
public String describeUndo()
{
return "Removing Falling Tower Focus for " + paradigm.focusStack.getDisplayName();
}
@Override
public Object getOverrideKey()
{
return null;
}
}
private static class Remove implements IUndoableAction {
private final ItemStack focus;
private MeteorParadigm paradigm;
public Remove(ItemStack focus)
{
this.focus = focus;
}
@Override
public void apply()
{
for (Iterator<MeteorParadigm> itr = MeteorRegistry.paradigmList.iterator(); itr.hasNext();)
{
MeteorParadigm paradigm = itr.next();
if (OreDictionary.itemMatches(paradigm.focusStack,focus,false))
{
this.paradigm = paradigm;
itr.remove();
break;
}
}
}
@Override
public boolean canUndo()
{
return MeteorRegistry.paradigmList!= null && paradigm != null;
}
@Override
public void undo()
{
MeteorRegistry.paradigmList.add(paradigm);
}
@Override
public String describe() {
return "Removing Falling Tower Focus for " + focus.getDisplayName();
}
@Override
public String describeUndo()
{
return "Restoring Falling Tower Focus for " + focus.getDisplayName();
}
@Override
public Object getOverrideKey()
{
return null;
}
}
}
//package WayofTime.alchemicalWizardry.common.tweaker;
//
//import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorParadigm;
//import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorRegistry;
//import minetweaker.IUndoableAction;
//import minetweaker.MineTweakerAPI;
//import minetweaker.api.item.IItemStack;
//import net.minecraft.item.ItemStack;
//import net.minecraftforge.oredict.OreDictionary;
//import stanhebben.zenscript.annotations.ZenClass;
//import stanhebben.zenscript.annotations.ZenMethod;
//
//import java.util.Iterator;
//
//import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStack;
//
///**
// * MineTweaker3 Falling Tower Paradigm Handler by hilburn *
// */
//@ZenClass("mods.bloodmagic.FallingTower")
//public class FallingTower
//{
// @ZenMethod
// public static void addFocus(IItemStack stack, int radius, String[] components)
// {
// MineTweakerAPI.apply(new Add(toStack(stack),radius, components));
// }
//
// @ZenMethod
// public static void addFocus(IItemStack stack, int radius, String components)
// {
// MineTweakerAPI.apply(new Add(toStack(stack),radius, components.split("\\s*,\\s*")));
// }
//
// @ZenMethod
// public static void removeFocus(IItemStack output) {
// MineTweakerAPI.apply(new Remove(toStack(output)));
// }
//
// private static class Add implements IUndoableAction
// {
// private MeteorParadigm paradigm;
//
// public Add(ItemStack stack, int radius, String[] components)
// {
// paradigm = new MeteorParadigm(stack,radius);
// paradigm.parseStringArray(components);
// }
//
// @Override
// public void apply()
// {
// MeteorRegistry.registerMeteorParadigm(paradigm);
// }
//
// @Override
// public boolean canUndo()
// {
// return MeteorRegistry.paradigmList!= null;
// }
//
// @Override
// public void undo()
// {
// MeteorRegistry.paradigmList.remove(paradigm);
// }
//
// @Override
// public String describe() {
// return "Adding Falling Tower Focus for " + paradigm.focusStack.getDisplayName();
// }
//
// @Override
// public String describeUndo()
// {
// return "Removing Falling Tower Focus for " + paradigm.focusStack.getDisplayName();
// }
//
// @Override
// public Object getOverrideKey()
// {
// return null;
// }
// }
//
// private static class Remove implements IUndoableAction {
// private final ItemStack focus;
// private MeteorParadigm paradigm;
//
// public Remove(ItemStack focus)
// {
// this.focus = focus;
// }
//
// @Override
// public void apply()
// {
// for (Iterator<MeteorParadigm> itr = MeteorRegistry.paradigmList.iterator(); itr.hasNext();)
// {
// MeteorParadigm paradigm = itr.next();
// if (OreDictionary.itemMatches(paradigm.focusStack,focus,false))
// {
// this.paradigm = paradigm;
// itr.remove();
// break;
// }
// }
// }
//
// @Override
// public boolean canUndo()
// {
// return MeteorRegistry.paradigmList!= null && paradigm != null;
// }
//
// @Override
// public void undo()
// {
// MeteorRegistry.paradigmList.add(paradigm);
// }
//
// @Override
// public String describe() {
// return "Removing Falling Tower Focus for " + focus.getDisplayName();
// }
//
// @Override
// public String describeUndo()
// {
// return "Restoring Falling Tower Focus for " + focus.getDisplayName();
// }
//
// @Override
// public Object getOverrideKey()
// {
// return null;
// }
// }
//}

View file

@ -1,90 +1,90 @@
package WayofTime.alchemicalWizardry.common.tweaker;
import WayofTime.alchemicalWizardry.api.harvest.HarvestRegistry;
import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler;
import WayofTime.alchemicalWizardry.common.harvest.GenericItemStackHarvestHandler;
import minetweaker.IUndoableAction;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IItemStack;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.IPlantable;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
/**
* MineTweaker3 Harvest Moon Handler by hilburn *
*/
@ZenClass("mods.bloodmagic.HarvestMoon")
public class HarvestMoon
{
@ZenMethod
public static void addHarvestable(IItemStack block, IItemStack seed)
{
addHarvestable(block,block.getDamage(),seed);
}
@ZenMethod
public static void addHarvestable(IItemStack block, int meta, IItemStack seed)
{
ItemStack seedStack = MTHelper.toStack(seed);
Block plantBlock = Block.getBlockFromItem(MTHelper.toStack(block).getItem());
if (!(plantBlock==null || plantBlock== Blocks.air || seedStack==null || !(seedStack.getItem() instanceof IPlantable)))
{
MineTweakerAPI.apply(new Add(plantBlock, meta, seedStack));
}
else
{
throw new IllegalArgumentException("Invalid Harvest Block or Seed");
}
}
private static class Add implements IUndoableAction
{
private IHarvestHandler handler;
private String name;
public Add(Block block, int meta, ItemStack seed)
{
handler = new GenericItemStackHarvestHandler(block,meta,seed);
name = seed.getDisplayName();
}
@Override
public void apply()
{
HarvestRegistry.registerHarvestHandler(handler);
}
@Override
public boolean canUndo()
{
return HarvestRegistry.handlerList!=null;
}
@Override
public void undo()
{
HarvestRegistry.handlerList.remove(handler);
}
@Override
public String describe() {
return "Adding Harvest Moon Support for " + name;
}
@Override
public String describeUndo()
{
return "Removing Harvest Moon Support for " + name;
}
@Override
public Object getOverrideKey()
{
return null;
}
}
}
//package WayofTime.alchemicalWizardry.common.tweaker;
//
//import WayofTime.alchemicalWizardry.api.harvest.HarvestRegistry;
//import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler;
//import WayofTime.alchemicalWizardry.common.harvest.GenericItemStackHarvestHandler;
//import minetweaker.IUndoableAction;
//import minetweaker.MineTweakerAPI;
//import minetweaker.api.item.IItemStack;
//import net.minecraft.block.Block;
//import net.minecraft.init.Blocks;
//import net.minecraft.item.ItemStack;
//import net.minecraftforge.common.IPlantable;
//import stanhebben.zenscript.annotations.ZenClass;
//import stanhebben.zenscript.annotations.ZenMethod;
//
///**
// * MineTweaker3 Harvest Moon Handler by hilburn *
// */
//@ZenClass("mods.bloodmagic.HarvestMoon")
//public class HarvestMoon
//{
//
// @ZenMethod
// public static void addHarvestable(IItemStack block, IItemStack seed)
// {
// addHarvestable(block,block.getDamage(),seed);
// }
//
// @ZenMethod
// public static void addHarvestable(IItemStack block, int meta, IItemStack seed)
// {
// ItemStack seedStack = MTHelper.toStack(seed);
// Block plantBlock = Block.getBlockFromItem(MTHelper.toStack(block).getItem());
// if (!(plantBlock==null || plantBlock== Blocks.air || seedStack==null || !(seedStack.getItem() instanceof IPlantable)))
// {
// MineTweakerAPI.apply(new Add(plantBlock, meta, seedStack));
// }
// else
// {
// throw new IllegalArgumentException("Invalid Harvest Block or Seed");
// }
// }
//
// private static class Add implements IUndoableAction
// {
// private IHarvestHandler handler;
// private String name;
//
// public Add(Block block, int meta, ItemStack seed)
// {
// handler = new GenericItemStackHarvestHandler(block,meta,seed);
// name = seed.getDisplayName();
// }
//
// @Override
// public void apply()
// {
// HarvestRegistry.registerHarvestHandler(handler);
// }
//
// @Override
// public boolean canUndo()
// {
// return HarvestRegistry.handlerList!=null;
// }
//
// @Override
// public void undo()
// {
// HarvestRegistry.handlerList.remove(handler);
// }
//
// @Override
// public String describe() {
// return "Adding Harvest Moon Support for " + name;
// }
//
// @Override
// public String describeUndo()
// {
// return "Removing Harvest Moon Support for " + name;
// }
//
// @Override
// public Object getOverrideKey()
// {
// return null;
// }
// }
//}

View file

@ -1,82 +1,82 @@
package WayofTime.alchemicalWizardry.common.tweaker;
import static minetweaker.api.minecraft.MineTweakerMC.getItemStack;
import java.util.ArrayList;
import minetweaker.api.item.IIngredient;
import minetweaker.api.item.IItemStack;
import minetweaker.api.oredict.IOreDictEntry;
import net.minecraft.item.ItemStack;
/**
* MineTweaker3 Helper by joshie *
*/
public class MTHelper {
public static ItemStack toStack(IItemStack iStack) {
return getItemStack(iStack);
}
public static ItemStack[] toStacks(IItemStack[] iStack) {
if (iStack == null) return null;
else {
ItemStack[] output = new ItemStack[iStack.length];
for (int i = 0; i < iStack.length; i++) {
output[i] = toStack(iStack[i]);
}
return output;
}
}
public static Object toObject(IIngredient iStack) {
if (iStack == null) return null;
else {
if (iStack instanceof IOreDictEntry) {
return toString((IOreDictEntry) iStack);
} else if (iStack instanceof IItemStack) {
return getItemStack((IItemStack) iStack);
} else return null;
}
}
public static Object[] toObjects(IIngredient[] ingredient) {
if (ingredient == null) return null;
else {
Object[] output = new Object[ingredient.length];
for (int i = 0; i < ingredient.length; i++) {
if (ingredient[i] != null) {
output[i] = toObject(ingredient[i]);
} else output[i] = "";
}
return output;
}
}
public static Object[] toShapedObjects(IIngredient[][] ingredients) {
if (ingredients == null) return null;
else {
ArrayList prep = new ArrayList();
prep.add("abc");
prep.add("def");
prep.add("ghi");
char[][] map = new char[][] { { 'a', 'b', 'c' }, { 'd', 'e', 'f' }, { 'g', 'h', 'i' } };
for (int x = 0; x < ingredients.length; x++) {
if (ingredients[x] != null) {
for (int y = 0; y < ingredients[x].length; y++) {
if (ingredients[x][y] != null && x < map.length && y < map[x].length) {
prep.add(map[x][y]);
prep.add(toObject(ingredients[x][y]));
}
}
}
}
return prep.toArray();
}
}
public static String toString(IOreDictEntry entry) {
return ((IOreDictEntry) entry).getName();
}
}
//package WayofTime.alchemicalWizardry.common.tweaker;
//
//import static minetweaker.api.minecraft.MineTweakerMC.getItemStack;
//
//import java.util.ArrayList;
//
//import minetweaker.api.item.IIngredient;
//import minetweaker.api.item.IItemStack;
//import minetweaker.api.oredict.IOreDictEntry;
//import net.minecraft.item.ItemStack;
//
///**
// * MineTweaker3 Helper by joshie *
// */
//public class MTHelper {
// public static ItemStack toStack(IItemStack iStack) {
// return getItemStack(iStack);
// }
//
// public static ItemStack[] toStacks(IItemStack[] iStack) {
// if (iStack == null) return null;
// else {
// ItemStack[] output = new ItemStack[iStack.length];
// for (int i = 0; i < iStack.length; i++) {
// output[i] = toStack(iStack[i]);
// }
//
// return output;
// }
// }
//
// public static Object toObject(IIngredient iStack) {
// if (iStack == null) return null;
// else {
// if (iStack instanceof IOreDictEntry) {
// return toString((IOreDictEntry) iStack);
// } else if (iStack instanceof IItemStack) {
// return getItemStack((IItemStack) iStack);
// } else return null;
// }
// }
//
// public static Object[] toObjects(IIngredient[] ingredient) {
// if (ingredient == null) return null;
// else {
// Object[] output = new Object[ingredient.length];
// for (int i = 0; i < ingredient.length; i++) {
// if (ingredient[i] != null) {
// output[i] = toObject(ingredient[i]);
// } else output[i] = "";
// }
//
// return output;
// }
// }
//
// public static Object[] toShapedObjects(IIngredient[][] ingredients) {
// if (ingredients == null) return null;
// else {
// ArrayList prep = new ArrayList();
// prep.add("abc");
// prep.add("def");
// prep.add("ghi");
// char[][] map = new char[][] { { 'a', 'b', 'c' }, { 'd', 'e', 'f' }, { 'g', 'h', 'i' } };
// for (int x = 0; x < ingredients.length; x++) {
// if (ingredients[x] != null) {
// for (int y = 0; y < ingredients[x].length; y++) {
// if (ingredients[x][y] != null && x < map.length && y < map[x].length) {
// prep.add(map[x][y]);
// prep.add(toObject(ingredients[x][y]));
// }
// }
// }
// }
// return prep.toArray();
// }
// }
//
// public static String toString(IOreDictEntry entry) {
// return ((IOreDictEntry) entry).getName();
// }
//}

View file

@ -1,19 +1,19 @@
package WayofTime.alchemicalWizardry.common.tweaker;
import minetweaker.MineTweakerAPI;
/**
* MineTweaker3 Integration by joshie *
*/
public class MineTweakerIntegration
{
public static void register()
{
MineTweakerAPI.registerClass(Alchemy.class);
MineTweakerAPI.registerClass(Binding.class);
MineTweakerAPI.registerClass(BloodAltar.class);
MineTweakerAPI.registerClass(BloodOrb.class);
MineTweakerAPI.registerClass(FallingTower.class);
MineTweakerAPI.registerClass(HarvestMoon.class);
}
}
//package WayofTime.alchemicalWizardry.common.tweaker;
//
//import minetweaker.MineTweakerAPI;
//
///**
// * MineTweaker3 Integration by joshie *
// */
//public class MineTweakerIntegration
//{
// public static void register()
// {
// MineTweakerAPI.registerClass(Alchemy.class);
// MineTweakerAPI.registerClass(Binding.class);
// MineTweakerAPI.registerClass(BloodAltar.class);
// MineTweakerAPI.registerClass(BloodOrb.class);
// MineTweakerAPI.registerClass(FallingTower.class);
// MineTweakerAPI.registerClass(HarvestMoon.class);
// }
//}