more fstbmb work, quadro guided rocket launcher
5715
src/main/java/assets/hbm/models/weapons/quadro.obj
Normal file
@ -130,7 +130,8 @@
|
||||
"weapon.bonk": {"category": "player", "sounds": [{"name": "weapon/bonk", "stream": false}]},
|
||||
"weapon.hksShoot": {"category": "player", "sounds": ["weapon/hksShoot1", "weapon/hksShoot2", "weapon/hksShoot3"]},
|
||||
"weapon.glauncher": {"category": "player", "sounds": ["weapon/glauncher1", "weapon/glauncher2"]},
|
||||
"weapon.bodysplat": {"category": "player", "sounds": [{"name": "weapon/bodysplat", "stream": false}]},
|
||||
"weapon.bodysplat": {"category": "player", "sounds": [{"name": "weapon/bodysplat", "stream": false}]},
|
||||
"weapon.quadroReload": {"category": "player", "sounds": [{"name": "weapon/quadroReload", "stream": false}]},
|
||||
|
||||
"weapon.reloadTurret": {"category": "player", "sounds": [{"name": "weapon/reloadTurret", "stream": false}]},
|
||||
"weapon.switchmode1": {"category": "player", "sounds": [{"name": "weapon/switchmode1", "stream": false}]},
|
||||
|
||||
BIN
src/main/java/assets/hbm/sounds/weapon/fstbmbPing.ogg
Normal file
BIN
src/main/java/assets/hbm/sounds/weapon/fstbmbStart.ogg
Normal file
BIN
src/main/java/assets/hbm/sounds/weapon/quadroReload.ogg
Normal file
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 9.3 KiB |
BIN
src/main/java/assets/hbm/textures/items/egg_balefire.png
Normal file
|
After Width: | Height: | Size: 548 B |
BIN
src/main/java/assets/hbm/textures/items/egg_balefire_blank.png
Normal file
|
After Width: | Height: | Size: 460 B |
BIN
src/main/java/assets/hbm/textures/models/weapons/quadro.png
Normal file
|
After Width: | Height: | Size: 932 B |
|
After Width: | Height: | Size: 189 B |
@ -325,40 +325,28 @@ public class ModBlocks {
|
||||
|
||||
public static Block nuke_gadget;
|
||||
public static final int guiID_nuke_gadget = 3;
|
||||
|
||||
public static Block nuke_boy;
|
||||
public static final int guiID_nuke_boy = 4;
|
||||
|
||||
public static Block nuke_man;
|
||||
public static final int guiID_nuke_man = 6;
|
||||
|
||||
public static Block nuke_mike;
|
||||
public static final int guiID_nuke_mike = 11;
|
||||
|
||||
public static Block nuke_tsar;
|
||||
public static final int guiID_nuke_tsar = 12;
|
||||
|
||||
public static Block nuke_fleija;
|
||||
public static final int guiID_nuke_fleija = 17;
|
||||
|
||||
public static Block nuke_prototype;
|
||||
public static final int guiID_nuke_prototype = 23;
|
||||
|
||||
public static Block nuke_custom;
|
||||
public static final int guiID_nuke_custom = 37;
|
||||
|
||||
public static Block nuke_solinium;
|
||||
public static final int guiID_nuke_solinium = 60;
|
||||
|
||||
public static Block nuke_n2;
|
||||
public static final int guiID_nuke_n2 = 61;
|
||||
|
||||
public static Block nuke_n45;
|
||||
public static final int guiID_nuke_n45 = 77;
|
||||
|
||||
public static Block nuke_balefire;
|
||||
public static final int guiID_nuke_balefire = 0000;
|
||||
|
||||
public static Block nuke_fstbmb;
|
||||
public static final int guiID_nuke_fstbmb = 0000;
|
||||
public static Block bomb_multi;
|
||||
public static final int guiID_bomb_multi = 10;
|
||||
|
||||
@ -1009,7 +997,7 @@ public class ModBlocks {
|
||||
nuke_solinium = new NukeSolinium(Material.iron).setBlockName("nuke_solinium").setCreativeTab(MainRegistry.nukeTab).setHardness(5.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":nuke_solinium");
|
||||
nuke_n2 = new NukeN2(Material.iron).setBlockName("nuke_n2").setCreativeTab(MainRegistry.nukeTab).setHardness(5.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":nuke_n2");
|
||||
nuke_n45 = new NukeN45(Material.iron).setBlockName("nuke_n45").setCreativeTab(MainRegistry.nukeTab).setHardness(5.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":code");
|
||||
//nuke_balefire = new NukeBalefire(Material.iron).setBlockName("nuke_balefire").setCreativeTab(MainRegistry.nukeTab).setHardness(5.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":nuke_balefire");
|
||||
nuke_fstbmb = new NukeBalefire(Material.iron, guiID_nuke_fstbmb).setBlockName("nuke_fstbmb").setCreativeTab(MainRegistry.nukeTab).setHardness(5.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":nuke_fstbmb");
|
||||
|
||||
cel_prime = new CelPrime(Material.iron).setBlockName("cel_prime").setCreativeTab(null).setHardness(5.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":code");
|
||||
cel_prime_terminal = new CelPrimePart(Material.iron).setBlockName("cel_prime_terminal").setCreativeTab(null).setHardness(5.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":code");
|
||||
@ -1632,6 +1620,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(nuke_solinium, nuke_solinium.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(nuke_n2, nuke_n2.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(nuke_n45, nuke_n45.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(nuke_fstbmb, nuke_fstbmb.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(nuke_custom, nuke_custom.getUnlocalizedName());
|
||||
|
||||
//Generic Bombs
|
||||
|
||||
@ -9,13 +9,29 @@ import net.minecraft.world.World;
|
||||
|
||||
public class NukeBalefire extends BlockMachineBase {
|
||||
|
||||
protected NukeBalefire(Material mat, int guiID) {
|
||||
public NukeBalefire(Material mat, int guiID) {
|
||||
super(mat, guiID);
|
||||
rotatable = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityNukeBalefire();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType(){
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ import net.minecraft.world.World;
|
||||
public abstract class BlockMachineBase extends BlockContainer {
|
||||
|
||||
int guiID = -1;
|
||||
boolean rotatable = false;
|
||||
protected boolean rotatable = false;
|
||||
|
||||
protected BlockMachineBase(Material mat, int guiID) {
|
||||
super(mat);
|
||||
|
||||
@ -44,7 +44,7 @@ import net.minecraft.world.World;
|
||||
public class EntityBulletBase extends Entity implements IProjectile {
|
||||
|
||||
private BulletConfiguration config;
|
||||
private EntityLivingBase shooter;
|
||||
public EntityLivingBase shooter;
|
||||
public float overrideDamage;
|
||||
|
||||
public EntityBulletBase(World world) {
|
||||
@ -322,13 +322,17 @@ public class EntityBulletBase extends Entity implements IProjectile {
|
||||
/// ZONE 1 END ///
|
||||
|
||||
if(!didBounce) {
|
||||
motionY -= config.gravity;
|
||||
motionY -= config.gravity;
|
||||
this.posX += this.motionX * this.config.velocity;
|
||||
this.posY += this.motionY * this.config.velocity;
|
||||
this.posZ += this.motionZ * this.config.velocity;
|
||||
this.setPosition(this.posX, this.posY, this.posZ);
|
||||
}
|
||||
|
||||
/// SPECIAL UPDATE BEHAVIOR ///
|
||||
if(this.config.bUpdate != null)
|
||||
this.config.bUpdate.behaveUpdate(this);
|
||||
|
||||
if(this.config.style == BulletConfiguration.STYLE_ROCKET && !worldObj.isRemote)
|
||||
this.worldObj.spawnEntityInWorld(new EntityTSmokeFX(worldObj, this.posX, this.posY, this.posZ, 0, 0, 0));
|
||||
|
||||
|
||||
@ -144,6 +144,18 @@ public class BulletConfigSyncingUtil {
|
||||
public static int G20_SHOCK_FIRE = i++;
|
||||
public static int G20_WITHER_FIRE = i++;
|
||||
|
||||
public static int ROCKET_NORMAL_LASER = i++;
|
||||
public static int ROCKET_HE_LASER = i++;
|
||||
public static int ROCKET_INCENDIARY_LASER = i++;
|
||||
public static int ROCKET_SHRAPNEL_LASER = i++;
|
||||
public static int ROCKET_EMP_LASER = i++;
|
||||
public static int ROCKET_GLARE_LASER = i++;
|
||||
public static int ROCKET_SLEEK_LASER = i++;
|
||||
public static int ROCKET_NUKE_LASER = i++;
|
||||
public static int ROCKET_CHAINSAW_LASER = i++;
|
||||
public static int ROCKET_TOXIC_LASER = i++;
|
||||
public static int ROCKET_PHOSPHORUS_LASER = i++;
|
||||
|
||||
public static int NUKE_NORMAL = i++;
|
||||
public static int NUKE_MIRV = i++;
|
||||
public static int NUKE_AMAT = i++;
|
||||
@ -283,6 +295,18 @@ public class BulletConfigSyncingUtil {
|
||||
configSet.put(G20_CAUSTIC_FIRE, Gun20GaugeFactory.get20GaugeCausticConfig().setToFire(3));
|
||||
configSet.put(G20_SHOCK_FIRE, Gun20GaugeFactory.get20GaugeShockConfig().setToFire(3));
|
||||
configSet.put(G20_WITHER_FIRE, Gun20GaugeFactory.get20GaugeWitherConfig().setToFire(3));
|
||||
|
||||
configSet.put(ROCKET_NORMAL_LASER, GunRocketFactory.getRocketConfig().setToGuided());
|
||||
configSet.put(ROCKET_HE_LASER, GunRocketFactory.getRocketHEConfig().setToGuided());
|
||||
configSet.put(ROCKET_INCENDIARY_LASER, GunRocketFactory.getRocketIncendiaryConfig().setToGuided());
|
||||
configSet.put(ROCKET_PHOSPHORUS_LASER, GunRocketFactory.getRocketPhosphorusConfig().setToGuided());
|
||||
configSet.put(ROCKET_SHRAPNEL_LASER, GunRocketFactory.getRocketShrapnelConfig().setToGuided());
|
||||
configSet.put(ROCKET_EMP_LASER, GunRocketFactory.getRocketEMPConfig().setToGuided());
|
||||
configSet.put(ROCKET_GLARE_LASER, GunRocketFactory.getRocketGlareConfig().setToGuided());
|
||||
configSet.put(ROCKET_SLEEK_LASER, GunRocketFactory.getRocketSleekConfig().setToGuided());
|
||||
configSet.put(ROCKET_NUKE_LASER, GunRocketFactory.getRocketNukeConfig().setToGuided());
|
||||
configSet.put(ROCKET_CHAINSAW_LASER, GunRocketFactory.getRocketRPCConfig().setToGuided());
|
||||
configSet.put(ROCKET_TOXIC_LASER, GunRocketFactory.getRocketChlorineConfig().setToGuided());
|
||||
|
||||
configSet.put(NUKE_NORMAL, GunFatmanFactory.getNukeConfig());
|
||||
configSet.put(NUKE_PROTO, GunFatmanFactory.getNukeProtoConfig());
|
||||
|
||||
@ -2,10 +2,12 @@ package com.hbm.handler;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.handler.guncfg.BulletConfigFactory;
|
||||
import com.hbm.interfaces.IBulletHitBehavior;
|
||||
import com.hbm.interfaces.IBulletHurtBehavior;
|
||||
import com.hbm.interfaces.IBulletImpactBehavior;
|
||||
import com.hbm.interfaces.IBulletRicochetBehavior;
|
||||
import com.hbm.interfaces.IBulletUpdateBehavior;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
@ -73,6 +75,7 @@ public class BulletConfiguration {
|
||||
public IBulletHitBehavior bHit;
|
||||
public IBulletRicochetBehavior bRicochet;
|
||||
public IBulletImpactBehavior bImpact;
|
||||
public IBulletUpdateBehavior bUpdate;
|
||||
|
||||
//appearance
|
||||
public int style;
|
||||
@ -119,5 +122,11 @@ public class BulletConfiguration {
|
||||
this.incendiary = duration;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BulletConfiguration setToGuided() {
|
||||
|
||||
this.bUpdate = BulletConfigFactory.getLaserSteering();
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -860,6 +860,15 @@ public class GUIHandler implements IGuiHandler {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_nuke_fstbmb:
|
||||
{
|
||||
if(entity instanceof TileEntityNukeBalefire)
|
||||
{
|
||||
return new ContainerNukeFstbmb(player.inventory, (TileEntityNukeBalefire) entity);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//NON-TE CONTAINERS
|
||||
@ -1717,6 +1726,15 @@ public class GUIHandler implements IGuiHandler {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_nuke_fstbmb:
|
||||
{
|
||||
if(entity instanceof TileEntityNukeBalefire)
|
||||
{
|
||||
return new GUINukeFstbmb(player.inventory, (TileEntityNukeBalefire) entity);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//CLIENTONLY GUIS
|
||||
|
||||
@ -6,6 +6,7 @@ import com.hbm.entity.projectile.EntityBulletBase;
|
||||
import com.hbm.handler.ArmorUtil;
|
||||
import com.hbm.handler.BulletConfiguration;
|
||||
import com.hbm.interfaces.IBulletImpactBehavior;
|
||||
import com.hbm.interfaces.IBulletUpdateBehavior;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
@ -20,6 +21,8 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
|
||||
public class BulletConfigFactory {
|
||||
|
||||
@ -263,5 +266,39 @@ public class BulletConfigFactory {
|
||||
|
||||
return impact;
|
||||
}
|
||||
|
||||
public static IBulletUpdateBehavior getLaserSteering() {
|
||||
|
||||
IBulletUpdateBehavior onUpdate = new IBulletUpdateBehavior() {
|
||||
|
||||
@Override
|
||||
public void behaveUpdate(EntityBulletBase bullet) {
|
||||
|
||||
if(bullet.shooter == null || !(bullet.shooter instanceof EntityPlayer))
|
||||
return;
|
||||
|
||||
MovingObjectPosition mop = Library.rayTrace((EntityPlayer)bullet.shooter, 200, 1);
|
||||
|
||||
if(mop == null || mop.hitVec == null)
|
||||
return;
|
||||
|
||||
Vec3 vec = Vec3.createVectorHelper(mop.hitVec.xCoord - bullet.posX, mop.hitVec.yCoord - bullet.posY, mop.hitVec.zCoord - bullet.posZ);
|
||||
|
||||
if(vec.lengthVector() < 3)
|
||||
return;
|
||||
|
||||
vec = vec.normalize();
|
||||
|
||||
double speed = Vec3.createVectorHelper(bullet.motionX, bullet.motionY, bullet.motionZ).lengthVector();
|
||||
|
||||
bullet.motionX = vec.xCoord * speed;
|
||||
bullet.motionY = vec.yCoord * speed;
|
||||
bullet.motionZ = vec.zCoord * speed;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
return onUpdate;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -8,6 +8,10 @@ import com.hbm.handler.BulletConfiguration;
|
||||
import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.interfaces.IBulletRicochetBehavior;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.render.anim.BusAnimation;
|
||||
import com.hbm.render.anim.BusAnimationKeyframe;
|
||||
import com.hbm.render.anim.BusAnimationSequence;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
@ -55,6 +59,70 @@ public class GunRocketFactory {
|
||||
return config;
|
||||
}
|
||||
|
||||
public static GunConfiguration getQuadroConfig() {
|
||||
|
||||
GunConfiguration config = new GunConfiguration();
|
||||
|
||||
config.rateOfFire = 5;
|
||||
config.roundsPerCycle = 1;
|
||||
config.gunMode = GunConfiguration.MODE_NORMAL;
|
||||
config.firingMode = GunConfiguration.FIRE_MANUAL;
|
||||
config.reloadDuration = 100;
|
||||
config.firingDuration = 0;
|
||||
config.ammoCap = 4;
|
||||
config.reloadType = GunConfiguration.RELOAD_FULL;
|
||||
config.allowsInfinity = true;
|
||||
config.crosshair = Crosshair.L_CIRCUMFLEX;
|
||||
config.firingSound = "hbm:weapon.rpgShoot";
|
||||
config.reloadSound = "hbm:weapon.quadroReload";
|
||||
config.reloadSoundEnd = false;
|
||||
|
||||
config.animations.put(AnimType.CYCLE, new BusAnimation()
|
||||
.addBus("QUADRO_RECOIL", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, -0.5, 50))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 50))
|
||||
)
|
||||
);
|
||||
|
||||
config.animations.put(AnimType.RELOAD, new BusAnimation()
|
||||
.addBus("QUADRO_RELOAD_ROTATE", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 60, 750))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 60, 3500))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 750))
|
||||
)
|
||||
.addBus("QUADRO_RELOAD_PUSH", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(-1, -1, 0, 0))
|
||||
.addKeyframe(new BusAnimationKeyframe(-1, -1, 0, 750))
|
||||
.addKeyframe(new BusAnimationKeyframe(-1, 0, 0, 500))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 3000))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 750))
|
||||
)
|
||||
);
|
||||
|
||||
config.name = "OpenQuadro Guided Man-Portable Missile Launcher";
|
||||
config.manufacturer = "Open Mann Co.";
|
||||
config.comment.add("For the next three hundred years, people who needed to get to the second");
|
||||
config.comment.add("floor used the only method available to them, which was rocket jumping.");
|
||||
config.comment.add("This persisted until 1857, when the young bearded inventor named");
|
||||
config.comment.add("President Abraham Lincoln invented stairs.");
|
||||
|
||||
config.config = new ArrayList<Integer>();
|
||||
config.config.add(BulletConfigSyncingUtil.ROCKET_NORMAL_LASER);
|
||||
config.config.add(BulletConfigSyncingUtil.ROCKET_HE_LASER);
|
||||
config.config.add(BulletConfigSyncingUtil.ROCKET_INCENDIARY_LASER);
|
||||
config.config.add(BulletConfigSyncingUtil.ROCKET_PHOSPHORUS_LASER);
|
||||
config.config.add(BulletConfigSyncingUtil.ROCKET_SHRAPNEL_LASER);
|
||||
config.config.add(BulletConfigSyncingUtil.ROCKET_EMP_LASER);
|
||||
config.config.add(BulletConfigSyncingUtil.ROCKET_GLARE_LASER);
|
||||
config.config.add(BulletConfigSyncingUtil.ROCKET_TOXIC_LASER);
|
||||
config.config.add(BulletConfigSyncingUtil.ROCKET_SLEEK_LASER);
|
||||
config.config.add(BulletConfigSyncingUtil.ROCKET_NUKE_LASER);
|
||||
config.config.add(BulletConfigSyncingUtil.ROCKET_CHAINSAW_LASER);
|
||||
config.durability = 500;
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
public static GunConfiguration getKarlConfig() {
|
||||
|
||||
GunConfiguration config = getGustavConfig();
|
||||
|
||||
10
src/main/java/com/hbm/interfaces/IBulletUpdateBehavior.java
Normal file
@ -0,0 +1,10 @@
|
||||
package com.hbm.interfaces;
|
||||
|
||||
import com.hbm.entity.projectile.EntityBulletBase;
|
||||
|
||||
public interface IBulletUpdateBehavior {
|
||||
|
||||
//once every update, for lcokon, steering and other memes
|
||||
public void behaveUpdate(EntityBulletBase bullet);
|
||||
|
||||
}
|
||||
@ -0,0 +1,73 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.tileentity.bomb.TileEntityNukeBalefire;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerNukeFstbmb extends Container {
|
||||
|
||||
private TileEntityNukeBalefire balefireBomb;
|
||||
|
||||
public ContainerNukeFstbmb(InventoryPlayer invPlayer, TileEntityNukeBalefire tedf) {
|
||||
|
||||
balefireBomb = tedf;
|
||||
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 17, 36));
|
||||
this.addSlotToContainer(new Slot(tedf, 1, 53, 36));
|
||||
|
||||
for(int i = 0; i < 3; i++)
|
||||
{
|
||||
for(int j = 0; j < 9; j++)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18 + 56));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142 + 56));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2)
|
||||
{
|
||||
ItemStack var3 = null;
|
||||
Slot var4 = (Slot) this.inventorySlots.get(par2);
|
||||
|
||||
if (var4 != null && var4.getHasStack())
|
||||
{
|
||||
ItemStack var5 = var4.getStack();
|
||||
var3 = var5.copy();
|
||||
|
||||
if (par2 <= 2) {
|
||||
if (!this.mergeItemStack(var5, 2, this.inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (var5.stackSize == 0)
|
||||
{
|
||||
var4.putStack((ItemStack) null);
|
||||
}
|
||||
else
|
||||
{
|
||||
var4.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return var3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return balefireBomb.isUseableByPlayer(player);
|
||||
}
|
||||
}
|
||||
73
src/main/java/com/hbm/inventory/gui/GUINukeFstbmb.java
Normal file
@ -0,0 +1,73 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerNukeFstbmb;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.bomb.TileEntityNukeBalefire;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUINukeFstbmb extends GuiInfoContainer {
|
||||
|
||||
public static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/weapon/fstbmbSchematic.png");
|
||||
private TileEntityNukeBalefire bomb;
|
||||
|
||||
public GUINukeFstbmb(InventoryPlayer invPlayer, TileEntityNukeBalefire bomb) {
|
||||
super(new ContainerNukeFstbmb(invPlayer, bomb));
|
||||
this.bomb = bomb;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 222;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
super.drawScreen(mouseX, mouseY, f);
|
||||
}
|
||||
|
||||
protected void mouseClicked(int x, int y, int i) {
|
||||
super.mouseClicked(x, y, i);
|
||||
|
||||
if(guiLeft + 61 <= x && guiLeft + 61 + 18 > x && guiTop + 17 < y && guiTop + 17 + 18 >= y) {
|
||||
|
||||
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
|
||||
//PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(laser.xCoord, laser.yCoord, laser.zCoord, 0, 0));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
|
||||
String name = this.bomb.hasCustomInventoryName() ? this.bomb.getInventoryName() : I18n.format(this.bomb.getInventoryName());
|
||||
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
|
||||
if(bomb.hasBattery()) {
|
||||
String timer = bomb.getMinutes() + ":" + bomb.getSeconds();
|
||||
double scale = 0.75;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
this.fontRendererObj.drawString(timer, (int) ((69 - this.fontRendererObj.getStringWidth(timer) / 2) * (1/scale)), (int) (95 * (1/scale)), 0xff0000);
|
||||
|
||||
GL11.glScaled(1/scale, 1/scale, 1/scale);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
if(bomb.hasEgg())
|
||||
drawTexturedModalRect(guiLeft + 19, guiTop + 90, 176, 0, 30, 16);
|
||||
|
||||
if(bomb.hasBattery())
|
||||
drawTexturedModalRect(guiLeft + 88, guiTop + 93, 176, 16, 18, 10);
|
||||
}
|
||||
}
|
||||
@ -1195,6 +1195,7 @@ public class ModItems {
|
||||
public static Item gun_rpg_ammo;
|
||||
public static Item gun_karl;
|
||||
public static Item gun_panzerschreck;
|
||||
public static Item gun_quadro;
|
||||
public static Item gun_hk69;
|
||||
public static Item gun_stinger;
|
||||
public static Item gun_skystinger;
|
||||
@ -1378,33 +1379,27 @@ public class ModItems {
|
||||
public static Item gadget_explosive8;
|
||||
public static Item gadget_wireing;
|
||||
public static Item gadget_core;
|
||||
|
||||
public static Item boy_igniter;
|
||||
public static Item boy_propellant;
|
||||
public static Item boy_bullet;
|
||||
public static Item boy_target;
|
||||
public static Item boy_shielding;
|
||||
|
||||
public static Item man_explosive;
|
||||
public static Item man_explosive8;
|
||||
public static Item man_igniter;
|
||||
public static Item man_core;
|
||||
|
||||
public static Item mike_core;
|
||||
public static Item mike_deut;
|
||||
public static Item mike_cooling_unit;
|
||||
|
||||
public static Item tsar_core;
|
||||
|
||||
public static Item fleija_igniter;
|
||||
public static Item fleija_propellant;
|
||||
public static Item fleija_core;
|
||||
|
||||
public static Item solinium_igniter;
|
||||
public static Item solinium_propellant;
|
||||
public static Item solinium_core;
|
||||
|
||||
public static Item n2_charge;
|
||||
public static Item egg_balefire;
|
||||
|
||||
public static Item custom_tnt;
|
||||
public static Item custom_nuke;
|
||||
@ -2995,6 +2990,7 @@ public class ModItems {
|
||||
gun_rpg = new ItemGunBase(GunRocketFactory.getGustavConfig()).setUnlocalizedName("gun_rpg").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_rpg");
|
||||
gun_karl = new ItemGunBase(GunRocketFactory.getKarlConfig()).setUnlocalizedName("gun_karl").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_karl");
|
||||
gun_panzerschreck = new ItemGunBase(GunRocketFactory.getPanzConfig()).setUnlocalizedName("gun_panzerschreck").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_panzerschreck");
|
||||
gun_quadro = new ItemGunBase(GunRocketFactory.getQuadroConfig()).setUnlocalizedName("gun_quadro").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_quadro");
|
||||
gun_rpg_ammo = new Item().setUnlocalizedName("gun_rpg_ammo").setCreativeTab(null).setTextureName(RefStrings.MODID + ":gun_rpg_ammo_alt");
|
||||
gun_hk69 = new ItemGunBase(GunGrenadeFactory.getHK69Config()).setUnlocalizedName("gun_hk69").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_hk69");
|
||||
gun_stinger = new GunStinger().setUnlocalizedName("gun_stinger").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_stinger");
|
||||
@ -3204,6 +3200,8 @@ public class ModItems {
|
||||
solinium_core = new ItemSolinium(15F, true).setUnlocalizedName("solinium_core").setMaxStackSize(1).setCreativeTab(MainRegistry.nukeTab).setTextureName(RefStrings.MODID + ":solinium_core");
|
||||
|
||||
n2_charge = new ItemN2().setUnlocalizedName("n2_charge").setMaxStackSize(1).setCreativeTab(MainRegistry.nukeTab).setTextureName(RefStrings.MODID + ":n2_charge");
|
||||
|
||||
egg_balefire = new ItemCustomLore().setUnlocalizedName("egg_balefire").setMaxStackSize(1).setCreativeTab(MainRegistry.nukeTab).setTextureName(RefStrings.MODID + ":egg_balefire");
|
||||
|
||||
custom_tnt = new ItemCustomLore().setUnlocalizedName("custom_tnt").setMaxStackSize(1).setCreativeTab(MainRegistry.nukeTab).setTextureName(RefStrings.MODID + ":custom_tnt");
|
||||
custom_nuke = new ItemCustomLore().setUnlocalizedName("custom_nuke").setMaxStackSize(1).setCreativeTab(MainRegistry.nukeTab).setTextureName(RefStrings.MODID + ":custom_nuke");
|
||||
@ -5003,6 +5001,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(gun_rpg, gun_rpg.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_karl, gun_karl.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_panzerschreck, gun_panzerschreck.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_quadro, gun_quadro.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_hk69, gun_hk69.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_stinger, gun_stinger.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_fatman, gun_fatman.getUnlocalizedName());
|
||||
@ -5512,6 +5511,9 @@ public class ModItems {
|
||||
//N2
|
||||
GameRegistry.registerItem(n2_charge, n2_charge.getUnlocalizedName());
|
||||
|
||||
//FSTBMB
|
||||
GameRegistry.registerItem(egg_balefire, egg_balefire.getUnlocalizedName());
|
||||
|
||||
//Conventional Armor
|
||||
GameRegistry.registerItem(goggles, goggles.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gas_mask, gas_mask.getUnlocalizedName());
|
||||
|
||||
@ -584,6 +584,11 @@ public class ItemCustomLore extends Item {
|
||||
{
|
||||
list.add("Doubles as a crappy lander!");
|
||||
}
|
||||
|
||||
if(this == ModItems.egg_balefire)
|
||||
{
|
||||
list.add("Doubles as a crappy lander!");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -639,7 +644,8 @@ public class ItemCustomLore extends Item {
|
||||
this == ModItems.rune_dagaz ||
|
||||
this == ModItems.rune_hagalaz ||
|
||||
this == ModItems.rune_jera ||
|
||||
this == ModItems.rune_thurisaz)
|
||||
this == ModItems.rune_thurisaz ||
|
||||
this == ModItems.egg_balefire)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -48,9 +48,8 @@ public class ItemGunBase extends Item implements IHoldableWeapon {
|
||||
}
|
||||
|
||||
public ItemGunBase(GunConfiguration config, GunConfiguration alt) {
|
||||
mainConfig = config;
|
||||
this(config);
|
||||
altConfig = alt;
|
||||
this.setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -419,6 +418,8 @@ public class ItemGunBase extends Item implements IHoldableWeapon {
|
||||
if(!mainConfig.reloadSoundEnd)
|
||||
world.playSoundAtEntity(player, mainConfig.reloadSound, 1.0F, 1.0F);
|
||||
|
||||
PacketDispatcher.wrapper.sendTo(new GunAnimationPacket(AnimType.RELOAD.ordinal()), (EntityPlayerMP) player);
|
||||
|
||||
setIsReloading(stack, true);
|
||||
resetReloadCycle(stack);
|
||||
}
|
||||
|
||||
@ -97,6 +97,7 @@ public class ClientProxy extends ServerProxy
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityNukeN2.class, new RenderNukeN2());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityNukeMan.class, new RenderNukeMan());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityNukeN45.class, new RenderNukeN45());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityNukeBalefire.class, new RenderNukeFstbmb());
|
||||
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretHeavy.class, new RenderHeavyTurret());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretRocket.class, new RenderRocketTurret());
|
||||
@ -161,6 +162,7 @@ public class ClientProxy extends ServerProxy
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_ks23, new ItemRenderWeaponObj());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_flamer, new ItemRenderWeaponObj());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_flechette, new ItemRenderWeaponObj());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_quadro, new ItemRenderWeaponQuadro());
|
||||
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBombMulti.class, new RenderBombMulti());
|
||||
|
||||
|
||||
@ -567,6 +567,7 @@ public class MainRegistry
|
||||
GameRegistry.registerTileEntity(TileEntityMachineMiningLaser.class, "tileentity_mining_laser");
|
||||
GameRegistry.registerTileEntity(TileEntityProxyInventory.class, "tileentity_proxy_inventory");
|
||||
GameRegistry.registerTileEntity(TileEntityProxyEnergy.class, "tileentity_proxy_power");
|
||||
GameRegistry.registerTileEntity(TileEntityNukeBalefire.class, "tileentity_nuke_fstbmb");
|
||||
|
||||
EntityRegistry.registerModEntity(EntityRocket.class, "entity_rocket", 0, this, 250, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityNukeExplosion.class, "entity_nuke_explosion", 1, this, 250, 1, true);
|
||||
|
||||
@ -327,6 +327,7 @@ public class ResourceManager {
|
||||
public static final IModelCustom ks23 = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/ks23.obj"));
|
||||
public static final IModelCustom flamer = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/flamer.obj"));
|
||||
public static final IModelCustom flechette = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/flechette.obj"));
|
||||
public static final IModelCustom quadro = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/quadro.obj"));
|
||||
|
||||
public static final IModelCustom grenade_frag = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/grenade_frag.obj"));
|
||||
|
||||
@ -355,6 +356,8 @@ public class ResourceManager {
|
||||
public static final ResourceLocation flechette_drum = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/flechette_drum.png");
|
||||
public static final ResourceLocation flechette_trigger = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/flechette_trigger.png");
|
||||
public static final ResourceLocation flechette_stock = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/flechette_stock.png");
|
||||
public static final ResourceLocation quadro_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/quadro.png");
|
||||
public static final ResourceLocation quadro_rocket_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/quadro_rocket.png");
|
||||
|
||||
public static final ResourceLocation grenade_mk2 = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/grenade_mk2.png");
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@ public class ItemRenderWeaponObj implements IItemRenderer {
|
||||
case INVENTORY:
|
||||
return item.getItem() == ModItems.gun_ks23 || item.getItem() == ModItems.gun_hk69
|
||||
|| item.getItem() == ModItems.gun_flamer || item.getItem() == ModItems.gun_deagle
|
||||
|| item.getItem() == ModItems.gun_flechette;
|
||||
|| item.getItem() == ModItems.gun_flechette || item.getItem() == ModItems.gun_quadro;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
@ -58,6 +58,9 @@ public class ItemRenderWeaponObj implements IItemRenderer {
|
||||
|
||||
if(item.getItem() == ModItems.gun_flamer)
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.flamer_tex);
|
||||
|
||||
if(item.getItem() == ModItems.gun_quadro)
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.quadro_tex);
|
||||
|
||||
switch(type) {
|
||||
|
||||
@ -141,6 +144,25 @@ public class ItemRenderWeaponObj implements IItemRenderer {
|
||||
GL11.glTranslatef(-2.0F, 1.2F, 3.7F);
|
||||
}
|
||||
}
|
||||
|
||||
if(item.getItem() == ModItems.gun_quadro) {
|
||||
GL11.glTranslatef(0.75F, 0.0F, -0.15F);
|
||||
GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-25F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(-10F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glScaled(0.5, 0.5, 0.5);
|
||||
|
||||
if(player.isSneaking()) {
|
||||
GL11.glRotatef(5F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glTranslatef(1.0F, 0.5F, 0.3F);
|
||||
}
|
||||
|
||||
double[] recoil = HbmAnimations.getRelevantTransformation("QUADRO_RECOIL");
|
||||
GL11.glTranslated(0, 0, recoil[2]);
|
||||
|
||||
double[] reload = HbmAnimations.getRelevantTransformation("QUADRO_RELOAD_ROTATE");
|
||||
GL11.glRotated(reload[2], 1, 0, 0);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@ -187,6 +209,13 @@ public class ItemRenderWeaponObj implements IItemRenderer {
|
||||
GL11.glTranslatef(-1.4F, -0.55F, 0.0F);
|
||||
GL11.glScaled(0.125, 0.125, 0.125);
|
||||
}
|
||||
|
||||
if(item.getItem() == ModItems.gun_quadro) {
|
||||
GL11.glRotatef(20F, 1.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(10F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glTranslatef(0.4F, -0.35F, -0.4F);
|
||||
GL11.glScaled(0.75, 0.75, 0.75);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@ -225,6 +254,12 @@ public class ItemRenderWeaponObj implements IItemRenderer {
|
||||
GL11.glScaled(0.125, 0.125, 0.125);
|
||||
}
|
||||
|
||||
if(item.getItem() == ModItems.gun_quadro) {
|
||||
GL11.glRotatef(-90F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glTranslatef(0.0F, 0.0F, 0.0F);
|
||||
GL11.glScaled(0.75, 0.75, 0.75);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case INVENTORY:
|
||||
@ -270,6 +305,14 @@ public class ItemRenderWeaponObj implements IItemRenderer {
|
||||
GL11.glRotatef(-45F, 0.0F, 0.0F, 1.0F);
|
||||
}
|
||||
|
||||
if(item.getItem() == ModItems.gun_quadro) {
|
||||
GL11.glScaled(4.5, 4.5, -4.5);
|
||||
GL11.glTranslatef(1.0F, 2.5F, 0.0F);
|
||||
GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(-90F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-45F, 1.0F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default: break;
|
||||
@ -308,6 +351,12 @@ public class ItemRenderWeaponObj implements IItemRenderer {
|
||||
if(item.getItem() == ModItems.gun_flechette) {
|
||||
renderFlechette();
|
||||
}
|
||||
|
||||
if(item.getItem() == ModItems.gun_quadro) {
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.quadro.renderPart("Launcher");
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
135
src/main/java/com/hbm/render/item/ItemRenderWeaponQuadro.java
Normal file
@ -0,0 +1,135 @@
|
||||
package com.hbm.render.item;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGunBase;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.anim.HbmAnimations;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
public class ItemRenderWeaponQuadro implements IItemRenderer {
|
||||
|
||||
public ItemRenderWeaponQuadro() { }
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
switch(type) {
|
||||
case EQUIPPED:
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
case ENTITY:
|
||||
case INVENTORY:
|
||||
return true;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||
|
||||
return type == ItemRenderType.ENTITY && (helper == ItemRendererHelper.ENTITY_ROTATION || helper == ItemRendererHelper.ENTITY_BOBBING);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
|
||||
switch(type) {
|
||||
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
|
||||
if(item.getItem() == ModItems.gun_quadro) {
|
||||
GL11.glTranslatef(0.75F, 0.0F, -0.15F);
|
||||
GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-25F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(-10F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glScaled(0.5, 0.5, 0.5);
|
||||
|
||||
if(player.isSneaking()) {
|
||||
GL11.glRotatef(5F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glTranslatef(1.0F, 0.5F, 0.3F);
|
||||
}
|
||||
|
||||
double[] recoil = HbmAnimations.getRelevantTransformation("QUADRO_RECOIL");
|
||||
GL11.glTranslated(0, 0, recoil[2]);
|
||||
|
||||
double[] reload = HbmAnimations.getRelevantTransformation("QUADRO_RELOAD_ROTATE");
|
||||
GL11.glRotated(reload[2], 1, 0, 0);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case EQUIPPED:
|
||||
|
||||
if(item.getItem() == ModItems.gun_quadro) {
|
||||
GL11.glRotatef(20F, 1.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(10F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glTranslatef(0.4F, -0.35F, -0.4F);
|
||||
GL11.glScaled(0.75, 0.75, 0.75);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case ENTITY:
|
||||
|
||||
if(item.getItem() == ModItems.gun_quadro) {
|
||||
GL11.glRotatef(-90F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glTranslatef(0.0F, 0.0F, 0.0F);
|
||||
GL11.glScaled(0.75, 0.75, 0.75);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case INVENTORY:
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
if(item.getItem() == ModItems.gun_quadro) {
|
||||
GL11.glScaled(4.5, 4.5, -4.5);
|
||||
GL11.glTranslatef(1.0F, 2.5F, 0.0F);
|
||||
GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(-90F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-45F, 1.0F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default: break;
|
||||
}
|
||||
|
||||
if(item.getItem() == ModItems.gun_quadro) {
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.quadro_tex);
|
||||
ResourceManager.quadro.renderPart("Launcher");
|
||||
|
||||
if(ItemGunBase.getMag(item) > 0 || ItemGunBase.getIsReloading(item)) {
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glTranslated(0, -1, 0);
|
||||
|
||||
double[] push = HbmAnimations.getRelevantTransformation("QUADRO_RELOAD_PUSH");
|
||||
GL11.glTranslated(0, 3, 0);
|
||||
GL11.glRotated(push[1] * 30, 1, 0, 0);
|
||||
GL11.glTranslated(0, -3, 0);
|
||||
GL11.glTranslated(0, 0, push[0] * 3);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.quadro_rocket_tex);
|
||||
ResourceManager.quadro.renderPart("Rockets");
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
package com.hbm.render.tileentity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.util.RenderMiscEffects;
|
||||
import com.hbm.tileentity.bomb.TileEntityNukeBalefire;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class RenderNukeFstbmb extends TileEntitySpecialRenderer {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
switch(tileEntity.getBlockMetadata())
|
||||
{
|
||||
case 2:
|
||||
GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
case 4:
|
||||
GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 3:
|
||||
GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
case 5:
|
||||
GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
}
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.fstbmb_tex);
|
||||
ResourceManager.fstbmb.renderPart("Body");
|
||||
ResourceManager.fstbmb.renderPart("Balefire");
|
||||
|
||||
TileEntityNukeBalefire bf = (TileEntityNukeBalefire)tileEntity;
|
||||
|
||||
if(bf.hasEgg()) {
|
||||
bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/misc/glintBF.png"));
|
||||
RenderMiscEffects.renderClassicGlint(tileEntity.getWorldObj(), f, ResourceManager.fstbmb, "Balefire", 0.0F, 0.8F, 0.15F, 5, 2F);
|
||||
}
|
||||
|
||||
if(bf.hasBattery()) {
|
||||
FontRenderer font = Minecraft.getMinecraft().fontRenderer;
|
||||
float f3 = 0.04F;
|
||||
GL11.glTranslatef(0.815F, 0.9275F, 0.5F);
|
||||
GL11.glScalef(f3, -f3, f3);
|
||||
GL11.glNormal3f(0.0F, 0.0F, -1.0F * f3);
|
||||
GL11.glRotatef(90, 0, 1, 0);
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glTranslatef(0, 1, 0);
|
||||
font.drawString(bf.getMinutes() + ":" + bf.getSeconds(), 0, 0, 0xff0000);
|
||||
GL11.glDepthMask(true);
|
||||
}
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
@ -1,21 +1,98 @@
|
||||
package com.hbm.tileentity.bomb;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class TileEntityNukeBalefire extends TileEntityMachineBase {
|
||||
|
||||
public boolean loaded;
|
||||
public boolean started;
|
||||
public int timer;
|
||||
|
||||
public TileEntityNukeBalefire() {
|
||||
super(1);
|
||||
super(2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return null;
|
||||
return "container.nukeFstbmb";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
if(started)
|
||||
timer--;
|
||||
|
||||
if(timer <= 0)
|
||||
explode();
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setInteger("timer", timer);
|
||||
data.setBoolean("loaded", loaded);
|
||||
data.setBoolean("started", started);
|
||||
networkPack(data, 250);
|
||||
}
|
||||
}
|
||||
|
||||
public void networkUnpack(NBTTagCompound data) {
|
||||
|
||||
timer = data.getInteger("timer");
|
||||
started = data.getBoolean("started");
|
||||
loaded = data.getBoolean("loaded");
|
||||
}
|
||||
|
||||
public boolean isLoaded() {
|
||||
|
||||
return hasEgg() && hasBattery();
|
||||
}
|
||||
|
||||
public boolean hasEgg() {
|
||||
|
||||
if(slots[0] != null && slots[0].getItem() == ModItems.egg_balefire) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean hasBattery() {
|
||||
|
||||
if(slots[1] != null && slots[1].getItem() == ModItems.battery_spark &&
|
||||
((IBatteryItem)ModItems.battery_spark).getCharge(slots[1]) == ((IBatteryItem)ModItems.battery_spark).getMaxCharge()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void explode() {
|
||||
|
||||
}
|
||||
|
||||
public String getMinutes() {
|
||||
|
||||
String mins = "" + (timer / 60);
|
||||
|
||||
if(mins.length() == 1)
|
||||
mins = "0" + mins;
|
||||
|
||||
return mins;
|
||||
}
|
||||
|
||||
public String getSeconds() {
|
||||
|
||||
String mins = "" + (timer % 60);
|
||||
|
||||
if(mins.length() == 1)
|
||||
mins = "0" + mins;
|
||||
|
||||
return mins;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||