mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
the axe-pack
This commit is contained in:
parent
6d0095d39b
commit
40cc6e009e
@ -1446,6 +1446,10 @@ public class ClientProxy extends ServerProxy {
|
||||
double ox = offset.xCoord;
|
||||
double oz = offset.zCoord;
|
||||
|
||||
if(player.isSneaking()) {
|
||||
iy += 0.25;
|
||||
}
|
||||
|
||||
vec = vec.normalize();
|
||||
double mult = 0.025D;
|
||||
double mX = vec.xCoord * mult;
|
||||
|
||||
@ -81,6 +81,7 @@ import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerChangedDimensionEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
@ -857,6 +858,33 @@ public class ModEventHandler {
|
||||
|
||||
if(player.getCurrentArmor(2) == null && !player.onGround) {
|
||||
|
||||
if(player.getUniqueID().toString().equals(ShadyUtil.Barnaby99_x) || player.getDisplayName().equals("pheo7")) {
|
||||
|
||||
ArmorUtil.resetFlightTime(player);
|
||||
HbmPlayerProps props = HbmPlayerProps.getData(player);
|
||||
|
||||
if(props.isJetpackActive()) {
|
||||
|
||||
if(player.motionY < 0.4D)
|
||||
player.motionY += 0.1D;
|
||||
|
||||
Vec3 look = player.getLookVec();
|
||||
|
||||
if(Vec3.createVectorHelper(player.motionX, player.motionY, player.motionZ).lengthVector() < 2) {
|
||||
player.motionX += look.xCoord * 0.2;
|
||||
player.motionY += look.yCoord * 0.2;
|
||||
player.motionZ += look.zCoord * 0.2;
|
||||
|
||||
if(look.yCoord > 0)
|
||||
player.fallDistance = 0;
|
||||
}
|
||||
} else if(props.enableBackpack && !player.isSneaking()) {
|
||||
|
||||
if(player.motionY < -0.2)
|
||||
player.motionY += 0.075D;
|
||||
}
|
||||
}
|
||||
|
||||
boolean isBob = player.getUniqueID().toString().equals(ShadyUtil.HbMinecraft) || player.getDisplayName().equals("HbMinecraft");
|
||||
boolean isOther = player.getUniqueID().toString().equals(ShadyUtil.the_NCR) || player.getDisplayName().equals("the_NCR");
|
||||
|
||||
|
||||
@ -581,6 +581,8 @@ public class ModEventHandlerClient {
|
||||
RenderAccessoryUtility.renderWings(event, 2);
|
||||
if(player.getUniqueID().toString().equals(ShadyUtil.the_NCR) || player.getDisplayName().equals("the_NCR"))
|
||||
RenderAccessoryUtility.renderWings(event, 3);
|
||||
if(player.getUniqueID().toString().equals(ShadyUtil.Barnaby99_x) || player.getDisplayName().equals("pheo7"))
|
||||
RenderAccessoryUtility.renderAxePack(event);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -866,6 +866,7 @@ public class ResourceManager {
|
||||
public static final IModelCustom armor_bismuth = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/bismuth.obj"));
|
||||
public static final IModelCustom armor_mod_tesla = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/mod_tesla.obj"));
|
||||
public static final IModelCustom armor_wings = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/murk.obj"));
|
||||
public static final IModelCustom armor_axepack = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/wings_pheo.obj"));
|
||||
public static final IModelCustom player_manly_af = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/armor/player_fem.obj"));
|
||||
public static final IModelCustom armor_envsuit = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/envsuit.obj"));
|
||||
public static final IModelCustom armor_trenchmaster = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/trenchmaster.obj"));
|
||||
@ -1029,6 +1030,7 @@ public class ResourceManager {
|
||||
public static final ResourceLocation wings_murk = new ResourceLocation(RefStrings.MODID, "textures/armor/wings_murk.png");
|
||||
public static final ResourceLocation wings_bob = new ResourceLocation(RefStrings.MODID, "textures/armor/wings_bob.png");
|
||||
public static final ResourceLocation wings_black = new ResourceLocation(RefStrings.MODID, "textures/armor/wings_black.png");
|
||||
public static final ResourceLocation wings_pheo = new ResourceLocation(RefStrings.MODID, "textures/armor/axepack.png");
|
||||
|
||||
public static final ResourceLocation hat = new ResourceLocation(RefStrings.MODID, "textures/armor/hat.png");
|
||||
public static final ResourceLocation no9 = new ResourceLocation(RefStrings.MODID, "textures/armor/no9.png");
|
||||
|
||||
@ -40,7 +40,6 @@ public class ModelArmorBase extends ModelBiped {
|
||||
}
|
||||
|
||||
public void setRotationAngles(float walkCycle, float walkAmplitude, float idleCycle, float headYaw, float headPitch, float scale, Entity entity) {
|
||||
//super.setRotationAngles(walkCycle, walkAmplitude, idleCycle, headYaw, headPitch, scale, entity);
|
||||
|
||||
head.rotateAngleY = headYaw / (180F / (float) Math.PI);
|
||||
head.rotateAngleX = headPitch / (180F / (float) Math.PI);
|
||||
|
||||
224
src/main/java/com/hbm/render/model/ModelArmorWingsPheo.java
Normal file
224
src/main/java/com/hbm/render/model/ModelArmorWingsPheo.java
Normal file
@ -0,0 +1,224 @@
|
||||
package com.hbm.render.model;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.loader.ModelRendererObj;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class ModelArmorWingsPheo extends ModelArmorBase {
|
||||
|
||||
ModelRendererObj axe;
|
||||
|
||||
public ModelArmorWingsPheo() {
|
||||
super(0);
|
||||
axe = new ModelRendererObj(ResourceManager.armor_axepack, "Wings");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Entity entity, float par2, float par3, float par4, float par5, float par6, float par7) {
|
||||
setRotationAngles(par2, par3, par4, par5, par6, par7, entity);
|
||||
body.copyTo(axe);
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.wings_pheo);
|
||||
axe.render(par7);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
float lastX = OpenGlHelper.lastBrightnessX;
|
||||
float lastY = OpenGlHelper.lastBrightnessY;
|
||||
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240F, 240F);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
|
||||
|
||||
double pixel = 0.0625D;
|
||||
|
||||
if(entity.isSneaking()) {
|
||||
GL11.glRotated(28.6479D, 1, 0, 0);
|
||||
}
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, pixel * 15, pixel * 5.5);
|
||||
this.renderFlame();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, pixel * 3, pixel * 5.5);
|
||||
GL11.glRotated(-25, 0, 1, 0);
|
||||
GL11.glRotated(-90, 0, 0, 1);
|
||||
GL11.glTranslated(0, pixel * 5, 0);
|
||||
this.renderFlame();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, -pixel * 5, 0);
|
||||
GL11.glRotated(45, 0, 0, 1);
|
||||
GL11.glTranslated(-pixel, pixel * 5.5, 0);
|
||||
this.renderFlame();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, -pixel * 5, 0);
|
||||
GL11.glRotated(-45, 0, 0, 1);
|
||||
GL11.glTranslated(pixel, pixel * 5.5, 0);
|
||||
this.renderFlame();
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, pixel * 15, pixel * 5.5);
|
||||
this.renderFlame();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, pixel * 3, pixel * 5.5);
|
||||
GL11.glRotated(25, 0, 1, 0);
|
||||
GL11.glRotated(90, 0, 0, 1);
|
||||
GL11.glTranslated(0, pixel * 5, 0);
|
||||
this.renderFlame();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, -pixel * 5, 0);
|
||||
GL11.glRotated(45, 0, 0, 1);
|
||||
GL11.glTranslated(-pixel, pixel * 5.5, 0);
|
||||
this.renderFlame();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, -pixel * 5, 0);
|
||||
GL11.glRotated(-45, 0, 0, 1);
|
||||
GL11.glTranslated(pixel, pixel * 5.5, 0);
|
||||
this.renderFlame();
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glPopAttrib();
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lastX, lastY);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
|
||||
private static void renderFlame() {
|
||||
|
||||
Tessellator tess = Tessellator.instance;
|
||||
tess.startDrawing(GL11.GL_TRIANGLES);
|
||||
|
||||
double b = 0.125D;
|
||||
double t = 0.375;
|
||||
double w = 0.0625D;
|
||||
double s2 = Math.sqrt(2D) / 2D * w;
|
||||
int colorBase = 0x808080;
|
||||
int colorFlame = 0x004040;
|
||||
int colorTip = 0x000000;
|
||||
|
||||
tess.setColorOpaque_I(colorBase);
|
||||
tess.addVertex(0, 0, 0);
|
||||
tess.setColorOpaque_I(colorFlame);
|
||||
tess.addVertex(w, b, 0);
|
||||
tess.addVertex(s2, b, s2);
|
||||
|
||||
tess.setColorOpaque_I(colorBase);
|
||||
tess.addVertex(0, 0, 0);
|
||||
tess.setColorOpaque_I(colorFlame);
|
||||
tess.addVertex(s2, b, s2);
|
||||
tess.addVertex(0, b, w);
|
||||
|
||||
tess.setColorOpaque_I(colorBase);
|
||||
tess.addVertex(0, 0, 0);
|
||||
tess.setColorOpaque_I(colorFlame);
|
||||
tess.addVertex(0, b, w);
|
||||
tess.addVertex(-s2, b, s2);
|
||||
|
||||
tess.setColorOpaque_I(colorBase);
|
||||
tess.addVertex(0, 0, 0);
|
||||
tess.setColorOpaque_I(colorFlame);
|
||||
tess.addVertex(-s2, b, s2);
|
||||
tess.addVertex(-w, b, 0);
|
||||
|
||||
tess.setColorOpaque_I(colorBase);
|
||||
tess.addVertex(0, 0, 0);
|
||||
tess.setColorOpaque_I(colorFlame);
|
||||
tess.addVertex(-w, b, 0);
|
||||
tess.addVertex(-s2, b, -s2);
|
||||
|
||||
tess.setColorOpaque_I(colorBase);
|
||||
tess.addVertex(0, 0, 0);
|
||||
tess.setColorOpaque_I(colorFlame);
|
||||
tess.addVertex(-s2, b, -s2);
|
||||
tess.addVertex(0, b, -w);
|
||||
|
||||
tess.setColorOpaque_I(colorBase);
|
||||
tess.addVertex(0, 0, 0);
|
||||
tess.setColorOpaque_I(colorFlame);
|
||||
tess.addVertex(0, b, -w);
|
||||
tess.addVertex(s2, b, -s2);
|
||||
|
||||
tess.setColorOpaque_I(colorBase);
|
||||
tess.addVertex(0, 0, 0);
|
||||
tess.setColorOpaque_I(colorFlame);
|
||||
tess.addVertex(s2, b, -s2);
|
||||
tess.addVertex(w, b, 0);
|
||||
|
||||
////////////////////////
|
||||
|
||||
tess.setColorOpaque_I(colorTip);
|
||||
tess.addVertex(0, t, 0);
|
||||
tess.setColorOpaque_I(colorFlame);
|
||||
tess.addVertex(w, b, 0);
|
||||
tess.addVertex(s2, b, s2);
|
||||
|
||||
tess.setColorOpaque_I(colorTip);
|
||||
tess.addVertex(0, t, 0);
|
||||
tess.setColorOpaque_I(colorFlame);
|
||||
tess.addVertex(s2, b, s2);
|
||||
tess.addVertex(0, b, w);
|
||||
|
||||
tess.setColorOpaque_I(colorTip);
|
||||
tess.addVertex(0, t, 0);
|
||||
tess.setColorOpaque_I(colorFlame);
|
||||
tess.addVertex(0, b, w);
|
||||
tess.addVertex(-s2, b, s2);
|
||||
|
||||
tess.setColorOpaque_I(colorTip);
|
||||
tess.addVertex(0, t, 0);
|
||||
tess.setColorOpaque_I(colorFlame);
|
||||
tess.addVertex(-s2, b, s2);
|
||||
tess.addVertex(-w, b, 0);
|
||||
|
||||
tess.setColorOpaque_I(colorTip);
|
||||
tess.addVertex(0, t, 0);
|
||||
tess.setColorOpaque_I(colorFlame);
|
||||
tess.addVertex(-w, b, 0);
|
||||
tess.addVertex(-s2, b, -s2);
|
||||
|
||||
tess.setColorOpaque_I(colorTip);
|
||||
tess.addVertex(0, t, 0);
|
||||
tess.setColorOpaque_I(colorFlame);
|
||||
tess.addVertex(-s2, b, -s2);
|
||||
tess.addVertex(0, b, -w);
|
||||
|
||||
tess.setColorOpaque_I(colorTip);
|
||||
tess.addVertex(0, t, 0);
|
||||
tess.setColorOpaque_I(colorFlame);
|
||||
tess.addVertex(0, b, -w);
|
||||
tess.addVertex(s2, b, -s2);
|
||||
|
||||
tess.setColorOpaque_I(colorTip);
|
||||
tess.addVertex(0, t, 0);
|
||||
tess.setColorOpaque_I(colorFlame);
|
||||
tess.addVertex(s2, b, -s2);
|
||||
tess.addVertex(w, b, 0);
|
||||
|
||||
tess.draw();
|
||||
}
|
||||
}
|
||||
@ -3,6 +3,7 @@ package com.hbm.render.util;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.render.model.ModelArmorWings;
|
||||
import com.hbm.render.model.ModelArmorWingsPheo;
|
||||
import com.hbm.util.ShadyUtil;
|
||||
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
@ -115,9 +116,9 @@ public class RenderAccessoryUtility {
|
||||
if(uuid.equals(ShadyUtil.FrizzleFrazzle)) {
|
||||
return frizzlefrazzle;
|
||||
}
|
||||
if(uuid.equals(ShadyUtil.Barnaby99_x)) {
|
||||
/*if(uuid.equals(ShadyUtil.Barnaby99_x)) {
|
||||
return pheo;
|
||||
}
|
||||
}*/
|
||||
if(uuid.equals(ShadyUtil.Ma118)) {
|
||||
return vaer;
|
||||
}
|
||||
@ -161,4 +162,26 @@ public class RenderAccessoryUtility {
|
||||
|
||||
wingModels[mode].render(event.entityPlayer, 0.0F, 0.0F, yawWrapped, yaw, pitch, 0.0625F);
|
||||
}
|
||||
|
||||
private static ModelBiped axePackModel;
|
||||
public static void renderAxePack(RenderPlayerEvent.SetArmorModel event) {
|
||||
|
||||
if(axePackModel == null)
|
||||
axePackModel = new ModelArmorWingsPheo();
|
||||
|
||||
RenderPlayer renderer = event.renderer;
|
||||
ModelBiped model = renderer.modelArmor;
|
||||
EntityPlayer player = event.entityPlayer;
|
||||
|
||||
axePackModel.isSneak = model.isSneak;
|
||||
|
||||
float interp = event.partialRenderTick;
|
||||
float yawHead = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * interp;
|
||||
float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * interp;
|
||||
float yaw = yawHead - yawOffset;
|
||||
float yawWrapped = MathHelper.wrapAngleTo180_float(yawHead - yawOffset);
|
||||
float pitch = player.rotationPitch;
|
||||
|
||||
axePackModel.render(event.entityPlayer, 0.0F, 0.0F, yawWrapped, yaw, pitch, 0.0625F);
|
||||
}
|
||||
}
|
||||
|
||||
3317
src/main/resources/assets/hbm/models/armor/wings_pheo.obj
Normal file
3317
src/main/resources/assets/hbm/models/armor/wings_pheo.obj
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user