Compare commits

...
8 changed files with 34 additions and 11 deletions

No files matched your search

@@ -26,7 +26,9 @@ import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
version = References.VERSION,
canBeDeactivated = false,
guiFactory = References.GUIFACTORY,
dependencies = "after:NotEnoughItems;" + "after:ThermalExpansion;" + "after:ThermalFoundation;")
dependencies = "after:NotEnoughItems;" + "after:ThermalExpansion;"
+ "after:ThermalFoundation;"
+ "required-after:gtnhlib@[0.9.47,);")
public class DraconicEvolution {
@Mod.Instance(References.MODID)
@@ -28,6 +28,7 @@ import com.brandon3055.draconicevolution.client.utils.guicomponents.GUIBase;
import com.brandon3055.draconicevolution.common.container.ContainerAdvTool;
import com.brandon3055.draconicevolution.common.handler.ContributorHandler;
import com.brandon3055.draconicevolution.common.items.weapons.BowHandler;
import com.brandon3055.draconicevolution.common.items.weapons.IEnergyContainerBowItem;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.network.ContributorPacket;
import com.brandon3055.draconicevolution.common.network.ItemConfigPacket;
@@ -310,11 +311,11 @@ public class GUIToolConfig extends GUIBase {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
if (slot > -1) editingItem = player.inventory.getStackInSlot(slot);
if (slot > -1 && editingItem != null && editingItem.getUnlocalizedName().toLowerCase().contains("bow")) {
if (slot > -1 && editingItem != null && editingItem.getItem() instanceof IEnergyContainerBowItem) {
BowHandler.BowProperties properties = new BowHandler.BowProperties(editingItem, player);
if (!properties.canFire() && properties.cantFireMessage != null
&& !properties.cantFireMessage.equals("msg.de.outOfArrows.name")) {
&& !properties.cantFireMessage.equals("msg.de.outOfArrows.txt")) {
fontRendererObj.drawSplitString(
StatCollector.translateToLocal(properties.cantFireMessage),
0,
@@ -139,6 +139,17 @@ public final class HudHandler {
showShieldHud = false;
return;
}
if (!shouldDisplayArmorHud(summary)) {
showShieldHud = false;
armorStatsFadeOut = 0F;
maxShieldPoints = 0F;
shieldPoints = 0F;
shieldPercentCharge = 0;
shieldEntropy = 0F;
rfCharge = 0;
rfTotal = 0;
return;
}
showShieldHud = armorStatsFadeOut > 0F;
if (maxShieldPoints != summary.maxProtectionPoints || shieldPoints != summary.protectionPoints
@@ -155,6 +166,10 @@ public final class HudHandler {
rfTotal = summary.totalEnergyStored;
}
private boolean shouldDisplayArmorHud(ArmorSummary summary) {
return summary.maxProtectionPoints > 0F || summary.maxTotalEnergyStorage > 0;
}
private void drawArmorHUD(int x, int y, boolean rotated, double scale) {
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_ALPHA_TEST);
@@ -35,6 +35,7 @@ public class ModelRenderOBJ extends ModelRenderer {
this.compileDisplayList(scale);
}
ResourceHandler.bindTexture(texture);
GL11.glTranslatef(this.offsetX, this.offsetY, this.offsetZ);
if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) {
@@ -84,7 +85,6 @@ public class ModelRenderOBJ extends ModelRenderer {
GL11.glNewList(this.displayList, GL11.GL_COMPILE);
GL11.glPushMatrix();
ResourceHandler.bindTexture(texture);
// scale = 1F/15F;
GL11.glScalef(scale, scale, scale);
GL11.glRotatef(180, -1, 0, 1);
@@ -102,6 +102,7 @@ public class ModelRenderOBJ extends ModelRenderer {
this.compileDisplayList(scale);
}
ResourceHandler.bindTexture(texture);
GL11.glPushMatrix();
GL11.glTranslatef(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale);
if (this.rotateAngleY != 0.0F) {
@@ -158,8 +158,8 @@ public class BowHandler {
public int calculateEnergyCost() {
updateValues();
double rfCost = (bow.getItem() instanceof IEnergyContainerWeaponItem)
? ((IEnergyContainerWeaponItem) bow.getItem()).getEnergyPerAttack()
double rfCost = (bow.getItem() instanceof IEnergyContainerBowItem)
? ((IEnergyContainerBowItem) bow.getItem()).getEnergyPerAttack()
: 80;
rfCost *= 1 + arrowDamage;
@@ -175,7 +175,7 @@ public class BowHandler {
updateValues();
if (player == null) return false;
if (!(bow.getItem() instanceof IEnergyContainerWeaponItem)) {
if (!(bow.getItem() instanceof IEnergyContainerBowItem)) {
cantFireMessage = "[Error] This bow is not a valid energy container (This is a bug, Please report on the Draconic Evolution github)";
return false;
} else if (!energyBolt && shockWavePower > 0) {
@@ -184,7 +184,7 @@ public class BowHandler {
} else if (energyBolt && explosionPower > 0) {
cantFireMessage = "msg.de.explosiveNotForEnergyBolts.txt";
return false;
} else if (calculateEnergyCost() > ((IEnergyContainerWeaponItem) bow.getItem()).getEnergyStored(bow)
} else if (calculateEnergyCost() > ((IEnergyContainerBowItem) bow.getItem()).getEnergyStored(bow)
&& !player.capabilities.isCreativeMode) {
cantFireMessage = "msg.de.insufficientPowerToFire.txt";
return false;
@@ -223,7 +223,7 @@ public class BowHandler {
public boolean consumeArrowAndEnergy() {
if (!player.capabilities.isCreativeMode)
((IEnergyContainerWeaponItem) bow.getItem()).extractEnergy(bow, calculateEnergyCost(), false);
((IEnergyContainerBowItem) bow.getItem()).extractEnergy(bow, calculateEnergyCost(), false);
if (!energyBolt && EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, bow) == 0
&& !player.capabilities.isCreativeMode) {
@@ -39,7 +39,7 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class DraconicBow extends ItemBow
implements IInventoryTool, IUpgradableItem, IEnergyContainerWeaponItem, IHudDisplayItem {
implements IInventoryTool, IUpgradableItem, IEnergyContainerBowItem, IHudDisplayItem {
public static final String[] bowPullIconNameArray = new String[] { "pulling_0", "pulling_1", "pulling_2" };
@@ -0,0 +1,4 @@
package com.brandon3055.draconicevolution.common.items.weapons;
public interface IEnergyContainerBowItem extends IEnergyContainerWeaponItem {
}
@@ -39,7 +39,7 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class WyvernBow extends ItemBow
implements IInventoryTool, IUpgradableItem, IEnergyContainerWeaponItem, IHudDisplayItem {
implements IInventoryTool, IUpgradableItem, IEnergyContainerBowItem, IHudDisplayItem {
public static final String[] bowPullIconNameArray = new String[] { "pulling_0", "pulling_1", "pulling_2" };