This commit is contained in:
Pheonix 2022-03-13 22:15:56 +00:00
parent 6d6712aa98
commit 2f7bb54c3a
8 changed files with 5269 additions and 5142 deletions

View File

@ -20,6 +20,12 @@ public class HbmPlayerProps implements IExtendedEntityProperties {
private boolean[] keysPressed = new boolean[EnumKeybind.values().length]; private boolean[] keysPressed = new boolean[EnumKeybind.values().length];
public static final int dashCooldownLength = 10;
public int dashCooldown = 0;
public int totalDashCount = 0;
public int stamina = 0;
public HbmPlayerProps(EntityPlayer player) { public HbmPlayerProps(EntityPlayer player) {
this.player = player; this.player = player;
} }
@ -69,6 +75,33 @@ public class HbmPlayerProps implements IExtendedEntityProperties {
keysPressed[key.ordinal()] = pressed; keysPressed[key.ordinal()] = pressed;
} }
public void setDashCooldown(int cooldown) {
this.dashCooldown = cooldown;
return;
}
public int getDashCooldown() {
return this.dashCooldown;
}
public void setStamina(int stamina) {
this.stamina = stamina;
return;
}
public int getStamina() {
return this.stamina;
}
public void setDashCount(int count) {
this.totalDashCount = count;
return;
}
public int getDashCount() {
return this.totalDashCount;
}
@Override @Override
public void init(Entity entity, World world) { } public void init(Entity entity, World world) { }

View File

