Bug Fixes and Sixth Sense Visual Improvement (#886)
This commit is contained in:
@@ -60,10 +60,12 @@ public class RenderSixthSense {
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
RenderManager renderManager = event.getRenderer().getRenderManager();
|
||||
float effectRadius = Spells.sixth_sense.getProperty(Spell.EFFECT_RADIUS).floatValue();
|
||||
float distance = event.getEntity().getDistance(mc.player);
|
||||
|
||||
if(mc.player.isPotionActive(WizardryPotions.sixth_sense) && !(event.getEntity() instanceof EntityArmorStand)
|
||||
&& event.getEntity() != mc.player && mc.player.getActivePotionEffect(WizardryPotions.sixth_sense) != null
|
||||
&& event.getEntity().getDistance(mc.player) < Spells.sixth_sense.getProperty(Spell.EFFECT_RADIUS).floatValue()
|
||||
&& distance < effectRadius
|
||||
* (1 + mc.player.getActivePotionEffect(WizardryPotions.sixth_sense).getAmplifier() * Constants.RANGE_INCREASE_PER_LEVEL)){
|
||||
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
@@ -87,7 +89,13 @@ public class RenderSixthSense {
|
||||
GlStateManager.rotate(180 - renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
|
||||
GlStateManager.rotate(yaw, 1.0F, 0.0F, 0.0F);
|
||||
|
||||
GlStateManager.color(1, 1, 1, 1);
|
||||
//Decreases the opacity of the marker after 80% of the effect distance
|
||||
float alpha = 1f;
|
||||
float f = 5 * (1f - distance / effectRadius);
|
||||
if (f <= 1) {
|
||||
alpha = f;
|
||||
}
|
||||
GlStateManager.color(1, 1, 1, alpha);
|
||||
|
||||
ResourceLocation texture = PASSIVE_MOB_MARKER_TEXTURE;
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ public final class Constants {
|
||||
/** The fraction by which spell blast radius is increased for each level of range upgrade. */
|
||||
public static float BLAST_RADIUS_INCREASE_PER_LEVEL = 0.25f;
|
||||
/** The fraction by which movement speed is reduced per level of frost effect. */
|
||||
public static final double FROST_SLOWNESS_PER_LEVEL = 0.5;
|
||||
public static double FROST_SLOWNESS_PER_LEVEL = 0.5;
|
||||
/** The fraction by which movement speed is reduced per level of decay effect. */
|
||||
public static final double DECAY_SLOWNESS_PER_LEVEL = 0.2;
|
||||
/** The fraction by which dig speed is reduced per level of frostbite effect. */
|
||||
@@ -56,6 +56,6 @@ public final class Constants {
|
||||
DURATION_INCREASE_PER_LEVEL = (float) Wizardry.settings.durationIncreasePerLevel;
|
||||
RANGE_INCREASE_PER_LEVEL = (float) Wizardry.settings.rangeIncreasePerLevel;
|
||||
BLAST_RADIUS_INCREASE_PER_LEVEL = (float) Wizardry.settings.blastIncreasePerLevel;
|
||||
RANGE_INCREASE_PER_LEVEL = (float) Wizardry.settings.frostSlownessIncreasePerLevel;
|
||||
FROST_SLOWNESS_PER_LEVEL = (float) Wizardry.settings.frostSlownessIncreasePerLevel;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -735,7 +735,7 @@ public class ItemWand extends Item implements IWorkbenchItem, ISpellCastingItem,
|
||||
Item specialUpgrade = upgrade.getItem();
|
||||
|
||||
int maxUpgrades = this.tier.upgradeLimit;
|
||||
if(this.element == Element.MAGIC) maxUpgrades += Constants.NON_ELEMENTAL_UPGRADE_BONUS;
|
||||
if(this.element == null) maxUpgrades += Constants.NON_ELEMENTAL_UPGRADE_BONUS;
|
||||
|
||||
if(WandHelper.getTotalUpgrades(wand) < maxUpgrades
|
||||
&& WandHelper.getUpgradeLevel(wand, specialUpgrade) < Constants.UPGRADE_STACK_LIMIT){
|
||||
|
||||
@@ -130,17 +130,7 @@ public final class WizardryPotions {
|
||||
registerPotion(registry, "decay", new PotionDecay(true, 0x3c006c));
|
||||
|
||||
registerPotion(registry, "sixth_sense", new PotionMagicEffect(false, 0xc6ff01,
|
||||
new ResourceLocation(Wizardry.MODID, "textures/gui/potion_icons/sixth_sense.png")){
|
||||
@Override
|
||||
public void performEffect(EntityLivingBase target, int strength){
|
||||
// Reset the shader (a bit dirty but both the potion expiry hooks are only fired server-side, and
|
||||
// there's no point sending packets unnecessarily if we can just do this instead)
|
||||
if(target.getActivePotionEffect(this).getDuration() <= 1 && target.world.isRemote
|
||||
&& target == net.minecraft.client.Minecraft.getMinecraft().player){
|
||||
net.minecraft.client.Minecraft.getMinecraft().entityRenderer.stopUseShader();
|
||||
}
|
||||
}
|
||||
}.setBeneficial());
|
||||
new ResourceLocation(Wizardry.MODID, "textures/gui/potion_icons/sixth_sense.png")).setBeneficial());
|
||||
|
||||
registerPotion(registry, "arcane_jammer", new PotionMagicEffect(true, 0xcf4aa2,
|
||||
new ResourceLocation(Wizardry.MODID, "textures/gui/potion_icons/arcane_jammer.png")));
|
||||
|
||||
Reference in New Issue
Block a user