diff --git a/assets/hbm/sounds.json b/assets/hbm/sounds.json index aab905ea8..83693bb96 100644 --- a/assets/hbm/sounds.json +++ b/assets/hbm/sounds.json @@ -104,5 +104,7 @@ "alarm.blastDoorAlarm": {"category": "record", "sounds": [{"name": "alarm/blastDoorAlarm", "stream": false}]}, "alarm.klaxon": {"category": "record", "sounds": [{"name": "alarm/klaxon", "stream": false}]}, "alarm.striderSiren": {"category": "record", "sounds": [{"name": "alarm/striderSiren", "stream": false}]}, - "alarm.regularSiren": {"category": "record", "sounds": [{"name": "alarm/regularSiren", "stream": false}]} + "alarm.regularSiren": {"category": "record", "sounds": [{"name": "alarm/regularSiren", "stream": false}]}, + "alarm.foKlaxonA": {"category": "record", "sounds": [{"name": "alarm/foKlaxonA", "stream": false}]}, + "alarm.foKlaxonB": {"category": "record", "sounds": [{"name": "alarm/foKlaxonB", "stream": false}]} } diff --git a/assets/hbm/sounds/alarm/foKlaxonA.ogg b/assets/hbm/sounds/alarm/foKlaxonA.ogg new file mode 100644 index 000000000..e2471c001 Binary files /dev/null and b/assets/hbm/sounds/alarm/foKlaxonA.ogg differ diff --git a/assets/hbm/sounds/alarm/foKlaxonB.ogg b/assets/hbm/sounds/alarm/foKlaxonB.ogg new file mode 100644 index 000000000..6a2b5fb7d Binary files /dev/null and b/assets/hbm/sounds/alarm/foKlaxonB.ogg differ diff --git a/com/hbm/entity/effect/EntityCloudFleija.java b/com/hbm/entity/effect/EntityCloudFleija.java index 5962681a1..ec4a3f694 100644 --- a/com/hbm/entity/effect/EntityCloudFleija.java +++ b/com/hbm/entity/effect/EntityCloudFleija.java @@ -81,4 +81,11 @@ public class EntityCloudFleija extends Entity { public int getMaxAge() { return this.dataWatcher.getWatchableObjectInt(16); } + + @Override + @SideOnly(Side.CLIENT) + public boolean isInRangeToRenderDist(double distance) + { + return distance < 25000; + } } diff --git a/com/hbm/entity/effect/EntityCloudFleijaRainbow.java b/com/hbm/entity/effect/EntityCloudFleijaRainbow.java index 9b23ae778..0bd74f21b 100644 --- a/com/hbm/entity/effect/EntityCloudFleijaRainbow.java +++ b/com/hbm/entity/effect/EntityCloudFleijaRainbow.java @@ -81,4 +81,11 @@ public class EntityCloudFleijaRainbow extends Entity { public int getMaxAge() { return this.dataWatcher.getWatchableObjectInt(16); } + + @Override + @SideOnly(Side.CLIENT) + public boolean isInRangeToRenderDist(double distance) + { + return distance < 25000; + } } diff --git a/com/hbm/entity/effect/EntityNukeCloudSmall.java b/com/hbm/entity/effect/EntityNukeCloudSmall.java index 7444391a4..8ea634974 100644 --- a/com/hbm/entity/effect/EntityNukeCloudSmall.java +++ b/com/hbm/entity/effect/EntityNukeCloudSmall.java @@ -88,5 +88,12 @@ public class EntityNukeCloudSmall extends Entity { return cloud; } + + @Override + @SideOnly(Side.CLIENT) + public boolean isInRangeToRenderDist(double distance) + { + return distance < 25000; + } } diff --git a/com/hbm/entity/logic/EntityDeathBlast.java b/com/hbm/entity/logic/EntityDeathBlast.java new file mode 100644 index 000000000..e9db9a631 --- /dev/null +++ b/com/hbm/entity/logic/EntityDeathBlast.java @@ -0,0 +1,59 @@ +package com.hbm.entity.logic; + +import com.hbm.explosion.ExplosionLarge; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + +public class EntityDeathBlast extends Entity { + + public static final int maxAge = 60; + + public EntityDeathBlast(World p_i1582_1_) { + super(p_i1582_1_); + this.ignoreFrustumCheck = true; + } + + @Override + protected void entityInit() { } + + @Override + protected void readEntityFromNBT(NBTTagCompound nbt) { } + + @Override + protected void writeEntityToNBT(NBTTagCompound nbt) { } + + @Override + public void onUpdate() { + + if(this.ticksExisted >= maxAge && !worldObj.isRemote) { + this.setDead(); + + ExplosionLarge.explodeFire(worldObj, posX, posY, posZ, 25, true, true, true); + } + } + + @Override + @SideOnly(Side.CLIENT) + public int getBrightnessForRender(float p_70070_1_) + { + return 15728880; + } + + @Override + public float getBrightness(float p_70013_1_) + { + return 1.0F; + } + + @Override + @SideOnly(Side.CLIENT) + public boolean isInRangeToRenderDist(double distance) + { + return distance < 25000; + } + +} diff --git a/com/hbm/inventory/FluidTank.java b/com/hbm/inventory/FluidTank.java index 037126fa5..af5206ae5 100644 --- a/com/hbm/inventory/FluidTank.java +++ b/com/hbm/inventory/FluidTank.java @@ -5,6 +5,10 @@ import java.util.Arrays; import com.hbm.handler.FluidTypeHandler.FluidType; import com.hbm.inventory.gui.GuiInfoContainer; import com.hbm.items.ModItems; +import com.hbm.items.gear.JetpackBooster; +import com.hbm.items.gear.JetpackBreak; +import com.hbm.items.gear.JetpackRegular; +import com.hbm.items.gear.JetpackVectorized; import com.hbm.items.tool.ItemFluidIdentifier; import com.hbm.lib.RefStrings; import com.hbm.packet.PacketDispatcher; @@ -108,6 +112,40 @@ public class FluidTank { ItemStack full = null; if(slots[in] != null) { + + for(int i = 0; i < 25; i++) { + if(slots[in].getItem() == ModItems.jetpack_boost && this.type.name().equals(FluidType.KEROSENE.name())) { + if(this.fluid > 0 && JetpackBooster.getFuel(slots[in]) < JetpackBooster.maxFuel) { + this.fluid--; + JetpackBooster.setFuel(slots[in], JetpackBooster.getFuel(slots[in]) + 1); + } else { + return; + } + } else if(slots[in].getItem() == ModItems.jetpack_break && this.type.name().equals(FluidType.KEROSENE.name())) { + if(this.fluid > 0 && JetpackBreak.getFuel(slots[in]) < JetpackBreak.maxFuel) { + this.fluid--; + JetpackBreak.setFuel(slots[in], JetpackBreak.getFuel(slots[in]) + 1); + } else { + return; + } + } else if(slots[in].getItem() == ModItems.jetpack_fly && this.type.name().equals(FluidType.KEROSENE.name())) { + if(this.fluid > 0 && JetpackRegular.getFuel(slots[in]) < JetpackRegular.maxFuel) { + this.fluid--; + JetpackRegular.setFuel(slots[in], JetpackRegular.getFuel(slots[in]) + 1); + } else { + return; + } + } else if(slots[in].getItem() == ModItems.jetpack_vector && this.type.name().equals(FluidType.KEROSENE.name())) { + if(this.fluid > 0 && JetpackVectorized.getFuel(slots[in]) < JetpackVectorized.maxFuel) { + this.fluid--; + JetpackVectorized.setFuel(slots[in], JetpackVectorized.getFuel(slots[in]) + 1); + } else { + return; + } + } else { + break; + } + } if(slots[in].getItem() == ModItems.fluid_barrel_infinite) { this.fluid = 0; diff --git a/com/hbm/items/gear/ArmorT45.java b/com/hbm/items/gear/ArmorT45.java index d341ccde8..0d9ef924d 100644 --- a/com/hbm/items/gear/ArmorT45.java +++ b/com/hbm/items/gear/ArmorT45.java @@ -191,18 +191,18 @@ public class ArmorT45 extends ItemArmor implements ISpecialArmor { } if (Library.checkArmor(player, ModItems.t45_helmet, ModItems.t45_plate, ModItems.t45_legs, - ModItems.t45_boots)) { + ModItems.t45_boots) && !world.isRemote) { if (player.inventory.armorInventory[2] != null && player.inventory.armorInventory[2].getItem() == ModItems.t45_plate && player.inventory.armorInventory[2].stackTagCompound != null && player.inventory.armorInventory[2].stackTagCompound.getInteger("charge") > 0) { - player.addPotionEffect(new PotionEffect(Potion.jump.id, 20, 0, true)); - player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 20, 1, true)); - player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 20, 2, true)); - player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 20, 0, true)); + player.addPotionEffect(new PotionEffect(Potion.jump.id, 30, 0, true)); + player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 30, 1, true)); + player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 30, 2, true)); + player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 30, 0, true)); } else { - player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 20, 1, true)); - player.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 20, 0, true)); + player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 30, 1, true)); + player.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 30, 0, true)); } } } @@ -212,9 +212,9 @@ public class ArmorT45 extends ItemArmor implements ISpecialArmor { if (itemstack.getItem() == ModItems.t45_plate) { if (itemstack.stackTagCompound != null) { if (itemstack.stackTagCompound.getInteger("charge") != 0) - list.add("Charge: " + (itemstack.stackTagCompound.getInteger("charge") / 50 + 1) + "%"); + list.add("Charge: " + (itemstack.stackTagCompound.getInteger("charge") / 2000 + 1) + "%"); else - list.add("Charge: " + (itemstack.stackTagCompound.getInteger("charge") / 50) + "%"); + list.add("Charge: " + (itemstack.stackTagCompound.getInteger("charge") / 2000) + "%"); } } } diff --git a/com/hbm/items/gear/JetpackBooster.java b/com/hbm/items/gear/JetpackBooster.java index 58f5b354b..b0d71fbc5 100644 --- a/com/hbm/items/gear/JetpackBooster.java +++ b/com/hbm/items/gear/JetpackBooster.java @@ -1,5 +1,7 @@ package com.hbm.items.gear; +import java.util.List; + import com.hbm.entity.particle.EntityGasFlameFX; import com.hbm.items.ModItems; import com.hbm.render.model.ModelGoggles; @@ -21,10 +23,17 @@ import net.minecraft.world.World; public class JetpackBooster extends ItemArmor { private ModelJetPack model; + public static int maxFuel = 750; public JetpackBooster(ArmorMaterial p_i45325_1_, int p_i45325_2_, int p_i45325_3_) { super(p_i45325_1_, p_i45325_2_, p_i45325_3_); } + + @Override + public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) + { + list.add("Kerosene: " + this.getFuel(itemstack) + "mB / " + this.maxFuel + "mB"); + } @Override @@ -52,7 +61,7 @@ public class JetpackBooster extends ItemArmor { public void onArmorTick(World world, EntityPlayer player, ItemStack stack) { - if(player.isSneaking() && this.getBoost(stack) == 0 && this.getCooldown(stack) == 0) { + if(player.isSneaking() && this.getBoost(stack) == 0 && this.getCooldown(stack) == 0 && this.getFuel(stack) > 0) { this.setBoost(stack, 15); this.setCooldown(stack, 40); } @@ -71,12 +80,17 @@ public class JetpackBooster extends ItemArmor { fx.motionY = -0.1; world.spawnEntityInWorld(fx); + this.setFuel(stack, this.getFuel(stack) - 1); + if(player.motionY > 0) player.fallDistance = 0; } if(this.getCooldown(stack) > 0) this.setCooldown(stack, this.getCooldown(stack) - 1); + + if(this.getFuel(stack) == 0) + this.setBoost(stack, 0); } public void setBoost(ItemStack stack, int i) { @@ -106,5 +120,24 @@ public class JetpackBooster extends ItemArmor { return stack.stackTagCompound.getInteger("cool"); } + + public static int getFuel(ItemStack stack) { + if(stack.stackTagCompound == null) { + stack.stackTagCompound = new NBTTagCompound(); + return 0; + } + + return stack.stackTagCompound.getInteger("fuel"); + + } + + public static void setFuel(ItemStack stack, int i) { + if(stack.stackTagCompound == null) { + stack.stackTagCompound = new NBTTagCompound(); + } + + stack.stackTagCompound.setInteger("fuel", i); + + } } diff --git a/com/hbm/items/gear/JetpackBreak.java b/com/hbm/items/gear/JetpackBreak.java index 4b0283591..27025a59e 100644 --- a/com/hbm/items/gear/JetpackBreak.java +++ b/com/hbm/items/gear/JetpackBreak.java @@ -1,5 +1,7 @@ package com.hbm.items.gear; +import java.util.List; + import com.hbm.entity.particle.EntityGasFlameFX; import com.hbm.render.model.ModelJetPack; @@ -12,16 +14,24 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemArmor.ArmorMaterial; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.Vec3; import net.minecraft.world.World; public class JetpackBreak extends ItemArmor { private ModelJetPack model; + public static int maxFuel = 1200; public JetpackBreak(ArmorMaterial p_i45325_1_, int p_i45325_2_, int p_i45325_3_) { super(p_i45325_1_, p_i45325_2_, p_i45325_3_); } + + @Override + public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) + { + list.add("Kerosene: " + this.getFuel(itemstack) + "mB / " + this.maxFuel + "mB"); + } @Override @@ -49,7 +59,7 @@ public class JetpackBreak extends ItemArmor { public void onArmorTick(World world, EntityPlayer player, ItemStack stack) { - if(player.motionY < -0.25) { + if(player.motionY < -0.25 && this.getFuel(stack) > 0) { Vec3 vec = Vec3.createVectorHelper(player.getLookVec().xCoord, 0, player.getLookVec().zCoord); vec.normalize(); @@ -63,6 +73,27 @@ public class JetpackBreak extends ItemArmor { world.spawnEntityInWorld(fx); player.fallDistance = 0; + + this.setFuel(stack, this.getFuel(stack) - 1); } } + + public static int getFuel(ItemStack stack) { + if(stack.stackTagCompound == null) { + stack.stackTagCompound = new NBTTagCompound(); + return 0; + } + + return stack.stackTagCompound.getInteger("fuel"); + + } + + public static void setFuel(ItemStack stack, int i) { + if(stack.stackTagCompound == null) { + stack.stackTagCompound = new NBTTagCompound(); + } + + stack.stackTagCompound.setInteger("fuel", i); + + } } diff --git a/com/hbm/items/gear/JetpackRegular.java b/com/hbm/items/gear/JetpackRegular.java index e69032984..dafe0404f 100644 --- a/com/hbm/items/gear/JetpackRegular.java +++ b/com/hbm/items/gear/JetpackRegular.java @@ -1,5 +1,7 @@ package com.hbm.items.gear; +import java.util.List; + import com.hbm.entity.particle.EntityGasFlameFX; import com.hbm.items.ModItems; import com.hbm.render.model.ModelGoggles; @@ -21,10 +23,17 @@ import net.minecraft.world.World; public class JetpackRegular extends ItemArmor { private ModelJetPack model; + public static int maxFuel = 3000; public JetpackRegular(ArmorMaterial p_i45325_1_, int p_i45325_2_, int p_i45325_3_) { super(p_i45325_1_, p_i45325_2_, p_i45325_3_); } + + @Override + public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) + { + list.add("Kerosene: " + this.getFuel(itemstack) + "mB / " + this.maxFuel + "mB"); + } @Override @@ -52,7 +61,7 @@ public class JetpackRegular extends ItemArmor { public void onArmorTick(World world, EntityPlayer player, ItemStack stack) { - if(player.isSneaking()) { + if(player.isSneaking() && this.getFuel(stack) > 0) { Vec3 vec = Vec3.createVectorHelper(player.getLookVec().xCoord, 0, player.getLookVec().zCoord); vec.normalize(); @@ -66,7 +75,28 @@ public class JetpackRegular extends ItemArmor { world.spawnEntityInWorld(fx); player.fallDistance = 0; + + this.setFuel(stack, this.getFuel(stack) - 1); } } + + public static int getFuel(ItemStack stack) { + if(stack.stackTagCompound == null) { + stack.stackTagCompound = new NBTTagCompound(); + return 0; + } + + return stack.stackTagCompound.getInteger("fuel"); + + } + + public static void setFuel(ItemStack stack, int i) { + if(stack.stackTagCompound == null) { + stack.stackTagCompound = new NBTTagCompound(); + } + + stack.stackTagCompound.setInteger("fuel", i); + + } } diff --git a/com/hbm/items/gear/JetpackVectorized.java b/com/hbm/items/gear/JetpackVectorized.java index 52d6484b0..c623eaddd 100644 --- a/com/hbm/items/gear/JetpackVectorized.java +++ b/com/hbm/items/gear/JetpackVectorized.java @@ -1,5 +1,7 @@ package com.hbm.items.gear; +import java.util.List; + import com.hbm.entity.particle.EntityGasFlameFX; import com.hbm.render.model.ModelJetPack; @@ -12,16 +14,24 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemArmor.ArmorMaterial; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.Vec3; import net.minecraft.world.World; public class JetpackVectorized extends ItemArmor { private ModelJetPack model; + public static int maxFuel = 6000; public JetpackVectorized(ArmorMaterial p_i45325_1_, int p_i45325_2_, int p_i45325_3_) { super(p_i45325_1_, p_i45325_2_, p_i45325_3_); } + + @Override + public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) + { + list.add("Kerosene: " + this.getFuel(itemstack) + "mB / " + this.maxFuel + "mB"); + } @Override @@ -49,7 +59,7 @@ public class JetpackVectorized extends ItemArmor { public void onArmorTick(World world, EntityPlayer player, ItemStack stack) { - if(player.isSneaking()) { + if(player.isSneaking() && this.getFuel(stack) > 0) { Vec3 vec = Vec3.createVectorHelper(player.getLookVec().xCoord, 0, player.getLookVec().zCoord); vec.normalize(); @@ -68,6 +78,27 @@ public class JetpackVectorized extends ItemArmor { world.spawnEntityInWorld(fx); player.fallDistance = 0; + + this.setFuel(stack, this.getFuel(stack) - 1); } } + + public static int getFuel(ItemStack stack) { + if(stack.stackTagCompound == null) { + stack.stackTagCompound = new NBTTagCompound(); + return 0; + } + + return stack.stackTagCompound.getInteger("fuel"); + + } + + public static void setFuel(ItemStack stack, int i) { + if(stack.stackTagCompound == null) { + stack.stackTagCompound = new NBTTagCompound(); + } + + stack.stackTagCompound.setInteger("fuel", i); + + } } diff --git a/com/hbm/items/tool/ItemCassette.java b/com/hbm/items/tool/ItemCassette.java index 103196ec0..e2711536b 100644 --- a/com/hbm/items/tool/ItemCassette.java +++ b/com/hbm/items/tool/ItemCassette.java @@ -31,6 +31,8 @@ public class ItemCassette extends Item { BLAST_DOOR( "Blast Door Alarm", new ResourceLocation("hbm:alarm.blastDoorAlarm"), SoundType.LOOP, 11665408, 50), APC_LOOP( "APC Siren", new ResourceLocation("hbm:alarm.apcLoop"), SoundType.LOOP, 3565216, 50), KLAXON( "Klaxon", new ResourceLocation("hbm:alarm.klaxon"), SoundType.LOOP, 8421504, 50), + KLAXON_A( "Vault Door Alarm", new ResourceLocation("hbm:alarm.foKlaxonA"), SoundType.LOOP, 0x8c810b, 50), + KLAXON_B( "Security Alert", new ResourceLocation("hbm:alarm.foKlaxonB"), SoundType.LOOP, 0x76818e, 50), SIREN( "Standard Siren", new ResourceLocation("hbm:alarm.regularSiren"), SoundType.LOOP, 6684672, 100), BANK_ALARM( "Bank Alarm", new ResourceLocation("hbm:alarm.bankAlarm"), SoundType.LOOP, 3572962, 100), BEEP_SIREN( "Beep Siren", new ResourceLocation("hbm:alarm.beepSiren"), SoundType.LOOP, 13882323, 100), diff --git a/com/hbm/main/ClientProxy.java b/com/hbm/main/ClientProxy.java index 009bced8b..c60c24322 100644 --- a/com/hbm/main/ClientProxy.java +++ b/com/hbm/main/ClientProxy.java @@ -11,6 +11,7 @@ import com.hbm.entity.effect.*; import com.hbm.entity.grenade.*; import com.hbm.entity.item.EntityMinecartTest; import com.hbm.entity.logic.EntityBomber; +import com.hbm.entity.logic.EntityDeathBlast; import com.hbm.entity.logic.EntityNukeExplosionAdvanced; import com.hbm.entity.missile.*; import com.hbm.entity.mob.*; @@ -159,6 +160,7 @@ public class ClientProxy extends ServerProxy RenderingRegistry.registerEntityRenderingHandler(EntityBlackHole.class, new RenderBlackHole()); RenderingRegistry.registerEntityRenderingHandler(EntityVortex.class, new RenderBlackHole()); RenderingRegistry.registerEntityRenderingHandler(EntityRagingVortex.class, new RenderBlackHole()); + RenderingRegistry.registerEntityRenderingHandler(EntityDeathBlast.class, new RenderDeathBlast()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDecoTapeRecorder.class, new RenderTapeRecorder()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDecoSteelPoles.class, new RenderSteelPoles()); diff --git a/com/hbm/main/MainRegistry.java b/com/hbm/main/MainRegistry.java index fbf59ae49..be566b7a3 100644 --- a/com/hbm/main/MainRegistry.java +++ b/com/hbm/main/MainRegistry.java @@ -90,6 +90,7 @@ import com.hbm.entity.grenade.EntityGrenadeTau; import com.hbm.entity.grenade.EntityGrenadeZOMG; import com.hbm.entity.item.EntityMinecartTest; import com.hbm.entity.logic.EntityBomber; +import com.hbm.entity.logic.EntityDeathBlast; import com.hbm.entity.logic.EntityMissileTest; import com.hbm.entity.logic.EntityNukeExplosion; import com.hbm.entity.logic.EntityNukeExplosionAdvanced; @@ -791,6 +792,7 @@ public class MainRegistry EntityRegistry.registerModEntity(EntityBomber.class, "entity_bomber", 108, this, 1000, 1, true); EntityRegistry.registerModEntity(EntityBombletZeta.class, "entity_zeta", 109, this, 1000, 1, true); EntityRegistry.registerModEntity(EntityOrangeFX.class, "entity_agent_orange", 110, this, 1000, 1, true); + EntityRegistry.registerModEntity(EntityDeathBlast.class, "entity_laser_blast", 111, this, 1000, 1, true); EntityRegistry.registerGlobalEntityID(EntityNuclearCreeper.class, "entity_mob_nuclear_creeper", EntityRegistry.findGlobalUniqueEntityId(), 0x204131, 0x75CE00); EntityRegistry.registerGlobalEntityID(EntityHunterChopper.class, "entity_mob_hunter_chopper", EntityRegistry.findGlobalUniqueEntityId(), 0x000020, 0x2D2D72); diff --git a/com/hbm/packet/SatLaserPacket.java b/com/hbm/packet/SatLaserPacket.java index a3cd4d30c..bbf2ac679 100644 --- a/com/hbm/packet/SatLaserPacket.java +++ b/com/hbm/packet/SatLaserPacket.java @@ -1,5 +1,6 @@ package com.hbm.packet; +import com.hbm.entity.logic.EntityDeathBlast; import com.hbm.explosion.ExplosionLarge; import com.hbm.items.ModItems; import com.hbm.saveddata.SatelliteSaveStructure; @@ -70,7 +71,13 @@ public class SatLaserPacket implements IMessage { int y = p.worldObj.getHeightValue(m.x, m.z); - ExplosionLarge.explodeFire(p.worldObj, m.x, y, m.z, 50, true, true, true); + //ExplosionLarge.explodeFire(p.worldObj, m.x, y, m.z, 50, true, true, true); + EntityDeathBlast blast = new EntityDeathBlast(p.worldObj); + blast.posX = m.x; + blast.posY = y; + blast.posZ = m.z; + + p.worldObj.spawnEntityInWorld(blast); } } diff --git a/com/hbm/render/entity/RenderDeathBlast.java b/com/hbm/render/entity/RenderDeathBlast.java new file mode 100644 index 000000000..ef4b301a1 --- /dev/null +++ b/com/hbm/render/entity/RenderDeathBlast.java @@ -0,0 +1,120 @@ +package com.hbm.render.entity; + +import org.lwjgl.opengl.GL11; + +import com.hbm.entity.effect.EntityCloudFleijaRainbow; +import com.hbm.entity.logic.EntityDeathBlast; +import com.hbm.lib.RefStrings; + +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Vec3; +import net.minecraftforge.client.model.AdvancedModelLoader; +import net.minecraftforge.client.model.IModelCustom; + +public class RenderDeathBlast extends Render { + + private static final IModelCustom sphere = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/Sphere.obj")); + + @Override + public void doRender(Entity entity, double x, double y, double z, float p_76986_8_, float p_76986_9_) { + + GL11.glPushMatrix(); + GL11.glTranslatef((float)x, (float)y, (float)z); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glShadeModel(GL11.GL_SMOOTH); + GL11.glDepthMask(false); + + GL11.glPushMatrix(); + //GL11.glRotatef((entity.ticksExisted % 360) * 10, 0, 1, 0); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); + //GL11.glDisable(GL11.GL_ALPHA_TEST); + + GL11.glColor3f(1.0F, 0, 0); + + Vec3 vector = Vec3.createVectorHelper(0.5D, 0, 0); + + Tessellator tessellator = Tessellator.instance; + RenderHelper.disableStandardItemLighting(); + + for(int i = 0; i < 8; i++) { + tessellator.startDrawing(6); + tessellator.addVertex(vector.xCoord, 250.0D, vector.zCoord); + tessellator.addVertex(vector.xCoord, 0.0D, vector.zCoord); + vector.rotateAroundY(45); + tessellator.addVertex(vector.xCoord, 0.0D, vector.zCoord); + tessellator.addVertex(vector.xCoord, 250.0D, vector.zCoord); + tessellator.draw(); + } + + GL11.glColor3f(1.0F, 0, 1.0F); + + for(int i = 0; i < 8; i++) { + tessellator.startDrawing(6); + tessellator.addVertex(vector.xCoord / 2, 250.0D, vector.zCoord / 2); + tessellator.addVertex(vector.xCoord / 2, 0.0D, vector.zCoord / 2); + vector.rotateAroundY(45); + tessellator.addVertex(vector.xCoord / 2, 0.0D, vector.zCoord / 2); + tessellator.addVertex(vector.xCoord / 2, 250.0D, vector.zCoord / 2); + tessellator.draw(); + } + GL11.glPopMatrix(); + + GL11.glDepthMask(true); + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glShadeModel(GL11.GL_FLAT); + + GL11.glPopMatrix(); + + renderOrb(entity, x, y, z, p_76986_8_, p_76986_9_); + } + + public void renderOrb(Entity entity, double x, double y, double z, float p_76986_8_, float p_76986_9_) { + GL11.glPushMatrix(); + GL11.glTranslatef((float)x, (float)y, (float)z); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_TEXTURE_2D); + + double scale = 15 - 15D * (((double)entity.ticksExisted) / ((double)EntityDeathBlast.maxAge)); + double alpha = (((double)entity.ticksExisted) / ((double)EntityDeathBlast.maxAge)); + + if(scale < 0) + scale = 0; + + GL11.glColor4d(1.0, 0, 1.0, alpha); + + GL11.glEnable(GL11.GL_BLEND); + GL11.glScaled(scale, scale, scale); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + sphere.renderAll(); + + GL11.glColor4d(1.0, 0, 0, alpha); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); + GL11.glScaled(1.5, 1.5, 1.5); + sphere.renderAll(); + + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glColor4d(1.0, 1.0, 1.0, 1.0); + + GL11.glPopMatrix(); + } + + @Override + protected ResourceLocation getEntityTexture(Entity p_110775_1_) { + return null; + } + +}