Pushed a beta release

This commit is contained in:
WayofTime 2014-12-11 20:08:24 -05:00
parent b30d6de13c
commit f08363b74a
9 changed files with 123 additions and 29 deletions

View file

@ -1,5 +1,5 @@
# #
#Wed Dec 10 11:02:48 EST 2014 #Thu Dec 11 19:56:39 EST 2014
mod_name=BloodMagic mod_name=BloodMagic
forge_version=10.13.2.1232 forge_version=10.13.2.1232
ccc_version=1.0.4.29 ccc_version=1.0.4.29
@ -8,5 +8,5 @@ nei_version=1.0.3.64
package_group=com.wayoftime.bloodmagic package_group=com.wayoftime.bloodmagic
mod_version=1.3.0Beta mod_version=1.3.0Beta
minetweaker_version=Dev-1.7.10-3.0.9B minetweaker_version=Dev-1.7.10-3.0.9B
build_number=5
mc_version=1.7.10 mc_version=1.7.10
build_number=4

View file

@ -137,14 +137,14 @@ public class BloodMagicConfiguration
AlchemicalWizardry.ritualDisabledFullStomach = config.get("Ritual Blacklist", "Requiem of the Satiated Stomach", false).getBoolean(false); AlchemicalWizardry.ritualDisabledFullStomach = config.get("Ritual Blacklist", "Requiem of the Satiated Stomach", false).getBoolean(false);
String tempDemonConfigs = "Temp Demon Configs [2]"; String tempDemonConfigs = "Temp Demon Configs [2]";
// TEDemonPortal.buildingGridDelay = config.get(tempDemonConfigs, "Building Grid Delay", 25).getInt(); TEDemonPortal.buildingGridDelay = config.get(tempDemonConfigs, "Building Grid Delay", 25).getInt();
// TEDemonPortal.roadGridDelay = config.get(tempDemonConfigs, "Road Grid Delay", 10).getInt(); TEDemonPortal.roadGridDelay = config.get(tempDemonConfigs, "Road Grid Delay", 10).getInt();
// TEDemonPortal.demonHoardDelay = config.get(tempDemonConfigs, "Demon Hoard Delay", 40).getInt(); TEDemonPortal.demonHoardDelay = config.get(tempDemonConfigs, "Demon Hoard Delay", 40).getInt();
// TEDemonPortal.demonRoadChance = (float)(config.get(tempDemonConfigs, "Demon Road Chance", 0.3f).getDouble()); TEDemonPortal.demonRoadChance = (float)(config.get(tempDemonConfigs, "Demon Road Chance", 0.3f).getDouble());
// TEDemonPortal.demonHouseChance = (float)(config.get(tempDemonConfigs, "Demon House Chance", 0.6f).getDouble()); TEDemonPortal.demonHouseChance = (float)(config.get(tempDemonConfigs, "Demon House Chance", 0.6f).getDouble());
// TEDemonPortal.demonPortalChance = (float)(config.get(tempDemonConfigs, "Demon Portal Chance", 0.5f).getDouble()); TEDemonPortal.demonPortalChance = (float)(config.get(tempDemonConfigs, "Demon Portal Chance", 0.5f).getDouble());
// TEDemonPortal.demonHoardChance = (float)(config.get(tempDemonConfigs, "Demon Hoard Chance", 0.8f).getDouble()); TEDemonPortal.demonHoardChance = (float)(config.get(tempDemonConfigs, "Demon Hoard Chance", 0.8f).getDouble());
// TEDemonPortal.portalTickRate = (float)(config.get(tempDemonConfigs, "Portal Tick Rate", 0.1f).getDouble()); TEDemonPortal.portalTickRate = (float)(config.get(tempDemonConfigs, "Portal Tick Rate", 0.1f).getDouble());
DemonVillagePath.canGoDown = config.get(tempDemonConfigs, "canRoadGoDown", true).getBoolean(); DemonVillagePath.canGoDown = config.get(tempDemonConfigs, "canRoadGoDown", true).getBoolean();
DemonVillagePath.tunnelIfObstructed = config.get(tempDemonConfigs, "tunnelIfObstructed", false).getBoolean(); DemonVillagePath.tunnelIfObstructed = config.get(tempDemonConfigs, "tunnelIfObstructed", false).getBoolean();
@ -158,6 +158,8 @@ public class BloodMagicConfiguration
{ {
RenderHelper.xOffset = config.get("ClientSettings", "AlchemyHUDxOffset", 50).getInt(); RenderHelper.xOffset = config.get("ClientSettings", "AlchemyHUDxOffset", 50).getInt();
RenderHelper.yOffset = config.get("ClientSettings", "AlchemyHUDyOffset", 2).getInt(); RenderHelper.yOffset = config.get("ClientSettings", "AlchemyHUDyOffset", 2).getInt();
RenderHelper.lpBarX = config.get("ClientSettings", "LPHUDxOffset", 12).getInt();
RenderHelper.lpBarY = config.get("ClientSettings", "LPHUDyOffset", 75).getInt();
} }
config.save(); config.save();

View file

