mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
:painB:
This commit is contained in:
parent
b6f29739a1
commit
40d5c05b64
@ -41,7 +41,7 @@ public class XFactoryEnergy {
|
||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_TESLA_ANIMS = (stack, type) -> {
|
||||
switch(type) {
|
||||
case EQUIP: return new BusAnimation()
|
||||
.addBus("EQUIP", new BusAnimationSequence().addPos(60, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_DOWN));
|
||||
.addBus("EQUIP", new BusAnimationSequence().addPos(60, 0, 0, 0).addPos(0, 0, 0, 1000, IType.SIN_DOWN));
|
||||
case CYCLE: return new BusAnimation()
|
||||
.addBus("RECOIL", new BusAnimationSequence().addPos(0, 0, -1, 50, IType.SIN_DOWN).addPos(0, 0, 0, 150, IType.SIN_FULL))
|
||||
.addBus("CYCLE", new BusAnimationSequence().addPos(0, 0, 0, 150).addPos(0, 0, 18, 100));
|
||||
|
||||
@ -860,6 +860,7 @@ public class ResourceManager {
|
||||
public static final IModelCustom mike_hawk = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/mike_hawk.obj")).asVBO();
|
||||
public static final IModelCustom minigun = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/minigun.obj")).asVBO();
|
||||
public static final IModelCustom missile_launcher = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/missile_launcher.obj")).asVBO();
|
||||
public static final IModelCustom tesla_cannon = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/tesla_cannon.obj")).asVBO();
|
||||
|
||||
public static final HashMap<String, BusAnimation> python_anim = AnimationLoader.load(new ResourceLocation(RefStrings.MODID, "models/weapons/animations/python.json"));
|
||||
public static final HashMap<String, BusAnimation> cursed_anim = AnimationLoader.load(new ResourceLocation(RefStrings.MODID, "models/weapons/animations/cursed.json"));
|
||||
@ -991,6 +992,7 @@ public class ResourceManager {
|
||||
public static final ResourceLocation quadro_rocket_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/quadro_rocket.png");
|
||||
public static final ResourceLocation minigun_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/minigun.png");
|
||||
public static final ResourceLocation missile_launcher_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/missile_launcher.png");
|
||||
public static final ResourceLocation tesla_cannon_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/tesla_cannon.png");
|
||||
|
||||
public static final ResourceLocation lance_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/lance.png");
|
||||
|
||||
|
||||
@ -1,26 +1,120 @@
|
||||
package com.hbm.render.item.weapon.sedna;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.anim.HbmAnimations;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
public class ItemRenderTeslaCannon implements IItemRenderer {
|
||||
public class ItemRenderTeslaCannon extends ItemRenderWeaponBase {
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
protected float getTurnMagnitude(ItemStack stack) { return ItemGunBaseNT.getIsAiming(stack) ? 2.5F : -0.5F; }
|
||||
|
||||
@Override
|
||||
public void setupFirstPerson(ItemStack stack) {
|
||||
GL11.glTranslated(0, 0, 0.875);
|
||||
|
||||
float offset = 0.8F;
|
||||
standardAimingTransform(stack,
|
||||
-1.75F * offset, -0.5F * offset, 1.75F * offset,
|
||||
-1.3125F * offset, 0F * offset, -0.5F * offset);
|
||||
}
|
||||
|
||||
protected static String label = "AUTO";
|
||||
|
||||
@Override
|
||||
public void renderFirstPerson(ItemStack stack) {
|
||||
|
||||
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.tesla_cannon_tex);
|
||||
double scale = 0.75D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
|
||||
double[] equip = HbmAnimations.getRelevantTransformation("EQUIP");
|
||||
|
||||
GL11.glTranslated(0, -2, -2);
|
||||
GL11.glRotated(equip[0], 1, 0, 0);
|
||||
GL11.glTranslated(0, 2, 2);
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
int amount = gun.getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmount(stack, MainRegistry.proxy.me().inventory);
|
||||
|
||||
ResourceManager.tesla_cannon.renderPart("Gun");
|
||||
ResourceManager.tesla_cannon.renderPart("Extension");
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, -1.875, 0);
|
||||
GL11.glRotated(-22.5, 0, 0, 1);
|
||||
GL11.glTranslated(0, 1.875, 0);
|
||||
ResourceManager.tesla_cannon.renderPart("Cog");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
for(int i = 0; i < Math.min(amount, 8); i++) {
|
||||
ResourceManager.tesla_cannon.renderPart("Capacitor");
|
||||
|
||||
if(i < 4) {
|
||||
GL11.glTranslated(0, -1.625, 0);
|
||||
GL11.glRotated(-22.5, 0, 0, 1);
|
||||
GL11.glTranslated(0, 1.625, 0);
|
||||
} else {
|
||||
GL11.glTranslated(0.5, 0, 0);
|
||||
}
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
public void setupThirdPerson(ItemStack stack) {
|
||||
super.setupThirdPerson(stack);
|
||||
double scale = 2.75D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
GL11.glTranslated(0, 1.5, 1);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
public void setupInv(ItemStack stack) {
|
||||
super.setupInv(stack);
|
||||
double scale = 1.25D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
GL11.glRotated(25, 1, 0, 0);
|
||||
GL11.glRotated(45, 0, 1, 0);
|
||||
GL11.glTranslated(0, 0.5, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderOther(ItemStack stack, ItemRenderType type) {
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.tesla_cannon_tex);
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.tesla_cannon.renderPart("Gun");
|
||||
ResourceManager.tesla_cannon.renderPart("Extension");
|
||||
ResourceManager.tesla_cannon.renderPart("Cog");
|
||||
|
||||
GL11.glPushMatrix();
|
||||
for(int i = 0; i < 10; i++) {
|
||||
ResourceManager.tesla_cannon.renderPart("Capacitor");
|
||||
|
||||
if(i < 4) {
|
||||
GL11.glTranslated(0, -1.625, 0);
|
||||
GL11.glRotated(-22.5, 0, 0, 1);
|
||||
GL11.glTranslated(0, 1.625, 0);
|
||||
} else {
|
||||
GL11.glTranslated(0.5, 0, 0);
|
||||
}
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
}
|
||||
|
||||
8340
src/main/resources/assets/hbm/models/weapons/tesla_cannon.obj
Normal file
8340
src/main/resources/assets/hbm/models/weapons/tesla_cannon.obj
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 6.5 KiB |
Loading…
x
Reference in New Issue
Block a user