this doesn't compile yet, but have something to peek at

This commit is contained in:
Nicholas Ignoffo 2017-08-14 20:53:42 -07:00
parent 973f1019a5
commit 5fcdd978d7
329 changed files with 3247 additions and 2953 deletions

View file

@ -25,7 +25,6 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.Potion;
@ -33,7 +32,6 @@ import net.minecraft.potion.PotionEffect;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
@ -46,12 +44,10 @@ import net.minecraftforge.common.ISpecialArmor.ArmorProperties;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fluids.IFluidBlock;
import net.minecraftforge.fml.common.discovery.ASMDataTable;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.ItemHandlerHelper;
import net.minecraftforge.items.wrapper.InvWrapper;
import net.minecraftforge.items.wrapper.PlayerInvWrapper;
import net.minecraftforge.items.wrapper.PlayerMainInvWrapper;
import net.minecraftforge.items.wrapper.SidedInvWrapper;
import WayofTime.bloodmagic.BloodMagic;
@ -62,7 +58,7 @@ import WayofTime.bloodmagic.api.iface.IDemonWillViewer;
import WayofTime.bloodmagic.api.util.helper.NBTHelper;
import WayofTime.bloodmagic.network.BloodMagicPacketHandler;
import WayofTime.bloodmagic.network.PlayerVelocityPacketProcessor;
import WayofTime.bloodmagic.registry.ModBlocks;
import WayofTime.bloodmagic.registry.RegistrarBloodMagicBlocks;
import WayofTime.bloodmagic.tile.TileInventory;
import com.google.common.collect.Iterables;
@ -142,7 +138,7 @@ public class Utils
public static boolean canEntitySeeBlock(World world, Entity entity, BlockPos pos)
{
Vec3d relativePosition = new Vec3d(entity.posX - pos.getX() - 0.5, entity.posY + (double) entity.getEyeHeight() - pos.getY() - 0.5, entity.posZ - pos.getZ() - 0.5);
EnumFacing dir = EnumFacing.getFacingFromVector((float) relativePosition.xCoord, (float) relativePosition.yCoord, (float) relativePosition.zCoord);
EnumFacing dir = EnumFacing.getFacingFromVector((float) relativePosition.x, (float) relativePosition.y, (float) relativePosition.z);
RayTraceResult result = world.rayTraceBlocks(new Vec3d(entity.posX, entity.posY + (double) entity.getEyeHeight(), entity.posZ), new Vec3d(pos.getX() + 0.5 + dir.getFrontOffsetX() * 0.4, pos.getY() + 0.5 + dir.getFrontOffsetY() * 0.4, pos.getZ() + 0.5 + dir.getFrontOffsetZ() * 0.4), false, true, true);
return result == null || pos.equals(result.getBlockPos());
}
@ -226,7 +222,7 @@ public class Utils
World world = itemEntity.getEntityWorld();
BlockPos pos = itemEntity.getPosition();
ItemStack stack = itemEntity.getEntityItem();
ItemStack stack = itemEntity.getItem();
int planted = plantItemStack(world, pos, stack, horizontalRadius, verticalRadius);
@ -408,13 +404,13 @@ public class Utils
case GLOWSTONE:
return Blocks.GLOWSTONE;
case BLOODSTONE:
return ModBlocks.BLOOD_STONE;
return RegistrarBloodMagicBlocks.DECORATIVE_BRICK;
case BEACON:
return Blocks.BEACON;
case BLOODRUNE:
return ModBlocks.BLOOD_RUNE;
return RegistrarBloodMagicBlocks.BLOOD_RUNE;
case CRYSTAL:
return ModBlocks.CRYSTAL;
return RegistrarBloodMagicBlocks.CRYSTAL;
case NOTAIR:
return Blocks.STONEBRICK;
default:
@ -1016,7 +1012,7 @@ public class Utils
}
}
entityItem.setEntityItemStack(stack);
entityItem.setItem(stack);
return world.spawnEntity(entityItem);
}
@ -1120,7 +1116,7 @@ public class Utils
Class<?> handlerClass = Class.forName(data.getClassName());
Object handlerImpl = handlerClass.newInstance();
MinecraftForge.EVENT_BUS.register(handlerImpl);
BloodMagic.instance.getLogger().debug("Registering event handler for class {}", data.getClassName());
BloodMagic.instance.logger.debug("Registering event handler for class {}", data.getClassName());
} catch (Exception e)
{
// No-op

View file

@ -218,7 +218,7 @@ public class ClientHandler
@SubscribeEvent
public void onModelBake(ModelBakeEvent event)
{
if (BloodMagic.isDev() && SUPPRESS_ASSET_ERRORS)
if (BloodMagic.IS_DEV && SUPPRESS_ASSET_ERRORS)
return;
Stopwatch stopwatch = Stopwatch.createStarted();
@ -228,13 +228,13 @@ public class ClientHandler
// Collect all Blood Magic model errors
List<ResourceLocation> errored = new ArrayList<ResourceLocation>();
for (ResourceLocation modelError : modelErrors.keySet())
if (modelError.getResourceDomain().equalsIgnoreCase(Constants.Mod.MODID))
if (modelError.getResourceDomain().equalsIgnoreCase(BloodMagic.MODID))
errored.add(modelError);
// Collect all Blood Magic variant errors
List<ModelResourceLocation> missing = new ArrayList<ModelResourceLocation>();
for (ModelResourceLocation missingVariant : missingVariants)
if (missingVariant.getResourceDomain().equalsIgnoreCase(Constants.Mod.MODID))
if (missingVariant.getResourceDomain().equalsIgnoreCase(BloodMagic.MODID))
missing.add(missingVariant);
// Remove discovered model errors
@ -245,17 +245,17 @@ public class ClientHandler
missingVariants.removeAll(missing);
if (errored.size() > 0)
BloodMagic.instance.getLogger().info("Suppressed {} model errors from Blood Magic.", errored.size());
BloodMagic.instance.logger.info("Suppressed {} model errors from Blood Magic.", errored.size());
if (missing.size() > 0)
BloodMagic.instance.getLogger().info("Suppressed {} variant errors from Blood Magic.", missing.size());
BloodMagic.instance.getLogger().debug("Suppressed discovered model/variant errors in {}", stopwatch.stop());
BloodMagic.instance.logger.info("Suppressed {} variant errors from Blood Magic.", missing.size());
BloodMagic.instance.logger.debug("Suppressed discovered model/variant errors in {}", stopwatch.stop());
}
// For some reason, we need some bad textures to be listed in the Crystal and Node models. This will hide that from the end user.
@SubscribeEvent
public void onTextureStitch(TextureStitchEvent.Post event)
{
if (BloodMagic.isDev() && SUPPRESS_ASSET_ERRORS)
if (BloodMagic.IS_DEV && SUPPRESS_ASSET_ERRORS)
return;
Stopwatch stopwatch = Stopwatch.createStarted();
@ -284,7 +284,7 @@ public class ClientHandler
missingTextures.keySet().remove(mc);
badTextureDomains.remove(mc);
}
BloodMagic.instance.getLogger().debug("Suppressed required texture errors in {}", stopwatch.stop());
BloodMagic.instance.logger.debug("Suppressed required texture errors in {}", stopwatch.stop());
}
public static void cycleSigil(ItemStack stack, EntityPlayer player, int dWheel)