@ -5,22 +5,26 @@ import net.minecraft.nbt.NBTTagCompound;
public class LifeEssenceNetwork extends net.minecraft.world.WorldSavedData public class LifeEssenceNetwork extends net.minecraft.world.WorldSavedData
{ {
public int currentEssence; public int currentEssence;
public int maxOrb;
public LifeEssenceNetwork(String par1Str) public LifeEssenceNetwork(String par1Str)
{ {
super(par1Str); super(par1Str);
currentEssence = 0; currentEssence = 0;
maxOrb = 0;
} }
@Override @Override
public void readFromNBT(NBTTagCompound nbttagcompound) public void readFromNBT(NBTTagCompound nbttagcompound)
{ {
currentEssence = nbttagcompound.getInteger("currentEssence"); currentEssence = nbttagcompound.getInteger("currentEssence");
maxOrb = nbttagcompound.getInteger("maxOrb");
} }
@Override @Override
public void writeToNBT(NBTTagCompound nbttagcompound) public void writeToNBT(NBTTagCompound nbttagcompound)
{ {
nbttagcompound.setInteger("currentEssence", currentEssence); nbttagcompound.setInteger("currentEssence", currentEssence);
nbttagcompound.setInteger("maxOrb", maxOrb);
} }
} }

View file

@ -53,6 +53,66 @@ public class SoulNetworkHandler
return syphonFromNetwork(event.ownerNetwork, event.drainAmount) >= damageToBeDone; return syphonFromNetwork(event.ownerNetwork, event.drainAmount) >= damageToBeDone;
} }
public static int getCurrentMaxOrb(String ownerName)
{
if (MinecraftServer.getServer() == null)
{
return 0;
}
World world = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName);
if (data == null)
{
data = new LifeEssenceNetwork(ownerName);
world.setItemData(ownerName, data);
}
return data.maxOrb;
}
public static void setMaxOrbToMax(String ownerName, int maxOrb)
{
if (MinecraftServer.getServer() == null)
{
return;
}
World world = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName);
if (data == null)
{
data = new LifeEssenceNetwork(ownerName);
world.setItemData(ownerName, data);
}
data.maxOrb = Math.max(maxOrb, data.maxOrb);
data.markDirty();
}
public static int getMaximumForOrbTier(int maxOrb)
{
switch(maxOrb)
{
case 1:
return 5000;
case 2:
return 25000;
case 3:
return 150000;
case 4:
return 1000000;
case 5:
return 10000000;
case 6:
return 30000000;
default:
return 1;
}
}
public static int syphonFromNetwork(ItemStack ist, int damageToBeDone) public static int syphonFromNetwork(ItemStack ist, int damageToBeDone)
{ {

View file

@ -34,6 +34,23 @@ public class APISpellHelper
data.setInteger("BM:StoredLP", amount); data.setInteger("BM:StoredLP", amount);
} }
public static int getPlayerMaxLPTag(EntityPlayer player)
{
NBTTagCompound data = player.getEntityData();
if(data.hasKey("BM:MaxStoredLP"))
{
return data.getInteger("BM:MaxStoredLP");
}
return 0;
}
public static void setPlayerMaxLPTag(EntityPlayer player, int amount)
{
NBTTagCompound data = player.getEntityData();
data.setInteger("BM:MaxStoredLP", amount);
}
public static MovingObjectPosition raytraceFromEntity(World world, Entity player, boolean par3, double range) public static MovingObjectPosition raytraceFromEntity(World world, Entity player, boolean par3, double range)
{ {
float f = 1.0F; float f = 1.0F;

View file

@ -33,6 +33,9 @@ public class RenderHelper
public static boolean enabled = true; public static boolean enabled = true;
public static boolean showInChat = true; public static boolean showInChat = true;
public static int lpBarX = 12;
public static int lpBarY = 75;
public static int zLevel = 0; public static int zLevel = 0;
private static int xOffsetDefault = +50; private static int xOffsetDefault = +50;
@ -72,10 +75,15 @@ public class RenderHelper
if(reagentStack != null && reagentStack.amount > 0) if(reagentStack != null && reagentStack.amount > 0)
{ {
renderTestHUD(mc, reagentStack, maxAmount); // renderTestHUD(mc, reagentStack, maxAmount);
} }
renderLPHUD(mc, APISpellHelper.getPlayerLPTag(player), 10000000); int max = APISpellHelper.getPlayerMaxLPTag(player);
if(max > 1)
{
renderLPHUD(mc, APISpellHelper.getPlayerLPTag(player), max);
}
} }
return true; return true;
@ -87,10 +95,10 @@ public class RenderHelper
int xSize = 32; int xSize = 32;
int ySize = 32; int ySize = 32;
int amount = (int) (256 * ((double)(maxAmount - lpAmount) / maxAmount)); int amount = Math.max((int) (256 * ((double)(maxAmount - lpAmount) / maxAmount)), 0);
int x = (16 + 32 - xSize) / 2 * 8; int x = (lpBarX - xSize / 2) * 8;
int y = (150 - ySize) / 2 * 8; int y = (lpBarY - ySize / 2) * 8;
ResourceLocation test2 = new ResourceLocation("alchemicalwizardry", "textures/gui/container1.png"); ResourceLocation test2 = new ResourceLocation("alchemicalwizardry", "textures/gui/container1.png");
GL11.glColor4f(1, 0, 0, 1.0F); GL11.glColor4f(1, 0, 0, 1.0F);
@ -211,7 +219,7 @@ public class RenderHelper
int xSize = 32; int xSize = 32;
int ySize = 32; int ySize = 32;
int amount = 256 * (maxAmount - reagentStack.amount) / maxAmount; int amount = Math.max((int) (256 * ((double)(maxAmount - reagentStack.amount) / maxAmount)), 0);
int x = (16 - xSize) / 2 * 8; int x = (16 - xSize) / 2 * 8;
int y = (150 - ySize) / 2 * 8; int y = (150 - ySize) / 2 * 8;

