mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-02-21 05:22:35 +00:00
rabies part 3
This commit is contained in:
parent
75946a0054
commit
22bd62f789
@ -1778,6 +1778,10 @@ public class ModItems {
|
||||
public static Item rpa_plate;
|
||||
public static Item rpa_legs;
|
||||
public static Item rpa_boots;
|
||||
public static Item ncrpa_helmet;
|
||||
public static Item ncrpa_plate;
|
||||
public static Item ncrpa_legs;
|
||||
public static Item ncrpa_boots;
|
||||
public static Item bismuth_helmet;
|
||||
public static Item bismuth_plate;
|
||||
public static Item bismuth_legs;
|
||||
@ -4254,6 +4258,20 @@ public class ModItems {
|
||||
rpa_legs = new ArmorRPA(aMatAJR, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", 2500000, 10000, 2000, 25).cloneStats((ArmorFSB) rpa_helmet).setUnlocalizedName("rpa_legs").setTextureName(RefStrings.MODID + ":rpa_legs");
|
||||
rpa_boots = new ArmorRPA(aMatAJR, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png", 2500000, 10000, 2000, 25).cloneStats((ArmorFSB) rpa_helmet).setUnlocalizedName("rpa_boots").setTextureName(RefStrings.MODID + ":rpa_boots");
|
||||
|
||||
ncrpa_helmet = new ArmorNCRPA(aMatAJR, 0, RefStrings.MODID + ":textures/armor/starmetal_1.png", 2500000, 10000, 2000, 25)
|
||||
.enableVATS(true)
|
||||
.setHasGeigerSound(true)
|
||||
.setHasHardLanding(true)
|
||||
.addEffect(new PotionEffect(Potion.damageBoost.id, 20, 3))
|
||||
.setStep("hbm:step.powered")
|
||||
.setJump("hbm:step.powered")
|
||||
.setFall("hbm:step.powered")
|
||||
.hides(EnumPlayerPart.HAT)
|
||||
.setUnlocalizedName("ncrpa_helmet").setTextureName(RefStrings.MODID + ":rpa_helmet");
|
||||
ncrpa_plate = new ArmorNCRPA(aMatAJR, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", 2500000, 10000, 2000, 25).cloneStats((ArmorFSB) rpa_helmet).setUnlocalizedName("ncrpa_plate").setTextureName(RefStrings.MODID + ":rpa_plate");
|
||||
ncrpa_legs = new ArmorNCRPA(aMatAJR, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", 2500000, 10000, 2000, 25).cloneStats((ArmorFSB) rpa_helmet).setUnlocalizedName("ncrpa_legs").setTextureName(RefStrings.MODID + ":rpa_legs");
|
||||
ncrpa_boots = new ArmorNCRPA(aMatAJR, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png", 2500000, 10000, 2000, 25).cloneStats((ArmorFSB) rpa_helmet).setUnlocalizedName("ncrpa_boots").setTextureName(RefStrings.MODID + ":rpa_boots");
|
||||
|
||||
ArmorMaterial aMatBJ = EnumHelper.addArmorMaterial("HBM_BLACKJACK", 150, new int[] { 3, 8, 6, 3 }, 0);
|
||||
aMatBJ.customCraftingMaterial = ModItems.plate_armor_lunar;
|
||||
bj_helmet = new ArmorBJ(aMatBJ, 0, RefStrings.MODID + ":textures/armor/starmetal_1.png", 10000000, 10000, 1000, 100)
|
||||
@ -6807,6 +6825,10 @@ public class ModItems {
|
||||
GameRegistry.registerItem(rpa_plate, rpa_plate.getUnlocalizedName());
|
||||
GameRegistry.registerItem(rpa_legs, rpa_legs.getUnlocalizedName());
|
||||
GameRegistry.registerItem(rpa_boots, rpa_boots.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ncrpa_helmet, ncrpa_helmet.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ncrpa_plate, ncrpa_plate.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ncrpa_legs, ncrpa_legs.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ncrpa_boots, ncrpa_boots.getUnlocalizedName());
|
||||
GameRegistry.registerItem(bj_helmet, bj_helmet.getUnlocalizedName());
|
||||
GameRegistry.registerItem(bj_plate, bj_plate.getUnlocalizedName());
|
||||
GameRegistry.registerItem(bj_plate_jetpack, bj_plate_jetpack.getUnlocalizedName());
|
||||
|
||||
49
src/main/java/com/hbm/items/armor/ArmorNCRPA.java
Normal file
49
src/main/java/com/hbm/items/armor/ArmorNCRPA.java
Normal file
@ -0,0 +1,49 @@
|
||||
package com.hbm.items.armor;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.item.ItemRenderBase;
|
||||
import com.hbm.render.model.ModelArmorNCRPA;
|
||||
import com.hbm.render.tileentity.IItemRendererProvider;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
public class ArmorNCRPA extends ArmorFSBPowered implements IItemRendererProvider {
|
||||
|
||||
public ArmorNCRPA(ArmorMaterial material, int slot, String texture, long maxPower, long chargeRate, long consumption, long drain) {
|
||||
super(material, slot, texture, maxPower, chargeRate, consumption, drain);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
ModelArmorNCRPA[] models;
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) {
|
||||
|
||||
if(models == null) { models = new ModelArmorNCRPA[4];
|
||||
for(int i = 0; i < 4; i++) models[i] = new ModelArmorNCRPA(i);
|
||||
}
|
||||
|
||||
return models[armorSlot];
|
||||
}
|
||||
|
||||
@Override public Item getItemForRenderer() { return this; }
|
||||
|
||||
@Override
|
||||
public IItemRenderer getRenderer() {
|
||||
return new ItemRenderBase( ) {
|
||||
public void renderInventory() { setupRenderInv(); }
|
||||
public void renderNonInv() { setupRenderNonInv(); }
|
||||
public void renderCommon() {
|
||||
renderStandard(ResourceManager.armor_ncr, armorType,
|
||||
ResourceManager.ncrpa_helmet, ResourceManager.ncrpa_chest, ResourceManager.ncrpa_arm, ResourceManager.ncrpa_leg,
|
||||
"Helmet,Eyes", "Chest", "LeftArm", "RightArm", "LeftLeg", "RightLeg", "LeftBoot", "RightBoot");
|
||||
}};
|
||||
}
|
||||
}
|
||||
@ -968,6 +968,7 @@ public class ResourceManager {
|
||||
public static final IModelCustom armor_steamsuit = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/steamsuit.obj")).asVBO();
|
||||
public static final IModelCustom armor_dieselsuit = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/bnuuy.obj")).asVBO();
|
||||
public static final IModelCustom armor_remnant = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/remnant.obj")).asVBO();
|
||||
public static final IModelCustom armor_ncr = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/ncrpa.obj")).asVBO();
|
||||
public static final IModelCustom armor_bismuth = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/bismuth.obj")).asVBO();
|
||||
public static final IModelCustom armor_mod_tesla = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/mod_tesla.obj")).asVBO();
|
||||
public static final IModelCustom armor_wings = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/murk.obj")).asVBO();
|
||||
@ -1154,6 +1155,11 @@ public class ResourceManager {
|
||||
public static final ResourceLocation rpa_chest = new ResourceLocation(RefStrings.MODID, "textures/armor/rpa_chest.png");
|
||||
public static final ResourceLocation rpa_arm = new ResourceLocation(RefStrings.MODID, "textures/armor/rpa_arm.png");
|
||||
|
||||
public static final ResourceLocation ncrpa_helmet = new ResourceLocation(RefStrings.MODID, "textures/armor/ncrpa_helmet.png");
|
||||
public static final ResourceLocation ncrpa_leg = new ResourceLocation(RefStrings.MODID, "textures/armor/ncrpa_leg.png");
|
||||
public static final ResourceLocation ncrpa_chest = new ResourceLocation(RefStrings.MODID, "textures/armor/ncrpa_chest.png");
|
||||
public static final ResourceLocation ncrpa_arm = new ResourceLocation(RefStrings.MODID, "textures/armor/ncrpa_arm.png");
|
||||
|
||||
public static final ResourceLocation taurun_helmet = new ResourceLocation(RefStrings.MODID, "textures/armor/taurun_helmet.png");
|
||||
public static final ResourceLocation taurun_leg = new ResourceLocation(RefStrings.MODID, "textures/armor/taurun_leg.png");
|
||||
public static final ResourceLocation taurun_chest = new ResourceLocation(RefStrings.MODID, "textures/armor/taurun_chest.png");
|
||||
|
||||
@ -52,6 +52,7 @@ public class HFRWavefrontObject implements IModelCustomNamed {
|
||||
public ResourceLocation resource;
|
||||
private String fileName;
|
||||
private boolean smoothing = true;
|
||||
private boolean allowMixedMode = false;
|
||||
|
||||
public HFRWavefrontObject(String name) throws ModelFormatException {
|
||||
this(new ResourceLocation(RefStrings.MODID, name));
|
||||
@ -61,6 +62,13 @@ public class HFRWavefrontObject implements IModelCustomNamed {
|
||||
this.smoothing = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
/** Provides a way for a model to have both tris and quads, however this means it can't be rendered directly.
|
||||
* Useful for ISBRHs which access vertices manually, allowing the quad to tri trick without forcing the entire model to be redundant tris. */
|
||||
public HFRWavefrontObject mixedMode() {
|
||||
this.allowMixedMode = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public HFRWavefrontObject(ResourceLocation resource) throws ModelFormatException {
|
||||
this.resource = resource;
|
||||
@ -164,6 +172,8 @@ public class HFRWavefrontObject implements IModelCustomNamed {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderAll() {
|
||||
if(allowMixedMode) throw new UnsupportedOperationException("Rendering of mixed-mode model " + this.fileName + " is not supported!");
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
if(currentGroupObject != null) {
|
||||
@ -179,13 +189,15 @@ public class HFRWavefrontObject implements IModelCustomNamed {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void tessellateAll(Tessellator tessellator) {
|
||||
for(S_GroupObject groupObject : groupObjects) {
|
||||
groupObject.render(tessellator);
|
||||
groupObject.tessellate(tessellator);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderOnly(String... groupNames) {
|
||||
if(allowMixedMode) throw new UnsupportedOperationException("Rendering of mixed-mode model " + this.fileName + " is not supported!");
|
||||
|
||||
for(S_GroupObject groupObject : groupObjects) {
|
||||
for(String groupName : groupNames) {
|
||||
if(groupName.equalsIgnoreCase(groupObject.name)) {
|
||||
@ -200,7 +212,7 @@ public class HFRWavefrontObject implements IModelCustomNamed {
|
||||
for(S_GroupObject groupObject : groupObjects) {
|
||||
for(String groupName : groupNames) {
|
||||
if(groupName.equalsIgnoreCase(groupObject.name)) {
|
||||
groupObject.render(tessellator);
|
||||
groupObject.tessellate(tessellator);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -209,6 +221,8 @@ public class HFRWavefrontObject implements IModelCustomNamed {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderPart(String partName) {
|
||||
if(allowMixedMode) throw new UnsupportedOperationException("Rendering of mixed-mode model " + this.fileName + " is not supported!");
|
||||
|
||||
for(S_GroupObject groupObject : groupObjects) {
|
||||
if(partName.equalsIgnoreCase(groupObject.name)) {
|
||||
groupObject.render();
|
||||
@ -220,7 +234,7 @@ public class HFRWavefrontObject implements IModelCustomNamed {
|
||||
public void tessellatePart(Tessellator tessellator, String partName) {
|
||||
for(S_GroupObject groupObject : groupObjects) {
|
||||
if(partName.equalsIgnoreCase(groupObject.name)) {
|
||||
groupObject.render(tessellator);
|
||||
groupObject.tessellate(tessellator);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -228,6 +242,8 @@ public class HFRWavefrontObject implements IModelCustomNamed {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderAllExcept(String... excludedGroupNames) {
|
||||
if(allowMixedMode) throw new UnsupportedOperationException("Rendering of mixed-mode model " + this.fileName + " is not supported!");
|
||||
|
||||
for(S_GroupObject groupObject : groupObjects) {
|
||||
boolean skipPart = false;
|
||||
for(String excludedGroupName : excludedGroupNames) {
|
||||
@ -252,7 +268,7 @@ public class HFRWavefrontObject implements IModelCustomNamed {
|
||||
}
|
||||
}
|
||||
if(!exclude) {
|
||||
groupObject.render(tessellator);
|
||||
groupObject.tessellate(tessellator);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -332,19 +348,21 @@ public class HFRWavefrontObject implements IModelCustomNamed {
|
||||
String[] tokens = trimmedLine.split(" ");
|
||||
String[] subTokens = null;
|
||||
|
||||
if(tokens.length == 3) {
|
||||
if(currentGroupObject.glDrawingMode == -1) {
|
||||
currentGroupObject.glDrawingMode = GL11.GL_TRIANGLES;
|
||||
} else if(currentGroupObject.glDrawingMode != GL11.GL_TRIANGLES) {
|
||||
throw new ModelFormatException("Error parsing entry ('" + line + "'" + ", line " + lineCount + ") in file '" + fileName
|
||||
+ "' - Invalid number of points for face (expected 4, found " + tokens.length + ")");
|
||||
}
|
||||
} else if(tokens.length == 4) {
|
||||
if(currentGroupObject.glDrawingMode == -1) {
|
||||
currentGroupObject.glDrawingMode = GL11.GL_QUADS;
|
||||
} else if(currentGroupObject.glDrawingMode != GL11.GL_QUADS) {
|
||||
throw new ModelFormatException("Error parsing entry ('" + line + "'" + ", line " + lineCount + ") in file '" + fileName
|
||||
+ "' - Invalid number of points for face (expected 3, found " + tokens.length + ")");
|
||||
if(!this.allowMixedMode) {
|
||||
if(tokens.length == 3) {
|
||||
if(currentGroupObject.glDrawingMode == -1) {
|
||||
currentGroupObject.glDrawingMode = GL11.GL_TRIANGLES;
|
||||
} else if(currentGroupObject.glDrawingMode != GL11.GL_TRIANGLES) {
|
||||
throw new ModelFormatException("Error parsing entry ('" + line + "'" + ", line " + lineCount + ") in file '" + fileName
|
||||
+ "' - Invalid number of points for face (expected 4, found " + tokens.length + ")");
|
||||
}
|
||||
} else if(tokens.length == 4) {
|
||||
if(currentGroupObject.glDrawingMode == -1) {
|
||||
currentGroupObject.glDrawingMode = GL11.GL_QUADS;
|
||||
} else if(currentGroupObject.glDrawingMode != GL11.GL_QUADS) {
|
||||
throw new ModelFormatException("Error parsing entry ('" + line + "'" + ", line " + lineCount + ") in file '" + fileName
|
||||
+ "' - Invalid number of points for face (expected 3, found " + tokens.length + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -26,12 +26,12 @@ public class S_GroupObject {
|
||||
if (this.faces.size() > 0) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.startDrawing(this.glDrawingMode);
|
||||
render(tessellator);
|
||||
tessellate(tessellator);
|
||||
tessellator.draw();
|
||||
}
|
||||
}
|
||||
|
||||
public void render(Tessellator tessellator) {
|
||||
public void tessellate(Tessellator tessellator) {
|
||||
if (this.faces.size() > 0) {
|
||||
for (S_Face face : this.faces) {
|
||||
face.addFaceForRender(tessellator);
|
||||
|
||||
77
src/main/java/com/hbm/render/model/ModelArmorNCRPA.java
Normal file
77
src/main/java/com/hbm/render/model/ModelArmorNCRPA.java
Normal file
@ -0,0 +1,77 @@
|
||||
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.renderer.OpenGlHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class ModelArmorNCRPA extends ModelArmorBase {
|
||||
|
||||
ModelRendererObj eyes;
|
||||
|
||||
public ModelArmorNCRPA(int type) {
|
||||
super(type);
|
||||
|
||||
this.head = new ModelRendererObj(ResourceManager.armor_ncr, "Helmet");
|
||||
this.eyes = new ModelRendererObj(ResourceManager.armor_ncr, "Eyes");
|
||||
this.body = new ModelRendererObj(ResourceManager.armor_ncr, "Chest");
|
||||
this.leftArm = new ModelRendererObj(ResourceManager.armor_ncr, "LeftArm").setRotationPoint(5.0F, 2.0F, 0.0F);
|
||||
this.rightArm = new ModelRendererObj(ResourceManager.armor_ncr, "RightArm").setRotationPoint(-5.0F, 2.0F, 0.0F);
|
||||
this.leftLeg = new ModelRendererObj(ResourceManager.armor_ncr, "LeftLeg").setRotationPoint(1.9F, 12.0F, 0.0F);
|
||||
this.rightLeg = new ModelRendererObj(ResourceManager.armor_ncr, "RightLeg").setRotationPoint(-1.9F, 12.0F, 0.0F);
|
||||
this.leftFoot = new ModelRendererObj(ResourceManager.armor_ncr, "LeftBoot").setRotationPoint(1.9F, 12.0F, 0.0F);
|
||||
this.rightFoot = new ModelRendererObj(ResourceManager.armor_ncr, "RightBoot").setRotationPoint(-1.9F, 12.0F, 0.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor) {
|
||||
|
||||
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entity);
|
||||
this.head.copyTo(this.eyes);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
if(this.type == 0) {
|
||||
bindTexture(ResourceManager.ncrpa_helmet);
|
||||
this.head.render(scaleFactor);
|
||||
|
||||
/// START GLOW ///
|
||||
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);
|
||||
this.eyes.render(scaleFactor);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glPopAttrib();
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lastX, lastY);
|
||||
/// END GLOW ///
|
||||
}
|
||||
if(this.type == 1) {
|
||||
|
||||
bindTexture(ResourceManager.ncrpa_arm);
|
||||
this.leftArm.render(scaleFactor);
|
||||
this.rightArm.render(scaleFactor);
|
||||
|
||||
bindTexture(ResourceManager.ncrpa_chest);
|
||||
this.body.render(scaleFactor);
|
||||
}
|
||||
if(this.type == 2) {
|
||||
bindTexture(ResourceManager.ncrpa_leg);
|
||||
this.leftLeg.render(scaleFactor);
|
||||
this.rightLeg.render(scaleFactor);
|
||||
}
|
||||
if(this.type == 3) {
|
||||
bindTexture(ResourceManager.ncrpa_leg);
|
||||
this.leftFoot.render(scaleFactor);
|
||||
this.rightFoot.render(scaleFactor);
|
||||
}
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user