View file

@ -3,6 +3,7 @@ package WayofTime.bloodmagic.util.handler.event;
import java.util.ArrayList;
import java.util.List;
import WayofTime.bloodmagic.BloodMagic;
import net.minecraft.init.Items;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.ItemBanner;
@ -21,7 +22,7 @@ import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
import WayofTime.bloodmagic.api.util.helper.ItemHelper;
import WayofTime.bloodmagic.api.util.helper.NBTHelper;
import WayofTime.bloodmagic.item.ItemInscriptionTool;
import WayofTime.bloodmagic.registry.ModItems;
import WayofTime.bloodmagic.registry.RegistrarBloodMagicItems;
@Handler
public class CraftingHandler
@ -55,11 +56,11 @@ public class CraftingHandler
{
if (ConfigHandler.thaumcraftGogglesUpgrade)
{
if (event.getLeft().getItem() == ModItems.LIVING_ARMOUR_HELMET && event.getRight().getItem() == Constants.Compat.THAUMCRAFT_GOGGLES && !event.getRight().isItemDamaged())
if (event.getLeft().getItem() == RegistrarBloodMagicItems.LIVING_ARMOUR_HELMET && event.getRight().getItem() == Constants.Compat.THAUMCRAFT_GOGGLES && !event.getRight().isItemDamaged())
{
ItemStack output = new ItemStack(ModItems.UPGRADE_TOME);
ItemStack output = new ItemStack(RegistrarBloodMagicItems.UPGRADE_TOME);
output = NBTHelper.checkNBT(output);
ItemHelper.LivingUpgrades.setKey(output, Constants.Mod.MODID + ".upgrade.revealing");
ItemHelper.LivingUpgrades.setKey(output, BloodMagic.MODID + ".upgrade.revealing");
ItemHelper.LivingUpgrades.setLevel(output, 1);
event.setCost(1);
@ -69,7 +70,7 @@ public class CraftingHandler
}
}
if (event.getLeft().getItem() == ModItems.SIGIL_HOLDING)
if (event.getLeft().getItem() == RegistrarBloodMagicItems.SIGIL_HOLDING)
{
if (event.getRight().getItem() == Items.NAME_TAG)
{
@ -90,7 +91,7 @@ public class CraftingHandler
ItemStack output = event.getLeft().copy();
if (!output.hasTagCompound())
output.setTagCompound(new NBTTagCompound());
output.getTagCompound().setString(Constants.NBT.COLOR, String.valueOf(dyeColor.getMapColor().colorValue));
output.getTagCompound().setString(Constants.NBT.COLOR, String.valueOf(dyeColor.getColorValue()));
event.setCost(1);
event.setOutput(output);
@ -101,9 +102,9 @@ public class CraftingHandler
if (event.getLeft().getItem() == Items.BOOK && event.getRight().getItem() == Items.ELYTRA && !event.getRight().isItemDamaged())
{
ItemStack output = new ItemStack(ModItems.UPGRADE_TOME);
ItemStack output = new ItemStack(RegistrarBloodMagicItems.UPGRADE_TOME);
output = NBTHelper.checkNBT(output);
ItemHelper.LivingUpgrades.setKey(output, Constants.Mod.MODID + ".upgrade.elytra");
ItemHelper.LivingUpgrades.setKey(output, BloodMagic.MODID + ".upgrade.elytra");
ItemHelper.LivingUpgrades.setLevel(output, 1);
event.setCost(30);
@ -112,7 +113,7 @@ public class CraftingHandler
return;
}
if (event.getLeft().getItem() == ModItems.UPGRADE_TOME && event.getRight().getItem() == ModItems.UPGRADE_TOME)
if (event.getLeft().getItem() == RegistrarBloodMagicItems.UPGRADE_TOME && event.getRight().getItem() == RegistrarBloodMagicItems.UPGRADE_TOME)
{
LivingArmourUpgrade leftUpgrade = ItemHelper.LivingUpgrades.getUpgrade(event.getLeft());
if (leftUpgrade != null && !leftUpgrade.isDowngrade() && ItemHelper.LivingUpgrades.getKey(event.getLeft()).equals(ItemHelper.LivingUpgrades.getKey(event.getRight())))
@ -133,7 +134,7 @@ public class CraftingHandler
}
}
if (event.getLeft().getItem() instanceof IUpgradeTrainer && event.getRight().getItem() == ModItems.UPGRADE_TOME)
if (event.getLeft().getItem() instanceof IUpgradeTrainer && event.getRight().getItem() == RegistrarBloodMagicItems.UPGRADE_TOME)
{
LivingArmourUpgrade rightUpgrade = ItemHelper.LivingUpgrades.getUpgrade(event.getRight());
if (rightUpgrade != null)

View file

@ -5,6 +5,7 @@ import java.util.List;
import java.util.Map;
import java.util.Random;
import WayofTime.bloodmagic.BloodMagic;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.enchantment.EnchantmentHelper;
@ -78,7 +79,7 @@ import WayofTime.bloodmagic.livingArmour.upgrade.LivingArmourUpgradeSelfSacrific
import WayofTime.bloodmagic.network.BloodMagicPacketHandler;
import WayofTime.bloodmagic.network.DemonAuraPacketProcessor;
import WayofTime.bloodmagic.potion.BMPotionUtils;
import WayofTime.bloodmagic.registry.ModItems;
import WayofTime.bloodmagic.registry.RegistrarBloodMagicItems;
import WayofTime.bloodmagic.registry.ModPotions;
import WayofTime.bloodmagic.util.ChatUtil;
import WayofTime.bloodmagic.util.Utils;
@ -160,7 +161,7 @@ public class GenericHandler
EntityItem itemEntity = event.getEntityItem();
if (itemEntity != null)
{
ItemStack stack = itemEntity.getEntityItem();
ItemStack stack = itemEntity.getItem();
Item item = stack.getItem();
if (stack.hasTagCompound() && item instanceof ISentientTool)
{
@ -180,7 +181,7 @@ public class GenericHandler
Vec3d position = exp.getPosition();
double radius = 3;
AxisAlignedBB bb = new AxisAlignedBB(position.xCoord - radius, position.yCoord - radius, position.zCoord - radius, position.xCoord + radius, position.yCoord + radius, position.zCoord + radius);
AxisAlignedBB bb = new AxisAlignedBB(position.x - radius, position.y - radius, position.z - radius, position.x + radius, position.y + radius, position.z + radius);
List<EntitySentientSpecter> specterList = world.getEntitiesWithinAABB(EntitySentientSpecter.class, bb);
if (!specterList.isEmpty())
{
@ -201,9 +202,9 @@ public class GenericHandler
if (event.getEntity().getEntityWorld().isRemote)
return;
if (event.getSource().getEntity() instanceof EntityPlayer && !PlayerHelper.isFakePlayer((EntityPlayer) event.getSource().getEntity()))
if (event.getSource().getTrueSource() instanceof EntityPlayer && !PlayerHelper.isFakePlayer((EntityPlayer) event.getSource().getTrueSource()))
{
EntityPlayer player = (EntityPlayer) event.getSource().getEntity();
EntityPlayer player = (EntityPlayer) event.getSource().getTrueSource();
if (!player.getItemStackFromSlot(EntityEquipmentSlot.CHEST).isEmpty() && player.getItemStackFromSlot(EntityEquipmentSlot.CHEST).getItem() instanceof ItemPackSacrifice)
{
@ -224,7 +225,7 @@ public class GenericHandler
if (armour != null)
{
LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgrade(Constants.Mod.MODID + ".upgrade.battleHunger", chestStack);
LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgrade(BloodMagic.MODID + ".upgrade.battleHunger", chestStack);
if (upgrade instanceof LivingArmourUpgradeBattleHungry)
{
((LivingArmourUpgradeBattleHungry) upgrade).resetTimer();
@ -368,7 +369,7 @@ public class GenericHandler
if (ConfigHandler.teleposerBlacklist.contains(event.initialStack) || ConfigHandler.teleposerBlacklist.contains(event.finalStack))
event.setCanceled(true);
if (BloodMagicAPI.getTeleposerBlacklist().contains(event.initialStack) || BloodMagicAPI.getTeleposerBlacklist().contains(event.finalStack))
if (BloodMagicAPI.teleposerBlacklist.contains(event.initialStack) || BloodMagicAPI.teleposerBlacklist.contains(event.finalStack))
event.setCanceled(true);
}
@ -443,7 +444,7 @@ public class GenericHandler
if (armour != null)
{
StatTrackerSelfSacrifice.incrementCounter(armour, event.healthDrained / 2);
LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgrade(Constants.Mod.MODID + ".upgrade.selfSacrifice", chestStack);
LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgrade(BloodMagic.MODID + ".upgrade.selfSacrifice", chestStack);
if (upgrade instanceof LivingArmourUpgradeSelfSacrifice)
{
@ -461,17 +462,17 @@ public class GenericHandler
{
EntityLivingBase attackedEntity = event.getEntityLiving();
DamageSource source = event.getSource();
Entity entity = source.getEntity();
Entity entity = source.getTrueSource();
if (entity != null && entity instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer) entity;
ItemStack heldStack = player.getHeldItemMainhand();
if (!heldStack.isEmpty() && heldStack.getItem() == ModItems.BOUND_SWORD && !(attackedEntity instanceof EntityAnimal))
if (!heldStack.isEmpty() && heldStack.getItem() == RegistrarBloodMagicItems.BOUND_SWORD && !(attackedEntity instanceof EntityAnimal))
for (int i = 0; i <= EnchantmentHelper.getLootingModifier(player); i++)
if (attackedEntity.getEntityWorld().rand.nextDouble() < 0.2)
event.getDrops().add(new EntityItem(attackedEntity.getEntityWorld(), attackedEntity.posX, attackedEntity.posY, attackedEntity.posZ, new ItemStack(ModItems.BLOOD_SHARD, 1, 0)));
event.getDrops().add(new EntityItem(attackedEntity.getEntityWorld(), attackedEntity.posX, attackedEntity.posY, attackedEntity.posZ, new ItemStack(RegistrarBloodMagicItems.BLOOD_SHARD, 1, 0)));
}
}

View file

@ -1,5 +1,6 @@
package WayofTime.bloodmagic.util.handler.event;
import WayofTime.bloodmagic.BloodMagic;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@ -58,7 +59,7 @@ public class LivingArmourHandler
if (armour != null)
{
double modifier = 1;
LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgrade(Constants.Mod.MODID + ".upgrade.slowHeal", chestStack);
LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgrade(BloodMagic.MODID + ".upgrade.slowHeal", chestStack);
if (upgrade instanceof LivingArmourUpgradeSlowHeal)
{
@ -121,7 +122,7 @@ public class LivingArmourHandler
LivingArmour armour = ItemLivingArmour.getLivingArmour(chestStack);
if (armour != null)
{
LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgrade(Constants.Mod.MODID + ".upgrade.stormTrooper", chestStack);
LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgrade(BloodMagic.MODID + ".upgrade.stormTrooper", chestStack);
if (upgrade instanceof LivingArmourUpgradeStormTrooper)
{
@ -151,7 +152,7 @@ public class LivingArmourHandler
{
if (event.getHand() == EnumHand.OFF_HAND)
{
LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgrade(Constants.Mod.MODID + ".upgrade.crippledArm", chestStack);
LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgrade(BloodMagic.MODID + ".upgrade.crippledArm", chestStack);
if (upgrade instanceof LivingArmourUpgradeCrippledArm)
{
@ -164,7 +165,7 @@ public class LivingArmourHandler
ItemStack drinkStack = event.getItemStack();
//TODO: See if the item is a splash potion? Those should be usable.
LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgrade(Constants.Mod.MODID + ".upgrade.quenched", chestStack);
LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgrade(BloodMagic.MODID + ".upgrade.quenched", chestStack);
if (upgrade instanceof LivingArmourUpgradeQuenched)
{
@ -192,7 +193,7 @@ public class LivingArmourHandler
{
StatTrackerGrimReaperSprint.incrementCounter(armour);
LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgrade(Constants.Mod.MODID + ".upgrade.grimReaper", chestStack);
LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgrade(BloodMagic.MODID + ".upgrade.grimReaper", chestStack);
if (upgrade instanceof LivingArmourUpgradeGrimReaperSprint && ((LivingArmourUpgradeGrimReaperSprint) upgrade).canSavePlayer(player))
{
@ -225,7 +226,7 @@ public class LivingArmourHandler
if (!player.isSneaking())
{
LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgradeFromNBT(Constants.Mod.MODID + ".upgrade.jump", chestStack);
LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgradeFromNBT(BloodMagic.MODID + ".upgrade.jump", chestStack);
if (upgrade instanceof LivingArmourUpgradeJump)
{
@ -257,7 +258,7 @@ public class LivingArmourHandler
LivingArmour armour = ItemLivingArmour.getLivingArmourFromStack(chestStack);
if (armour != null)
{
LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgrade(Constants.Mod.MODID + ".upgrade.stepAssist", chestStack);
LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgrade(BloodMagic.MODID + ".upgrade.stepAssist", chestStack);
if (upgrade instanceof LivingArmourUpgradeStepAssist)
{
@ -279,7 +280,7 @@ public class LivingArmourHandler
LivingArmour armour = ItemLivingArmour.getLivingArmourFromStack(chestStack);
if (armour != null)
{
LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgradeFromNBT(Constants.Mod.MODID + ".upgrade.movement", chestStack);
LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgradeFromNBT(BloodMagic.MODID + ".upgrade.movement", chestStack);
if (upgrade instanceof LivingArmourUpgradeSpeed)
{
@ -298,7 +299,7 @@ public class LivingArmourHandler
if (percentIncrease > 0 && (player.onGround || player.capabilities.isFlying) && (Math.abs(player.moveForward) > 0 || Math.abs(player.moveStrafing) > 0))
{
player.moveRelative(player.moveStrafing, player.moveForward, player.capabilities.isFlying ? (percentIncrease / 2.0f) : percentIncrease);
player.moveRelative(player.moveStrafing, player.moveForward, player.capabilities.isFlying ? (percentIncrease / 2.0f) : percentIncrease, 0.02F);
}
}
}
@ -323,7 +324,7 @@ public class LivingArmourHandler
{
StatTrackerArrowShot.incrementCounter(armour);
LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgrade(Constants.Mod.MODID + ".upgrade.arrowShot", chestStack);
LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgrade(BloodMagic.MODID + ".upgrade.arrowShot", chestStack);
if (upgrade instanceof LivingArmourUpgradeArrowShot)
{
int charge = event.getCharge();

View file

@ -1,5 +1,6 @@
package WayofTime.bloodmagic.util.handler.event;
import WayofTime.bloodmagic.BloodMagic;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@ -17,7 +18,6 @@ import net.minecraftforge.event.world.BlockEvent;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import WayofTime.bloodmagic.annot.Handler;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
import WayofTime.bloodmagic.item.armour.ItemLivingArmour;
import WayofTime.bloodmagic.item.armour.ItemSentientArmour;
@ -106,7 +106,7 @@ public class StatTrackerHandler
public void entityHurt(LivingHurtEvent event)
{
DamageSource source = event.getSource();
Entity sourceEntity = event.getSource().getEntity();
Entity sourceEntity = event.getSource().getTrueSource();
EntityLivingBase attackedEntity = event.getEntityLiving();
if (attackedEntity instanceof EntityPlayer)
@ -196,7 +196,7 @@ public class StatTrackerHandler
LivingArmour armour = ItemLivingArmour.getLivingArmour(chestStack);
if (armour != null)
{
LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgrade(Constants.Mod.MODID + ".upgrade.experienced", chestStack);
LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgrade(BloodMagic.MODID + ".upgrade.experienced", chestStack);
if (upgrade instanceof LivingArmourUpgradeExperience)
{
double modifier = ((LivingArmourUpgradeExperience) upgrade).getExperienceModifier();

View file

@ -34,7 +34,7 @@ import WayofTime.bloodmagic.demonAura.PosXY;
import WayofTime.bloodmagic.demonAura.WillChunk;
import WayofTime.bloodmagic.demonAura.WorldDemonWillHandler;
import WayofTime.bloodmagic.entity.projectile.EntitySentientArrow;
import WayofTime.bloodmagic.registry.ModItems;
import WayofTime.bloodmagic.registry.RegistrarBloodMagicItems;
import WayofTime.bloodmagic.registry.ModPotions;
@Handler
@ -47,7 +47,7 @@ public class WillHandler
@SubscribeEvent
public void onItemPickup(EntityItemPickupEvent event)
{
ItemStack stack = event.getItem().getEntityItem();
ItemStack stack = event.getItem().getItem();
if (stack.getItem() instanceof IDemonWill)
{
EntityPlayer player = event.getEntityPlayer();
@ -67,7 +67,7 @@ public class WillHandler
{
if (event.getSource() instanceof EntityDamageSourceIndirect)
{
Entity sourceEntity = event.getSource().getSourceOfDamage();
Entity sourceEntity = event.getSource().getImmediateSource();
if (sourceEntity instanceof EntitySentientArrow)
{
@ -82,7 +82,7 @@ public class WillHandler
{
EntityLivingBase attackedEntity = event.getEntityLiving();
DamageSource source = event.getSource();
Entity entity = source.getEntity();
Entity entity = source.getTrueSource();
if (attackedEntity.isPotionActive(ModPotions.soulSnare) && (attackedEntity instanceof EntityMob || attackedEntity.getEntityWorld().getDifficulty() == EnumDifficulty.PEACEFUL))
{
@ -90,7 +90,7 @@ public class WillHandler
int lvl = eff.getAmplifier();
double amountOfSouls = attackedEntity.getEntityWorld().rand.nextDouble() * (lvl + 1) * (lvl + 1) * 5;
ItemStack soulStack = ((IDemonWill) ModItems.MONSTER_SOUL).createWill(0, amountOfSouls);
ItemStack soulStack = ((IDemonWill) RegistrarBloodMagicItems.MONSTER_SOUL).createWill(0, amountOfSouls);
event.getDrops().add(new EntityItem(attackedEntity.getEntityWorld(), attackedEntity.posX, attackedEntity.posY, attackedEntity.posZ, soulStack));
}
@ -159,18 +159,18 @@ public class WillHandler
public void chunkSave(ChunkDataEvent.Save event)
{
int dim = event.getWorld().provider.getDimension();
ChunkPos loc = event.getChunk().getChunkCoordIntPair();
ChunkPos loc = event.getChunk().getPos();
NBTTagCompound nbt = new NBTTagCompound();
event.getData().setTag("BloodMagic", nbt);
WillChunk ac = WorldDemonWillHandler.getWillChunk(dim, loc.chunkXPos, loc.chunkZPos);
WillChunk ac = WorldDemonWillHandler.getWillChunk(dim, loc.x, loc.z);
if (ac != null)
{
nbt.setShort("base", ac.getBase());
ac.getCurrentWill().writeToNBT(nbt, "current");
if (!event.getChunk().isLoaded())
WorldDemonWillHandler.removeWillChunk(dim, loc.chunkXPos, loc.chunkZPos);
WorldDemonWillHandler.removeWillChunk(dim, loc.x, loc.z);
}
}

View file

@ -1,17 +1,17 @@
package WayofTime.bloodmagic.util.helper;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import WayofTime.bloodmagic.api.recipe.TartaricForgeRecipe;
import WayofTime.bloodmagic.api.registry.AltarRecipeRegistry;
import WayofTime.bloodmagic.api.registry.TartaricForgeRecipeRegistry;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
public class RecipeHelper
{
public static IRecipe getRecipeForOutput(ItemStack stack)
{
for (IRecipe recipe : CraftingManager.getInstance().getRecipeList())
for (IRecipe recipe : ForgeRegistries.RECIPES.getValues())
{
if (recipe != null)
{