why do they call it the oven when you of in the cold food out hot eat th

This commit is contained in:
Bob 2025-05-07 22:40:56 +02:00
parent d8d3263493
commit ca9b9f7b6c
16 changed files with 4617 additions and 2443 deletions

View File

@ -1,12 +1,15 @@
package com.hbm.entity.projectile;
import com.hbm.items.weapon.sedna.BulletConfig;
import com.hbm.items.weapon.sedna.factory.XFactoryTool;
import com.hbm.util.BobMathUtil;
import com.hbm.util.TrackerUtil;
import com.hbm.util.Vec3NT;
import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.EntityTrackerEntry;
@ -16,7 +19,7 @@ import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
public class EntityBulletBaseMK4 extends EntityThrowableInterp {
public class EntityBulletBaseMK4 extends EntityThrowableInterp implements IEntityAdditionalSpawnData {
public BulletConfig config;
//used for rendering tracers
@ -134,7 +137,7 @@ public class EntityBulletBaseMK4 extends EntityThrowableInterp {
double dY = this.posY - this.prevPosY;
double dZ = this.posZ - this.prevPosZ;
if(this.lockonTarget != null && !this.lockonTarget.isDead) {
if(!this.inGround && this.lockonTarget != null && !this.lockonTarget.isDead) {
Vec3NT motion = new Vec3NT(motionX, motionY, motionZ);
double vel = motion.lengthVector();
Vec3NT delta = new Vec3NT(lockonTarget.posX - posX, lockonTarget.posY + lockonTarget.height / 2D - posY, lockonTarget.posZ - posZ);
@ -153,7 +156,8 @@ public class EntityBulletBaseMK4 extends EntityThrowableInterp {
this.prevVelocity = this.velocity;
this.velocity = Math.sqrt(dX * dX + dY * dY + dZ * dZ);
if(!this.onGround && velocity > 0) {
// shitty hack
if((this.config != XFactoryTool.ct_hook || !worldObj.isRemote) && !this.inGround && !this.onGround && velocity > 0) {
float hyp = MathHelper.sqrt_double(dX * dX + dZ * dZ);
this.rotationYaw = (float) (Math.atan2(dX, dZ) * 180.0D / Math.PI);
@ -184,7 +188,7 @@ public class EntityBulletBaseMK4 extends EntityThrowableInterp {
if(!worldObj.isRemote) {
if(this.config.onImpact != null) this.config.onImpact.accept(this, mop);
if(this.isDead) return;
if(this.isDead || this.inGround) return;
if(this.config.onRicochet != null) this.config.onRicochet.accept(this, mop);
if(this.config.onEntityHit != null) this.config.onEntityHit.accept(this, mop);
}
@ -202,4 +206,12 @@ public class EntityBulletBaseMK4 extends EntityThrowableInterp {
@Override public int selfDamageDelay() { return this.config.selfDamageDelay; }
@Override @SideOnly(Side.CLIENT) public boolean canRenderOnFire() { return false; }
@Override public void writeSpawnData(ByteBuf buf) {
buf.writeInt(this.thrower != null ? thrower.getEntityId() : -1);
}
@Override public void readSpawnData(ByteBuf buf) {
Entity e = worldObj.getEntityByID(buf.readInt());
if(e instanceof EntityLivingBase) this.thrower = (EntityLivingBase) e;
}
}

View File

@ -57,6 +57,7 @@ import net.minecraft.world.World;
* - also comes with tons of legacy code to ensure compat (sadly)
* @author hbm
*/
@Deprecated
public class EntityBulletBaseNT extends EntityThrowableInterp implements IBulletBase {
@Override public double prevX() { return prevRenderX; }

View File

@ -1475,6 +1475,7 @@ public class ModItems {
public static Item gun_quadro;
public static Item gun_lag;
public static Item gun_minigun;
public static Item gun_minigun_dual;
public static Item gun_minigun_lacunae;
public static Item gun_missile_launcher;
public static Item gun_tesla_cannon;
@ -6424,6 +6425,7 @@ public class ModItems {
GameRegistry.registerItem(gun_quadro, gun_quadro.getUnlocalizedName());
GameRegistry.registerItem(gun_lag, gun_lag.getUnlocalizedName());
GameRegistry.registerItem(gun_minigun, gun_minigun.getUnlocalizedName());
GameRegistry.registerItem(gun_minigun_dual, gun_minigun_dual.getUnlocalizedName());
GameRegistry.registerItem(gun_minigun_lacunae, gun_minigun_lacunae.getUnlocalizedName());
GameRegistry.registerItem(gun_missile_launcher, gun_missile_launcher.getUnlocalizedName());
GameRegistry.registerItem(gun_tesla_cannon, gun_tesla_cannon.getUnlocalizedName());

View File

@ -126,7 +126,7 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IItemHUD, I
this.quality = quality;
this.lastShot = new long[cfg.length];
for(int i = 0; i < cfg.length; i++) cfg[i].index = i;
if(quality == WeaponQuality.A_SIDE || quality == WeaponQuality.SPECIAL) this.setCreativeTab(MainRegistry.weaponTab);
if(quality == WeaponQuality.A_SIDE || quality == WeaponQuality.SPECIAL || quality == WeaponQuality.UTILITY) this.setCreativeTab(MainRegistry.weaponTab);
if(quality == WeaponQuality.LEGENDARY || quality == WeaponQuality.SECRET) this.secrets.add(this);
this.setTextureName(RefStrings.MODID + ":gun_darter");
}

View File

@ -77,6 +77,7 @@ public class GunFactoryClient {
MinecraftForgeClient.registerItemRenderer(ModItems.gun_quadro, new ItemRenderQuadro());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_minigun, new ItemRenderMinigun(ResourceManager.minigun_tex));
MinecraftForgeClient.registerItemRenderer(ModItems.gun_minigun_lacunae, new ItemRenderMinigun(ResourceManager.minigun_lacunae_tex));
MinecraftForgeClient.registerItemRenderer(ModItems.gun_minigun_dual, new ItemRenderMinigunDual());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_missile_launcher, new ItemRenderMissileLauncher());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_tesla_cannon, new ItemRenderTeslaCannon());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_laser_pistol, new ItemRenderLaserPistol(ResourceManager.laser_pistol_tex));
@ -218,7 +219,7 @@ public class GunFactoryClient {
p35800.setRendererBeam(LegoClient.RENDER_CRACKLE);
ct_hook.setRenderer(LegoClient.RENDER_HIVE);
ct_hook.setRenderer(LegoClient.RENDER_CT_HOOK);
setRendererBulk(LegoClient.RENDER_GRENADE, shell_normal, shell_explosive, shell_ap, shell_du, shell_w9); //TODO: change the sabots
@ -283,6 +284,8 @@ public class GunFactoryClient {
((ItemGunBaseNT) ModItems.gun_maresleg_akimbo) .getConfig(null, 1).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_uzi_akimbo) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY_MIRROR, LegoClient.HUD_COMPONENT_AMMO_MIRROR);
((ItemGunBaseNT) ModItems.gun_uzi_akimbo) .getConfig(null, 1).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_minigun_dual) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY_MIRROR, LegoClient.HUD_COMPONENT_AMMO_MIRROR);
((ItemGunBaseNT) ModItems.gun_minigun_dual) .getConfig(null, 1).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_aberrator_eott) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_AMMO_MIRROR);
((ItemGunBaseNT) ModItems.gun_aberrator_eott) .getConfig(null, 1).hud(LegoClient.HUD_COMPONENT_AMMO);
}

View File

@ -6,8 +6,10 @@ import org.lwjgl.opengl.GL11;
import com.hbm.entity.projectile.EntityBulletBaseMK4;
import com.hbm.entity.projectile.EntityBulletBeamBase;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.sedna.hud.HUDComponentAmmoCounter;
import com.hbm.items.weapon.sedna.hud.HUDComponentDurabilityBar;
import com.hbm.items.weapon.sedna.impl.ItemGunChargeThrower;
import com.hbm.lib.RefStrings;
import com.hbm.main.ResourceManager;
import com.hbm.render.tileentity.RenderArcFurnace;
@ -20,6 +22,7 @@ import net.minecraft.client.renderer.ActiveRenderInfo;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Vec3;
@ -444,4 +447,133 @@ public class LegoClient {
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPopMatrix();
};
public static BiConsumer<EntityBulletBaseMK4, Float> RENDER_CT_HOOK = (bullet, interp) -> {
GL11.glPushMatrix();
GL11.glRotatef(bullet.prevRotationYaw + (bullet.rotationYaw - bullet.prevRotationYaw) * interp - 90.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(bullet.prevRotationPitch + (bullet.rotationPitch - bullet.prevRotationPitch) * interp + 180, 0.0F, 0.0F, 1.0F);
GL11.glScalef(0.125F, 0.125F, 0.125F);
GL11.glRotated(90, 0, -1, 0);
GL11.glRotated(180, 0, 0, 1);
GL11.glTranslatef(0, 0, -6F);
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.charge_thrower_hook_tex);
ResourceManager.charge_thrower.renderPart("Hook");
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPopMatrix();
if(bullet.getThrower() instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) bullet.getThrower();
if(player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.gun_charge_thrower && ItemGunChargeThrower.getLastHook(player.getHeldItem()) == bullet.getEntityId()) {
renderWire(bullet, interp);
}
}
};
public static void renderWire(EntityBulletBaseMK4 bullet, float interp) {
Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.wire_greyscale_tex);
double bx = bullet.prevPosX + (bullet.posX - bullet.prevPosX) * interp;
double by = bullet.prevPosY + (bullet.posY - bullet.prevPosY) * interp;
double bz = bullet.prevPosZ + (bullet.posZ - bullet.prevPosZ) * interp;
Entity thrower = bullet.getThrower();
double x = thrower.prevPosX + (thrower.posX - thrower.prevPosX) * interp;
double y = thrower.prevPosY + (thrower.posY - thrower.prevPosY) * interp;
double z = thrower.prevPosZ + (thrower.posZ - thrower.prevPosZ) * interp;
double eyaw = thrower.prevRotationYaw + (thrower.rotationYaw - thrower.prevRotationYaw) * interp;
double epitch = thrower.prevRotationPitch + (thrower.rotationPitch - thrower.prevRotationPitch) * interp;
Vec3 offset = Vec3.createVectorHelper(0.125D, 0.25, -0.75);
offset.rotateAroundX((float) -epitch / 180F * (float) Math.PI);
offset.rotateAroundY((float) -eyaw / 180F * (float) Math.PI);
Vec3 target = Vec3.createVectorHelper(x - offset.xCoord, y + thrower.getEyeHeight() - offset.yCoord, z - offset.zCoord);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
double deltaX = target.xCoord - bx;
double deltaY = target.yCoord - by;
double deltaZ = target.zCoord - bz;
Vec3 delta = Vec3.createVectorHelper(deltaX, deltaY, deltaZ);
Tessellator tess = Tessellator.instance;
tess.startDrawingQuads();
int count = 10;
double hang = Math.min(delta.lengthVector() / 15D, 0.5D);
double girth = 0.03125D;
double hyp = Math.sqrt(delta.xCoord * delta.xCoord + delta.zCoord * delta.zCoord);
double yaw = Math.atan2(delta.xCoord, delta.zCoord);
double pitch = Math.atan2(delta.yCoord, hyp);
double rotator = Math.PI * 0.5D;
double newPitch = pitch + rotator;
double newYaw = yaw + rotator;
double iZ = Math.cos(yaw) * Math.cos(newPitch) * girth;
double iX = Math.sin(yaw) * Math.cos(newPitch) * girth;
double iY = Math.sin(newPitch) * girth;
double jZ = Math.cos(newYaw) * girth;
double jX = Math.sin(newYaw) * girth;
for(float j = 0; j < count; j++) {
float k = j + 1;
double sagJ = Math.sin(j / count * Math.PI) * hang;
double sagK = Math.sin(k / count * Math.PI) * hang;
double sagMean = (sagJ + sagK) / 2D;
double ja = j + 0.5D;
double ix = bx + deltaX / (double)(count) * ja;
double iy = by + deltaY / (double)(count) * ja - sagMean;
double iz = bz + deltaZ / (double)(count) * ja;
int brightness = bullet.worldObj.getLightBrightnessForSkyBlocks(MathHelper.floor_double(ix), MathHelper.floor_double(iy), MathHelper.floor_double(iz), 0);
tess.setBrightness(brightness);
tess.setColorOpaque_I(0x606060);
drawLineSegment(tess,
(deltaX * j / count),
(deltaY * j / count) - sagJ,
(deltaZ * j / count),
(deltaX * k / count),
(deltaY * k / count) - sagK,
(deltaZ * k / count),
iX, iY, iZ, jX, jZ);
}
tess.draw();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_CULL_FACE);
}
public static void drawLineSegment(Tessellator tessellator, double x, double y, double z, double a, double b, double c, double iX, double iY, double iZ, double jX, double jZ) {
double deltaX = a - x;
double deltaY = b - y;
double deltaZ = c - z;
double length = Math.sqrt(deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ);
int wrap = (int) Math.ceil(length * 8);
if(deltaX + deltaZ < 0) {
wrap *= -1;
jZ *= -1;
jX *= -1;
}
tessellator.addVertexWithUV(x + iX, y + iY, z + iZ, 0, 0);
tessellator.addVertexWithUV(x - iX, y - iY, z - iZ, 0, 1);
tessellator.addVertexWithUV(a - iX, b - iY, c - iZ, wrap, 1);
tessellator.addVertexWithUV(a + iX, b + iY, c + iZ, wrap, 0);
tessellator.addVertexWithUV(x + jX, y, z + jZ, 0, 0);
tessellator.addVertexWithUV(x - jX, y, z - jZ, 0, 1);
tessellator.addVertexWithUV(a - jX, b, c - jZ, wrap, 1);
tessellator.addVertexWithUV(a + jX, b, c + jZ, wrap, 0);
}
}

View File

@ -941,6 +941,35 @@ public class Orchestras {
}
};
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_MINIGUN_DUAL = (stack, ctx) -> {
EntityLivingBase entity = ctx.entity;
if(entity.worldObj.isRemote) return;
AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
if(type == AnimType.CYCLE) {
if(timer == 0) {
int index = ctx.configIndex == 0 ? -1 : 1;
int rounds = WeaponModManager.hasUpgrade(stack, ctx.configIndex, WeaponModManager.ID_MINIGUN_SPEED) ? 3 : 1;
for(int i = 0; i < rounds; i++) {
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.25, -0.25, -0.5D * index, 0, 0.18, -0.12 * index, 0.01, (float)entity.getRNG().nextGaussian() * 15F, (float)entity.getRNG().nextGaussian() * 15F, casing.getName());
}
}
if(timer == (WeaponModManager.hasUpgrade(stack, 0, 207) ? 3 : 1)) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverSpin", 1F, 0.75F);
}
if(type == AnimType.CYCLE_DRY) {
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.dryFireClick", 1F, 0.75F);
if(timer == 1) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverSpin", 1F, 0.75F);
}
if(type == AnimType.RELOAD) {
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverSpin", 1F, 0.75F);
}
if(type == AnimType.INSPECT) {
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverSpin", 1F, 0.75F);
}
};
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_MISSILE_LAUNCHER = (stack, ctx) -> {
EntityLivingBase entity = ctx.entity;
if(entity.worldObj.isRemote) return;

View File

@ -11,6 +11,7 @@ import com.hbm.items.weapon.sedna.Crosshair;
import com.hbm.items.weapon.sedna.GunConfig;
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
import com.hbm.items.weapon.sedna.Receiver;
import com.hbm.items.weapon.sedna.ItemGunBaseNT.GunState;
import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
import com.hbm.items.weapon.sedna.ItemGunBaseNT.WeaponQuality;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
@ -96,6 +97,28 @@ public class XFactory762mm {
.setupStandardConfiguration()
.anim(LAMBDA_MINIGUN_ANIMS).orchestra(Orchestras.ORCHESTRA_MINIGUN)
).setUnlocalizedName("gun_minigun_lacunae");
ModItems.gun_minigun_dual = new ItemGunBaseNT(WeaponQuality.DEBUG,
new GunConfig()
.dura(50_000).draw(20).inspect(20).crosshair(Crosshair.L_CIRCLE).smoke(LAMBDA_SMOKE)
.rec(new Receiver(0)
.dmg(6F).delay(1).auto(true).dry(15).spread(0.01F).sound("hbm:weapon.calShoot", 1.0F, 1.0F)
.mag(new MagazineBelt().addConfigs(r762_sp, r762_fmj, r762_jhp, r762_ap, r762_du, r762_he))
.offset(1, -0.0625 * 2.5, 0.25D)
.setupStandardFire().recoil(LAMBDA_RECOIL_MINIGUN))
.pp(Lego.LAMBDA_STANDARD_CLICK_PRIMARY).pr(Lego.LAMBDA_STANDARD_RELOAD)
.decider(GunStateDecider.LAMBDA_STANDARD_DECIDER)
.anim(LAMBDA_MINIGUN_ANIMS).orchestra(Orchestras.ORCHESTRA_MINIGUN_DUAL),
new GunConfig()
.dura(50_000).draw(20).inspect(20).crosshair(Crosshair.L_CIRCLE).smoke(LAMBDA_SMOKE)
.rec(new Receiver(0)
.dmg(6F).delay(1).auto(true).dry(15).spread(0.01F).sound("hbm:weapon.calShoot", 1.0F, 1.0F)
.mag(new MagazineBelt().addConfigs(r762_sp, r762_fmj, r762_jhp, r762_ap, r762_du, r762_he))
.offset(1, -0.0625 * 2.5, -0.25D)
.setupStandardFire().recoil(LAMBDA_RECOIL_MINIGUN))
.ps(Lego.LAMBDA_STANDARD_CLICK_PRIMARY).pr(Lego.LAMBDA_STANDARD_RELOAD)
.decider(LAMBDA_SECOND_MINIGUN)
.anim(LAMBDA_MINIGUN_ANIMS).orchestra(Orchestras.ORCHESTRA_MINIGUN_DUAL)
).setUnlocalizedName("gun_minigun_dual");
ModItems.gun_mas36 = new ItemGunBaseNT(WeaponQuality.LEGENDARY, new GunConfig()
.dura(5_000).draw(20).inspect(31).reloadSequential(true).crosshair(Crosshair.CIRCLE).smoke(LAMBDA_SMOKE)
@ -109,6 +132,15 @@ public class XFactory762mm {
).setUnlocalizedName("gun_mas36");
}
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_SECOND_MINIGUN = (stack, ctx) -> {
int index = ctx.configIndex;
GunState lastState = ItemGunBaseNT.getState(stack, index);
GunStateDecider.deciderStandardFinishDraw(stack, lastState, index);
GunStateDecider.deciderStandardClearJam(stack, lastState, index);
GunStateDecider.deciderStandardReload(stack, ctx, lastState, 0, index);
GunStateDecider.deciderAutoRefire(stack, ctx, lastState, 0, index, () -> { return ItemGunBaseNT.getSecondary(stack, index) && ItemGunBaseNT.getMode(stack, ctx.configIndex) == 0; });
};
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_SMOKE = (stack, ctx) -> {
Lego.handleStandardSmoke(ctx.entity, stack, 1500, 0.075D, 1.1D, 0);
};

View File

@ -2,7 +2,9 @@ package com.hbm.items.weapon.sedna.factory;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import java.util.function.Consumer;
import com.hbm.entity.projectile.EntityBulletBaseMK4;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.sedna.BulletConfig;
import com.hbm.items.weapon.sedna.Crosshair;
@ -12,23 +14,48 @@ import com.hbm.items.weapon.sedna.Receiver;
import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
import com.hbm.items.weapon.sedna.ItemGunBaseNT.WeaponQuality;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
import com.hbm.items.weapon.sedna.impl.ItemGunChargeThrower;
import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
import com.hbm.render.anim.BusAnimation;
import com.hbm.render.anim.BusAnimationSequence;
import com.hbm.render.anim.BusAnimationKeyframe.IType;
import com.hbm.render.anim.HbmAnimations.AnimType;
import com.hbm.util.Vec3NT;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
public class XFactoryTool {
public static BulletConfig ct_hook;
public static Consumer<Entity> LAMBDA_SET_HOOK = (entity) -> {
EntityBulletBaseMK4 bullet = (EntityBulletBaseMK4) entity;
if(!bullet.worldObj.isRemote && bullet.ticksExisted < 2 && bullet.getThrower() instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) bullet.getThrower();
if(player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.gun_charge_thrower) {
ItemGunChargeThrower.setLastHook(player.getHeldItem(), bullet.getEntityId());
}
}
bullet.ignoreFrustumCheck = true;
};
public static BiConsumer<EntityBulletBaseMK4, MovingObjectPosition> LAMBDA_HOOK = (bullet, mop) -> {
if(mop.typeOfHit == mop.typeOfHit.BLOCK) {
Vec3NT vec = new Vec3NT(-bullet.motionX, -bullet.motionY, -bullet.motionZ).normalizeSelf().multiply(0.05);
bullet.setPosition(mop.hitVec.xCoord + vec.xCoord, mop.hitVec.yCoord + vec.yCoord, mop.hitVec.zCoord + vec.zCoord);
bullet.getStuck(mop.blockX, mop.blockY, mop.blockZ, mop.sideHit);
}
};
public static void init() {
ct_hook = new BulletConfig().setItem(EnumAmmo.CT_HOOK);
ct_hook = new BulletConfig().setItem(EnumAmmo.CT_HOOK).setRenderRotations(false).setLife(1200).setVel(2F).setGrav(0.035D).setDoesPenetrate(true).setDamageFalloffByPen(false)
.setOnUpdate(LAMBDA_SET_HOOK).setOnImpact(LAMBDA_HOOK);
ModItems.gun_charge_thrower = new ItemGunBaseNT(WeaponQuality.UTILITY, new GunConfig()
ModItems.gun_charge_thrower = new ItemGunChargeThrower(WeaponQuality.UTILITY, new GunConfig()
.dura(3_000).draw(20).inspect(31).reloadChangeType(true).hideCrosshair(false).crosshair(Crosshair.L_CIRCUMFLEX)
.rec(new Receiver(0)
.dmg(5F).delay(4).dry(40).auto(true).spread(0F).spreadHipfire(0F).reload(60).jam(55).sound("hbm:weapon.fire.grenade", 1.0F, 1.0F)

View File

@ -0,0 +1,74 @@
package com.hbm.items.weapon.sedna.impl;
import com.hbm.entity.projectile.EntityBulletBaseMK4;
import com.hbm.extprop.HbmPlayerProps;
import com.hbm.handler.HbmKeybinds.EnumKeybind;
import com.hbm.items.weapon.sedna.GunConfig;
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
import com.hbm.items.weapon.sedna.factory.XFactoryTool;
import com.hbm.util.ArmorUtil;
import com.hbm.util.Vec3NT;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class ItemGunChargeThrower extends ItemGunBaseNT {
public static final String KEY_LASTHOOK = "lasthook";
public ItemGunChargeThrower(WeaponQuality quality, GunConfig... cfg) {
super(quality, cfg);
}
@Override
public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean isHeld) {
super.onUpdate(stack, world, entity, slot, isHeld);
if(this.getState(stack, 0) == GunState.RELOADING) {
if(this.getLastHook(stack) != -1) this.setLastHook(stack, -1);
}
if(isHeld && entity instanceof EntityPlayer) {
Entity e = world.getEntityByID(this.getLastHook(stack));
if(e != null && !e.isDead && e instanceof EntityBulletBaseMK4 && ((EntityBulletBaseMK4) e).config == XFactoryTool.ct_hook && ((EntityBulletBaseMK4) e).velocity < 0.01) {
EntityPlayer player = (EntityPlayer) entity;
Vec3NT vec = new Vec3NT(e.posX - player.posX, e.posY - player.posY - player.getEyeHeight(), e.posZ - player.posZ);
double line = vec.lengthVector();
if(HbmPlayerProps.getData((EntityPlayer) entity).getKeyPressed(EnumKeybind.GUN_PRIMARY)) {
vec.normalizeSelf().multiply(0.1);
player.motionX += vec.xCoord;
player.motionY += vec.yCoord + 0.04;
player.motionZ += vec.zCoord;
if(!world.isRemote && line < 2) e.setDead();
} else if(!HbmPlayerProps.getData((EntityPlayer) entity).getKeyPressed(EnumKeybind.GUN_SECONDARY)) {
Vec3NT nextPos = new Vec3NT(player.posX + player.motionX, player.posY + player.getEyeHeight() + player.motionY, player.posZ + player.motionZ);
Vec3NT delta = new Vec3NT(e.posX - nextPos.xCoord, e.posY - nextPos.yCoord, e.posZ - nextPos.zCoord);
if(delta.lengthVector() > line) {
delta.normalizeSelf().multiply(line);
Vec3NT newNext = new Vec3NT(e.posX - delta.xCoord, e.posY - delta.yCoord, e.posZ - delta.zCoord);
Vec3NT vel = new Vec3NT(newNext.xCoord - player.posX, newNext.yCoord - player.posY - player.getEyeHeight(), newNext.zCoord - player.posZ);
if(vel.lengthVector() < 3) {
player.motionX = vel.xCoord;
player.motionY = vel.yCoord;
player.motionZ = vel.zCoord;
}
}
} else {
player.motionX *= 0.5;
player.motionY *= 0.5;
player.motionZ *= 0.5;
}
if(player.motionY > -0.1) player.fallDistance = 0;
ArmorUtil.resetFlightTime((EntityPlayer)entity);
}
} else {
if(this.getLastHook(stack) != -1) this.setLastHook(stack, -1);
}
}
public static int getLastHook(ItemStack stack) { return getValueInt(stack, KEY_LASTHOOK); }
public static void setLastHook(ItemStack stack, int value) { setValueInt(stack, KEY_LASTHOOK, value); }
}

View File

@ -133,9 +133,9 @@ public class WeaponModManager {
.addMod(ModItems.gun_panzerschreck, new WeaponModPanzerschreckSawedOff(ID_NO_SHIELD))
.addMod(new Item[] {ModItems.gun_g3, ModItems.gun_g3_zebra}, new WeapnModG3SawedOff(ID_NO_STOCK));
new WeaponModDefinition(EnumModSpecial.GREASEGUN).addMod(ModItems.gun_greasegun, new WeaponModGreasegun(ID_GREASEGUN_CLEAN));
new WeaponModDefinition(EnumModSpecial.SLOWDOWN).addMod(ModItems.gun_minigun, new WeaponModSlowdown(207));
new WeaponModDefinition(EnumModSpecial.SLOWDOWN).addMod(new Item[] {ModItems.gun_minigun, ModItems.gun_minigun_dual}, new WeaponModSlowdown(207));
new WeaponModDefinition(EnumModSpecial.SPEEDUP)
.addMod(ModItems.gun_minigun, new WeaponModMinigunSpeedup(ID_MINIGUN_SPEED))
.addMod(new Item[] {ModItems.gun_minigun, ModItems.gun_minigun_dual}, new WeaponModMinigunSpeedup(ID_MINIGUN_SPEED))
.addMod(new Item[] {ModItems.gun_autoshotgun, ModItems.gun_autoshotgun_shredder}, new WeaponModShredderSpeedup(209));
new WeaponModDefinition(EnumModSpecial.CHOKE).addMod(new Item[] {ModItems.gun_pepperbox, ModItems.gun_maresleg, ModItems.gun_double_barrel, ModItems.gun_liberator, ModItems.gun_spas12}, new WeaponModChoke(210));
new WeaponModDefinition(EnumModSpecial.FURNITURE_GREEN).addMod(ModItems.gun_g3, new WeaponModPolymerFurniture(ID_FURNITURE_GREEN));
@ -177,13 +177,13 @@ public class WeaponModManager {
new WeaponModDefinition(EnumModCaliber.R556)
.addMod(ModItems.gun_henry, new WeaponModCaliber(350, 10, 10F, r556))
.addMod(ModItems.gun_carbine, new WeaponModCaliber(351, 20, 15F, r556))
.addMod(ModItems.gun_minigun, new WeaponModCaliber(352, 0, 6F, r556));
.addMod(new Item[] {ModItems.gun_minigun, ModItems.gun_minigun_dual}, new WeaponModCaliber(352, 0, 6F, r556));
new WeaponModDefinition(EnumModCaliber.R762)
.addMod(ModItems.gun_henry, new WeaponModCaliber(360, 8, 10F, r762))
.addMod(ModItems.gun_g3, new WeaponModCaliber(361, 24, 5F, r762));
new WeaponModDefinition(EnumModCaliber.BMG50)
.addMod(ModItems.gun_henry, new WeaponModCaliber(370, 5, 10F, bmg50))
.addMod(ModItems.gun_minigun, new WeaponModCaliber(371, 0, 6F, bmg50));
.addMod(new Item[] {ModItems.gun_minigun, ModItems.gun_minigun_dual}, new WeaponModCaliber(371, 0, 6F, bmg50));
}
public static final int ID_SILENCER = 201;

View File

@ -995,6 +995,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 minigun_lacunae_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/minigun_lacunae.png");
public static final ResourceLocation minigun_dual_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/minigun_dual.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 laser_pistol_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/laser_pistol.png");

View File

@ -59,6 +59,7 @@ public class ItemRenderMinigun extends ItemRenderWeaponBase {
GL11.glShadeModel(GL11.GL_SMOOTH);
ResourceManager.minigun.renderPart("Gun");
ResourceManager.minigun.renderPart("Grip");
GL11.glPushMatrix();
GL11.glRotated(rotate[2], 0, 0, 1);
@ -124,7 +125,9 @@ public class ItemRenderMinigun extends ItemRenderWeaponBase {
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
ResourceManager.minigun.renderAll();
ResourceManager.minigun.renderPart("Gun");
ResourceManager.minigun.renderPart("Grip");
ResourceManager.minigun.renderPart("Barrels");
GL11.glShadeModel(GL11.GL_FLAT);
}
}

View File

@ -0,0 +1,193 @@
package com.hbm.render.item.weapon.sedna;
import org.lwjgl.opengl.GL11;
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
import com.hbm.items.weapon.sedna.mods.WeaponModManager;
import com.hbm.main.ResourceManager;
import com.hbm.render.anim.HbmAnimations;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
public class ItemRenderMinigunDual extends ItemRenderWeaponBase {
@Override public boolean isAkimbo() { return true; }
@Override
protected float getTurnMagnitude(ItemStack stack) { return ItemGunBaseNT.getIsAiming(stack) ? 2.5F : -0.25F; }
@Override
public float getViewFOV(ItemStack stack, float fov) {
float aimingProgress = ItemGunBaseNT.prevAimingProgress + (ItemGunBaseNT.aimingProgress - ItemGunBaseNT.prevAimingProgress) * interp;
return fov * (1 - aimingProgress * 0.33F);
}
@Override
public void setupFirstPerson(ItemStack stack) {
GL11.glTranslated(0, 0, 0.875);
}
@Override
public void renderFirstPerson(ItemStack stack) {
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
float offset = 0.8F;
for(int i = -1; i <= 1; i += 2) {
int index = i == -1 ? 0 : 1;
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.minigun_dual_tex);
GL11.glPushMatrix();
standardAimingTransform(stack, -2.75F * offset * i, -1.75F * offset, 2.5F * offset, 0, 0, 0);
double scale = 0.375D;
GL11.glScaled(scale, scale, scale);
double[] equip = HbmAnimations.getRelevantTransformation("EQUIP", index);
double[] recoil = HbmAnimations.getRelevantTransformation("RECOIL", index);
double[] rotate = HbmAnimations.getRelevantTransformation("ROTATE", index);
GL11.glTranslated(0, 3, -6);
GL11.glRotated(equip[0], 1, 0, 0);
GL11.glTranslated(0, -3, 6);
GL11.glTranslated(0, 0, recoil[2]);
GL11.glShadeModel(GL11.GL_SMOOTH);
ResourceManager.minigun.renderPart(index == 0 ? "GunDual" : "Gun");
GL11.glPushMatrix();
GL11.glRotated(rotate[2] * i, 0, 0, 1);
ResourceManager.minigun.renderPart("Barrels");
GL11.glPopMatrix();
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPushMatrix();
GL11.glTranslated(0, 0, 12);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(gun.shotRand * 90, 1, 0, 0);
GL11.glScaled(1.5, 1.5, 1.5);
this.renderMuzzleFlash(gun.lastShot[index], 75, 5);
GL11.glPopMatrix();
GL11.glPopMatrix();
}
}
@Override
public void setupThirdPerson(ItemStack stack) {
super.setupThirdPerson(stack);
double scale = 1.75D;
GL11.glScaled(scale, scale, scale);
GL11.glTranslated(-1, -3.5, 8);
}
@Override
public void setupThirdPersonAkimbo(ItemStack stack) {
super.setupThirdPerson(stack);
double scale = 1.75D;
GL11.glScaled(scale, scale, scale);
GL11.glTranslated(2, -3.5, 8);
}
@Override
public void setupInv(ItemStack stack) {
GL11.glScaled(1, 1, -1);
GL11.glTranslated(8, 8, 0);
double scale = 0.875D;
GL11.glScaled(scale, scale, scale);
}
@Override
public void setupModTable(ItemStack stack) {
double scale = -6.25D;
GL11.glScaled(scale, scale, scale);
GL11.glRotated(90, 0, 1, 0);
}
@Override
public void renderEquipped(ItemStack stack) {
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.minigun_dual_tex);
ResourceManager.minigun.renderPart("Gun");
ResourceManager.minigun.renderPart("Barrels");
GL11.glShadeModel(GL11.GL_FLAT);
}
@Override
public void renderEquippedAkimbo(ItemStack stack) {
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.minigun_dual_tex);
ResourceManager.minigun.renderPart("GunDual");
ResourceManager.minigun.renderPart("Barrels");
GL11.glShadeModel(GL11.GL_FLAT);
}
@Override
public void renderModTable(ItemStack stack, int index) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.minigun_dual_tex);
ResourceManager.minigun.renderPart(index == 0 ? "GunDual" : "Gun");
ResourceManager.minigun.renderPart("Grip");
ResourceManager.minigun.renderPart("Barrels");
GL11.glShadeModel(GL11.GL_FLAT);
}
@Override
public void renderInv(ItemStack stack) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.minigun_dual_tex);
GL11.glPushMatrix();
GL11.glRotated(225, 0, 0, 1);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(45, 0, 1, 0);
ResourceManager.minigun.renderPart("GunDual");
ResourceManager.minigun.renderPart("Barrels");
GL11.glPopMatrix();
GL11.glTranslated(0, 0, 8);
GL11.glPushMatrix();
GL11.glRotated(225, 0, 0, 1);
GL11.glRotated(-90, 0, 1, 0);
GL11.glRotated(-90, 1, 0, 0);
GL11.glRotated(-45, 0, 1, 0);
ResourceManager.minigun.renderPart("Gun");
ResourceManager.minigun.renderPart("Barrels");
GL11.glPopMatrix();
GL11.glShadeModel(GL11.GL_FLAT);
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.minigun_dual_tex);
ResourceManager.minigun.renderPart("Gun");
ResourceManager.minigun.renderPart("Barrels");
GL11.glShadeModel(GL11.GL_FLAT);
}
public boolean hasSilencer(ItemStack stack, int cfg) {
return WeaponModManager.hasUpgrade(stack, cfg, WeaponModManager.ID_SILENCER);
}
public boolean isSaturnite(ItemStack stack, int cfg) {
return WeaponModManager.hasUpgrade(stack, cfg, WeaponModManager.ID_UZI_SATURN);
}
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB