Potential fix for Zephyr ritual dupe bug, some adjustments to rendering of a fancy new health bar.

This commit is contained in:
WayofTime 2015-01-12 17:04:44 -05:00
parent 8315dcf864
commit ca74a33a12
8 changed files with 110 additions and 38 deletions

View file

@ -113,6 +113,7 @@ import WayofTime.alchemicalWizardry.common.harvest.PamHarvestCompatRegistry;
import WayofTime.alchemicalWizardry.common.items.ItemRitualDiviner;
import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfHolding;
import WayofTime.alchemicalWizardry.common.items.thaumcraft.ItemSanguineArmour;
import WayofTime.alchemicalWizardry.common.omega.OmegaParadigmEarth;
import WayofTime.alchemicalWizardry.common.omega.OmegaParadigmWater;
import WayofTime.alchemicalWizardry.common.omega.OmegaRegistry;
import WayofTime.alchemicalWizardry.common.potion.PotionBoost;
@ -1311,6 +1312,7 @@ public class AlchemicalWizardry
ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.baseAlchemyItems, 1, 8), new ReagentStack(ReagentRegistry.potentiaReagent, 1000));
OmegaRegistry.registerParadigm(ReagentRegistry.aquasalusReagent, new OmegaParadigmWater(ModItems.boundHelmetWater, ModItems.boundPlateWater, ModItems.boundLeggingsWater, ModItems.boundBootsWater));
OmegaRegistry.registerParadigm(ReagentRegistry.terraeReagent, new OmegaParadigmEarth(ModItems.boundHelmetEarth, ModItems.boundPlateEarth, ModItems.boundLeggingsEarth, ModItems.boundBootsEarth));
}
public static void initDemonPacketRegistiry()

View file