View file

@ -25,6 +25,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.Vec3; import net.minecraft.util.Vec3;
import net.minecraftforge.client.event.FOVUpdateEvent;
import net.minecraftforge.event.AnvilUpdateEvent; import net.minecraftforge.event.AnvilUpdateEvent;
import net.minecraftforge.event.entity.living.EnderTeleportEvent; import net.minecraftforge.event.entity.living.EnderTeleportEvent;
import net.minecraftforge.event.entity.living.LivingAttackEvent; import net.minecraftforge.event.entity.living.LivingAttackEvent;
@ -239,11 +240,11 @@ public class AlchemicalWizardryEventHooks
} }
} }
// @ForgeSubscribe @SubscribeEvent
// public void onFOVUpdate(FOVUpdateEvent event) public void onFOVUpdate(FOVUpdateEvent event)
// { {
// event.setResult(Result.DEFAULT); event.setResult(Result.DENY);
// } }
// @SubscribeEvent // @SubscribeEvent
// public void onPlayerTickEnd(PlayerTickEvent event) // public void onPlayerTickEnd(PlayerTickEvent event)
@ -269,15 +270,12 @@ public class AlchemicalWizardryEventHooks
if (entityLiving instanceof EntityPlayer) if (entityLiving instanceof EntityPlayer)
{ {
if(!entityLiving.worldObj.isRemote) if(!entityLiving.worldObj.isRemote && entityLiving.worldObj.getTotalWorldTime() % 20 == 0)
{ {
// APISpellHelper.setPlayerLPTag((EntityPlayer)entityLiving, SoulNetworkHandler.getCurrentEssence(SoulNetworkHandler.getUsername((EntityPlayer)entityLiving)));
// ((EntityPlayer) entityLiving).sendPlayerAbilities();
if(entityLiving instanceof EntityPlayerMP) if(entityLiving instanceof EntityPlayerMP)
{ {
// System.out.println("Sending Packet"); String ownerName = SoulNetworkHandler.getUsername((EntityPlayer)entityLiving);
NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getLPPacket(SoulNetworkHandler.getCurrentEssence(SoulNetworkHandler.getUsername((EntityPlayer)entityLiving)), 1000), (EntityPlayerMP)entityLiving); NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getLPPacket(SoulNetworkHandler.getCurrentEssence(ownerName), SoulNetworkHandler.getMaximumForOrbTier(SoulNetworkHandler.getCurrentMaxOrb(ownerName))), (EntityPlayerMP)entityLiving);
} }
} }
ObfuscationReflectionHelper.setPrivateValue(PlayerCapabilities.class, ((EntityPlayer) event.entityLiving).capabilities, Float.valueOf(0.1f), new String[]{"walkSpeed", "g", "field_75097_g"}); ObfuscationReflectionHelper.setPrivateValue(PlayerCapabilities.class, ((EntityPlayer) event.entityLiving).capabilities, Float.valueOf(0.1f), new String[]{"walkSpeed", "g", "field_75097_g"});

View file

@ -263,8 +263,8 @@ public enum NewPacketHandler
{ {
EntityPlayer player = Minecraft.getMinecraft().thePlayer; EntityPlayer player = Minecraft.getMinecraft().thePlayer;
System.out.println("" + msg.currentLP + ", " + msg.maxLP);
APISpellHelper.setPlayerLPTag(player, msg.currentLP); APISpellHelper.setPlayerLPTag(player, msg.currentLP);
APISpellHelper.setPlayerMaxLPTag(player, msg.maxLP);
} }
} }

View file

@ -75,6 +75,11 @@ public class EnergyBattery extends Item implements ArmourUpgrade, IBindable, IBl
{ {
return par1ItemStack; return par1ItemStack;
} }
if(itemTag.getString("ownerName").equals(SpellHelper.getUsername(par3EntityPlayer)))
{
SoulNetworkHandler.setMaxOrbToMax(itemTag.getString("ownerName"), this.orbLevel);
}
SoulNetworkHandler.addCurrentEssenceToMaximum(itemTag.getString("ownerName"), 200, this.getMaxEssence()); SoulNetworkHandler.addCurrentEssenceToMaximum(itemTag.getString("ownerName"), 200, this.getMaxEssence());
EnergyItems.hurtPlayer(par3EntityPlayer, 200); EnergyItems.hurtPlayer(par3EntityPlayer, 200);