@ -4800,16 +4800,17 @@ public class ModItems {
schrabidium_plate = new ArmorFSB(MainRegistry.aMatSchrab, 7, 1, RefStrings.MODID + ":textures/armor/schrabidium_1.png").cloneStats((ArmorFSB) schrabidium_helmet).setUnlocalizedName("schrabidium_plate").setTextureName(RefStrings.MODID + ":schrabidium_plate"); schrabidium_plate = new ArmorFSB(MainRegistry.aMatSchrab, 7, 1, RefStrings.MODID + ":textures/armor/schrabidium_1.png").cloneStats((ArmorFSB) schrabidium_helmet).setUnlocalizedName("schrabidium_plate").setTextureName(RefStrings.MODID + ":schrabidium_plate");
schrabidium_legs = new ArmorFSB(MainRegistry.aMatSchrab, 7, 2, RefStrings.MODID + ":textures/armor/schrabidium_2.png").cloneStats((ArmorFSB) schrabidium_helmet).setCap(4F).setMod(0.1F).setUnlocalizedName("schrabidium_legs").setTextureName(RefStrings.MODID + ":schrabidium_legs"); schrabidium_legs = new ArmorFSB(MainRegistry.aMatSchrab, 7, 2, RefStrings.MODID + ":textures/armor/schrabidium_2.png").cloneStats((ArmorFSB) schrabidium_helmet).setCap(4F).setMod(0.1F).setUnlocalizedName("schrabidium_legs").setTextureName(RefStrings.MODID + ":schrabidium_legs");
schrabidium_boots = new ArmorFSB(MainRegistry.aMatSchrab, 7, 3, RefStrings.MODID + ":textures/armor/schrabidium_1.png").cloneStats((ArmorFSB) schrabidium_helmet).setCap(4F).setMod(0.1F).setUnlocalizedName("schrabidium_boots").setTextureName(RefStrings.MODID + ":schrabidium_boots"); schrabidium_boots = new ArmorFSB(MainRegistry.aMatSchrab, 7, 3, RefStrings.MODID + ":textures/armor/schrabidium_1.png").cloneStats((ArmorFSB) schrabidium_helmet).setCap(4F).setMod(0.1F).setUnlocalizedName("schrabidium_boots").setTextureName(RefStrings.MODID + ":schrabidium_boots");
bismuth_helmet = new ArmorBismuth(MainRegistry.aMatBismuth, 7, 0, RefStrings.MODID + ":textures/armor/starmetal_1.png").setCap(8F).setMod(0.75F) bismuth_helmet = new ArmorBismuth(MainRegistry.aMatBismuth, 7, 0, RefStrings.MODID + ":textures/armor/starmetal_1.png").setCap(8F).setMod(0.3F)
.addResistance("fall", 0) .addResistance("fall", 0)
.addEffect(new PotionEffect(Potion.jump.id, 20, 6)) .addEffect(new PotionEffect(Potion.jump.id, 20, 6))
.addEffect(new PotionEffect(Potion.moveSpeed.id, 20, 6)) .addEffect(new PotionEffect(Potion.moveSpeed.id, 20, 6))
.addEffect(new PotionEffect(Potion.regeneration.id, 20, 1)) .addEffect(new PotionEffect(Potion.regeneration.id, 20, 1))
.addEffect(new PotionEffect(Potion.nightVision.id, 15 * 20, 0)) .addEffect(new PotionEffect(Potion.nightVision.id, 15 * 20, 0))
.setDashCount(3)
.setUnlocalizedName("bismuth_helmet").setTextureName(RefStrings.MODID + ":bismuth_helmet"); .setUnlocalizedName("bismuth_helmet").setTextureName(RefStrings.MODID + ":bismuth_helmet");
bismuth_plate = new ArmorBismuth(MainRegistry.aMatBismuth, 7, 1, RefStrings.MODID + ":textures/armor/starmetal_2.png").cloneStats((ArmorFSB) bismuth_helmet).setCap(8F).setMod(0.75F).setUnlocalizedName("bismuth_plate").setTextureName(RefStrings.MODID + ":bismuth_plate"); bismuth_plate = new ArmorBismuth(MainRegistry.aMatBismuth, 7, 1, RefStrings.MODID + ":textures/armor/starmetal_2.png").cloneStats((ArmorFSB) bismuth_helmet).setCap(8F).setMod(0.3F).setUnlocalizedName("bismuth_plate").setTextureName(RefStrings.MODID + ":bismuth_plate");
bismuth_legs = new ArmorBismuth(MainRegistry.aMatBismuth, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_1.png").cloneStats((ArmorFSB) bismuth_helmet).setCap(8F).setMod(0.75F).setUnlocalizedName("bismuth_legs").setTextureName(RefStrings.MODID + ":bismuth_legs"); bismuth_legs = new ArmorBismuth(MainRegistry.aMatBismuth, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_1.png").cloneStats((ArmorFSB) bismuth_helmet).setCap(8F).setMod(0.3F).setUnlocalizedName("bismuth_legs").setTextureName(RefStrings.MODID + ":bismuth_legs");
bismuth_boots = new ArmorBismuth(MainRegistry.aMatBismuth, 7, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png").cloneStats((ArmorFSB) bismuth_helmet).setCap(8F).setMod(0.75F).setUnlocalizedName("bismuth_boots").setTextureName(RefStrings.MODID + ":bismuth_boots"); bismuth_boots = new ArmorBismuth(MainRegistry.aMatBismuth, 7, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png").cloneStats((ArmorFSB) bismuth_helmet).setCap(8F).setMod(0.3F).setUnlocalizedName("bismuth_boots").setTextureName(RefStrings.MODID + ":bismuth_boots");
titanium_helmet = new ArmorFSB(MainRegistry.aMatTitan, 7, 0, RefStrings.MODID + ":textures/armor/titanium_1.png").setMod(0.85F).setUnlocalizedName("titanium_helmet").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":titanium_helmet"); titanium_helmet = new ArmorFSB(MainRegistry.aMatTitan, 7, 0, RefStrings.MODID + ":textures/armor/titanium_1.png").setMod(0.85F).setUnlocalizedName("titanium_helmet").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":titanium_helmet");
titanium_plate = new ArmorFSB(MainRegistry.aMatTitan, 7, 1, RefStrings.MODID + ":textures/armor/titanium_1.png").cloneStats((ArmorFSB) titanium_helmet).setUnlocalizedName("titanium_plate").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":titanium_plate"); titanium_plate = new ArmorFSB(MainRegistry.aMatTitan, 7, 1, RefStrings.MODID + ":textures/armor/titanium_1.png").cloneStats((ArmorFSB) titanium_helmet).setUnlocalizedName("titanium_plate").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":titanium_plate");
titanium_legs = new ArmorFSB(MainRegistry.aMatTitan, 7, 2, RefStrings.MODID + ":textures/armor/titanium_2.png").cloneStats((ArmorFSB) titanium_helmet).setUnlocalizedName("titanium_legs").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":titanium_legs"); titanium_legs = new ArmorFSB(MainRegistry.aMatTitan, 7, 2, RefStrings.MODID + ":textures/armor/titanium_2.png").cloneStats((ArmorFSB) titanium_helmet).setUnlocalizedName("titanium_legs").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":titanium_legs");

View File

