Merge apibutnotreally with the main packages
Do not consider anything outside of the true API safe to use. And even then, I'm changing things. Just wait. Please I beg you.
This commit is contained in:
parent
616c08094b
commit
2fecb427fd
399 changed files with 958 additions and 977 deletions
|
@ -1,14 +1,14 @@
|
|||
package WayofTime.bloodmagic.ritual;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.BlockStack;
|
||||
import WayofTime.bloodmagic.apibutnotreally.altar.AltarComponent;
|
||||
import WayofTime.bloodmagic.apibutnotreally.altar.EnumAltarComponent;
|
||||
import WayofTime.bloodmagic.apibutnotreally.altar.EnumAltarTier;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.EnumRuneType;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.IMasterRitualStone;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.Ritual;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.RitualComponent;
|
||||
import WayofTime.bloodmagic.util.BlockStack;
|
||||
import WayofTime.bloodmagic.altar.AltarComponent;
|
||||
import WayofTime.bloodmagic.altar.EnumAltarComponent;
|
||||
import WayofTime.bloodmagic.altar.EnumAltarTier;
|
||||
import WayofTime.bloodmagic.ritual.data.EnumRuneType;
|
||||
import WayofTime.bloodmagic.ritual.data.IMasterRitualStone;
|
||||
import WayofTime.bloodmagic.ritual.data.Ritual;
|
||||
import WayofTime.bloodmagic.ritual.data.RitualComponent;
|
||||
import WayofTime.bloodmagic.block.BlockBloodRune;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package WayofTime.bloodmagic.ritual;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.*;
|
||||
import WayofTime.bloodmagic.apibutnotreally.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagic;
|
||||
import WayofTime.bloodmagic.demonAura.WorldDemonWillHandler;
|
||||
import WayofTime.bloodmagic.ritual.data.*;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import net.minecraft.entity.passive.EntityAnimal;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package WayofTime.bloodmagic.ritual;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.*;
|
||||
import WayofTime.bloodmagic.item.armour.ItemLivingArmour;
|
||||
import WayofTime.bloodmagic.livingArmour.LivingArmour;
|
||||
import WayofTime.bloodmagic.ritual.data.*;
|
||||
import com.google.common.collect.Iterables;
|
||||
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package WayofTime.bloodmagic.ritual;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.*;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import WayofTime.bloodmagic.ritual.data.*;
|
||||
import WayofTime.bloodmagic.tile.TileAlchemyArray;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package WayofTime.bloodmagic.ritual;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.*;
|
||||
import WayofTime.bloodmagic.apibutnotreally.util.helper.PlayerHelper;
|
||||
import WayofTime.bloodmagic.util.helper.PlayerHelper;
|
||||
import WayofTime.bloodmagic.ritual.data.*;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package WayofTime.bloodmagic.ritual;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.compress.CompressionRegistry;
|
||||
import WayofTime.bloodmagic.apibutnotreally.recipe.AlchemyTableRecipe;
|
||||
import WayofTime.bloodmagic.apibutnotreally.registry.AlchemyTableRecipeRegistry;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.*;
|
||||
import WayofTime.bloodmagic.apibutnotreally.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.compress.CompressionRegistry;
|
||||
import WayofTime.bloodmagic.recipe.AlchemyTableRecipe;
|
||||
import WayofTime.bloodmagic.core.registry.AlchemyTableRecipeRegistry;
|
||||
import WayofTime.bloodmagic.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks;
|
||||
import WayofTime.bloodmagic.demonAura.WorldDemonWillHandler;
|
||||
import WayofTime.bloodmagic.ritual.data.*;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package WayofTime.bloodmagic.ritual;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.*;
|
||||
import WayofTime.bloodmagic.ritual.data.*;
|
||||
import WayofTime.bloodmagic.tile.TileDemonCrystal;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package WayofTime.bloodmagic.ritual;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.iface.IBindable;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.*;
|
||||
import WayofTime.bloodmagic.apibutnotreally.util.helper.PlayerHelper;
|
||||
import WayofTime.bloodmagic.iface.IBindable;
|
||||
import WayofTime.bloodmagic.util.helper.PlayerHelper;
|
||||
import WayofTime.bloodmagic.ritual.data.*;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import com.google.common.base.Strings;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
|
|
@ -2,16 +2,16 @@ package WayofTime.bloodmagic.ritual;
|
|||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.ConfigHandler;
|
||||
import WayofTime.bloodmagic.apibutnotreally.altar.IBloodAltar;
|
||||
import WayofTime.bloodmagic.apibutnotreally.livingArmour.LivingArmourUpgrade;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.*;
|
||||
import WayofTime.bloodmagic.apibutnotreally.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.apibutnotreally.util.helper.PlayerSacrificeHelper;
|
||||
import WayofTime.bloodmagic.altar.IBloodAltar;
|
||||
import WayofTime.bloodmagic.livingArmour.LivingArmourUpgrade;
|
||||
import WayofTime.bloodmagic.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.util.helper.PlayerSacrificeHelper;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagic;
|
||||
import WayofTime.bloodmagic.demonAura.WorldDemonWillHandler;
|
||||
import WayofTime.bloodmagic.item.armour.ItemLivingArmour;
|
||||
import WayofTime.bloodmagic.livingArmour.LivingArmour;
|
||||
import WayofTime.bloodmagic.livingArmour.upgrade.LivingArmourUpgradeSelfSacrifice;
|
||||
import WayofTime.bloodmagic.ritual.data.*;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package WayofTime.bloodmagic.ritual;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.*;
|
||||
import WayofTime.bloodmagic.ritual.data.*;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
|
|
|
@ -2,7 +2,7 @@ package WayofTime.bloodmagic.ritual;
|
|||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.impl.BloodMagicAPI;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.*;
|
||||
import WayofTime.bloodmagic.ritual.data.*;
|
||||
import WayofTime.bloodmagic.tile.TileDemonCrystal;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.passive.EntityAnimal;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package WayofTime.bloodmagic.ritual;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.*;
|
||||
import WayofTime.bloodmagic.ritual.data.*;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemFood;
|
||||
|
|
|
@ -2,11 +2,11 @@ package WayofTime.bloodmagic.ritual;
|
|||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.impl.BloodMagicAPI;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.*;
|
||||
import WayofTime.bloodmagic.apibutnotreally.soul.DemonWillHolder;
|
||||
import WayofTime.bloodmagic.apibutnotreally.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.soul.DemonWillHolder;
|
||||
import WayofTime.bloodmagic.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagic;
|
||||
import WayofTime.bloodmagic.demonAura.WorldDemonWillHandler;
|
||||
import WayofTime.bloodmagic.ritual.data.*;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFarmland;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package WayofTime.bloodmagic.ritual;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.BlockStack;
|
||||
import WayofTime.bloodmagic.apibutnotreally.iface.IHarvestHandler;
|
||||
import WayofTime.bloodmagic.apibutnotreally.registry.HarvestRegistry;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.*;
|
||||
import WayofTime.bloodmagic.util.BlockStack;
|
||||
import WayofTime.bloodmagic.iface.IHarvestHandler;
|
||||
import WayofTime.bloodmagic.core.registry.HarvestRegistry;
|
||||
import WayofTime.bloodmagic.ritual.data.*;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package WayofTime.bloodmagic.ritual;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.*;
|
||||
import WayofTime.bloodmagic.apibutnotreally.util.helper.PlayerHelper;
|
||||
import WayofTime.bloodmagic.util.helper.PlayerHelper;
|
||||
import WayofTime.bloodmagic.ritual.data.*;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package WayofTime.bloodmagic.ritual;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.*;
|
||||
import WayofTime.bloodmagic.ritual.data.*;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package WayofTime.bloodmagic.ritual;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.BloodMagicAPI;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.*;
|
||||
import WayofTime.bloodmagic.apibutnotreally.soul.DemonWillHolder;
|
||||
import WayofTime.bloodmagic.apibutnotreally.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.util.PleaseStopUsingMe;
|
||||
import WayofTime.bloodmagic.soul.DemonWillHolder;
|
||||
import WayofTime.bloodmagic.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagic;
|
||||
import WayofTime.bloodmagic.demonAura.WorldDemonWillHandler;
|
||||
import WayofTime.bloodmagic.ritual.data.*;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
|
@ -198,7 +198,7 @@ public class RitualLava extends Ritual {
|
|||
}
|
||||
|
||||
if (!entity.isDead && entity.hurtTime <= 0 && Utils.isImmuneToFireDamage(entity)) {
|
||||
if (entity.attackEntityFrom(BloodMagicAPI.damageSource, damage)) {
|
||||
if (entity.attackEntityFrom(PleaseStopUsingMe.damageSource, damage)) {
|
||||
corrosiveDrained += corrosiveWillDrain;
|
||||
corrosiveWill -= corrosiveWillDrain;
|
||||
}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package WayofTime.bloodmagic.ritual;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.livingArmour.LivingArmourUpgrade;
|
||||
import WayofTime.bloodmagic.apibutnotreally.recipe.LivingArmourDowngradeRecipe;
|
||||
import WayofTime.bloodmagic.apibutnotreally.registry.LivingArmourDowngradeRecipeRegistry;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.*;
|
||||
import WayofTime.bloodmagic.livingArmour.LivingArmourUpgrade;
|
||||
import WayofTime.bloodmagic.recipe.LivingArmourDowngradeRecipe;
|
||||
import WayofTime.bloodmagic.core.registry.LivingArmourDowngradeRecipeRegistry;
|
||||
import WayofTime.bloodmagic.item.armour.ItemLivingArmour;
|
||||
import WayofTime.bloodmagic.livingArmour.LivingArmour;
|
||||
import WayofTime.bloodmagic.ritual.data.*;
|
||||
import WayofTime.bloodmagic.util.ChatUtil;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package WayofTime.bloodmagic.ritual;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.BlockStack;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.*;
|
||||
import WayofTime.bloodmagic.util.BlockStack;
|
||||
import WayofTime.bloodmagic.ritual.data.*;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockOre;
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package WayofTime.bloodmagic.ritual;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.*;
|
||||
import WayofTime.bloodmagic.apibutnotreally.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.demonAura.WorldDemonWillHandler;
|
||||
import WayofTime.bloodmagic.entity.projectile.EntityMeteor;
|
||||
import WayofTime.bloodmagic.meteor.Meteor;
|
||||
import WayofTime.bloodmagic.meteor.MeteorRegistry;
|
||||
import WayofTime.bloodmagic.ritual.data.*;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package WayofTime.bloodmagic.ritual;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.*;
|
||||
import WayofTime.bloodmagic.ritual.data.*;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package WayofTime.bloodmagic.ritual;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.EnumRuneType;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.IMasterRitualStone;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.Ritual;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.RitualComponent;
|
||||
import WayofTime.bloodmagic.apibutnotreally.teleport.PortalLocation;
|
||||
import WayofTime.bloodmagic.ritual.data.EnumRuneType;
|
||||
import WayofTime.bloodmagic.ritual.data.IMasterRitualStone;
|
||||
import WayofTime.bloodmagic.ritual.data.Ritual;
|
||||
import WayofTime.bloodmagic.ritual.data.RitualComponent;
|
||||
import WayofTime.bloodmagic.teleport.PortalLocation;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks;
|
||||
import WayofTime.bloodmagic.ritual.portal.LocationsHandler;
|
||||
import WayofTime.bloodmagic.tile.TileDimensionalPortal;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package WayofTime.bloodmagic.ritual;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.*;
|
||||
import WayofTime.bloodmagic.ritual.data.*;
|
||||
import com.google.common.collect.Lists;
|
||||
import net.minecraft.block.BlockLiquid;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package WayofTime.bloodmagic.ritual;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.BloodMagicAPI;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.*;
|
||||
import WayofTime.bloodmagic.apibutnotreally.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.util.PleaseStopUsingMe;
|
||||
import WayofTime.bloodmagic.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.demonAura.WorldDemonWillHandler;
|
||||
import WayofTime.bloodmagic.ritual.data.*;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -92,7 +92,7 @@ public class RitualRegeneration extends Ritual {
|
|||
|
||||
float currentHealth = damagedEntity.getHealth();
|
||||
|
||||
damagedEntity.attackEntityFrom(BloodMagicAPI.damageSource, Math.min(player.getMaxHealth() - player.getHealth(), syphonedHealthAmount));
|
||||
damagedEntity.attackEntityFrom(PleaseStopUsingMe.damageSource, Math.min(player.getMaxHealth() - player.getHealth(), syphonedHealthAmount));
|
||||
|
||||
float healthDifference = currentHealth - damagedEntity.getHealth();
|
||||
if (healthDifference > 0) {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package WayofTime.bloodmagic.ritual;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.*;
|
||||
import WayofTime.bloodmagic.apibutnotreally.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.demonAura.WorldDemonWillHandler;
|
||||
import WayofTime.bloodmagic.ritual.data.*;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package WayofTime.bloodmagic.ritual;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.*;
|
||||
import WayofTime.bloodmagic.ritual.data.*;
|
||||
import WayofTime.bloodmagic.tile.TileSpectralBlock;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package WayofTime.bloodmagic.ritual;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.livingArmour.LivingArmourUpgrade;
|
||||
import WayofTime.bloodmagic.apibutnotreally.livingArmour.StatTracker;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.*;
|
||||
import WayofTime.bloodmagic.apibutnotreally.util.helper.ItemHelper.LivingUpgrades;
|
||||
import WayofTime.bloodmagic.livingArmour.LivingArmourUpgrade;
|
||||
import WayofTime.bloodmagic.livingArmour.StatTracker;
|
||||
import WayofTime.bloodmagic.util.helper.ItemHelper.LivingUpgrades;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import WayofTime.bloodmagic.item.armour.ItemLivingArmour;
|
||||
import WayofTime.bloodmagic.livingArmour.LivingArmour;
|
||||
import WayofTime.bloodmagic.ritual.data.*;
|
||||
import com.google.common.collect.Iterables;
|
||||
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package WayofTime.bloodmagic.ritual;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.*;
|
||||
import WayofTime.bloodmagic.ritual.data.*;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
|
|
@ -2,7 +2,7 @@ package WayofTime.bloodmagic.ritual;
|
|||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.impl.BloodMagicAPI;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.*;
|
||||
import WayofTime.bloodmagic.ritual.data.*;
|
||||
import WayofTime.bloodmagic.tile.TileAltar;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package WayofTime.bloodmagic.ritual;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.*;
|
||||
import WayofTime.bloodmagic.ritual.data.*;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
|
|
@ -0,0 +1,495 @@
|
|||
package WayofTime.bloodmagic.ritual.data;
|
||||
|
||||
import WayofTime.bloodmagic.util.Constants;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.gen.structure.template.PlacementSettings;
|
||||
import net.minecraft.world.gen.structure.template.Template;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class AreaDescriptor implements Iterator<BlockPos> {
|
||||
public List<BlockPos> getContainedPositions(BlockPos pos) {
|
||||
return new ArrayList<BlockPos>();
|
||||
}
|
||||
|
||||
public AxisAlignedBB getAABB(BlockPos pos) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public abstract void resetCache();
|
||||
|
||||
public abstract boolean isWithinArea(BlockPos pos);
|
||||
|
||||
public abstract void resetIterator();
|
||||
|
||||
public void readFromNBT(NBTTagCompound tag) {
|
||||
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound tag) {
|
||||
|
||||
}
|
||||
|
||||
public abstract int getVolumeForOffsets(BlockPos offset1, BlockPos offset2);
|
||||
|
||||
public abstract boolean isWithinRange(BlockPos offset1, BlockPos offset2, int verticalLimit, int horizontalLimit);
|
||||
|
||||
public abstract int getVolume();
|
||||
|
||||
public abstract boolean isWithinRange(int verticalLimit, int horizontalLimit);
|
||||
|
||||
/**
|
||||
* This method changes the area descriptor so that its range matches the two
|
||||
* blocks that are selected. When implementing this method, assume that
|
||||
* these positions are the blocks that are clicked by the player.
|
||||
*
|
||||
* @param pos1
|
||||
* @param pos2
|
||||
*/
|
||||
public abstract void modifyAreaByBlockPositions(BlockPos pos1, BlockPos pos2);
|
||||
|
||||
public abstract boolean intersects(AreaDescriptor descriptor);
|
||||
|
||||
public abstract AreaDescriptor offset(BlockPos offset);
|
||||
|
||||
public abstract AreaDescriptor rotateDescriptor(PlacementSettings settings);
|
||||
|
||||
public static class Rectangle extends AreaDescriptor {
|
||||
protected BlockPos minimumOffset;
|
||||
protected BlockPos maximumOffset; // Non-inclusive maximum offset.
|
||||
private BlockPos currentPosition;
|
||||
|
||||
private ArrayList<BlockPos> blockPosCache;
|
||||
private BlockPos cachedPosition;
|
||||
|
||||
private boolean cache = true;
|
||||
|
||||
/**
|
||||
* This constructor takes in the minimum and maximum BlockPos. The
|
||||
* maximum offset is non-inclusive, meaning if you pass in (0,0,0) and
|
||||
* (1,1,1), calling getContainedPositions() will only give (0,0,0).
|
||||
*
|
||||
* @param minimumOffset -
|
||||
* @param maximumOffset -
|
||||
*/
|
||||
public Rectangle(BlockPos minimumOffset, BlockPos maximumOffset) {
|
||||
setOffsets(minimumOffset, maximumOffset);
|
||||
}
|
||||
|
||||
public Rectangle(BlockPos minimumOffset, int sizeX, int sizeY, int sizeZ) {
|
||||
this(minimumOffset, minimumOffset.add(sizeX, sizeY, sizeZ));
|
||||
}
|
||||
|
||||
public Rectangle(BlockPos minimumOffset, int size) {
|
||||
this(minimumOffset, size, size, size);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BlockPos> getContainedPositions(BlockPos pos) {
|
||||
if (!cache || !pos.equals(cachedPosition) || blockPosCache.isEmpty()) {
|
||||
ArrayList<BlockPos> posList = new ArrayList<BlockPos>();
|
||||
|
||||
for (int j = minimumOffset.getY(); j < maximumOffset.getY(); j++) {
|
||||
for (int i = minimumOffset.getX(); i < maximumOffset.getX(); i++) {
|
||||
for (int k = minimumOffset.getZ(); k < maximumOffset.getZ(); k++) {
|
||||
posList.add(pos.add(i, j, k));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
blockPosCache = posList;
|
||||
cachedPosition = pos;
|
||||
}
|
||||
|
||||
return Collections.unmodifiableList(blockPosCache);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getAABB(BlockPos pos) {
|
||||
AxisAlignedBB tempAABB = new AxisAlignedBB(minimumOffset, maximumOffset);
|
||||
return tempAABB.offset(pos.getX(), pos.getY(), pos.getZ());
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the offsets of the AreaDescriptor in a safe way that will make
|
||||
* minimumOffset the lowest corner
|
||||
*
|
||||
* @param offset1 -
|
||||
* @param offset2 -
|
||||
*/
|
||||
public void setOffsets(BlockPos offset1, BlockPos offset2) {
|
||||
this.minimumOffset = new BlockPos(Math.min(offset1.getX(), offset2.getX()), Math.min(offset1.getY(), offset2.getY()), Math.min(offset1.getZ(), offset2.getZ()));
|
||||
this.maximumOffset = new BlockPos(Math.max(offset1.getX(), offset2.getX()), Math.max(offset1.getY(), offset2.getY()), Math.max(offset1.getZ(), offset2.getZ()));
|
||||
blockPosCache = new ArrayList<BlockPos>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetCache() {
|
||||
this.blockPosCache = new ArrayList<BlockPos>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWithinArea(BlockPos pos) {
|
||||
int x = pos.getX();
|
||||
int y = pos.getY();
|
||||
int z = pos.getZ();
|
||||
|
||||
return x >= minimumOffset.getX() && x < maximumOffset.getX() && y >= minimumOffset.getY() && y < maximumOffset.getY() && z >= minimumOffset.getZ() && z < maximumOffset.getZ();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
return currentPosition == null || !(currentPosition.getX() + 1 == maximumOffset.getX() && currentPosition.getY() + 1 == maximumOffset.getY() && currentPosition.getZ() + 1 == maximumOffset.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockPos next() {
|
||||
if (currentPosition != null) {
|
||||
int nextX = currentPosition.getX() + 1 >= maximumOffset.getX() ? minimumOffset.getX() : currentPosition.getX() + 1;
|
||||
int nextZ = nextX != minimumOffset.getX() ? currentPosition.getZ() : (currentPosition.getZ() + 1 >= maximumOffset.getZ() ? minimumOffset.getZ() : currentPosition.getZ() + 1);
|
||||
int nextY = (nextZ != minimumOffset.getZ() || nextX != minimumOffset.getX()) ? currentPosition.getY() : (currentPosition.getY() + 1);
|
||||
currentPosition = new BlockPos(nextX, nextY, nextZ);
|
||||
} else {
|
||||
currentPosition = minimumOffset;
|
||||
}
|
||||
|
||||
return currentPosition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetIterator() {
|
||||
currentPosition = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modifyAreaByBlockPositions(BlockPos pos1, BlockPos pos2) {
|
||||
setOffsets(pos1, pos2);
|
||||
maximumOffset = maximumOffset.add(1, 1, 1);
|
||||
resetIterator();
|
||||
resetCache();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tag) {
|
||||
minimumOffset = new BlockPos(tag.getInteger(Constants.NBT.X_COORD + "min"), tag.getInteger(Constants.NBT.Y_COORD + "min"), tag.getInteger(Constants.NBT.Z_COORD + "min"));
|
||||
maximumOffset = new BlockPos(tag.getInteger(Constants.NBT.X_COORD + "max"), tag.getInteger(Constants.NBT.Y_COORD + "max"), tag.getInteger(Constants.NBT.Z_COORD + "max"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound tag) {
|
||||
tag.setInteger(Constants.NBT.X_COORD + "min", minimumOffset.getX());
|
||||
tag.setInteger(Constants.NBT.Y_COORD + "min", minimumOffset.getY());
|
||||
tag.setInteger(Constants.NBT.Z_COORD + "min", minimumOffset.getZ());
|
||||
tag.setInteger(Constants.NBT.X_COORD + "max", maximumOffset.getX());
|
||||
tag.setInteger(Constants.NBT.Y_COORD + "max", maximumOffset.getY());
|
||||
tag.setInteger(Constants.NBT.Z_COORD + "max", maximumOffset.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVolumeForOffsets(BlockPos offset1, BlockPos offset2) {
|
||||
BlockPos minPos = new BlockPos(Math.min(offset1.getX(), offset2.getX()), Math.min(offset1.getY(), offset2.getY()), Math.min(offset1.getZ(), offset2.getZ()));
|
||||
BlockPos maxPos = new BlockPos(Math.max(offset1.getX(), offset2.getX()), Math.max(offset1.getY(), offset2.getY()), Math.max(offset1.getZ(), offset2.getZ()));
|
||||
|
||||
maxPos = maxPos.add(1, 1, 1);
|
||||
|
||||
return (maxPos.getX() - minPos.getX()) * (maxPos.getY() - minPos.getY()) * (maxPos.getZ() - minPos.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWithinRange(BlockPos offset1, BlockPos offset2, int verticalLimit, int horizontalLimit) {
|
||||
BlockPos minPos = new BlockPos(Math.min(offset1.getX(), offset2.getX()), Math.min(offset1.getY(), offset2.getY()), Math.min(offset1.getZ(), offset2.getZ()));
|
||||
BlockPos maxPos = new BlockPos(Math.max(offset1.getX(), offset2.getX()), Math.max(offset1.getY(), offset2.getY()), Math.max(offset1.getZ(), offset2.getZ()));
|
||||
|
||||
return minPos.getY() >= -verticalLimit && maxPos.getY() <= verticalLimit && minPos.getX() >= -horizontalLimit && maxPos.getX() <= horizontalLimit && minPos.getZ() >= -horizontalLimit && maxPos.getZ() <= horizontalLimit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVolume() {
|
||||
return (maximumOffset.getX() - minimumOffset.getX()) * (maximumOffset.getY() - minimumOffset.getY()) * (maximumOffset.getZ() - minimumOffset.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWithinRange(int verticalLimit, int horizontalLimit) {
|
||||
return minimumOffset.getY() >= -verticalLimit && maximumOffset.getY() <= verticalLimit + 1 && minimumOffset.getX() >= -horizontalLimit && maximumOffset.getX() <= horizontalLimit + 1 && minimumOffset.getZ() >= -horizontalLimit && maximumOffset.getZ() <= horizontalLimit + 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean intersects(AreaDescriptor descriptor) {
|
||||
if (descriptor instanceof AreaDescriptor.Rectangle) {
|
||||
AreaDescriptor.Rectangle rectangle = (AreaDescriptor.Rectangle) descriptor;
|
||||
|
||||
return !(minimumOffset.getX() >= rectangle.maximumOffset.getX() || minimumOffset.getY() >= rectangle.maximumOffset.getY() || minimumOffset.getZ() >= rectangle.maximumOffset.getZ() || rectangle.minimumOffset.getX() >= maximumOffset.getX() || rectangle.minimumOffset.getY() >= maximumOffset.getY() || rectangle.minimumOffset.getZ() >= maximumOffset.getZ());
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AreaDescriptor offset(BlockPos offset) {
|
||||
return new AreaDescriptor.Rectangle(this.minimumOffset.add(offset), this.maximumOffset.add(offset));
|
||||
}
|
||||
|
||||
@Override
|
||||
public AreaDescriptor rotateDescriptor(PlacementSettings settings) {
|
||||
BlockPos rotatePos1 = Template.transformedBlockPos(settings, minimumOffset);
|
||||
BlockPos rotatePos2 = Template.transformedBlockPos(settings, maximumOffset.add(-1, -1, -1)); //It works, shut up!
|
||||
|
||||
AreaDescriptor.Rectangle rectangle = new AreaDescriptor.Rectangle(this.minimumOffset, 1);
|
||||
rectangle.modifyAreaByBlockPositions(rotatePos1, rotatePos2);
|
||||
|
||||
return rectangle;
|
||||
}
|
||||
}
|
||||
|
||||
public static class HemiSphere extends AreaDescriptor {
|
||||
private BlockPos minimumOffset;
|
||||
private int radius;
|
||||
|
||||
private ArrayList<BlockPos> blockPosCache;
|
||||
private BlockPos cachedPosition;
|
||||
|
||||
private boolean cache = true;
|
||||
|
||||
public HemiSphere(BlockPos minimumOffset, int radius) {
|
||||
setRadius(minimumOffset, radius);
|
||||
}
|
||||
|
||||
public void setRadius(BlockPos minimumOffset, int radius) {
|
||||
this.minimumOffset = new BlockPos(Math.min(minimumOffset.getX(), minimumOffset.getX()), Math.min(minimumOffset.getY(), minimumOffset.getY()), Math.min(minimumOffset.getZ(), minimumOffset.getZ()));
|
||||
this.radius = radius;
|
||||
blockPosCache = new ArrayList<BlockPos>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BlockPos> getContainedPositions(BlockPos pos) {
|
||||
if (!cache || !pos.equals(cachedPosition) || blockPosCache.isEmpty()) {
|
||||
ArrayList<BlockPos> posList = new ArrayList<BlockPos>();
|
||||
|
||||
int i = -radius;
|
||||
int j = minimumOffset.getY();
|
||||
int k = -radius;
|
||||
|
||||
//TODO For some reason the bottom of the hemisphere is not going up with the minOffset
|
||||
|
||||
while (i <= radius) {
|
||||
while (j <= radius) {
|
||||
while (k <= radius) {
|
||||
if (i * i + j * j + k * k >= (radius + 0.5F) * (radius + 0.5F)) {
|
||||
k++;
|
||||
continue;
|
||||
}
|
||||
|
||||
posList.add(pos.add(i, j, k));
|
||||
k++;
|
||||
}
|
||||
|
||||
k = -radius;
|
||||
j++;
|
||||
}
|
||||
|
||||
j = minimumOffset.getY();
|
||||
i++;
|
||||
}
|
||||
|
||||
blockPosCache = posList;
|
||||
cachedPosition = pos;
|
||||
}
|
||||
|
||||
return Collections.unmodifiableList(blockPosCache);
|
||||
}
|
||||
|
||||
/**
|
||||
* Since you can't make a box using a sphere, this returns null
|
||||
*/
|
||||
@Override
|
||||
public AxisAlignedBB getAABB(BlockPos pos) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetCache() {
|
||||
this.blockPosCache = new ArrayList<BlockPos>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWithinArea(BlockPos pos) {
|
||||
return blockPosCache.contains(pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockPos next() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetIterator() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modifyAreaByBlockPositions(BlockPos pos1, BlockPos pos2) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVolumeForOffsets(BlockPos pos1, BlockPos pos2) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWithinRange(BlockPos offset1, BlockPos offset2, int verticalLimit, int horizontalLimit) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVolume() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWithinRange(int verticalLimit, int horizontalLimit) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean intersects(AreaDescriptor descriptor) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AreaDescriptor offset(BlockPos offset) {
|
||||
return new AreaDescriptor.HemiSphere(minimumOffset.add(offset), radius);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AreaDescriptor rotateDescriptor(PlacementSettings settings) {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Cross extends AreaDescriptor {
|
||||
|
||||
private ArrayList<BlockPos> blockPosCache;
|
||||
private BlockPos cachedPosition;
|
||||
|
||||
private BlockPos centerPos;
|
||||
private int size;
|
||||
|
||||
private boolean cache = true;
|
||||
|
||||
public Cross(BlockPos center, int size) {
|
||||
this.centerPos = center;
|
||||
this.size = size;
|
||||
this.blockPosCache = new ArrayList<BlockPos>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BlockPos> getContainedPositions(BlockPos pos) {
|
||||
if (!cache || !pos.equals(cachedPosition) || blockPosCache.isEmpty()) {
|
||||
resetCache();
|
||||
|
||||
blockPosCache.add(centerPos.add(pos));
|
||||
for (int i = 1; i <= size; i++) {
|
||||
blockPosCache.add(centerPos.add(pos).add(i, 0, 0));
|
||||
blockPosCache.add(centerPos.add(pos).add(0, 0, i));
|
||||
blockPosCache.add(centerPos.add(pos).add(-i, 0, 0));
|
||||
blockPosCache.add(centerPos.add(pos).add(0, 0, -i));
|
||||
}
|
||||
}
|
||||
|
||||
cachedPosition = pos;
|
||||
|
||||
return Collections.unmodifiableList(blockPosCache);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetCache() {
|
||||
blockPosCache = new ArrayList<BlockPos>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWithinArea(BlockPos pos) {
|
||||
return blockPosCache.contains(pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockPos next() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetIterator() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modifyAreaByBlockPositions(BlockPos pos1, BlockPos pos2) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVolumeForOffsets(BlockPos pos1, BlockPos pos2) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWithinRange(BlockPos offset1, BlockPos offset2, int verticalLimit, int horizontalLimit) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVolume() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWithinRange(int verticalLimit, int horizontalLimit) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean intersects(AreaDescriptor descriptor) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AreaDescriptor offset(BlockPos offset) {
|
||||
return new AreaDescriptor.Cross(centerPos.add(offset), size);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AreaDescriptor rotateDescriptor(PlacementSettings settings) {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
package WayofTime.bloodmagic.ritual.data;
|
||||
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTTagByte;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
public final class CapabilityRuneType {
|
||||
public static class RuneTypeStorage implements Capability.IStorage<IRitualStone.Tile> {
|
||||
@Override
|
||||
public NBTBase writeNBT(Capability<IRitualStone.Tile> capability, IRitualStone.Tile instance, EnumFacing side) {
|
||||
return new NBTTagByte((byte) instance.getRuneType().ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readNBT(Capability<IRitualStone.Tile> capability, IRitualStone.Tile instance, EnumFacing side, NBTBase nbt) {
|
||||
instance.setRuneType(EnumRuneType.byMetadata(((NBTTagByte) nbt).getByte()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class RuneTypeWrapper implements IRitualStone.Tile {
|
||||
private EnumRuneType type = EnumRuneType.BLANK;
|
||||
|
||||
@Override
|
||||
public boolean isRuneType(EnumRuneType runeType) {
|
||||
return type == runeType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRuneType getRuneType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setRuneType(EnumRuneType runeType) {
|
||||
type = runeType;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Factory implements Callable<IRitualStone.Tile> {
|
||||
@Override
|
||||
public IRitualStone.Tile call() throws Exception {
|
||||
return new RuneTypeWrapper();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package WayofTime.bloodmagic.ritual.data;
|
||||
|
||||
public enum EnumRitualReaderState {
|
||||
SET_AREA,
|
||||
INFORMATION,
|
||||
SET_WILL_TYPES;
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
package WayofTime.bloodmagic.ritual.data;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public enum EnumRuneType implements IStringSerializable {
|
||||
BLANK(TextFormatting.GRAY),
|
||||
WATER(TextFormatting.AQUA),
|
||||
FIRE(TextFormatting.RED),
|
||||
EARTH(TextFormatting.GREEN),
|
||||
AIR(TextFormatting.WHITE),
|
||||
DUSK(TextFormatting.DARK_GRAY),
|
||||
DAWN(TextFormatting.GOLD);
|
||||
|
||||
@GameRegistry.ObjectHolder("bloodmagic:inscription_tool")
|
||||
public static final Item INSCRIPTION_TOOL = Items.AIR;
|
||||
|
||||
public final TextFormatting colorCode;
|
||||
|
||||
EnumRuneType(TextFormatting colorCode) {
|
||||
this.colorCode = colorCode;
|
||||
}
|
||||
|
||||
public ItemStack getScribeStack() {
|
||||
return new ItemStack(INSCRIPTION_TOOL, 1, ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return name().toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return this.toString();
|
||||
}
|
||||
|
||||
public static EnumRuneType byMetadata(int meta) {
|
||||
if (meta < 0 || meta >= values().length)
|
||||
meta = 0;
|
||||
|
||||
return values()[meta];
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
package WayofTime.bloodmagic.ritual.data;
|
||||
|
||||
import WayofTime.bloodmagic.core.data.SoulNetwork;
|
||||
import WayofTime.bloodmagic.soul.EnumDemonWillType;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* This interface is for internal implementation only.
|
||||
* <p>
|
||||
* It is provided via the API for easy obtaining of basic data.
|
||||
*/
|
||||
public interface IMasterRitualStone {
|
||||
String getOwner();
|
||||
|
||||
SoulNetwork getOwnerNetwork();
|
||||
|
||||
boolean activateRitual(ItemStack activationCrystal, EntityPlayer activator, Ritual ritual);
|
||||
|
||||
void performRitual(World world, BlockPos pos);
|
||||
|
||||
void stopRitual(Ritual.BreakType breakType);
|
||||
|
||||
int getCooldown();
|
||||
|
||||
void setCooldown(int cooldown);
|
||||
|
||||
void setActive(boolean active);
|
||||
|
||||
EnumFacing getDirection();
|
||||
|
||||
boolean areTanksEmpty();
|
||||
|
||||
int getRunningTime();
|
||||
|
||||
World getWorldObj();
|
||||
|
||||
BlockPos getBlockPos();
|
||||
|
||||
String getNextBlockRange(String range);
|
||||
|
||||
void provideInformationOfRitualToPlayer(EntityPlayer player);
|
||||
|
||||
void provideInformationOfRangeToPlayer(EntityPlayer player, String range);
|
||||
|
||||
void provideInformationOfWillConfigToPlayer(EntityPlayer player, List<EnumDemonWillType> typeList);
|
||||
|
||||
void setActiveWillConfig(EntityPlayer player, List<EnumDemonWillType> typeList);
|
||||
|
||||
boolean setBlockRangeByBounds(EntityPlayer player, String range, BlockPos offset1, BlockPos offset2);
|
||||
|
||||
List<EnumDemonWillType> getActiveWillConfig();
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package WayofTime.bloodmagic.ritual.data;
|
||||
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* This interface is for internal implementation only.
|
||||
* <p>
|
||||
* It is provided via the API for easy obtaining of basic data.
|
||||
*/
|
||||
public interface IRitualStone {
|
||||
boolean isRuneType(World world, BlockPos pos, EnumRuneType runeType);
|
||||
|
||||
void setRuneType(World world, BlockPos pos, EnumRuneType runeType);
|
||||
|
||||
interface Tile {
|
||||
boolean isRuneType(EnumRuneType runeType);
|
||||
|
||||
EnumRuneType getRuneType();
|
||||
|
||||
void setRuneType(EnumRuneType runeType);
|
||||
}
|
||||
}
|
396
src/main/java/WayofTime/bloodmagic/ritual/data/Ritual.java
Normal file
396
src/main/java/WayofTime/bloodmagic/ritual/data/Ritual.java
Normal file
|
@ -0,0 +1,396 @@
|
|||
package WayofTime.bloodmagic.ritual.data;
|
||||
|
||||
import WayofTime.bloodmagic.soul.DemonWillHolder;
|
||||
import WayofTime.bloodmagic.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.core.registry.RitualRegistry;
|
||||
import WayofTime.bloodmagic.demonAura.WorldDemonWillHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextComponentTranslation;
|
||||
import net.minecraft.world.World;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
/**
|
||||
* Abstract class for creating new rituals. Rituals need be registered with
|
||||
* {@link RitualRegistry#registerRitual(Ritual, String)}
|
||||
*/
|
||||
public abstract class Ritual {
|
||||
public final ArrayList<RitualComponent> ritualComponents = new ArrayList<RitualComponent>();
|
||||
protected final Map<String, AreaDescriptor> modableRangeMap = new HashMap<String, AreaDescriptor>();
|
||||
protected final Map<String, Integer> volumeRangeMap = new HashMap<String, Integer>();
|
||||
protected final Map<String, Integer> horizontalRangeMap = new HashMap<String, Integer>();
|
||||
protected final Map<String, Integer> verticalRangeMap = new HashMap<String, Integer>();
|
||||
private final String name;
|
||||
private final int crystalLevel;
|
||||
private final int activationCost;
|
||||
private final RitualRenderer renderer;
|
||||
private final String unlocalizedName;
|
||||
|
||||
public Ritual(String name, int crystalLevel, int activationCost, RitualRenderer renderer, String unlocalizedName) {
|
||||
this.name = name;
|
||||
this.crystalLevel = crystalLevel;
|
||||
this.activationCost = activationCost;
|
||||
this.renderer = renderer;
|
||||
this.unlocalizedName = unlocalizedName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param name - The name of the ritual
|
||||
* @param crystalLevel - Required Activation Crystal tier
|
||||
* @param activationCost - Base LP cost for activating the ritual
|
||||
*/
|
||||
public Ritual(String name, int crystalLevel, int activationCost, String unlocalizedName) {
|
||||
this(name, crystalLevel, activationCost, null, unlocalizedName);
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound tag) {
|
||||
NBTTagList tags = tag.getTagList("areas", 10);
|
||||
if (tags.hasNoTags()) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < tags.tagCount(); i++) {
|
||||
NBTTagCompound newTag = tags.getCompoundTagAt(i);
|
||||
String rangeKey = newTag.getString("key");
|
||||
|
||||
NBTTagCompound storedTag = newTag.getCompoundTag("area");
|
||||
AreaDescriptor desc = this.getBlockRange(rangeKey);
|
||||
if (desc != null) {
|
||||
desc.readFromNBT(storedTag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound tag) {
|
||||
NBTTagList tags = new NBTTagList();
|
||||
|
||||
for (Entry<String, AreaDescriptor> entry : modableRangeMap.entrySet()) {
|
||||
NBTTagCompound newTag = new NBTTagCompound();
|
||||
newTag.setString("key", entry.getKey());
|
||||
NBTTagCompound storedTag = new NBTTagCompound();
|
||||
|
||||
entry.getValue().writeToNBT(storedTag);
|
||||
|
||||
newTag.setTag("area", storedTag);
|
||||
|
||||
tags.appendTag(newTag);
|
||||
}
|
||||
|
||||
tag.setTag("areas", tags);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the player attempts to activate the ritual.
|
||||
* <p>
|
||||
* {@link WayofTime.bloodmagic.tile.TileMasterRitualStone#activateRitual(ItemStack, EntityPlayer, Ritual)}
|
||||
*
|
||||
* @param masterRitualStone - The {@link IMasterRitualStone} that the ritual is bound to
|
||||
* @param player - The activating player
|
||||
* @param owner - Owner of the crystal activating this ritual, or the current
|
||||
* owner of the ritual if being reactivated.
|
||||
* @return - Whether activation was successful
|
||||
*/
|
||||
public boolean activateRitual(IMasterRitualStone masterRitualStone, EntityPlayer player, String owner) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called every {@link #getRefreshTime()} ticks while active.
|
||||
* <p>
|
||||
* {@link WayofTime.bloodmagic.tile.TileMasterRitualStone#performRitual(World, BlockPos)}
|
||||
*
|
||||
* @param masterRitualStone - The {@link IMasterRitualStone} that the ritual is bound to
|
||||
*/
|
||||
public abstract void performRitual(IMasterRitualStone masterRitualStone);
|
||||
|
||||
/**
|
||||
* Called when the ritual is stopped for a given {@link Ritual.BreakType}.
|
||||
* <p>
|
||||
* {@link WayofTime.bloodmagic.tile.TileMasterRitualStone#stopRitual(Ritual.BreakType)}
|
||||
*
|
||||
* @param masterRitualStone - The {@link IMasterRitualStone} that the ritual is bound to
|
||||
* @param breakType - The type of break that caused the stoppage.
|
||||
*/
|
||||
public void stopRitual(IMasterRitualStone masterRitualStone, BreakType breakType) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to set the amount of LP drained every {@link #getRefreshTime()}
|
||||
* ticks.
|
||||
*
|
||||
* @return - The amount of LP drained per refresh
|
||||
*/
|
||||
public abstract int getRefreshCost();
|
||||
|
||||
/**
|
||||
* Used to set the refresh rate of the ritual. (How often
|
||||
* {@link #performRitual(IMasterRitualStone)} is called.
|
||||
*
|
||||
* @return - How often to perform the effect in ticks.
|
||||
*/
|
||||
public int getRefreshTime() {
|
||||
return 20;
|
||||
}
|
||||
|
||||
public void addBlockRange(String range, AreaDescriptor defaultRange) {
|
||||
modableRangeMap.put(range, defaultRange);
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to grab the range of a ritual for a given effect.
|
||||
*
|
||||
* @param range - Range that needs to be pulled.
|
||||
* @return -
|
||||
*/
|
||||
public AreaDescriptor getBlockRange(String range) {
|
||||
if (modableRangeMap.containsKey(range)) {
|
||||
return modableRangeMap.get(range);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<String> getListOfRanges() {
|
||||
return new ArrayList<String>(modableRangeMap.keySet());
|
||||
}
|
||||
|
||||
public String getNextBlockRange(String range) {
|
||||
List<String> rangeList = getListOfRanges();
|
||||
|
||||
if (rangeList.isEmpty()) {
|
||||
return "";
|
||||
}
|
||||
|
||||
if (!rangeList.contains(range)) {
|
||||
return rangeList.get(0);
|
||||
}
|
||||
|
||||
boolean hasMatch = false;
|
||||
|
||||
for (String rangeCheck : rangeList) {
|
||||
if (hasMatch) {
|
||||
return rangeCheck;
|
||||
} else if (rangeCheck.equals(range)) {
|
||||
hasMatch = true;
|
||||
}
|
||||
}
|
||||
|
||||
return rangeList.get(0);
|
||||
}
|
||||
|
||||
public boolean setBlockRangeByBounds(String range, IMasterRitualStone master, BlockPos offset1, BlockPos offset2) {
|
||||
AreaDescriptor descriptor = this.getBlockRange(range);
|
||||
World world = master.getWorldObj();
|
||||
BlockPos masterPos = master.getBlockPos();
|
||||
DemonWillHolder holder = WorldDemonWillHandler.getWillHolder(world, masterPos);
|
||||
if (canBlockRangeBeModified(range, descriptor, master, offset1, offset2, holder)) {
|
||||
descriptor.modifyAreaByBlockPositions(offset1, offset2);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected boolean canBlockRangeBeModified(String range, AreaDescriptor descriptor, IMasterRitualStone master, BlockPos offset1, BlockPos offset2, DemonWillHolder holder) {
|
||||
List<EnumDemonWillType> willConfig = master.getActiveWillConfig();
|
||||
int maxVolume = getMaxVolumeForRange(range, willConfig, holder);
|
||||
int maxVertical = getMaxVerticalRadiusForRange(range, willConfig, holder);
|
||||
int maxHorizontal = getMaxHorizontalRadiusForRange(range, willConfig, holder);
|
||||
|
||||
return (maxVolume <= 0 || descriptor.getVolumeForOffsets(offset1, offset2) <= maxVolume) && descriptor.isWithinRange(offset1, offset2, maxVertical, maxHorizontal);
|
||||
}
|
||||
|
||||
protected void setMaximumVolumeAndDistanceOfRange(String range, int volume, int horizontalRadius, int verticalRadius) {
|
||||
volumeRangeMap.put(range, volume);
|
||||
horizontalRangeMap.put(range, horizontalRadius);
|
||||
verticalRangeMap.put(range, verticalRadius);
|
||||
}
|
||||
|
||||
protected boolean checkDescriptorIsWithinRange(AreaDescriptor descriptor, int maxVolume, int maxHorizontal, int maxVertical) {
|
||||
return descriptor.getVolume() <= maxVolume && descriptor.isWithinRange(maxVertical, maxHorizontal);
|
||||
}
|
||||
|
||||
public int getMaxVolumeForRange(String range, List<EnumDemonWillType> activeTypes, DemonWillHolder holder) {
|
||||
return volumeRangeMap.get(range);
|
||||
}
|
||||
|
||||
public int getMaxVerticalRadiusForRange(String range, List<EnumDemonWillType> activeTypes, DemonWillHolder holder) {
|
||||
return verticalRangeMap.get(range);
|
||||
}
|
||||
|
||||
public int getMaxHorizontalRadiusForRange(String range, List<EnumDemonWillType> activeTypes, DemonWillHolder holder) {
|
||||
return horizontalRangeMap.get(range);
|
||||
}
|
||||
|
||||
public ITextComponent getErrorForBlockRangeOnFail(EntityPlayer player, String range, IMasterRitualStone master, BlockPos offset1, BlockPos offset2) {
|
||||
AreaDescriptor descriptor = this.getBlockRange(range);
|
||||
if (descriptor == null) {
|
||||
return new TextComponentTranslation("ritual.bloodmagic.blockRange.tooBig", "?");
|
||||
}
|
||||
|
||||
List<EnumDemonWillType> willConfig = master.getActiveWillConfig();
|
||||
DemonWillHolder holder = WorldDemonWillHandler.getWillHolder(master.getWorldObj(), master.getBlockPos());
|
||||
|
||||
int maxVolume = this.getMaxVolumeForRange(range, willConfig, holder);
|
||||
int maxVertical = this.getMaxVerticalRadiusForRange(range, willConfig, holder);
|
||||
int maxHorizontal = this.getMaxHorizontalRadiusForRange(range, willConfig, holder);
|
||||
|
||||
if (maxVolume > 0 && descriptor.getVolumeForOffsets(offset1, offset2) > maxVolume) {
|
||||
return new TextComponentTranslation("ritual.bloodmagic.blockRange.tooBig", maxVolume);
|
||||
} else {
|
||||
return new TextComponentTranslation("ritual.bloodmagic.blockRange.tooFar", maxVertical, maxHorizontal);
|
||||
}
|
||||
}
|
||||
|
||||
public ITextComponent[] provideInformationOfRitualToPlayer(EntityPlayer player) {
|
||||
return new ITextComponent[]{new TextComponentTranslation(this.getUnlocalizedName() + ".info")};
|
||||
}
|
||||
|
||||
public ITextComponent provideInformationOfRangeToPlayer(EntityPlayer player, String range) {
|
||||
if (getListOfRanges().contains(range)) {
|
||||
return new TextComponentTranslation(this.getUnlocalizedName() + "." + range + ".info");
|
||||
} else {
|
||||
return new TextComponentTranslation("ritual.bloodmagic.blockRange.noRange");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return a list of {@link RitualComponent} for checking the ritual.
|
||||
*/
|
||||
public abstract ArrayList<RitualComponent> getComponents();
|
||||
|
||||
public void addRune(ArrayList<RitualComponent> components, int offset1, int y, int offset2, EnumRuneType rune) {
|
||||
components.add(new RitualComponent(new BlockPos(offset1, y, offset2), rune));
|
||||
}
|
||||
|
||||
public void addOffsetRunes(ArrayList<RitualComponent> components, int offset1, int offset2, int y, EnumRuneType rune) {
|
||||
addRune(components, offset1, y, offset2, rune);
|
||||
addRune(components, offset2, y, offset1, rune);
|
||||
addRune(components, offset1, y, -offset2, rune);
|
||||
addRune(components, -offset2, y, offset1, rune);
|
||||
addRune(components, -offset1, y, offset2, rune);
|
||||
addRune(components, offset2, y, -offset1, rune);
|
||||
addRune(components, -offset1, y, -offset2, rune);
|
||||
addRune(components, -offset2, y, -offset1, rune);
|
||||
}
|
||||
|
||||
public void addCornerRunes(ArrayList<RitualComponent> components, int offset, int y, EnumRuneType rune) {
|
||||
addRune(components, offset, y, offset, rune);
|
||||
addRune(components, offset, y, -offset, rune);
|
||||
addRune(components, -offset, y, -offset, rune);
|
||||
addRune(components, -offset, y, offset, rune);
|
||||
}
|
||||
|
||||
public void addParallelRunes(ArrayList<RitualComponent> components, int offset, int y, EnumRuneType rune) {
|
||||
addRune(components, offset, y, 0, rune);
|
||||
addRune(components, -offset, y, 0, rune);
|
||||
addRune(components, 0, y, -offset, rune);
|
||||
addRune(components, 0, y, offset, rune);
|
||||
}
|
||||
|
||||
public double getWillRespectingConfig(World world, BlockPos pos, EnumDemonWillType type, List<EnumDemonWillType> willConfig) {
|
||||
return willConfig.contains(type) ? WorldDemonWillHandler.getCurrentWill(world, pos, type) : 0;
|
||||
}
|
||||
|
||||
public abstract Ritual getNewCopy();
|
||||
|
||||
public ArrayList<RitualComponent> getRitualComponents() {
|
||||
return ritualComponents;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public int getCrystalLevel() {
|
||||
return crystalLevel;
|
||||
}
|
||||
|
||||
public int getActivationCost() {
|
||||
return activationCost;
|
||||
}
|
||||
|
||||
public RitualRenderer getRenderer() {
|
||||
return renderer;
|
||||
}
|
||||
|
||||
public String getUnlocalizedName() {
|
||||
return unlocalizedName;
|
||||
}
|
||||
|
||||
public Map<String, AreaDescriptor> getModableRangeMap() {
|
||||
return modableRangeMap;
|
||||
}
|
||||
|
||||
public Map<String, Integer> getVolumeRangeMap() {
|
||||
return volumeRangeMap;
|
||||
}
|
||||
|
||||
public Map<String, Integer> getHorizontalRangeMap() {
|
||||
return horizontalRangeMap;
|
||||
}
|
||||
|
||||
public Map<String, Integer> getVerticalRangeMap() {
|
||||
return verticalRangeMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this)
|
||||
.append("ritualComponents", ritualComponents)
|
||||
.append("name", name)
|
||||
.append("crystalLevel", crystalLevel)
|
||||
.append("activationCost", activationCost)
|
||||
.append("renderer", renderer)
|
||||
.append("unlocalizedName", unlocalizedName)
|
||||
.append("modableRangeMap", modableRangeMap)
|
||||
.append("volumeRangeMap", volumeRangeMap)
|
||||
.append("horizontalRangeMap", horizontalRangeMap)
|
||||
.append("verticalRangeMap", verticalRangeMap)
|
||||
.append("refreshTime", getRefreshTime())
|
||||
.append("listOfRanges", getListOfRanges())
|
||||
.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof Ritual)) return false;
|
||||
|
||||
Ritual ritual = (Ritual) o;
|
||||
|
||||
if (crystalLevel != ritual.crystalLevel) return false;
|
||||
if (activationCost != ritual.activationCost) return false;
|
||||
if (name != null ? !name.equals(ritual.name) : ritual.name != null) return false;
|
||||
return unlocalizedName != null ? unlocalizedName.equals(ritual.unlocalizedName) : ritual.unlocalizedName == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = name != null ? name.hashCode() : 0;
|
||||
result = 31 * result + crystalLevel;
|
||||
result = 31 * result + activationCost;
|
||||
result = 31 * result + (unlocalizedName != null ? unlocalizedName.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
public enum BreakType {
|
||||
REDSTONE,
|
||||
BREAK_MRS,
|
||||
BREAK_STONE,
|
||||
ACTIVATE,
|
||||
DEACTIVATE,
|
||||
EXPLOSION,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
package WayofTime.bloodmagic.ritual.data;
|
||||
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
/**
|
||||
* Used to set a {@link EnumRuneType} type to a given {@link BlockPos} for usage
|
||||
* in Ritual creation.
|
||||
*/
|
||||
public class RitualComponent {
|
||||
private final BlockPos offset;
|
||||
private final EnumRuneType runeType;
|
||||
|
||||
public RitualComponent(BlockPos offset, EnumRuneType runeType) {
|
||||
this.offset = offset;
|
||||
this.runeType = runeType;
|
||||
}
|
||||
|
||||
public int getX(EnumFacing direction) {
|
||||
switch (direction) {
|
||||
case EAST:
|
||||
return -this.getOffset().getZ();
|
||||
case SOUTH:
|
||||
return -this.getOffset().getX();
|
||||
case WEST:
|
||||
return this.getOffset().getZ();
|
||||
default:
|
||||
return this.getOffset().getX();
|
||||
}
|
||||
}
|
||||
|
||||
public int getY() {
|
||||
return this.getOffset().getY();
|
||||
}
|
||||
|
||||
public int getZ(EnumFacing direction) {
|
||||
switch (direction) {
|
||||
case EAST:
|
||||
return this.getOffset().getX();
|
||||
case SOUTH:
|
||||
return -this.getOffset().getZ();
|
||||
case WEST:
|
||||
return -this.getOffset().getX();
|
||||
default:
|
||||
return this.getOffset().getZ();
|
||||
}
|
||||
}
|
||||
|
||||
public BlockPos getOffset(EnumFacing direction) {
|
||||
return new BlockPos(getX(direction), offset.getY(), getZ(direction));
|
||||
}
|
||||
|
||||
public BlockPos getOffset() {
|
||||
return offset;
|
||||
}
|
||||
|
||||
public EnumRuneType getRuneType() {
|
||||
return runeType;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package WayofTime.bloodmagic.ritual.data;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public abstract class RitualRenderer {
|
||||
public abstract void renderAt(IMasterRitualStone masterRitualStone, double x, double y, double z);
|
||||
|
||||
protected void bindTexture(ResourceLocation resourceLocation) {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package WayofTime.bloodmagic.ritual.data.imperfect;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* This interface is for internal implementation only.
|
||||
* <p>
|
||||
* It is provided via the API for easy obtaining of basic data.
|
||||
*/
|
||||
public interface IImperfectRitualStone {
|
||||
|
||||
boolean performRitual(World world, BlockPos pos, ImperfectRitual imperfectRitual, EntityPlayer player);
|
||||
|
||||
World getRitualWorld();
|
||||
|
||||
BlockPos getRitualPos();
|
||||
}
|
|
@ -0,0 +1,97 @@
|
|||
package WayofTime.bloodmagic.ritual.data.imperfect;
|
||||
|
||||
import WayofTime.bloodmagic.util.BlockStack;
|
||||
import WayofTime.bloodmagic.core.registry.ImperfectRitualRegistry;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* Abstract class for creating new imperfect rituals. ImperfectRituals need be
|
||||
* registered with
|
||||
* {@link ImperfectRitualRegistry#registerRitual(ImperfectRitual)}
|
||||
*/
|
||||
public abstract class ImperfectRitual {
|
||||
|
||||
private final String name;
|
||||
private final BlockStack requiredBlock;
|
||||
private final int activationCost;
|
||||
private final boolean lightshow;
|
||||
private final String unlocalizedName;
|
||||
|
||||
public ImperfectRitual(String name, BlockStack requiredBlock, int activationCost, boolean lightshow, String unlocalizedName) {
|
||||
this.name = name;
|
||||
this.requiredBlock = requiredBlock;
|
||||
this.activationCost = activationCost;
|
||||
this.lightshow = lightshow;
|
||||
this.unlocalizedName = unlocalizedName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param name - The name of the ritual
|
||||
* @param requiredBlock - The block required above the ImperfectRitualStone
|
||||
* @param activationCost - Base LP cost for activating the ritual
|
||||
*/
|
||||
public ImperfectRitual(String name, BlockStack requiredBlock, int activationCost, String unlocalizedName) {
|
||||
this(name, requiredBlock, activationCost, false, unlocalizedName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the player activates the ritual
|
||||
* {@link WayofTime.bloodmagic.tile.TileImperfectRitualStone#performRitual(World, net.minecraft.util.math.BlockPos, ImperfectRitual, EntityPlayer)}
|
||||
*
|
||||
* @param imperfectRitualStone - The {@link IImperfectRitualStone} that the ritual is bound to
|
||||
* @param player - The player activating the ritual
|
||||
* @return - Whether activation was successful
|
||||
*/
|
||||
public abstract boolean onActivate(IImperfectRitualStone imperfectRitualStone, EntityPlayer player);
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public BlockStack getRequiredBlock() {
|
||||
return requiredBlock;
|
||||
}
|
||||
|
||||
public int getActivationCost() {
|
||||
return activationCost;
|
||||
}
|
||||
|
||||
public boolean isLightshow() {
|
||||
return lightshow;
|
||||
}
|
||||
|
||||
public String getUnlocalizedName() {
|
||||
return unlocalizedName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getName() + ":" + getRequiredBlock().toString() + "@" + getActivationCost();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof ImperfectRitual)) return false;
|
||||
|
||||
ImperfectRitual that = (ImperfectRitual) o;
|
||||
|
||||
if (activationCost != that.activationCost) return false;
|
||||
if (lightshow != that.lightshow) return false;
|
||||
if (name != null ? !name.equals(that.name) : that.name != null) return false;
|
||||
if (requiredBlock != null ? !requiredBlock.equals(that.requiredBlock) : that.requiredBlock != null)
|
||||
return false;
|
||||
return unlocalizedName != null ? unlocalizedName.equals(that.unlocalizedName) : that.unlocalizedName == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = name != null ? name.hashCode() : 0;
|
||||
result = 31 * result + (requiredBlock != null ? requiredBlock.hashCode() : 0);
|
||||
result = 31 * result + activationCost;
|
||||
result = 31 * result + (lightshow ? 1 : 0);
|
||||
result = 31 * result + (unlocalizedName != null ? unlocalizedName.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
@ParametersAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
package WayofTime.bloodmagic.ritual.data.imperfect;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
|
@ -1,9 +1,9 @@
|
|||
package WayofTime.bloodmagic.ritual.harvest;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.BlockStack;
|
||||
import WayofTime.bloodmagic.apibutnotreally.iface.IHarvestHandler;
|
||||
import WayofTime.bloodmagic.apibutnotreally.registry.HarvestRegistry;
|
||||
import WayofTime.bloodmagic.util.BlockStack;
|
||||
import WayofTime.bloodmagic.iface.IHarvestHandler;
|
||||
import WayofTime.bloodmagic.core.registry.HarvestRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockCrops;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package WayofTime.bloodmagic.ritual.harvest;
|
||||
|
||||
import WayofTime.bloodmagic.apibutnotreally.BlockStack;
|
||||
import WayofTime.bloodmagic.apibutnotreally.iface.IHarvestHandler;
|
||||
import WayofTime.bloodmagic.apibutnotreally.registry.HarvestRegistry;
|
||||
import WayofTime.bloodmagic.util.BlockStack;
|
||||
import WayofTime.bloodmagic.iface.IHarvestHandler;
|
||||
import WayofTime.bloodmagic.core.registry.HarvestRegistry;
|
||||
import net.minecraft.block.BlockStem;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.init.Blocks;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package WayofTime.bloodmagic.ritual.harvest;
|
||||
|
||||
import WayofTime.bloodmagic.apibutnotreally.BlockStack;
|
||||
import WayofTime.bloodmagic.apibutnotreally.iface.IHarvestHandler;
|
||||
import WayofTime.bloodmagic.apibutnotreally.registry.HarvestRegistry;
|
||||
import WayofTime.bloodmagic.util.BlockStack;
|
||||
import WayofTime.bloodmagic.iface.IHarvestHandler;
|
||||
import WayofTime.bloodmagic.core.registry.HarvestRegistry;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package WayofTime.bloodmagic.ritual.imperfect;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.BlockStack;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.imperfect.IImperfectRitualStone;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.imperfect.ImperfectRitual;
|
||||
import WayofTime.bloodmagic.util.BlockStack;
|
||||
import WayofTime.bloodmagic.ritual.data.imperfect.IImperfectRitualStone;
|
||||
import WayofTime.bloodmagic.ritual.data.imperfect.ImperfectRitual;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package WayofTime.bloodmagic.ritual.imperfect;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.BlockStack;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.imperfect.IImperfectRitualStone;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.imperfect.ImperfectRitual;
|
||||
import WayofTime.bloodmagic.util.BlockStack;
|
||||
import WayofTime.bloodmagic.ritual.data.imperfect.IImperfectRitualStone;
|
||||
import WayofTime.bloodmagic.ritual.data.imperfect.ImperfectRitual;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package WayofTime.bloodmagic.ritual.imperfect;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.BlockStack;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.imperfect.IImperfectRitualStone;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.imperfect.ImperfectRitual;
|
||||
import WayofTime.bloodmagic.util.BlockStack;
|
||||
import WayofTime.bloodmagic.ritual.data.imperfect.IImperfectRitualStone;
|
||||
import WayofTime.bloodmagic.ritual.data.imperfect.ImperfectRitual;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package WayofTime.bloodmagic.ritual.imperfect;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.BlockStack;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.imperfect.IImperfectRitualStone;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.imperfect.ImperfectRitual;
|
||||
import WayofTime.bloodmagic.util.BlockStack;
|
||||
import WayofTime.bloodmagic.ritual.data.imperfect.IImperfectRitualStone;
|
||||
import WayofTime.bloodmagic.ritual.data.imperfect.ImperfectRitual;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.MobEffects;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package WayofTime.bloodmagic.ritual.imperfect;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.BlockStack;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.imperfect.IImperfectRitualStone;
|
||||
import WayofTime.bloodmagic.apibutnotreally.ritual.imperfect.ImperfectRitual;
|
||||
import WayofTime.bloodmagic.util.BlockStack;
|
||||
import WayofTime.bloodmagic.ritual.data.imperfect.IImperfectRitualStone;
|
||||
import WayofTime.bloodmagic.ritual.data.imperfect.ImperfectRitual;
|
||||
import net.minecraft.entity.monster.EntityZombie;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package WayofTime.bloodmagic.ritual.portal;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.apibutnotreally.BloodMagicAPI;
|
||||
import WayofTime.bloodmagic.apibutnotreally.teleport.PortalLocation;
|
||||
import WayofTime.bloodmagic.util.PleaseStopUsingMe;
|
||||
import WayofTime.bloodmagic.teleport.PortalLocation;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
|
||||
import java.io.*;
|
||||
|
@ -27,12 +27,12 @@ public class LocationsHandler implements Serializable {
|
|||
updateFile(fileName, portals);
|
||||
}
|
||||
if (!portals.get(name).isEmpty() && portals.get(name).size() >= 2) {
|
||||
BloodMagicAPI.logger.info("Location " + name + " already exists.");
|
||||
PleaseStopUsingMe.logger.info("Location " + name + " already exists.");
|
||||
updateFile(fileName, portals);
|
||||
return false;
|
||||
} else {
|
||||
portals.get(name).add(location);
|
||||
BloodMagicAPI.logger.info("Adding " + name);
|
||||
PleaseStopUsingMe.logger.info("Adding " + name);
|
||||
updateFile(fileName, portals);
|
||||
return true;
|
||||
}
|
||||
|
@ -42,11 +42,11 @@ public class LocationsHandler implements Serializable {
|
|||
if (portals.get(name) != null && !portals.get(name).isEmpty()) {
|
||||
if (portals.get(name).contains(location)) {
|
||||
portals.get(name).remove(location);
|
||||
BloodMagicAPI.logger.info("Removing " + name);
|
||||
PleaseStopUsingMe.logger.info("Removing " + name);
|
||||
updateFile(fileName, portals);
|
||||
return true;
|
||||
} else {
|
||||
BloodMagicAPI.logger.info("No location matching " + name);
|
||||
PleaseStopUsingMe.logger.info("No location matching " + name);
|
||||
updateFile(fileName, portals);
|
||||
return false;
|
||||
}
|
||||
|
@ -75,10 +75,10 @@ public class LocationsHandler implements Serializable {
|
|||
if (!file.exists()) {
|
||||
if (file.getParentFile().mkdir()) {
|
||||
if (file.createNewFile()) {
|
||||
BloodMagicAPI.logger.info("Creating " + fileName + " in " + String.valueOf(DimensionManager.getCurrentSaveRootDirectory()));
|
||||
PleaseStopUsingMe.logger.info("Creating " + fileName + " in " + String.valueOf(DimensionManager.getCurrentSaveRootDirectory()));
|
||||
}
|
||||
} else if (file.createNewFile()) {
|
||||
BloodMagicAPI.logger.info("Creating " + fileName + " in " + String.valueOf(DimensionManager.getCurrentSaveRootDirectory()));
|
||||
PleaseStopUsingMe.logger.info("Creating " + fileName + " in " + String.valueOf(DimensionManager.getCurrentSaveRootDirectory()));
|
||||
}
|
||||
}
|
||||
FileInputStream fileIn = new FileInputStream(file);
|
||||
|
@ -90,7 +90,7 @@ public class LocationsHandler implements Serializable {
|
|||
} catch (IOException e) {
|
||||
return null;
|
||||
} catch (ClassNotFoundException e) {
|
||||
BloodMagicAPI.logger.error(String.valueOf(file) + " was not found in " + String.valueOf(DimensionManager.getCurrentSaveRootDirectory()));
|
||||
PleaseStopUsingMe.logger.error(String.valueOf(file) + " was not found in " + String.valueOf(DimensionManager.getCurrentSaveRootDirectory()));
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package WayofTime.bloodmagic.ritual.portal;
|
||||
|
||||
import WayofTime.bloodmagic.apibutnotreally.event.TeleposeEvent;
|
||||
import WayofTime.bloodmagic.apibutnotreally.saving.SoulNetwork;
|
||||
import WayofTime.bloodmagic.apibutnotreally.teleport.Teleport;
|
||||
import WayofTime.bloodmagic.apibutnotreally.util.helper.NetworkHelper;
|
||||
import WayofTime.bloodmagic.event.TeleposeEvent;
|
||||
import WayofTime.bloodmagic.core.data.SoulNetwork;
|
||||
import WayofTime.bloodmagic.teleport.Teleport;
|
||||
import WayofTime.bloodmagic.util.helper.NetworkHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue