mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
some more gas mask shenanigans
This commit is contained in:
parent
efc382c9dc
commit
f5f5f18f1c
@ -11,6 +11,7 @@ import com.hbm.lib.RefStrings;
|
|||||||
import com.hbm.render.model.ModelGasMask;
|
import com.hbm.render.model.ModelGasMask;
|
||||||
import com.hbm.render.model.ModelM65;
|
import com.hbm.render.model.ModelM65;
|
||||||
import com.hbm.util.ArmorUtil;
|
import com.hbm.util.ArmorUtil;
|
||||||
|
import com.hbm.util.I18nUtil;
|
||||||
import com.hbm.util.ArmorRegistry.HazardClass;
|
import com.hbm.util.ArmorRegistry.HazardClass;
|
||||||
|
|
||||||
import api.hbm.item.IGasMask;
|
import api.hbm.item.IGasMask;
|
||||||
@ -26,6 +27,7 @@ import net.minecraft.entity.EntityLivingBase;
|
|||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemArmor;
|
import net.minecraft.item.ItemArmor;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
public class ArmorGasMask extends ItemArmor implements IGasMask {
|
public class ArmorGasMask extends ItemArmor implements IGasMask {
|
||||||
@ -164,7 +166,18 @@ public class ArmorGasMask extends ItemArmor implements IGasMask {
|
|||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||||
|
|
||||||
ArmorUtil.addGasMaskTooltip(stack, player, list, ext);
|
ArmorUtil.addGasMaskTooltip(stack, player, list, ext);
|
||||||
|
|
||||||
|
List<HazardClass> haz = getBlacklist(stack, player);
|
||||||
|
|
||||||
|
if(!haz.isEmpty()) {
|
||||||
|
list.add(EnumChatFormatting.RED + "Will never protect against:");
|
||||||
|
|
||||||
|
for(HazardClass clazz : haz) {
|
||||||
|
list.add(EnumChatFormatting.DARK_RED + " -" + I18nUtil.resolveKey(clazz.lang));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -26,7 +26,14 @@ public class ItemFilter extends Item {
|
|||||||
return stack;
|
return stack;
|
||||||
|
|
||||||
ItemStack copy = stack.copy();
|
ItemStack copy = stack.copy();
|
||||||
stack = ArmorUtil.getGasMaskFilter(helmet);
|
ItemStack current = ArmorUtil.getGasMaskFilter(helmet);
|
||||||
|
|
||||||
|
if(current != null) {
|
||||||
|
stack = current;
|
||||||
|
} else {
|
||||||
|
stack.stackSize = 0;
|
||||||
|
}
|
||||||
|
|
||||||
ArmorUtil.installGasMaskFilter(helmet, copy);
|
ArmorUtil.installGasMaskFilter(helmet, copy);
|
||||||
|
|
||||||
world.playSoundAtEntity(player, "hbm:item.gasmaskScrew", 1.0F, 1.0F);
|
world.playSoundAtEntity(player, "hbm:item.gasmaskScrew", 1.0F, 1.0F);
|
||||||
|
|||||||
@ -8,7 +8,7 @@ package com.hbm.render.model;
|
|||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import com.hbm.entity.mob.EntityRADBeast;
|
import com.hbm.util.ArmorUtil;
|
||||||
|
|
||||||
import net.minecraft.client.model.ModelBiped;
|
import net.minecraft.client.model.ModelBiped;
|
||||||
import net.minecraft.client.model.ModelRenderer;
|
import net.minecraft.client.model.ModelRenderer;
|
||||||
@ -18,16 +18,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||||||
public class ModelM65 extends ModelBiped {
|
public class ModelM65 extends ModelBiped {
|
||||||
// fields
|
// fields
|
||||||
public ModelRenderer mask;
|
public ModelRenderer mask;
|
||||||
public ModelRenderer Shape1;
|
public ModelRenderer filter;
|
||||||
public ModelRenderer Shape2;
|
|
||||||
public ModelRenderer Shape3;
|
|
||||||
public ModelRenderer Shape4;
|
|
||||||
public ModelRenderer Shape5;
|
|
||||||
public ModelRenderer Shape6;
|
|
||||||
public ModelRenderer Shape7;
|
|
||||||
public ModelRenderer Shape8;
|
|
||||||
public ModelRenderer Shape9;
|
|
||||||
public ModelRenderer Shape10;
|
|
||||||
|
|
||||||
public ModelM65() {
|
public ModelM65() {
|
||||||
textureWidth = 32;
|
textureWidth = 32;
|
||||||
@ -36,76 +27,77 @@ public class ModelM65 extends ModelBiped {
|
|||||||
float yOffset = 0.5F;
|
float yOffset = 0.5F;
|
||||||
|
|
||||||
mask = new ModelRenderer(this, 0, 0);
|
mask = new ModelRenderer(this, 0, 0);
|
||||||
Shape1 = new ModelRenderer(this, 0, 0);
|
filter = new ModelRenderer(this, 0, 0);
|
||||||
Shape1.addBox(0F, 0F, 0F, 8, 8, 8);
|
ModelRenderer maskHead = new ModelRenderer(this, 0, 0);
|
||||||
Shape1.setRotationPoint(-4F, -8F + yOffset, -4F);
|
maskHead.addBox(0F, 0F, 0F, 8, 8, 8);
|
||||||
Shape1.setTextureSize(32, 32);
|
maskHead.setRotationPoint(-4F, -8F + yOffset, -4F);
|
||||||
Shape1.mirror = true;
|
maskHead.setTextureSize(32, 32);
|
||||||
setRotation(Shape1, 0F, 0F, 0F);
|
maskHead.mirror = true;
|
||||||
convertToChild(mask, Shape1);
|
setRotation(maskHead, 0F, 0F, 0F);
|
||||||
Shape2 = new ModelRenderer(this, 0, 16);
|
convertToChild(mask, maskHead);
|
||||||
Shape2.addBox(0F, 0F, 0F, 3, 3, 1);
|
ModelRenderer nose = new ModelRenderer(this, 0, 16);
|
||||||
Shape2.setRotationPoint(-1.5F, -3.5F + yOffset, -5F);
|
nose.addBox(0F, 0F, 0F, 3, 3, 1);
|
||||||
Shape2.setTextureSize(32, 32);
|
nose.setRotationPoint(-1.5F, -3.5F + yOffset, -5F);
|
||||||
Shape2.mirror = true;
|
nose.setTextureSize(32, 32);
|
||||||
setRotation(Shape2, 0F, 0F, 0F);
|
nose.mirror = true;
|
||||||
convertToChild(mask, Shape2);
|
setRotation(nose, 0F, 0F, 0F);
|
||||||
Shape3 = new ModelRenderer(this, 0, 20);
|
convertToChild(mask, nose);
|
||||||
Shape3.addBox(0F, -2F, 0F, 2, 2, 1);
|
ModelRenderer outlet = new ModelRenderer(this, 0, 20);
|
||||||
Shape3.setRotationPoint(-1F, -3.5F + yOffset, -5F);
|
outlet.addBox(0F, -2F, 0F, 2, 2, 1);
|
||||||
Shape3.setTextureSize(32, 32);
|
outlet.setRotationPoint(-1F, -3.5F + yOffset, -5F);
|
||||||
Shape3.mirror = true;
|
outlet.setTextureSize(32, 32);
|
||||||
setRotation(Shape3, -0.4799655F, 0F, 0F);
|
outlet.mirror = true;
|
||||||
convertToChild(mask, Shape3);
|
setRotation(outlet, -0.4799655F, 0F, 0F);
|
||||||
Shape4 = new ModelRenderer(this, 8, 16);
|
convertToChild(mask, outlet);
|
||||||
Shape4.addBox(0F, 0F, -2F, 3, 2, 2);
|
ModelRenderer noseSlope = new ModelRenderer(this, 8, 16);
|
||||||
Shape4.setRotationPoint(-1.5F, -2F + yOffset, -4F);
|
noseSlope.addBox(0F, 0F, -2F, 3, 2, 2);
|
||||||
Shape4.setTextureSize(32, 32);
|
noseSlope.setRotationPoint(-1.5F, -2F + yOffset, -4F);
|
||||||
Shape4.mirror = true;
|
noseSlope.setTextureSize(32, 32);
|
||||||
setRotation(Shape4, 0.6108652F, 0F, 0F);
|
noseSlope.mirror = true;
|
||||||
convertToChild(mask, Shape4);
|
setRotation(noseSlope, 0.6108652F, 0F, 0F);
|
||||||
Shape5 = new ModelRenderer(this, 0, 23);
|
convertToChild(mask, noseSlope);
|
||||||
Shape5.addBox(0F, 0F, 0F, 3, 3, 0);
|
ModelRenderer eye1 = new ModelRenderer(this, 0, 23);
|
||||||
Shape5.setRotationPoint(-3.5F, -6F + yOffset, -4.2F);
|
eye1.addBox(0F, 0F, 0F, 3, 3, 0);
|
||||||
Shape5.setTextureSize(32, 32);
|
eye1.setRotationPoint(-3.5F, -6F + yOffset, -4.2F);
|
||||||
Shape5.mirror = true;
|
eye1.setTextureSize(32, 32);
|
||||||
setRotation(Shape5, 0F, 0F, 0F);
|
eye1.mirror = true;
|
||||||
convertToChild(mask, Shape5);
|
setRotation(eye1, 0F, 0F, 0F);
|
||||||
Shape6 = new ModelRenderer(this, 0, 26);
|
convertToChild(mask, eye1);
|
||||||
Shape6.addBox(0F, 0F, 0F, 3, 3, 0);
|
ModelRenderer eye2 = new ModelRenderer(this, 0, 26);
|
||||||
Shape6.setRotationPoint(0.5F, -6F + yOffset, -4.2F);
|
eye2.addBox(0F, 0F, 0F, 3, 3, 0);
|
||||||
Shape6.setTextureSize(32, 32);
|
eye2.setRotationPoint(0.5F, -6F + yOffset, -4.2F);
|
||||||
Shape6.mirror = true;
|
eye2.setTextureSize(32, 32);
|
||||||
setRotation(Shape6, 0F, 0F, 0F);
|
eye2.mirror = true;
|
||||||
convertToChild(mask, Shape6);
|
setRotation(eye2, 0F, 0F, 0F);
|
||||||
Shape7 = new ModelRenderer(this, 6, 20);
|
convertToChild(mask, eye2);
|
||||||
Shape7.addBox(0F, 0F, 0F, 2, 2, 1);
|
ModelRenderer iForgot = new ModelRenderer(this, 6, 20);
|
||||||
Shape7.setRotationPoint(-1F, -3.2F + yOffset, -6F);
|
iForgot.addBox(0F, 0F, 0F, 2, 2, 1);
|
||||||
Shape7.setTextureSize(32, 32);
|
iForgot.setRotationPoint(-1F, -3.2F + yOffset, -6F);
|
||||||
Shape7.mirror = true;
|
iForgot.setTextureSize(32, 32);
|
||||||
setRotation(Shape7, 0F, 0F, 0F);
|
iForgot.mirror = true;
|
||||||
convertToChild(mask, Shape7);
|
setRotation(iForgot, 0F, 0F, 0F);
|
||||||
Shape8 = new ModelRenderer(this, 6, 23);
|
convertToChild(mask, iForgot);
|
||||||
Shape8.addBox(0F, 0F, -3F, 2, 2, 1);
|
ModelRenderer filterConnector = new ModelRenderer(this, 6, 23);
|
||||||
Shape8.setRotationPoint(-1F, -2F + yOffset, -4F);
|
filterConnector.addBox(0F, 0F, -3F, 2, 2, 1);
|
||||||
Shape8.setTextureSize(32, 32);
|
filterConnector.setRotationPoint(-1F, -2F + yOffset, -4F);
|
||||||
Shape8.mirror = true;
|
filterConnector.setTextureSize(32, 32);
|
||||||
setRotation(Shape8, 0.6108652F, 0F, 0F);
|
filterConnector.mirror = true;
|
||||||
convertToChild(mask, Shape8);
|
setRotation(filterConnector, 0.6108652F, 0F, 0F);
|
||||||
Shape9 = new ModelRenderer(this, 18, 21);
|
convertToChild(filter, filterConnector);
|
||||||
Shape9.addBox(0F, -1F, -5F, 3, 4, 2);
|
ModelRenderer filter1 = new ModelRenderer(this, 18, 21);
|
||||||
Shape9.setRotationPoint(-1.5F, -2F + yOffset, -4F);
|
filter1.addBox(0F, -1F, -5F, 3, 4, 2);
|
||||||
Shape9.setTextureSize(32, 32);
|
filter1.setRotationPoint(-1.5F, -2F + yOffset, -4F);
|
||||||
Shape9.mirror = true;
|
filter1.setTextureSize(32, 32);
|
||||||
setRotation(Shape9, 0.6108652F, 0F, 0F);
|
filter1.mirror = true;
|
||||||
convertToChild(mask, Shape9);
|
setRotation(filter1, 0.6108652F, 0F, 0F);
|
||||||
Shape10 = new ModelRenderer(this, 18, 16);
|
convertToChild(filter, filter1);
|
||||||
Shape10.addBox(0F, -0.5F, -5F, 4, 3, 2);
|
ModelRenderer filter2 = new ModelRenderer(this, 18, 16);
|
||||||
Shape10.setRotationPoint(-2F, -2F + yOffset, -4F);
|
filter2.addBox(0F, -0.5F, -5F, 4, 3, 2);
|
||||||
Shape10.setTextureSize(32, 32);
|
filter2.setRotationPoint(-2F, -2F + yOffset, -4F);
|
||||||
Shape10.mirror = true;
|
filter2.setTextureSize(32, 32);
|
||||||
setRotation(Shape10, 0.6108652F, 0F, 0F);
|
filter2.mirror = true;
|
||||||
convertToChild(mask, Shape10);
|
setRotation(filter2, 0.6108652F, 0F, 0F);
|
||||||
|
convertToChild(filter, filter2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -124,17 +116,25 @@ public class ModelM65 extends ModelBiped {
|
|||||||
this.mask.rotationPointY = this.bipedHead.rotationPointY;
|
this.mask.rotationPointY = this.bipedHead.rotationPointY;
|
||||||
this.mask.rotateAngleY = this.bipedHead.rotateAngleY;
|
this.mask.rotateAngleY = this.bipedHead.rotateAngleY;
|
||||||
this.mask.rotateAngleX = this.bipedHead.rotateAngleX;
|
this.mask.rotateAngleX = this.bipedHead.rotateAngleX;
|
||||||
|
this.filter.rotationPointX = this.bipedHead.rotationPointX;
|
||||||
|
this.filter.rotationPointY = this.bipedHead.rotationPointY;
|
||||||
|
this.filter.rotateAngleY = this.bipedHead.rotateAngleY;
|
||||||
|
this.filter.rotateAngleX = this.bipedHead.rotateAngleX;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) {
|
public void render(Entity entity, float par2, float par3, float par4, float par5, float par6, float par7) {
|
||||||
setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity);
|
setRotationAngles(par2, par3, par4, par5, par6, par7, entity);
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
double d = 1D / 16D * 18D;
|
double d = 1D / 16D * 18D;
|
||||||
//GL11.glTranslated(0, 1/16D, 0);
|
//GL11.glTranslated(0, 1/16D, 0);
|
||||||
GL11.glScaled(d, d, d);
|
GL11.glScaled(d, d, d);
|
||||||
GL11.glScaled(1.01D, 1.01D, 1.01D);
|
GL11.glScaled(1.01D, 1.01D, 1.01D);
|
||||||
this.mask.render(par7);
|
this.mask.render(par7);
|
||||||
|
|
||||||
|
if(!(entity instanceof EntityPlayer) || ArmorUtil.getGasMaskFilter(((EntityPlayer)entity).getCurrentArmor(3)) != null)
|
||||||
|
this.filter.render(par7);
|
||||||
|
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -421,6 +421,7 @@ public class ArmorUtil {
|
|||||||
list.add(EnumChatFormatting.GOLD + "Installed filter:");
|
list.add(EnumChatFormatting.GOLD + "Installed filter:");
|
||||||
|
|
||||||
List<String> lore = new ArrayList();
|
List<String> lore = new ArrayList();
|
||||||
|
list.add(" " + filter.getDisplayName());
|
||||||
filter.getItem().addInformation(filter, player, lore, ext);
|
filter.getItem().addInformation(filter, player, lore, ext);
|
||||||
ForgeEventFactory.onItemTooltip(filter, player, lore, ext);
|
ForgeEventFactory.onItemTooltip(filter, player, lore, ext);
|
||||||
lore.forEach(x -> list.add(EnumChatFormatting.YELLOW + " " + x));
|
lore.forEach(x -> list.add(EnumChatFormatting.YELLOW + " " + x));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user