@ -80,7 +80,7 @@ public class RenderHelper
{
float val = APISpellHelper.getPlayerCurrentReagentAmount(player);
ReagentStack reagentStack = new ReagentStack(APISpellHelper.getPlayerReagentType(player), (int) val);
if(reagentStack != null && reagentStack.amount > 0)
{
renderTestHUD(mc, reagentStack, maxAmount);
@ -273,14 +273,14 @@ public class RenderHelper
int x = (lpBarX + 16 - xSize / 2) * 8;
int y = (lpBarY - ySize / 2) * 8;
ResourceLocation test2 = new ResourceLocation("alchemicalwizardry", "textures/gui/container1.png");
GL11.glColor4f(reagent.getColourRed(), reagent.getColourGreen(), reagent.getColourBlue(), 1.0F);
mc.getTextureManager().bindTexture(test2);
GL11.glScalef(1f/8f, 1f/8f, 1f/8f);
ResourceLocation test2 = new ResourceLocation("alchemicalwizardry", "textures/gui/container1.png");
GL11.glColor4f(reagent.getColourRed() / 255f, reagent.getColourGreen() / 255f, reagent.getColourBlue() / 255f, 1.0F);
mc.getTextureManager().bindTexture(test2);
drawTexturedModalRect(x, y + amount, 0, amount, 256, 256 - amount);
ResourceLocation test = new ResourceLocation("alchemicalwizardry", "textures/gui/container.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.getTextureManager().bindTexture(test);

View file

@ -1,10 +1,17 @@
package WayofTime.alchemicalWizardry.common.items.armour;
import java.util.UUID;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.entity.Entity;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.item.ItemStack;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaEarth;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
public class OmegaArmourEarth extends OmegaArmour
{
public OmegaArmourEarth(int armorType)
@ -29,4 +36,17 @@ public class OmegaArmourEarth extends OmegaArmour
{
return new ModelOmegaEarth(0.5f, false, false, true, false);
}
@Override
public Multimap getItemAttributeModifiers()
{
Multimap map = HashMultimap.create();
map.put(SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(179618 /** Random number **/, armorType), "Armor modifier" + armorType, getKnockbackResist(), 0));
return map;
}
public float getKnockbackResist()
{
return 0.25f;
}
}

View file

@ -0,0 +1,24 @@
package WayofTime.alchemicalWizardry.common.omega;
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
import WayofTime.alchemicalWizardry.common.items.armour.OmegaArmour;
public class OmegaParadigmEarth extends OmegaParadigm
{
public OmegaParadigmEarth(OmegaArmour helmet, OmegaArmour chestPiece, OmegaArmour leggings, OmegaArmour boots)
{
super(ReagentRegistry.terraeReagent, helmet, chestPiece, leggings, boots, new ReagentRegenConfiguration(50, 10, 100));
}
// @Override
// public float getCostPerTickOfUse(EntityPlayer player)
// {
// if(player.isInWater())
// {
// return 0.5f;
// }else
// {
// return 1;
// }
// }
}

View file

@ -1,12 +1,8 @@
package WayofTime.alchemicalWizardry.common.rituals;
import WayofTime.alchemicalWizardry.ModBlocks;
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
import WayofTime.alchemicalWizardry.api.rituals.RitualEffect;
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.init.Blocks;
@ -16,9 +12,14 @@ import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import java.util.ArrayList;
import java.util.List;
import net.minecraftforge.common.util.ForgeDirection;
import WayofTime.alchemicalWizardry.ModBlocks;
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
import WayofTime.alchemicalWizardry.api.rituals.RitualEffect;
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
public class RitualEffectCrushing extends RitualEffect
{
@ -126,7 +127,7 @@ public class RitualEffectCrushing extends RitualEffect
ItemStack item = new ItemStack(block, 1, meta);
ItemStack copyStack = item.copyItemStack(item);
SpellHelper.insertStackIntoInventory(copyStack, tileEntity);
SpellHelper.insertStackIntoInventory(copyStack, tileEntity, ForgeDirection.DOWN);
if (copyStack.stackSize > 0)
{
@ -156,7 +157,7 @@ public class RitualEffectCrushing extends RitualEffect
this.canDrainReagent(ritualStone, ReagentRegistry.incendiumReagent, incendiumDrain, true);
}
SpellHelper.insertStackIntoInventory(copyStack, tileEntity);
SpellHelper.insertStackIntoInventory(copyStack, tileEntity, ForgeDirection.DOWN);
if (copyStack.stackSize > 0)
{
world.spawnEntityInWorld(new EntityItem(world, x + 0.4, y + 2, z + 0.5, copyStack));

View file

@ -1,20 +1,20 @@
package WayofTime.alchemicalWizardry.common.rituals;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
import WayofTime.alchemicalWizardry.api.rituals.RitualEffect;
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import net.minecraft.block.BlockFurnace;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import java.util.ArrayList;
import java.util.List;
public class RitualEffectItemSuction extends RitualEffect
{
@ -75,7 +75,7 @@ public class RitualEffectItemSuction extends RitualEffect
ItemStack copyStack = itemEntity.getEntityItem().copy();
int pastAmount = copyStack.stackSize;
ItemStack newStack = SpellHelper.insertStackIntoInventory(copyStack, tileEntity);
ItemStack newStack = SpellHelper.insertStackIntoInventory(copyStack, tileEntity, ForgeDirection.DOWN);
if (newStack != null && newStack.stackSize < pastAmount)
{
@ -92,7 +92,6 @@ public class RitualEffectItemSuction extends RitualEffect
}
if (hasReductus)
{
BlockFurnace d;
this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, true);
}
}

View file

@ -6,6 +6,7 @@ import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
@ -30,11 +31,11 @@ public class RitualEffectOmegaTest extends RitualEffect
int x = ritualStone.getXCoord();
int y = ritualStone.getYCoord();
int z = ritualStone.getZCoord();
if (world.getWorldTime() % 200 != 0)
{
return;
}
//
// if (world.getWorldTime() % 200 != 0)
// {
// return;
// }
double range = 2;
@ -44,14 +45,16 @@ public class RitualEffectOmegaTest extends RitualEffect
{
// OmegaParadigm waterParadigm = new OmegaParadigm(ReagentRegistry.aquasalusReagent, ModItems.boundHelmetWater, ModItems.boundPlateWater, ModItems.boundLeggingsWater, ModItems.boundBootsWater, new ReagentRegenConfiguration(1, 1, 1));
OmegaParadigm waterParadigm = OmegaRegistry.getParadigmForReagent(ReagentRegistry.aquasalusReagent);
Reagent reagent = ReagentRegistry.terraeReagent;
OmegaParadigm waterParadigm = OmegaRegistry.getParadigmForReagent(reagent);
waterParadigm.convertPlayerArmour(player);
APISpellHelper.setPlayerCurrentReagentAmount(player, tickDuration);
APISpellHelper.setPlayerMaxReagentAmount(player, tickDuration);
APISpellHelper.setPlayerReagentType(player, ReagentRegistry.aquasalusReagent);
APISpellHelper.setPlayerReagentType(player, reagent);
APISpellHelper.setCurrentAdditionalMaxHP(player, waterParadigm.getMaxAdditionalHealth());
NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getReagentBarPacket(ReagentRegistry.aquasalusReagent, APISpellHelper.getPlayerCurrentReagentAmount(player), APISpellHelper.getPlayerMaxReagentAmount(player)), (EntityPlayerMP)player);
NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getReagentBarPacket(reagent, APISpellHelper.getPlayerCurrentReagentAmount(player), APISpellHelper.getPlayerMaxReagentAmount(player)), (EntityPlayerMP)player);
}
}

View file

@ -15,6 +15,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Blocks;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
@ -499,15 +500,37 @@ public class SpellHelper
return returned;
}
public static ItemStack insertStackIntoInventory(ItemStack stack, IInventory inventory)
public static ItemStack insertStackIntoInventory(ItemStack stack, IInventory inventory, ForgeDirection dir)
{
if (stack == null)
{
return stack;
}
boolean[] canBeInserted = new boolean[inventory.getSizeInventory()];
if(inventory instanceof ISidedInventory)
{
int[] array = ((ISidedInventory)inventory).getAccessibleSlotsFromSide(dir.ordinal());
for(int in : array)
{
canBeInserted[in] = true;
}
}else
{
for(int i=0; i<canBeInserted.length; i++)
{
canBeInserted[i] = true;
}
}
for (int i = 0; i < inventory.getSizeInventory(); i++)
{
if(!canBeInserted[i])
{
continue;
}
ItemStack[] combinedStacks = combineStacks(stack, inventory.getStackInSlot(i));
stack = combinedStacks[0];
inventory.setInventorySlotContents(i, combinedStacks[1]);