mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
More work on better reactor, "fixed" potions crashing on SMP
This commit is contained in:
parent
6038c29bf8
commit
46ea5754b9
Binary file not shown.
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 3.5 KiB |
BIN
assets/hbm/textures/gui/gui_reactor_small_overlay.png
Normal file
BIN
assets/hbm/textures/gui/gui_reactor_small_overlay.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.6 KiB |
@ -7,7 +7,7 @@ import java.util.Random;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.potion.PotionEffectTaint;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.tileentity.deco.TileEntityTaint;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -176,7 +176,7 @@ public class BlockTaint extends Block/*Container*/ {
|
||||
int level = 15 - meta;
|
||||
|
||||
List<ItemStack> list = new ArrayList<ItemStack>();
|
||||
PotionEffect effect = new PotionEffect(PotionEffectTaint.instance.id, 15 * 20, level);
|
||||
PotionEffect effect = new PotionEffect(HbmPotion.taint.id, 15 * 20, level);
|
||||
effect.setCurativeItems(list);
|
||||
if(entity instanceof EntityLivingBase)
|
||||
if(world.rand.nextInt(50) == 0)
|
||||
|
||||
@ -7,7 +7,7 @@ import com.hbm.entity.mob.EntityNuclearCreeper;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.potion.PotionEffectRadiation;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -192,21 +192,21 @@ public class BlockOre extends Block {
|
||||
{
|
||||
if(entity instanceof EntityPlayer && Library.checkForHazmat((EntityPlayer)entity))
|
||||
{ } else {
|
||||
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 45 * 20, 20));
|
||||
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 45 * 20, 20));
|
||||
}
|
||||
}
|
||||
if (entity instanceof EntityLivingBase && this == ModBlocks.block_waste)
|
||||
{
|
||||
if(entity instanceof EntityPlayer && Library.checkForHazmat((EntityPlayer)entity))
|
||||
{ } else {
|
||||
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 60 * 20, 20));
|
||||
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 60 * 20, 20));
|
||||
}
|
||||
}
|
||||
if (entity instanceof EntityLivingBase && (this == ModBlocks.waste_trinitite || this == ModBlocks.waste_trinitite_red))
|
||||
{
|
||||
if(entity instanceof EntityPlayer && Library.checkForHazmat((EntityPlayer)entity))
|
||||
{ } else {
|
||||
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 30 * 20, 10));
|
||||
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 30 * 20, 10));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -16,8 +16,7 @@ import com.hbm.explosion.ExplosionNukeRay;
|
||||
import com.hbm.explosion.ExplosionNukeRay.FloatTriplet;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.main.ModEventHandler;
|
||||
import com.hbm.potion.PotionEffectBang;
|
||||
import com.hbm.potion.PotionEffectTaint;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.saveddata.SatelliteSaveStructure;
|
||||
import com.hbm.saveddata.SatelliteSavedData;
|
||||
import com.hbm.world.Meteorite;
|
||||
@ -262,7 +261,7 @@ public class TestEventTester extends Block {
|
||||
/*if(!worldObj.isRemote)
|
||||
buildEvent(worldObj, par2, par3, par4, 30);*/
|
||||
|
||||
((EntityLivingBase)par5EntityPlayer).addPotionEffect(new PotionEffect(PotionEffectBang.instance.id, 100, 0));
|
||||
((EntityLivingBase)par5EntityPlayer).addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 100, 0));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@ import com.hbm.explosion.ExplosionThermo;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.potion.PotionEffectBang;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -336,7 +336,7 @@ public class EntityModBeam extends Entity implements IProjectile
|
||||
}
|
||||
|
||||
if(movingobjectposition.entityHit instanceof EntityLivingBase) {
|
||||
((EntityLivingBase)movingobjectposition.entityHit).addPotionEffect(new PotionEffect(PotionEffectBang.instance.id, 60, 0));
|
||||
((EntityLivingBase)movingobjectposition.entityHit).addPotionEffect(new PotionEffect(HbmPotion.bang.id, 60, 0));
|
||||
} else {
|
||||
explode();
|
||||
}
|
||||
|
||||
@ -18,9 +18,11 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIMachineReactorSmall extends GuiInfoContainer {
|
||||
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_reactor_small.png");
|
||||
private static ResourceLocation overlay = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_reactor_small_overlay.png");
|
||||
private TileEntityMachineReactorSmall diFurnace;
|
||||
private boolean toggleOverlay = false;
|
||||
|
||||
public GUIMachineReactorSmall(InventoryPlayer invPlayer, TileEntityMachineReactorSmall tedf) {
|
||||
super(new ContainerMachineReactorSmall(invPlayer, tedf));
|
||||
@ -36,7 +38,9 @@ public class GUIMachineReactorSmall extends GuiInfoContainer {
|
||||
|
||||
diFurnace.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 36, 16, 52);
|
||||
diFurnace.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 26, guiTop + 36, 16, 52);
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 108, 88, 7, diFurnace.power, diFurnace.powerMax);
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 108, 88, 4, diFurnace.power, diFurnace.powerMax);
|
||||
this.drawCustomInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 114, 88, 4, new String[] { "Hull Temperature:", " " + Math.round((diFurnace.hullHeat) * 0.00001 * 2480 + 20) + "°C" });
|
||||
this.drawCustomInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 120, 88, 4, new String[] { "Core Temperature:", " " + Math.round((diFurnace.coreHeat) * 0.00002 * 980 + 20) + "°C" });
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -60,7 +64,12 @@ public class GUIMachineReactorSmall extends GuiInfoContainer {
|
||||
@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);
|
||||
|
||||
if(toggleOverlay)
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(overlay);
|
||||
else
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
if(diFurnace.power > 0) {
|
||||
@ -68,31 +77,42 @@ public class GUIMachineReactorSmall extends GuiInfoContainer {
|
||||
|
||||
i = (int) Math.min(i, 88);
|
||||
|
||||
drawTexturedModalRect(guiLeft + 80, guiTop + 108, 0, 222, i, 7);
|
||||
drawTexturedModalRect(guiLeft + 80, guiTop + 108, 0, 222, i, 4);
|
||||
}
|
||||
if(diFurnace.heat > 0) {
|
||||
int i = diFurnace.getHeatScaled(88);
|
||||
|
||||
if(diFurnace.hasHullHeat()) {
|
||||
int i = diFurnace.getHullHeatScaled(88);
|
||||
|
||||
i = (int) Math.min(i, 160);
|
||||
|
||||
drawTexturedModalRect(guiLeft + 80, guiTop + 117, 0, 229, i, 7);
|
||||
drawTexturedModalRect(guiLeft + 80, guiTop + 114, 0, 226, i, 4);
|
||||
}
|
||||
|
||||
if(diFurnace.hasCoreHeat()) {
|
||||
int i = diFurnace.getCoreHeatScaled(88);
|
||||
|
||||
i = (int) Math.min(i, 160);
|
||||
|
||||
drawTexturedModalRect(guiLeft + 80, guiTop + 120, 0, 230, i, 4);
|
||||
}
|
||||
|
||||
if(!diFurnace.retracting)
|
||||
drawTexturedModalRect(guiLeft + 52, guiTop + 53, 212, 0, 18, 18);
|
||||
|
||||
if(diFurnace.rods >= diFurnace.rodsMax) {
|
||||
|
||||
for(int x = 0; x < 3; x++)
|
||||
for(int y = 0; y < 3; y++)
|
||||
drawTexturedModalRect(guiLeft + 79 + 36 * x, guiTop + 17 + 36 * y, 176, 0, 18, 18);
|
||||
|
||||
} else if(diFurnace.rods > 0) {
|
||||
|
||||
for(int x = 0; x < 3; x++)
|
||||
for(int y = 0; y < 3; y++)
|
||||
drawTexturedModalRect(guiLeft + 79 + 36 * x, guiTop + 17 + 36 * y, 194, 0, 18, 18);
|
||||
|
||||
if(!toggleOverlay) {
|
||||
if(diFurnace.rods >= diFurnace.rodsMax) {
|
||||
|
||||
for(int x = 0; x < 3; x++)
|
||||
for(int y = 0; y < 3; y++)
|
||||
drawTexturedModalRect(guiLeft + 79 + 36 * x, guiTop + 17 + 36 * y, 176, 0, 18, 18);
|
||||
|
||||
} else if(diFurnace.rods > 0) {
|
||||
|
||||
for(int x = 0; x < 3; x++)
|
||||
for(int y = 0; y < 3; y++)
|
||||
drawTexturedModalRect(guiLeft + 79 + 36 * x, guiTop + 17 + 36 * y, 194, 0, 18, 18);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(diFurnace.tanks[0].getSheet());
|
||||
@ -100,4 +120,15 @@ public class GUIMachineReactorSmall extends GuiInfoContainer {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(diFurnace.tanks[1].getSheet());
|
||||
diFurnace.tanks[1].renderTank(this, guiLeft + 26, guiTop + 88, diFurnace.tanks[1].getTankType().textureX() * FluidTank.x, diFurnace.tanks[1].getTankType().textureY() * FluidTank.y, 16, 52);
|
||||
}
|
||||
|
||||
protected void keyTyped(char p_73869_1_, int p_73869_2_)
|
||||
{
|
||||
super.keyTyped(p_73869_1_, p_73869_2_);
|
||||
|
||||
if (p_73869_2_ == 56)
|
||||
{
|
||||
this.toggleOverlay = !this.toggleOverlay;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1761,18 +1761,18 @@ public class ModItems {
|
||||
rod_quad_schrabidium = new ItemCustomLore().setUnlocalizedName("rod_quad_schrabidium").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_quad_empty).setTextureName(RefStrings.MODID + ":rod_quad_schrabidium");
|
||||
rod_quad_solinium = new ItemCustomLore().setUnlocalizedName("rod_quad_solinium").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_quad_empty).setTextureName(RefStrings.MODID + ":rod_quad_solinium");
|
||||
|
||||
rod_uranium_fuel = new ItemFuelRod(10000, 100).setUnlocalizedName("rod_uranium_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_empty).setTextureName(RefStrings.MODID + ":rod_uranium_fuel");
|
||||
rod_dual_uranium_fuel = new ItemFuelRod(20000, 100).setUnlocalizedName("rod_dual_uranium_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_dual_empty).setTextureName(RefStrings.MODID + ":rod_dual_uranium_fuel");
|
||||
rod_quad_uranium_fuel = new ItemFuelRod(40000, 100).setUnlocalizedName("rod_quad_uranium_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_quad_empty).setTextureName(RefStrings.MODID + ":rod_quad_uranium_fuel");
|
||||
rod_plutonium_fuel = new ItemFuelRod(25000, 250).setUnlocalizedName("rod_plutonium_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_empty).setTextureName(RefStrings.MODID + ":rod_plutonium_fuel");
|
||||
rod_dual_plutonium_fuel = new ItemFuelRod(50000, 250).setUnlocalizedName("rod_dual_plutonium_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_dual_empty).setTextureName(RefStrings.MODID + ":rod_dual_plutonium_fuel");
|
||||
rod_quad_plutonium_fuel = new ItemFuelRod(100000, 250).setUnlocalizedName("rod_quad_plutonium_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_quad_empty).setTextureName(RefStrings.MODID + ":rod_quad_plutonium_fuel");
|
||||
rod_mox_fuel = new ItemFuelRod(100000, 75).setUnlocalizedName("rod_mox_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_empty).setTextureName(RefStrings.MODID + ":rod_mox_fuel");
|
||||
rod_dual_mox_fuel = new ItemFuelRod(200000, 75).setUnlocalizedName("rod_dual_mox_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_dual_empty).setTextureName(RefStrings.MODID + ":rod_dual_mox_fuel");
|
||||
rod_quad_mox_fuel = new ItemFuelRod(400000, 75).setUnlocalizedName("rod_quad_mox_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_quad_empty).setTextureName(RefStrings.MODID + ":rod_quad_mox_fuel");
|
||||
rod_schrabidium_fuel = new ItemFuelRod(2500000, 1000).setUnlocalizedName("rod_schrabidium_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_empty).setTextureName(RefStrings.MODID + ":rod_schrabidium_fuel");
|
||||
rod_dual_schrabidium_fuel = new ItemFuelRod(5000000, 1000).setUnlocalizedName("rod_dual_schrabidium_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_dual_empty).setTextureName(RefStrings.MODID + ":rod_dual_schrabidium_fuel");
|
||||
rod_quad_schrabidium_fuel = new ItemFuelRod(10000000, 1000).setUnlocalizedName("rod_quad_schrabidium_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_quad_empty).setTextureName(RefStrings.MODID + ":rod_quad_schrabidium_fuel");
|
||||
rod_uranium_fuel = new ItemFuelRod(100000, 15).setUnlocalizedName("rod_uranium_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_empty).setTextureName(RefStrings.MODID + ":rod_uranium_fuel");
|
||||
rod_dual_uranium_fuel = new ItemFuelRod(100000, 30).setUnlocalizedName("rod_dual_uranium_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_dual_empty).setTextureName(RefStrings.MODID + ":rod_dual_uranium_fuel");
|
||||
rod_quad_uranium_fuel = new ItemFuelRod(100000, 60).setUnlocalizedName("rod_quad_uranium_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_quad_empty).setTextureName(RefStrings.MODID + ":rod_quad_uranium_fuel");
|
||||
rod_plutonium_fuel = new ItemFuelRod(75000, 25).setUnlocalizedName("rod_plutonium_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_empty).setTextureName(RefStrings.MODID + ":rod_plutonium_fuel");
|
||||
rod_dual_plutonium_fuel = new ItemFuelRod(75000, 50).setUnlocalizedName("rod_dual_plutonium_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_dual_empty).setTextureName(RefStrings.MODID + ":rod_dual_plutonium_fuel");
|
||||
rod_quad_plutonium_fuel = new ItemFuelRod(75000, 100).setUnlocalizedName("rod_quad_plutonium_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_quad_empty).setTextureName(RefStrings.MODID + ":rod_quad_plutonium_fuel");
|
||||
rod_mox_fuel = new ItemFuelRod(150000, 10).setUnlocalizedName("rod_mox_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_empty).setTextureName(RefStrings.MODID + ":rod_mox_fuel");
|
||||
rod_dual_mox_fuel = new ItemFuelRod(150000, 20).setUnlocalizedName("rod_dual_mox_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_dual_empty).setTextureName(RefStrings.MODID + ":rod_dual_mox_fuel");
|
||||
rod_quad_mox_fuel = new ItemFuelRod(150000, 40).setUnlocalizedName("rod_quad_mox_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_quad_empty).setTextureName(RefStrings.MODID + ":rod_quad_mox_fuel");
|
||||
rod_schrabidium_fuel = new ItemFuelRod(500000, 250).setUnlocalizedName("rod_schrabidium_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_empty).setTextureName(RefStrings.MODID + ":rod_schrabidium_fuel");
|
||||
rod_dual_schrabidium_fuel = new ItemFuelRod(500000, 500).setUnlocalizedName("rod_dual_schrabidium_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_dual_empty).setTextureName(RefStrings.MODID + ":rod_dual_schrabidium_fuel");
|
||||
rod_quad_schrabidium_fuel = new ItemFuelRod(500000, 1000).setUnlocalizedName("rod_quad_schrabidium_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_quad_empty).setTextureName(RefStrings.MODID + ":rod_quad_schrabidium_fuel");
|
||||
|
||||
rod_water = new ItemCustomLore().setUnlocalizedName("rod_water").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_empty).setTextureName(RefStrings.MODID + ":rod_water");
|
||||
rod_dual_water = new ItemCustomLore().setUnlocalizedName("rod_dual_water").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_dual_empty).setTextureName(RefStrings.MODID + ":rod_dual_water");
|
||||
|
||||
@ -26,84 +26,72 @@ public class ItemFuelRod extends ItemRadioactive {
|
||||
|
||||
if(this == ModItems.rod_uranium_fuel)
|
||||
{
|
||||
list.add("Generates 100 power per tick");
|
||||
list.add("Generates " + heat + " heat per tick");
|
||||
list.add("Lasts " + lifeTime + " ticks");
|
||||
}
|
||||
|
||||
if(this == ModItems.rod_dual_uranium_fuel)
|
||||
{
|
||||
list.add("Generates 100 power per tick");
|
||||
list.add("Generates " + heat + " heat per tick");
|
||||
list.add("Lasts " + lifeTime + " ticks");
|
||||
}
|
||||
|
||||
if(this == ModItems.rod_quad_uranium_fuel)
|
||||
{
|
||||
list.add("Generates 100 power per tick");
|
||||
list.add("Generates " + heat + " heat per tick");
|
||||
list.add("Lasts " + lifeTime + " ticks");
|
||||
}
|
||||
|
||||
if(this == ModItems.rod_plutonium_fuel)
|
||||
{
|
||||
list.add("Generates 150 power per tick");
|
||||
list.add("Generates " + heat + " heat per tick");
|
||||
list.add("Lasts " + lifeTime + " ticks");
|
||||
}
|
||||
|
||||
if(this == ModItems.rod_dual_plutonium_fuel)
|
||||
{
|
||||
list.add("Generates 150 power per tick");
|
||||
list.add("Generates " + heat + " heat per tick");
|
||||
list.add("Lasts " + lifeTime + " ticks");
|
||||
}
|
||||
|
||||
if(this == ModItems.rod_quad_plutonium_fuel)
|
||||
{
|
||||
list.add("Generates 150 power per tick");
|
||||
list.add("Generates " + heat + " heat per tick");
|
||||
list.add("Lasts " + lifeTime + " ticks");
|
||||
}
|
||||
|
||||
if(this == ModItems.rod_mox_fuel)
|
||||
{
|
||||
list.add("Generates 50 power per tick");
|
||||
list.add("Generates " + heat + " heat per tick");
|
||||
list.add("Lasts " + lifeTime + " ticks");
|
||||
}
|
||||
|
||||
if(this == ModItems.rod_dual_mox_fuel)
|
||||
{
|
||||
list.add("Generates 50 power per tick");
|
||||
list.add("Generates " + heat + " heat per tick");
|
||||
list.add("Lasts " + lifeTime + " ticks");
|
||||
}
|
||||
|
||||
if(this == ModItems.rod_quad_mox_fuel)
|
||||
{
|
||||
list.add("Generates 50 power per tick");
|
||||
list.add("Generates " + heat + " heat per tick");
|
||||
list.add("Lasts " + lifeTime + " ticks");
|
||||
}
|
||||
|
||||
if(this == ModItems.rod_schrabidium_fuel)
|
||||
{
|
||||
list.add("Generates 25000 power per tick");
|
||||
list.add("Generates " + heat + " heat per tick");
|
||||
list.add("Lasts " + lifeTime + " ticks");
|
||||
}
|
||||
|
||||
if(this == ModItems.rod_dual_schrabidium_fuel)
|
||||
{
|
||||
list.add("Generates 25000 power per tick");
|
||||
list.add("Generates " + heat + " heat per tick");
|
||||
list.add("Lasts " + lifeTime + " ticks");
|
||||
}
|
||||
|
||||
if(this == ModItems.rod_quad_schrabidium_fuel)
|
||||
{
|
||||
list.add("Generates 25000 power per tick");
|
||||
list.add("Generates " + heat + " heat per tick");
|
||||
list.add("Lasts " + lifeTime + " ticks");
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@ package com.hbm.items.special;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.potion.PotionEffectRadiation;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@ -44,7 +44,7 @@ public class ItemRadioactive extends Item {
|
||||
this == ModItems.pellet_mes ||
|
||||
this == ModItems.pellet_neptunium ||
|
||||
this == ModItems.pellet_schrabidium) {
|
||||
living.addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 80 * 20, 25));
|
||||
living.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 80 * 20, 25));
|
||||
}
|
||||
|
||||
//Strong
|
||||
@ -78,7 +78,7 @@ public class ItemRadioactive extends Item {
|
||||
this == ModItems.gadget_core ||
|
||||
this == ModItems.man_core ||
|
||||
this == ModItems.nuclear_waste) {
|
||||
living.addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 60 * 20, 20));
|
||||
living.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 60 * 20, 20));
|
||||
}
|
||||
|
||||
//Strong Nuggets
|
||||
@ -98,7 +98,7 @@ public class ItemRadioactive extends Item {
|
||||
this == ModItems.rod_uranium_fuel_depleted ||
|
||||
this == ModItems.rod_plutonium_fuel_depleted ||
|
||||
this == ModItems.rod_mox_fuel_depleted) {
|
||||
living.addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 45 * 20, 20));
|
||||
living.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 45 * 20, 20));
|
||||
}
|
||||
|
||||
//Medium
|
||||
@ -116,7 +116,7 @@ public class ItemRadioactive extends Item {
|
||||
this == ModItems.mike_core ||
|
||||
this == ModItems.tsar_core ||
|
||||
this == ModItems.trinitite) {
|
||||
living.addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 30 * 20, 15));
|
||||
living.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 30 * 20, 15));
|
||||
}
|
||||
|
||||
//Medium Nuggets
|
||||
@ -128,7 +128,7 @@ public class ItemRadioactive extends Item {
|
||||
this == ModItems.rod_pu238 ||
|
||||
this == ModItems.rod_plutonium ||
|
||||
this == ModItems.pellet_rtg_weak) {
|
||||
living.addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 20 * 20, 15));
|
||||
living.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 20 * 20, 15));
|
||||
}
|
||||
|
||||
//Weak
|
||||
@ -141,7 +141,7 @@ public class ItemRadioactive extends Item {
|
||||
this == ModItems.rod_dual_u238 ||
|
||||
this == ModItems.rod_quad_pu238 ||
|
||||
this == ModItems.rod_dual_pu238) {
|
||||
living.addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 20 * 20, 5));
|
||||
living.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 20 * 20, 5));
|
||||
}
|
||||
|
||||
//Weak Nuggets
|
||||
@ -155,19 +155,19 @@ public class ItemRadioactive extends Item {
|
||||
this == ModItems.rod_dual_tritium ||
|
||||
this == ModItems.rod_quad_tritium ||
|
||||
this == ModItems.powder_yellowcake) {
|
||||
living.addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 10 * 20, 5));
|
||||
living.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 10 * 20, 5));
|
||||
}
|
||||
|
||||
//Powder
|
||||
|
||||
if (this == ModItems.powder_neptunium ||
|
||||
this == ModItems.powder_plutonium) {
|
||||
living.addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 60 * 20, 20));
|
||||
living.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 60 * 20, 20));
|
||||
living.setFire(5);
|
||||
}
|
||||
|
||||
if (this == ModItems.powder_uranium) {
|
||||
living.addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 20 * 20, 5));
|
||||
living.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 20 * 20, 5));
|
||||
living.setFire(5);
|
||||
}
|
||||
|
||||
@ -191,7 +191,7 @@ public class ItemRadioactive extends Item {
|
||||
this == ModItems.rod_dual_schrabidium_fuel ||
|
||||
this == ModItems.rod_quad_schrabidium_fuel) {
|
||||
living.addPotionEffect(new PotionEffect(Potion.blindness.id, 60 * 20, 0));
|
||||
living.addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 100 * 20, 30));
|
||||
living.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 100 * 20, 30));
|
||||
}
|
||||
|
||||
if (this == ModItems.nugget_schrabidium ||
|
||||
@ -200,18 +200,18 @@ public class ItemRadioactive extends Item {
|
||||
this == ModItems.nugget_hes ||
|
||||
this == ModItems.nugget_les) {
|
||||
living.addPotionEffect(new PotionEffect(Potion.blindness.id, 60 * 20, 0));
|
||||
living.addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 75 * 20, 30));
|
||||
living.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 75 * 20, 30));
|
||||
}
|
||||
|
||||
if (this == ModItems.plate_schrabidium ||
|
||||
this == ModItems.wire_schrabidium) {
|
||||
living.addPotionEffect(new PotionEffect(Potion.blindness.id, 60 * 20, 0));
|
||||
living.addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 80 * 20, 30));
|
||||
living.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 80 * 20, 30));
|
||||
}
|
||||
|
||||
if (this == ModItems.powder_schrabidium) {
|
||||
living.addPotionEffect(new PotionEffect(Potion.blindness.id, 60 * 20, 0));
|
||||
living.addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 100 * 20, 30));
|
||||
living.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 100 * 20, 30));
|
||||
living.setFire(5);
|
||||
}
|
||||
}
|
||||
|
||||
@ -170,7 +170,7 @@ import com.hbm.lib.HbmWorld;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.potion.PotionEffectTaint;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.render.util.HmfModelLoader;
|
||||
import com.hbm.tileentity.bomb.TileEntityBombMulti;
|
||||
import com.hbm.tileentity.bomb.TileEntityCelPrime;
|
||||
@ -482,6 +482,10 @@ public class MainRegistry
|
||||
public static int generalOverride = 0;
|
||||
public static int polaroidID = 1;
|
||||
|
||||
public static int taintID = 62;
|
||||
public static int radiationID = 63;
|
||||
public static int bangID = 64;
|
||||
|
||||
public static int x;
|
||||
public static int y;
|
||||
public static int z;
|
||||
@ -509,6 +513,7 @@ public class MainRegistry
|
||||
proxy.registerRenderInfo();
|
||||
HbmWorld.mainRegistry();
|
||||
GameRegistry.registerFuelHandler(new FuelHandler());
|
||||
HbmPotion.init();
|
||||
|
||||
Library.superuser.add("192af5d7-ed0f-48d8-bd89-9d41af8524f8");
|
||||
Library.superuser.add("5aee1e3d-3767-4987-a222-e7ce1fbdf88e");
|
||||
@ -1449,6 +1454,16 @@ public class MainRegistry
|
||||
Property propCiwsHitrate = config.get(Configuration.CATEGORY_GENERAL, "7.03_ciwsAccuracy", 50);
|
||||
propCiwsHitrate.comment = "Additional modifier for CIWS accuracy";
|
||||
ciwsHitrate = propRadarAltitude.getInt();
|
||||
|
||||
Property propTaintID = config.get(Configuration.CATEGORY_GENERAL, "8.00_taintPotionID", 62);
|
||||
propTaintID.comment = "What potion ID the taint effect will have";
|
||||
taintID = propTaintID.getInt();
|
||||
Property propRadiationID = config.get(Configuration.CATEGORY_GENERAL, "8.01_radiationPotionID", 63);
|
||||
propRadiationID.comment = "What potion ID the radiation effect will have";
|
||||
radiationID = propRadiationID.getInt();
|
||||
Property propBangID = config.get(Configuration.CATEGORY_GENERAL, "8.02_bangPotionID", 64);
|
||||
propBangID.comment = "What potion ID the B93 timebomb effect will have";
|
||||
bangID = propBangID.getInt();
|
||||
|
||||
config.save();
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@ import com.hbm.entity.projectile.EntityMeteor;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.potion.PotionEffectRadiation;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent;
|
||||
@ -80,7 +80,7 @@ public class ModEventHandler
|
||||
for(Object e : event.world.loadedEntityList) {
|
||||
if(e instanceof EntityLivingBase) {
|
||||
EntityLivingBase entity = (EntityLivingBase) e;
|
||||
PotionEffect effect = entity.getActivePotionEffect(PotionEffectRadiation.instance);
|
||||
PotionEffect effect = entity.getActivePotionEffect(HbmPotion.radiation);
|
||||
|
||||
if(effect != null) {
|
||||
|
||||
|
||||
@ -125,7 +125,9 @@ public class AuxGaugePacket implements IMessage {
|
||||
if(m.id == 1)
|
||||
reactor.retracting = m.value == 1;
|
||||
if(m.id == 2)
|
||||
reactor.heat = m.value;
|
||||
reactor.coreHeat = m.value;
|
||||
if(m.id == 3)
|
||||
reactor.hullHeat = m.value;
|
||||
}
|
||||
|
||||
} catch (Exception x) { }
|
||||
|
||||
115
com/hbm/potion/HbmPotion.java
Normal file
115
com/hbm/potion/HbmPotion.java
Normal file
@ -0,0 +1,115 @@
|
||||
package com.hbm.potion;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.main.MainRegistry;
|
||||
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class HbmPotion extends Potion {
|
||||
|
||||
public static HbmPotion taint;
|
||||
public static HbmPotion radiation;
|
||||
public static HbmPotion bang;
|
||||
|
||||
public HbmPotion(int id, boolean isBad, int color) {
|
||||
super(id, isBad, color);
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
taint = registerPotion(MainRegistry.taintID, true, 8388736, "potion.hbm_taint", 0, 0);
|
||||
radiation = registerPotion(MainRegistry.radiationID, true, 8700200, "potion.hbm_radiation", 1, 0);
|
||||
bang = registerPotion(MainRegistry.bangID, true, 1118481, "potion.hbm_bang", 3, 0);
|
||||
}
|
||||
|
||||
public static HbmPotion registerPotion(int id, boolean isBad, int color, String name, int x, int y) {
|
||||
|
||||
if (id >= Potion.potionTypes.length) {
|
||||
|
||||
Potion[] newArray = new Potion[Math.max(256, id)];
|
||||
System.arraycopy(Potion.potionTypes, 0, newArray, 0, Potion.potionTypes.length);
|
||||
|
||||
Field field = ReflectionHelper.findField(Potion.class, new String[] { "field_76425_a", "potionTypes" });
|
||||
field.setAccessible(true);
|
||||
|
||||
try {
|
||||
|
||||
Field modfield = Field.class.getDeclaredField("modifiers");
|
||||
modfield.setAccessible(true);
|
||||
modfield.setInt(field, field.getModifiers() & 0xFFFFFFEF);
|
||||
field.set(null, newArray);
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
HbmPotion effect = new HbmPotion(id, isBad, color);
|
||||
effect.setPotionName(name);
|
||||
effect.setIconIndex(x, y);
|
||||
|
||||
return effect;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getStatusIconIndex() {
|
||||
ResourceLocation loc = new ResourceLocation("hbm","textures/gui/potions.png");
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(loc);
|
||||
return super.getStatusIconIndex();
|
||||
}
|
||||
|
||||
public void performEffect(EntityLivingBase entity, int level) {
|
||||
|
||||
if(this == taint) {
|
||||
|
||||
entity.attackEntityFrom(ModDamageSource.taint, (level + 1));
|
||||
}
|
||||
if(this == radiation) {
|
||||
|
||||
if (entity.getHealth() > entity.getMaxHealth() - (level + 1)) {
|
||||
entity.attackEntityFrom(ModDamageSource.radiation, 1);
|
||||
}
|
||||
}
|
||||
if(this == bang) {
|
||||
|
||||
entity.attackEntityFrom(ModDamageSource.bang, 1000);
|
||||
entity.setHealth(0.0F);
|
||||
|
||||
if (!(entity instanceof EntityPlayer))
|
||||
entity.setDead();
|
||||
|
||||
entity.worldObj.playSoundEffect(entity.posX, entity.posY, entity.posZ, "hbm:weapon.laserBang", 100.0F, 1.0F);
|
||||
ExplosionLarge.spawnParticles(entity.worldObj, entity.posX, entity.posY, entity.posZ, 10);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isReady(int par1, int par2) {
|
||||
|
||||
if(this == taint) {
|
||||
|
||||
int k = 80 >> par2;
|
||||
return k > 0 ? par1 % k == 0 : true;
|
||||
}
|
||||
if(this == radiation) {
|
||||
int k = 40 >> par2;
|
||||
return k > 0 ? par1 % k == 0 : true;
|
||||
}
|
||||
if(this == bang) {
|
||||
|
||||
return par1 <= 10;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,59 +0,0 @@
|
||||
package com.hbm.potion;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.bomb.BlockTaint;
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class PotionEffectBang extends Potion {
|
||||
|
||||
public static PotionEffectBang instance = new PotionEffectBang(Library.getFirstNullIndex(1, Potion.potionTypes), true, 1118481);
|
||||
Random rand = new Random();
|
||||
|
||||
public PotionEffectBang(int p_i1573_1_, boolean p_i1573_2_, int p_i1573_3_) {
|
||||
super(p_i1573_1_, p_i1573_2_, p_i1573_3_);
|
||||
this.setPotionName("potion.hbm_bang");
|
||||
this.setIconIndex(3, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getStatusIconIndex() {
|
||||
ResourceLocation loc = new ResourceLocation("hbm","textures/gui/potions.png");
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(loc);
|
||||
return super.getStatusIconIndex();
|
||||
}
|
||||
|
||||
|
||||
public void performEffect(EntityLivingBase entity, int level)
|
||||
{
|
||||
entity.attackEntityFrom(ModDamageSource.bang, 1000);
|
||||
entity.setHealth(0.0F);
|
||||
|
||||
if(!(entity instanceof EntityPlayer))
|
||||
entity.setDead();
|
||||
|
||||
entity.worldObj.playSoundEffect(entity.posX, entity.posY, entity.posZ, "hbm:weapon.laserBang", 100.0F, 1.0F);
|
||||
//entity.worldObj.spawnParticle("hugeexplosion", entity.posX, entity.posY, entity.posZ, 0, 0, 0);
|
||||
ExplosionLarge.spawnParticles(entity.worldObj, entity.posX, entity.posY, entity.posZ, 10);
|
||||
}
|
||||
|
||||
public boolean isReady(int par1, int par2)
|
||||
{
|
||||
return par1 <= 10;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,80 +0,0 @@
|
||||
package com.hbm.potion;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.bomb.BlockTaint;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class PotionEffectRadiation extends Potion {
|
||||
|
||||
public static PotionEffectRadiation instance = new PotionEffectRadiation(Library.getFirstNullIndex(1, Potion.potionTypes), true, 8700200);
|
||||
Random rand = new Random();
|
||||
|
||||
public PotionEffectRadiation(int p_i1573_1_, boolean p_i1573_2_, int p_i1573_3_) {
|
||||
super(p_i1573_1_, p_i1573_2_, p_i1573_3_);
|
||||
this.setPotionName("potion.hbm_radiation");
|
||||
this.setIconIndex(1, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getStatusIconIndex() {
|
||||
ResourceLocation loc = new ResourceLocation("hbm","textures/gui/potions.png");
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(loc);
|
||||
return super.getStatusIconIndex();
|
||||
}
|
||||
|
||||
|
||||
public void performEffect(EntityLivingBase entity, int level)
|
||||
{
|
||||
if(entity.getHealth() > entity.getMaxHealth() - (level + 1))
|
||||
entity.attackEntityFrom(ModDamageSource.radiation, 1);
|
||||
|
||||
/*if(level > 15) {
|
||||
if(rand.nextInt(10) == 0)
|
||||
entity.addPotionEffect(new PotionEffect(Potion.confusion.id, 5 * 20, 0));
|
||||
if(rand.nextInt(20) == 0)
|
||||
entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 5 * 20, 3));
|
||||
if(rand.nextInt(20) == 0)
|
||||
entity.addPotionEffect(new PotionEffect(Potion.weakness.id, 5 * 20, 3));
|
||||
if(rand.nextInt(20) == 0)
|
||||
entity.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 5 * 20, 2));
|
||||
if(rand.nextInt(30) == 0)
|
||||
entity.addPotionEffect(new PotionEffect(Potion.wither.id, 3 * 20, 4));
|
||||
} else if(level > 10) {
|
||||
if(rand.nextInt(10) == 0)
|
||||
entity.addPotionEffect(new PotionEffect(Potion.confusion.id, 5 * 20, 0));
|
||||
if(rand.nextInt(20) == 0)
|
||||
entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 5 * 20, 3));
|
||||
if(rand.nextInt(20) == 0)
|
||||
entity.addPotionEffect(new PotionEffect(Potion.weakness.id, 5 * 20, 3));
|
||||
if(rand.nextInt(20) == 0)
|
||||
entity.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 5 * 20, 2));
|
||||
} else if(level > 4) {
|
||||
if(rand.nextInt(10) == 0)
|
||||
entity.addPotionEffect(new PotionEffect(Potion.confusion.id, 5 * 20, 0));
|
||||
if(rand.nextInt(20) == 0)
|
||||
entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 5 * 20, 1));
|
||||
if(rand.nextInt(20) == 0)
|
||||
entity.addPotionEffect(new PotionEffect(Potion.weakness.id, 5 * 20, 1));
|
||||
}*/
|
||||
}
|
||||
|
||||
public boolean isReady(int par1, int par2)
|
||||
{
|
||||
int k = 40 >> par2;
|
||||
return k > 0 ? par1 % k == 0 : true;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,61 +0,0 @@
|
||||
package com.hbm.potion;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.bomb.BlockTaint;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class PotionEffectTaint extends Potion {
|
||||
|
||||
public static PotionEffectTaint instance = new PotionEffectTaint(Library.getFirstNullIndex(1, Potion.potionTypes), true, 8388736);
|
||||
Random rand = new Random();
|
||||
|
||||
public PotionEffectTaint(int p_i1573_1_, boolean p_i1573_2_, int p_i1573_3_) {
|
||||
super(p_i1573_1_, p_i1573_2_, p_i1573_3_);
|
||||
this.setPotionName("potion.hbm_taint");
|
||||
this.setIconIndex(0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getStatusIconIndex() {
|
||||
ResourceLocation loc = new ResourceLocation("hbm","textures/gui/potions.png");
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(loc);
|
||||
return super.getStatusIconIndex();
|
||||
}
|
||||
|
||||
|
||||
public void performEffect(EntityLivingBase entity, int level)
|
||||
{
|
||||
entity.attackEntityFrom(ModDamageSource.taint, (level + 1));
|
||||
|
||||
/*if(!entity.worldObj.isRemote) {
|
||||
|
||||
for(int i = 0; i < 15; i++) {
|
||||
int a = rand.nextInt(5) + (int)entity.posX - 2;
|
||||
int b = rand.nextInt(5) + (int)entity.posY - 2;
|
||||
int c = rand.nextInt(5) + (int)entity.posZ - 2;
|
||||
if(entity.worldObj.getBlock(a, b, c).isReplaceable(entity.worldObj, a, b, c) && BlockTaint.hasPosNeightbour(entity.worldObj, a, b, c))
|
||||
entity.worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(3), 2);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
public boolean isReady(int par1, int par2)
|
||||
{
|
||||
int k = 80 >> par2;
|
||||
return k > 0 ? par1 % k == 0 : true;
|
||||
}
|
||||
|
||||
}
|
||||
@ -6,7 +6,7 @@ import java.util.List;
|
||||
import com.hbm.entity.mob.EntityNuclearCreeper;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.potion.PotionEffectRadiation;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -71,23 +71,9 @@ public class TileEntityYellowBarrel extends TileEntity {
|
||||
Library.damageSuit(((EntityPlayer)entity), 2);
|
||||
Library.damageSuit(((EntityPlayer)entity), 3);*/
|
||||
|
||||
} else if(entity instanceof EntityCreeper) {
|
||||
EntityNuclearCreeper creep = new EntityNuclearCreeper(this.worldObj);
|
||||
creep.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
|
||||
//creep.setRotationYawHead(((EntityCreeper)entity).rotationYawHead);
|
||||
if(!entity.isDead)
|
||||
if(!worldObj.isRemote)
|
||||
worldObj.spawnEntityInWorld(creep);
|
||||
entity.setDead();
|
||||
} else if(entity instanceof EntityVillager) {
|
||||
EntityZombie creep = new EntityZombie(this.worldObj);
|
||||
creep.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
|
||||
entity.setDead();
|
||||
if(!this.worldObj.isRemote)
|
||||
this.worldObj.spawnEntityInWorld(creep);
|
||||
} else if(entity instanceof EntityLivingBase && !(entity instanceof EntityNuclearCreeper) && !(entity instanceof EntityMooshroom) && !(entity instanceof EntityZombie))
|
||||
{
|
||||
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 30 * 20, 14));
|
||||
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 30 * 20, 14));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,11 +33,13 @@ import net.minecraft.tileentity.TileEntity;
|
||||
public class TileEntityMachineReactorSmall extends TileEntity implements ISidedInventory, ISource, IFluidContainer, IFluidAcceptor {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
public int heat;
|
||||
public final int heatMax = 10000;
|
||||
|
||||
public int hullHeat;
|
||||
public final int maxHullHeat = 100000;
|
||||
public int coreHeat;
|
||||
public final int maxCoreHeat = 50000;
|
||||
public long power;
|
||||
public final long powerMax = 100000;
|
||||
public final long powerMax = 250000;
|
||||
public int rods;
|
||||
public final int rodsMax = 100;
|
||||
public boolean retracting = true;
|
||||
@ -177,7 +179,7 @@ public class TileEntityMachineReactorSmall extends TileEntity implements ISidedI
|
||||
NBTTagList list = nbt.getTagList("items", 10);
|
||||
|
||||
power = nbt.getLong("power");
|
||||
heat = nbt.getInteger("heat");
|
||||
coreHeat = nbt.getInteger("heat");
|
||||
slots = new ItemStack[getSizeInventory()];
|
||||
tanks[0].readFromNBT(nbt, "water");
|
||||
tanks[1].readFromNBT(nbt, "coolant");
|
||||
@ -197,7 +199,7 @@ public class TileEntityMachineReactorSmall extends TileEntity implements ISidedI
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setLong("power", power);
|
||||
nbt.setInteger("heat", heat);
|
||||
nbt.setInteger("heat", coreHeat);
|
||||
NBTTagList list = new NBTTagList();
|
||||
tanks[0].writeToNBT(nbt, "water");
|
||||
tanks[1].writeToNBT(nbt, "coolant");
|
||||
@ -264,16 +266,24 @@ public class TileEntityMachineReactorSmall extends TileEntity implements ISidedI
|
||||
return (power * i) / powerMax;
|
||||
}
|
||||
|
||||
public int getHeatScaled(int i) {
|
||||
return (heat * i) / heatMax;
|
||||
public int getCoreHeatScaled(int i) {
|
||||
return (coreHeat * i) / maxCoreHeat;
|
||||
}
|
||||
|
||||
public int getHullHeatScaled(int i) {
|
||||
return (hullHeat * i) / maxHullHeat;
|
||||
}
|
||||
|
||||
public boolean hasPower() {
|
||||
return power > 0;
|
||||
}
|
||||
|
||||
public boolean hasHeat() {
|
||||
return heat > 0;
|
||||
public boolean hasCoreHeat() {
|
||||
return coreHeat > 0;
|
||||
}
|
||||
|
||||
public boolean hasHullHeat() {
|
||||
return hullHeat > 0;
|
||||
}
|
||||
|
||||
private int[] getNeighbouringSlots(int id) {
|
||||
@ -347,12 +357,37 @@ public class TileEntityMachineReactorSmall extends TileEntity implements ISidedI
|
||||
decay(i);
|
||||
}
|
||||
|
||||
if(this.coreHeat > 0 && this.tanks[1].getFill() > 0 && this.hullHeat < this.maxHullHeat) {
|
||||
this.hullHeat += this.coreHeat * 0.175;
|
||||
this.coreHeat -= this.coreHeat * 0.1;
|
||||
|
||||
this.tanks[1].setFill(this.tanks[1].getFill() - 10);
|
||||
|
||||
if(this.tanks[1].getFill() < 0)
|
||||
this.tanks[1].setFill(0);
|
||||
}
|
||||
|
||||
if(this.hullHeat > maxHullHeat)
|
||||
{
|
||||
this.hullHeat = maxHullHeat;
|
||||
}
|
||||
|
||||
if(this.hullHeat > 0 && this.tanks[0].getFill() > 0) {
|
||||
this.power += this.hullHeat * 0.1;
|
||||
this.hullHeat -= this.hullHeat * 0.085;
|
||||
|
||||
this.tanks[0].setFill(this.tanks[0].getFill() - 100);
|
||||
|
||||
if(this.tanks[0].getFill() < 0)
|
||||
this.tanks[0].setFill(0);
|
||||
}
|
||||
|
||||
if(this.power > powerMax)
|
||||
{
|
||||
this.power = powerMax;
|
||||
}
|
||||
|
||||
if(this.heat > heatMax)
|
||||
if(this.coreHeat > maxCoreHeat)
|
||||
{
|
||||
this.explode();
|
||||
}
|
||||
@ -360,7 +395,8 @@ public class TileEntityMachineReactorSmall extends TileEntity implements ISidedI
|
||||
PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power));
|
||||
PacketDispatcher.wrapper.sendToAll(new AuxGaugePacket(xCoord, yCoord, zCoord, rods, 0));
|
||||
PacketDispatcher.wrapper.sendToAll(new AuxGaugePacket(xCoord, yCoord, zCoord, retracting ? 1 : 0, 1));
|
||||
PacketDispatcher.wrapper.sendToAll(new AuxGaugePacket(xCoord, yCoord, zCoord, heat, 2));
|
||||
PacketDispatcher.wrapper.sendToAll(new AuxGaugePacket(xCoord, yCoord, zCoord, coreHeat, 2));
|
||||
PacketDispatcher.wrapper.sendToAll(new AuxGaugePacket(xCoord, yCoord, zCoord, hullHeat, 3));
|
||||
}
|
||||
}
|
||||
|
||||
@ -400,7 +436,7 @@ public class TileEntityMachineReactorSmall extends TileEntity implements ISidedI
|
||||
|
||||
for(int i = 0; i < decay; i++) {
|
||||
ItemFuelRod rod = ((ItemFuelRod)slots[id].getItem());
|
||||
this.heat += rod.heat;
|
||||
this.coreHeat += rod.heat;
|
||||
ItemFuelRod.setLifeTime(slots[id], ItemFuelRod.getLifeTime(slots[id]) + 1);
|
||||
ItemFuelRod.updateDamage(slots[id]);
|
||||
|
||||
@ -473,15 +509,15 @@ public class TileEntityMachineReactorSmall extends TileEntity implements ISidedI
|
||||
|
||||
@Override
|
||||
public void ffgeuaInit() {
|
||||
ffgeua(this.xCoord - 1, this.yCoord + 1, this.zCoord, getTact());
|
||||
ffgeua(this.xCoord + 1, this.yCoord + 1, this.zCoord, getTact());
|
||||
ffgeua(this.xCoord, this.yCoord + 1, this.zCoord - 1, getTact());
|
||||
ffgeua(this.xCoord, this.yCoord + 1, this.zCoord + 1, getTact());
|
||||
ffgeua(this.xCoord - 1, this.yCoord, this.zCoord, getTact());
|
||||
ffgeua(this.xCoord + 1, this.yCoord, this.zCoord, getTact());
|
||||
ffgeua(this.xCoord, this.yCoord, this.zCoord - 1, getTact());
|
||||
ffgeua(this.xCoord, this.yCoord, this.zCoord + 1, getTact());
|
||||
|
||||
ffgeua(this.xCoord - 1, this.yCoord - 1, this.zCoord, getTact());
|
||||
ffgeua(this.xCoord + 1, this.yCoord - 1, this.zCoord, getTact());
|
||||
ffgeua(this.xCoord, this.yCoord - 1, this.zCoord - 1, getTact());
|
||||
ffgeua(this.xCoord, this.yCoord - 1, this.zCoord + 1, getTact());
|
||||
ffgeua(this.xCoord - 1, this.yCoord + 2, this.zCoord, getTact());
|
||||
ffgeua(this.xCoord + 1, this.yCoord + 2, this.zCoord, getTact());
|
||||
ffgeua(this.xCoord, this.yCoord + 2, this.zCoord - 1, getTact());
|
||||
ffgeua(this.xCoord, this.yCoord + 2, this.zCoord + 1, getTact());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -24,7 +24,7 @@ import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.potion.PotionEffectRadiation;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@ -513,7 +513,7 @@ public class TileEntityReactorMultiblock extends TileEntity implements ISidedInv
|
||||
Library.damageSuit(((EntityPlayer)entity), 3);*/
|
||||
|
||||
} else {
|
||||
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 80 * 20, 25));
|
||||
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 80 * 20, 25));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user