@ -8,6 +8,7 @@ import java.util.Map.Entry;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.hbm.extprop.HbmPlayerProps;
import com.hbm.handler.radiation.ChunkRadiationManager; import com.hbm.handler.radiation.ChunkRadiationManager;
import com.hbm.util.I18nUtil; import com.hbm.util.I18nUtil;
@ -60,6 +61,7 @@ public class ArmorFSB extends ItemArmor {
public boolean customGeiger = false; public boolean customGeiger = false;
public boolean hardLanding = false; public boolean hardLanding = false;
public double gravity = 0; public double gravity = 0;
public int dashCount = 0;
public String step; public String step;
public String jump; public String jump;
public String fall; public String fall;
@ -149,6 +151,11 @@ public class ArmorFSB extends ItemArmor {
return this; return this;
} }
public ArmorFSB setDashCount(int dashCount) {
this.dashCount = dashCount;
return this;
}
public ArmorFSB setStep(String step) { public ArmorFSB setStep(String step) {
this.step = step; this.step = step;
return this; return this;
@ -188,6 +195,7 @@ public class ArmorFSB extends ItemArmor {
this.customGeiger = original.customGeiger; this.customGeiger = original.customGeiger;
this.hardLanding = original.hardLanding; this.hardLanding = original.hardLanding;
this.gravity = original.gravity; this.gravity = original.gravity;
this.dashCount = original.dashCount;
this.step = original.step; this.step = original.step;
this.jump = original.jump; this.jump = original.jump;
this.fall = original.fall; this.fall = original.fall;
@ -271,6 +279,10 @@ public class ArmorFSB extends ItemArmor {
list.add(EnumChatFormatting.BLUE + " " + I18nUtil.resolveKey("armor.gravity", gravity)); list.add(EnumChatFormatting.BLUE + " " + I18nUtil.resolveKey("armor.gravity", gravity));
} }
if(dashCount > 0) {
list.add(EnumChatFormatting.AQUA + " " + I18nUtil.resolveKey("armor.dash", dashCount));
}
if(protectionYield != 100F) { if(protectionYield != 100F) {
list.add(EnumChatFormatting.BLUE + " Protection applies to damage <" + protectionYield); list.add(EnumChatFormatting.BLUE + " Protection applies to damage <" + protectionYield);
} }
@ -448,6 +460,35 @@ public class ArmorFSB extends ItemArmor {
} catch(Exception x) { } catch(Exception x) {
} }
} }
boolean v1enabled = true;
if(dashCount > 0) {
int perDash = 64;
HbmPlayerProps props = (HbmPlayerProps) player.getExtendedProperties("NTM_EXT_PLAYER");
props.setDashCount(dashCount);
if(props.getDashCooldown() <= 0) {
if(!player.capabilities.isFlying && player.isSneaking() && props.getStamina() >= perDash) {
Vec3 lookingIn = player.getLookVec();
player.addVelocity(lookingIn.xCoord, 0, lookingIn.zCoord);
props.setDashCooldown(HbmPlayerProps.dashCooldownLength);
props.setStamina(props.getStamina() - perDash);
}
} else {
props.setDashCooldown(props.getDashCooldown() - 1);
}
if(props.getStamina() < props.getDashCount() * perDash) {
props.setStamina(props.getStamina() + 1);
}
}
} }
} }

View File

@ -244,6 +244,15 @@ public class ModEventHandlerClient {
tess.draw(); tess.draw();
GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_TEXTURE_2D);
}
if(ArmorFSB.hasFSBArmor(player)) {
ArmorFSB chestplate = (ArmorFSB)player.inventory.armorInventory[2].getItem();
if(chestplate.dashCount > 0) {
HbmPlayerProps props = (HbmPlayerProps)player.getExtendedProperties("NTM_EXT_PLAYER");
RenderScreenOverlay.renderDashBar(event.resolution, Minecraft.getMinecraft().ingameGUI, props);
}
} }
} }
} }

View File

@ -3,6 +3,7 @@ package com.hbm.render.util;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12; import org.lwjgl.opengl.GL12;
import com.hbm.extprop.HbmPlayerProps;
import com.hbm.lib.RefStrings; import com.hbm.lib.RefStrings;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
@ -163,6 +164,48 @@ public class RenderScreenOverlay {
Minecraft.getMinecraft().renderEngine.bindTexture(Gui.icons); Minecraft.getMinecraft().renderEngine.bindTexture(Gui.icons);
} }
public static void renderDashBar(ScaledResolution resolution, Gui gui, HbmPlayerProps props) {
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glDepthMask(false);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(GL11.GL_ALPHA_TEST);
Minecraft mc = Minecraft.getMinecraft();
int posX = 16;
int posY = resolution.getScaledHeight() - 48 - 2;
mc.renderEngine.bindTexture(misc);
gui.drawTexturedModalRect(posX-10, posY, 99, 18, 7, 10);
int stamina = props.getStamina();
for(int x = 0; x < props.getDashCount(); x++) {
int status = 3;
int width = 22;
gui.drawTexturedModalRect(posX + (width+2)*x, posY, 76, 48, 30, 10);
if(stamina / 64 > x) {
status = 1;
} else if(stamina / 64 == x) {
width = (int)( (float)(stamina % 64) * (width/64F) );
status = 2;
}
gui.drawTexturedModalRect(posX + 24*x, posY, 76, 18+(10*status), width, 10);
}
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glDepthMask(true);
GL11.glPopMatrix();
mc.renderEngine.bindTexture(Gui.icons);
}
public enum Crosshair { public enum Crosshair {
NONE(0, 0, 0), NONE(0, 0, 0),

Binary file not shown.

After

Width:  |  Height:  |  Size: 1004 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB