Small changes to the AMS, rendering fixes (sorta), pre-merge

This commit is contained in:
HbmMods 2017-12-03 11:55:54 +01:00
parent 8f660a2984
commit 2936661299
19 changed files with 2812 additions and 178 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 B

View File

@ -33,6 +33,7 @@ public class ExplosionLarge {
public static void spawnShock(World world, double x, double y, double z, int count, double strength) { public static void spawnShock(World world, double x, double y, double z, int count, double strength) {
Vec3 vec = Vec3.createVectorHelper(strength, 0, 0); Vec3 vec = Vec3.createVectorHelper(strength, 0, 0);
vec.rotateAroundY(rand.nextInt(360));
for(int i = 0; i < count; i++) { for(int i = 0; i < count; i++) {
EntityDSmokeFX fx = new EntityDSmokeFX(world, x, y, z, 0.0, 0.0, 0.0); EntityDSmokeFX fx = new EntityDSmokeFX(world, x, y, z, 0.0, 0.0, 0.0);
@ -48,6 +49,7 @@ public class ExplosionLarge {
public static void spawnBurst(World world, double x, double y, double z, int count, double strength) { public static void spawnBurst(World world, double x, double y, double z, int count, double strength) {
Vec3 vec = Vec3.createVectorHelper(strength, 0, 0); Vec3 vec = Vec3.createVectorHelper(strength, 0, 0);
vec.rotateAroundY(rand.nextInt(360));
for(int i = 0; i < count; i++) { for(int i = 0; i < count; i++) {
EntityGasFlameFX fx = new EntityGasFlameFX(world, x, y, z, 0.0, 0.0, 0.0); EntityGasFlameFX fx = new EntityGasFlameFX(world, x, y, z, 0.0, 0.0, 0.0);

View File

@ -376,6 +376,13 @@ public class ModItems {
public static Item crystal_energy; public static Item crystal_energy;
public static Item pellet_coolant; public static Item pellet_coolant;
public static Item rune_blank;
public static Item rune_isa;
public static Item rune_dagaz;
public static Item rune_hagalaz;
public static Item rune_jera;
public static Item rune_thurisaz;
public static Item ams_catalyst_blank; public static Item ams_catalyst_blank;
public static Item ams_catalyst_aluminium; public static Item ams_catalyst_aluminium;
public static Item ams_catalyst_beryllium; public static Item ams_catalyst_beryllium;
@ -1372,6 +1379,13 @@ public class ModItems {
crystal_energy = new ItemCustomLore().setUnlocalizedName("crystal_energy").setCreativeTab(MainRegistry.tabParts).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":crystal_energy"); crystal_energy = new ItemCustomLore().setUnlocalizedName("crystal_energy").setCreativeTab(MainRegistry.tabParts).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":crystal_energy");
pellet_coolant = new ItemCustomLore().setUnlocalizedName("pellet_coolant").setMaxDamage(41400).setCreativeTab(MainRegistry.tabParts).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":pellet_coolant"); pellet_coolant = new ItemCustomLore().setUnlocalizedName("pellet_coolant").setMaxDamage(41400).setCreativeTab(MainRegistry.tabParts).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":pellet_coolant");
rune_blank = new ItemCustomLore().setUnlocalizedName("rune_blank").setCreativeTab(MainRegistry.tabParts).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":rune_blank");
rune_isa = new ItemCustomLore().setUnlocalizedName("rune_isa").setCreativeTab(MainRegistry.tabParts).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":rune_isa");
rune_dagaz = new ItemCustomLore().setUnlocalizedName("rune_dagaz").setCreativeTab(MainRegistry.tabParts).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":rune_dagaz");
rune_hagalaz = new ItemCustomLore().setUnlocalizedName("rune_hagalaz").setCreativeTab(MainRegistry.tabParts).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":rune_hagalaz");
rune_jera = new ItemCustomLore().setUnlocalizedName("rune_jera").setCreativeTab(MainRegistry.tabParts).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":rune_jera");
rune_thurisaz = new ItemCustomLore().setUnlocalizedName("rune_thurisaz").setCreativeTab(MainRegistry.tabParts).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":rune_thurisaz");
ams_catalyst_blank = new Item().setUnlocalizedName("ams_catalyst_blank").setCreativeTab(MainRegistry.tabParts).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":ams_catalyst_blank"); ams_catalyst_blank = new Item().setUnlocalizedName("ams_catalyst_blank").setCreativeTab(MainRegistry.tabParts).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":ams_catalyst_blank");
ams_catalyst_aluminium = new ItemCatalyst(0xCCCCCC).setUnlocalizedName("ams_catalyst_aluminium").setCreativeTab(MainRegistry.tabParts).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":ams_catalyst_aluminium"); ams_catalyst_aluminium = new ItemCatalyst(0xCCCCCC).setUnlocalizedName("ams_catalyst_aluminium").setCreativeTab(MainRegistry.tabParts).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":ams_catalyst_aluminium");
ams_catalyst_beryllium = new ItemCatalyst(0x97978B).setUnlocalizedName("ams_catalyst_beryllium").setCreativeTab(MainRegistry.tabParts).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":ams_catalyst_beryllium"); ams_catalyst_beryllium = new ItemCatalyst(0x97978B).setUnlocalizedName("ams_catalyst_beryllium").setCreativeTab(MainRegistry.tabParts).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":ams_catalyst_beryllium");
@ -2604,6 +2618,14 @@ public class ModItems {
GameRegistry.registerItem(part_copper, part_copper.getUnlocalizedName()); GameRegistry.registerItem(part_copper, part_copper.getUnlocalizedName());
GameRegistry.registerItem(part_plutonium, part_plutonium.getUnlocalizedName()); GameRegistry.registerItem(part_plutonium, part_plutonium.getUnlocalizedName());
//Catalyst Rune Sigils
GameRegistry.registerItem(rune_blank, rune_blank.getUnlocalizedName());
GameRegistry.registerItem(rune_isa, rune_isa.getUnlocalizedName());
GameRegistry.registerItem(rune_dagaz, rune_dagaz.getUnlocalizedName());
GameRegistry.registerItem(rune_hagalaz, rune_hagalaz.getUnlocalizedName());
GameRegistry.registerItem(rune_jera, rune_jera.getUnlocalizedName());
GameRegistry.registerItem(rune_thurisaz, rune_thurisaz.getUnlocalizedName());
//AMS Catalysts //AMS Catalysts
GameRegistry.registerItem(ams_catalyst_blank, ams_catalyst_blank.getUnlocalizedName()); GameRegistry.registerItem(ams_catalyst_blank, ams_catalyst_blank.getUnlocalizedName());
GameRegistry.registerItem(ams_catalyst_aluminium, ams_catalyst_aluminium.getUnlocalizedName()); GameRegistry.registerItem(ams_catalyst_aluminium, ams_catalyst_aluminium.getUnlocalizedName());

View File

@ -5,6 +5,8 @@ import java.util.List;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import com.hbm.main.MainRegistry; import com.hbm.main.MainRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -576,4 +578,20 @@ public class ItemCustomLore extends ItemRadioactive {
return EnumRarity.common; return EnumRarity.common;
} }
@Override
@SideOnly(Side.CLIENT)
public boolean hasEffect(ItemStack p_77636_1_)
{
if(this == ModItems.rune_isa ||
this == ModItems.rune_dagaz ||
this == ModItems.rune_hagalaz ||
this == ModItems.rune_jera ||
this == ModItems.rune_thurisaz)
{
return true;
}
return false;
}
} }

View File

@ -289,7 +289,9 @@ public class Library {
world.getBlock(x, y, z) == ModBlocks.dummy_port_chemplant || world.getBlock(x, y, z) == ModBlocks.dummy_port_chemplant ||
world.getBlock(x, y, z) == ModBlocks.dummy_port_refinery || world.getBlock(x, y, z) == ModBlocks.dummy_port_refinery ||
world.getBlock(x, y, z) == ModBlocks.dummy_port_pumpjack || world.getBlock(x, y, z) == ModBlocks.dummy_port_pumpjack ||
world.getBlock(x, y, z) == ModBlocks.dummy_port_turbofan) world.getBlock(x, y, z) == ModBlocks.dummy_port_turbofan ||
world.getBlock(x, y, z) == ModBlocks.dummy_port_ams_limiter ||
world.getBlock(x, y, z) == ModBlocks.dummy_port_ams_emitter)
{ {
return true; return true;
} }
@ -321,7 +323,9 @@ public class Library {
world.getBlock(x, y, z) == ModBlocks.reactor_hatch || world.getBlock(x, y, z) == ModBlocks.reactor_hatch ||
world.getBlock(x, y, z) == ModBlocks.fusion_hatch || world.getBlock(x, y, z) == ModBlocks.fusion_hatch ||
world.getBlock(x, y, z) == ModBlocks.watz_hatch || world.getBlock(x, y, z) == ModBlocks.watz_hatch ||
world.getBlock(x, y, z) == ModBlocks.fwatz_hatch) world.getBlock(x, y, z) == ModBlocks.fwatz_hatch ||
world.getBlock(x, y, z) == ModBlocks.dummy_port_ams_limiter ||
world.getBlock(x, y, z) == ModBlocks.dummy_port_ams_emitter)
{ {
return true; return true;
} }

View File

@ -8,6 +8,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.stats.Achievement;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.ForgeChunkManager; import net.minecraftforge.common.ForgeChunkManager;
@ -239,9 +240,6 @@ public class MainRegistry
@SidedProxy(clientSide = RefStrings.CLIENTSIDE, serverSide = RefStrings.SERVERSIDE) @SidedProxy(clientSide = RefStrings.CLIENTSIDE, serverSide = RefStrings.SERVERSIDE)
public static ServerProxy proxy; public static ServerProxy proxy;
//We'll get to that eventually
//public static PacketHandler packetHandler;
@Metadata @Metadata
public static ModMetadata meta; public static ModMetadata meta;
@ -292,45 +290,51 @@ public class MainRegistry
public static CreativeTabs tabNuke = new NukeTab(CreativeTabs.getNextID(), "tabNuke"); public static CreativeTabs tabNuke = new NukeTab(CreativeTabs.getNextID(), "tabNuke");
//Achievements //Achievements
/*public static Achievement achievementGetTitanium; public static Achievement achCircuit0;
public static Achievement achievementGetCopper; public static Achievement achCircuit1;
public static Achievement achievementCraftAlloyFurnace; public static Achievement achCircuit2;
public static Achievement achievementCraftElectricFurnace; public static Achievement achCircuit3;
public static Achievement achievementCraftDerrick; public static Achievement achCircuit4;
public static Achievement achievementCraftRefinery; public static Achievement achCircuit5;
public static Achievement achievementCraftFactoryTitanium; public static Achievement achJack;
public static Achievement achievementCraftFactoryAdvanced; public static Achievement achDalekanium;
public static Achievement achievementCraftGeneratorCoal; public static Achievement achRefinery;
public static Achievement achievementCraftGeneratorDiesel; public static Achievement achBattery;
public static Achievement achievementCraftGeneratorIndustrial; public static Achievement achOil;
public static Achievement achievementGetLead; public static Achievement achCatapult1;
public static Achievement achievementCraftBreedingReactor; public static Achievement achCatapult2;
public static Achievement achievementCraftAtomicFurnace; public static Achievement achCatapult3;
public static Achievement achievementCraftCentrifuge; public static Achievement achU235;
public static Achievement achievementCraftMissile; public static Achievement achPu238;
public static Achievement achievementCraftMIRV; public static Achievement achPu239;
public static Achievement achievementCraftNuclearReactor; public static Achievement achNeptunium;
public static Achievement achievementCraftRTGFurnace; public static Achievement achDesh;
public static Achievement achievementCraftRTG; public static Achievement achMeteor;
public static Achievement achievementCraftReactor; public static Achievement achGeiger;
public static Achievement achievementCraftTransmutator; public static Achievement achDesignator;
public static Achievement achievementCraftWatz; public static Achievement achRemote;
public static Achievement achievementCraftCMB; public static Achievement achOverpowered;
public static Achievement achievementCraftTeleporter; public static Achievement achShimSham;
public static Achievement achievementCraftFWatz; public static Achievement achMatchstick;
public static Achievement achievementCraftDeuterium; public static Achievement achRails;
public static Achievement achievementCraftFusion; public static Achievement achFolder;
public static Achievement achievementCraftCyclotron; public static Achievement achPress;
public static Achievement achievementCraftNuke; public static Achievement achFWatz;
public static Achievement achievementCraftFLEIJA; public static Achievement achTurbofan;
public static Achievement achievementCraftHammer; public static Achievement achGadget;
public static Achievement achievementCraftOutlaw; public static Achievement achBoy;
public static Achievement achievementGetReiium; public static Achievement achMan;
public static Achievement achievementGetWeidanium; public static Achievement achMike;
public static Achievement achievementGetAustalium; public static Achievement achTsar;
public static Achievement achievementGetVerticium; public static Achievement achFLEIJA;
public static Achievement achievementGetUnobtainium; public static Achievement achPrototype;
public static Achievement achievementGetDaffergon;*/ public static Achievement achCustom;
public static Achievement achTurret;
public static Achievement achMeteorDeath;
public static Achievement achXenium;
public static Achievement achRadiation;
public static Achievement achSchrabidium;
public static Achievement achEuphemium;
public static boolean enableDebugMode = true; public static boolean enableDebugMode = true;
public static boolean enableMycelium = false; public static boolean enableMycelium = false;

View File

@ -36,6 +36,7 @@ public class ResourceManager {
//Anti Mass Spectrometer //Anti Mass Spectrometer
public static final IModelCustom ams_base = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/ams_base.obj")); public static final IModelCustom ams_base = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/ams_base.obj"));
public static final IModelCustom ams_emitter = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/ams_emitter.obj")); public static final IModelCustom ams_emitter = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/ams_emitter.obj"));
public static final IModelCustom ams_emitter_destroyed = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/ams_emitter_destroyed.obj"));
public static final IModelCustom ams_limiter = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/ams_limiter.obj")); public static final IModelCustom ams_limiter = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/ams_limiter.obj"));
public static final IModelCustom ams_limiter_destroyed = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/ams_limiter_destroyed.obj")); public static final IModelCustom ams_limiter_destroyed = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/ams_limiter_destroyed.obj"));

View File

@ -16,7 +16,6 @@ import net.minecraft.util.ResourceLocation;
public class RenderAMSBase extends TileEntitySpecialRenderer { public class RenderAMSBase extends TileEntitySpecialRenderer {
public RenderAMSBase() { } public RenderAMSBase() { }
Random rand = new Random();
@Override @Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f)
@ -31,9 +30,43 @@ public class RenderAMSBase extends TileEntitySpecialRenderer {
ResourceManager.ams_base.renderAll(); ResourceManager.ams_base.renderAll();
GL11.glPopMatrix();
TileEntityAMSBase base = (TileEntityAMSBase)tileEntity;
if(base.color > -1)
renderTileEntityAt2(tileEntity, x, y, z, f);
}
public void renderTileEntityAt2(TileEntity tileEntity, double x, double y, double z, float f)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y + 5.5, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
int rot = (int) ((System.nanoTime()/100000000)%360) * 3;
TileEntityAMSBase base = (TileEntityAMSBase)tileEntity;
double maxSize = 5;
double minSize = 0.5;
double scale = minSize;
scale += ((((double)base.tanks[2].getFill()) / ((double)base.tanks[2].getMaxFill())) + (((double)base.tanks[3].getFill()) / ((double)base.tanks[3].getMaxFill()))) * ((maxSize - minSize) / 2);
GL11.glScaled(scale, scale, scale);
bindTexture(new ResourceLocation(RefStrings.MODID, "textures/models/EMPBlast.png"));
GL11.glRotatef(rot, 0F, 1F, 0F);
GL11.glScalef(1.1F, 1.1F, 1.1F);
ResourceManager.sphere_iuv.renderAll();
GL11.glScalef(1/1.1F, 1/1.1F, 1/1.1F);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glPopMatrix(); GL11.glPopMatrix();
renderTileEntityAt2(tileEntity, x, y, z, f); renderTileEntityAt3(tileEntity, x, y, z, f);
} }
public void renderTileEntityAt3(TileEntity tileEntity, double x, double y, double z, float f) public void renderTileEntityAt3(TileEntity tileEntity, double x, double y, double z, float f)
@ -43,9 +76,16 @@ public class RenderAMSBase extends TileEntitySpecialRenderer {
GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F); GL11.glRotatef(180, 0F, 1F, 0F);
GL11.glScalef(2.5F, 2.5F, 2.5F);
GL11.glColor3ub((byte)((((TileEntityAMSBase)tileEntity).color & 0xFF0000) >> 16), (byte)((((TileEntityAMSBase)tileEntity).color & 0x00FF00) >> 8), (byte)((((TileEntityAMSBase)tileEntity).color & 0x0000FF) >> 0)); TileEntityAMSBase base = (TileEntityAMSBase)tileEntity;
double maxSize = 5;
double minSize = 0.5;
double scale = minSize;
scale += ((((double)base.tanks[2].getFill()) / ((double)base.tanks[2].getMaxFill())) + (((double)base.tanks[3].getFill()) / ((double)base.tanks[3].getMaxFill()))) * ((maxSize - minSize) / 2);
GL11.glScaled(scale, scale, scale);
GL11.glColor3ub((byte)((base.color & 0xFF0000) >> 16), (byte)((base.color & 0x00FF00) >> 8), (byte)((base.color & 0x0000FF) >> 0));
GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_TEXTURE_2D);
@ -88,127 +128,5 @@ public class RenderAMSBase extends TileEntitySpecialRenderer {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glPopMatrix(); GL11.glPopMatrix();
renderTileEntityAt4(tileEntity, x, y, z, f);
}
public void renderTileEntityAt2(TileEntity tileEntity, double x, double y, double z, float f)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y + 5.5, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
GL11.glScalef(2.5F, 2.5F, 2.5F);
int rot = (int) ((System.nanoTime()/100000000)%360) * 3;
bindTexture(new ResourceLocation(RefStrings.MODID, "textures/models/EMPBlast.png"));
GL11.glRotatef(rot, 0F, 1F, 0F);
GL11.glScalef(1.1F, 1.1F, 1.1F);
ResourceManager.sphere_iuv.renderAll();
GL11.glScalef(1/1.1F, 1/1.1F, 1/1.1F);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glPopMatrix();
renderTileEntityAt3(tileEntity, x, y, z, f);
}
public void renderTileEntityAt4(TileEntity tileEntity, double x, double y, double z, float f)
{
float radius = 0.04F;
int distance = 1;
int layers = 3;
Tessellator tessellator = Tessellator.instance;
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
GL11.glTranslatef((float) x + 0.5F, (float) y + 2, (float) z + 0.5F);
double lastPosX = 0;
double lastPosZ = 0;
for(int i = 7; i > 0; i -= distance) {
double posX = rand.nextDouble() - 0.5;
double posZ = rand.nextDouble() - 0.5;
for(int j = 1; j <= layers; j++) {
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(1, 0.5F, 0, 1f);
tessellator.addVertex(lastPosX + (radius * j), i, lastPosZ + (radius * j));
tessellator.addVertex(lastPosX + (radius * j), i, lastPosZ - (radius * j));
tessellator.addVertex(posX + (radius * j), i - distance, posZ - (radius * j));
tessellator.addVertex(posX + (radius * j), i - distance, posZ + (radius * j));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(1, 0.5F, 0, 1f);
tessellator.addVertex(lastPosX - (radius * j), i, lastPosZ + (radius * j));
tessellator.addVertex(lastPosX - (radius * j), i, lastPosZ - (radius * j));
tessellator.addVertex(posX - (radius * j), i - distance, posZ - (radius * j));
tessellator.addVertex(posX - (radius * j), i - distance, posZ + (radius * j));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(1, 0.5F, 0, 1f);
tessellator.addVertex(lastPosX + (radius * j), i, lastPosZ + (radius * j));
tessellator.addVertex(lastPosX - (radius * j), i, lastPosZ + (radius * j));
tessellator.addVertex(posX - (radius * j), i - distance, posZ + (radius * j));
tessellator.addVertex(posX + (radius * j), i - distance, posZ + (radius * j));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(1, 0.5F, 0, 1f);
tessellator.addVertex(lastPosX + (radius * j), i, lastPosZ - (radius * j));
tessellator.addVertex(lastPosX - (radius * j), i, lastPosZ - (radius * j));
tessellator.addVertex(posX - (radius * j), i - distance, posZ - (radius * j));
tessellator.addVertex(posX + (radius * j), i - distance, posZ - (radius * j));
tessellator.draw();
}
lastPosX = posX;
lastPosZ = posZ;
}
for(int j = 1; j <= 2; j++) {
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(1, 1, 0, 1f);
tessellator.addVertex(0 + (radius * j), 7, 0 + (radius * j));
tessellator.addVertex(0 + (radius * j), 7, 0 - (radius * j));
tessellator.addVertex(0 + (radius * j), 0, 0 - (radius * j));
tessellator.addVertex(0 + (radius * j), 0, 0 + (radius * j));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(1, 1, 0, 1f);
tessellator.addVertex(0 - (radius * j), 7, 0 + (radius * j));
tessellator.addVertex(0 - (radius * j), 7, 0 - (radius * j));
tessellator.addVertex(0 - (radius * j), 0, 0 - (radius * j));
tessellator.addVertex(0 - (radius * j), 0, 0 + (radius * j));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(1, 1, 0, 1f);
tessellator.addVertex(0 + (radius * j), 7, 0 + (radius * j));
tessellator.addVertex(0 - (radius * j), 7, 0 + (radius * j));
tessellator.addVertex(0 - (radius * j), 0, 0 + (radius * j));
tessellator.addVertex(0 + (radius * j), 0, 0 + (radius * j));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(1, 1, 0, 1f);
tessellator.addVertex(0 + (radius * j), 7, 0 - (radius * j));
tessellator.addVertex(0 - (radius * j), 7, 0 - (radius * j));
tessellator.addVertex(0 - (radius * j), 0, 0 - (radius * j));
tessellator.addVertex(0 + (radius * j), 0, 0 - (radius * j));
tessellator.draw();
}
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glPopMatrix();
} }
} }

View File

@ -1,10 +1,16 @@
package com.hbm.render.tileentity; package com.hbm.render.tileentity;
import java.util.Random;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.hbm.lib.RefStrings; import com.hbm.lib.RefStrings;
import com.hbm.main.ResourceManager; import com.hbm.main.ResourceManager;
import com.hbm.tileentity.machine.TileEntityAMSBase;
import com.hbm.tileentity.machine.TileEntityAMSEmitter;
import com.hbm.tileentity.machine.TileEntityAMSLimiter;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
@ -14,6 +20,7 @@ import net.minecraftforge.client.model.IModelCustom;
public class RenderAMSEmitter extends TileEntitySpecialRenderer { public class RenderAMSEmitter extends TileEntitySpecialRenderer {
public RenderAMSEmitter() { } public RenderAMSEmitter() { }
Random rand = new Random();
@Override @Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f)
@ -24,10 +31,117 @@ public class RenderAMSEmitter extends TileEntitySpecialRenderer {
GL11.glDisable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F); GL11.glRotatef(180, 0F, 1F, 0F);
bindTexture(ResourceManager.ams_emitter_tex); bindTexture(ResourceManager.universal);
ResourceManager.ams_emitter.renderAll(); if(((TileEntityAMSEmitter)tileEntity).locked)
ResourceManager.ams_emitter_destroyed.renderAll();
else
ResourceManager.ams_emitter.renderAll();
GL11.glPopMatrix(); GL11.glPopMatrix();
renderTileEntityAt2(tileEntity, x, y, z, f);
}
public void renderTileEntityAt2(TileEntity tileEntity, double x, double y, double z, float f)
{
float radius = 0.04F;
int distance = 1;
int layers = 3;
Tessellator tessellator = Tessellator.instance;
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
GL11.glTranslatef((float) x + 0.5F, (float) y - 7, (float) z + 0.5F);
TileEntityAMSEmitter emitter = (TileEntityAMSEmitter)tileEntity;
if(emitter.getWorldObj().getTileEntity(emitter.xCoord, emitter.yCoord - 9, emitter.zCoord) instanceof TileEntityAMSBase && !emitter.locked) {
if(emitter.power > 0) {
double lastPosX = 0;
double lastPosZ = 0;
for(int i = 7; i > 0; i -= distance) {
double posX = rand.nextDouble() - 0.5;
double posZ = rand.nextDouble() - 0.5;
for(int j = 1; j <= layers; j++) {
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(1, 0.5F, 0, 1f);
tessellator.addVertex(lastPosX + (radius * j), i, lastPosZ + (radius * j));
tessellator.addVertex(lastPosX + (radius * j), i, lastPosZ - (radius * j));
tessellator.addVertex(posX + (radius * j), i - distance, posZ - (radius * j));
tessellator.addVertex(posX + (radius * j), i - distance, posZ + (radius * j));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(1, 0.5F, 0, 1f);
tessellator.addVertex(lastPosX - (radius * j), i, lastPosZ + (radius * j));
tessellator.addVertex(lastPosX - (radius * j), i, lastPosZ - (radius * j));
tessellator.addVertex(posX - (radius * j), i - distance, posZ - (radius * j));
tessellator.addVertex(posX - (radius * j), i - distance, posZ + (radius * j));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(1, 0.5F, 0, 1f);
tessellator.addVertex(lastPosX + (radius * j), i, lastPosZ + (radius * j));
tessellator.addVertex(lastPosX - (radius * j), i, lastPosZ + (radius * j));
tessellator.addVertex(posX - (radius * j), i - distance, posZ + (radius * j));
tessellator.addVertex(posX + (radius * j), i - distance, posZ + (radius * j));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(1, 0.5F, 0, 1f);
tessellator.addVertex(lastPosX + (radius * j), i, lastPosZ - (radius * j));
tessellator.addVertex(lastPosX - (radius * j), i, lastPosZ - (radius * j));
tessellator.addVertex(posX - (radius * j), i - distance, posZ - (radius * j));
tessellator.addVertex(posX + (radius * j), i - distance, posZ - (radius * j));
tessellator.draw();
}
lastPosX = posX;
lastPosZ = posZ;
}
}
for(int j = 1; j <= 2; j++) {
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(1, 1, 0, 1f);
tessellator.addVertex(0 + (radius * j), 7, 0 + (radius * j));
tessellator.addVertex(0 + (radius * j), 7, 0 - (radius * j));
tessellator.addVertex(0 + (radius * j), 0, 0 - (radius * j));
tessellator.addVertex(0 + (radius * j), 0, 0 + (radius * j));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(1, 1, 0, 1f);
tessellator.addVertex(0 - (radius * j), 7, 0 + (radius * j));
tessellator.addVertex(0 - (radius * j), 7, 0 - (radius * j));
tessellator.addVertex(0 - (radius * j), 0, 0 - (radius * j));
tessellator.addVertex(0 - (radius * j), 0, 0 + (radius * j));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(1, 1, 0, 1f);
tessellator.addVertex(0 + (radius * j), 7, 0 + (radius * j));
tessellator.addVertex(0 - (radius * j), 7, 0 + (radius * j));
tessellator.addVertex(0 - (radius * j), 0, 0 + (radius * j));
tessellator.addVertex(0 + (radius * j), 0, 0 + (radius * j));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(1, 1, 0, 1f);
tessellator.addVertex(0 + (radius * j), 7, 0 - (radius * j));
tessellator.addVertex(0 - (radius * j), 7, 0 - (radius * j));
tessellator.addVertex(0 - (radius * j), 0, 0 - (radius * j));
tessellator.addVertex(0 + (radius * j), 0, 0 - (radius * j));
tessellator.draw();
}
}
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glPopMatrix();
} }
} }

View File

@ -3,8 +3,11 @@ package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager; import com.hbm.main.ResourceManager;
import com.hbm.tileentity.machine.TileEntityAMSBase;
import com.hbm.tileentity.machine.TileEntityAMSLimiter; import com.hbm.tileentity.machine.TileEntityAMSLimiter;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
@ -40,6 +43,250 @@ public class RenderAMSLimiter extends TileEntitySpecialRenderer {
else else
ResourceManager.ams_limiter.renderAll(); ResourceManager.ams_limiter.renderAll();
GL11.glPopMatrix();
renderTileEntityAt2(tileEntity, x, y, z, f);
}
public void renderTileEntityAt2(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);
GL11.glRotatef(180, 0F, 1F, 0F);
GL11.glRotatef(-90, 0F, 1F, 0F);
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;
}
bindTexture(ResourceManager.universal);
TileEntityAMSLimiter limiter = (TileEntityAMSLimiter)tileEntity;
int meta = tileEntity.getBlockMetadata();
boolean flag = false;
double maxSize = 5;
double minSize = 0.5;
double rad = maxSize;
if(meta == 2 && tileEntity.getWorldObj().getTileEntity(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord - 6) instanceof TileEntityAMSBase && !limiter.locked) {
flag = true;
TileEntityAMSBase base = (TileEntityAMSBase)tileEntity.getWorldObj().getTileEntity(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord - 6);
maxSize += ((((double)base.tanks[2].getFill()) / ((double)base.tanks[2].getMaxFill())) + (((double)base.tanks[3].getFill()) / ((double)base.tanks[3].getMaxFill()))) * ((maxSize - minSize) / 2);
}
if(meta == 3 && tileEntity.getWorldObj().getTileEntity(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord + 6) instanceof TileEntityAMSBase && !limiter.locked) {
flag = true;
TileEntityAMSBase base = (TileEntityAMSBase)tileEntity.getWorldObj().getTileEntity(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord + 6);
maxSize += ((((double)base.tanks[2].getFill()) / ((double)base.tanks[2].getMaxFill())) + (((double)base.tanks[3].getFill()) / ((double)base.tanks[3].getMaxFill()))) * ((maxSize - minSize) / 2);
}
if(meta == 4 && tileEntity.getWorldObj().getTileEntity(tileEntity.xCoord - 6, tileEntity.yCoord, tileEntity.zCoord) instanceof TileEntityAMSBase && !limiter.locked) {
flag = true;
TileEntityAMSBase base = (TileEntityAMSBase)tileEntity.getWorldObj().getTileEntity(tileEntity.xCoord - 6, tileEntity.yCoord, tileEntity.zCoord);
maxSize += ((((double)base.tanks[2].getFill()) / ((double)base.tanks[2].getMaxFill())) + (((double)base.tanks[3].getFill()) / ((double)base.tanks[3].getMaxFill()))) * ((maxSize - minSize) / 2);
}
if(meta == 5 && tileEntity.getWorldObj().getTileEntity(tileEntity.xCoord + 6, tileEntity.yCoord, tileEntity.zCoord) instanceof TileEntityAMSBase && !limiter.locked) {
flag = true;
TileEntityAMSBase base = (TileEntityAMSBase)tileEntity.getWorldObj().getTileEntity(tileEntity.xCoord + 6, tileEntity.yCoord, tileEntity.zCoord);
maxSize += ((((double)base.tanks[2].getFill()) / ((double)base.tanks[2].getMaxFill())) + (((double)base.tanks[3].getFill()) / ((double)base.tanks[3].getMaxFill()))) * ((maxSize - minSize) / 2);
}
if(flag) {
GL11.glRotatef(-90, 0F, 1F, 0F);
double posX = 0;
double posY = 0;
double posZ = 0;
double length = 4;
double radius = 0.12;
GL11.glTranslated(2.5, 5.5, 0);
RenderHelper.disableStandardItemLighting();
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
GL11.glDisable(GL11.GL_ALPHA_TEST);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glDepthMask(false);
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(0, 0, 1F, 0f);
tessellator.addVertex(posX + length, posY - radius, posZ - radius);
tessellator.addVertex(posX + length, posY - radius, posZ + radius);
tessellator.setColorRGBA_F(0, 0, 1F, 1f);
tessellator.addVertex(posX, posY - radius, posZ + radius);
tessellator.addVertex(posX, posY - radius, posZ - radius);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(0, 0, 1F, 0f);
tessellator.addVertex(posX + length, posY + radius, posZ + radius);
tessellator.addVertex(posX + length, posY + radius, posZ - radius);
tessellator.setColorRGBA_F(0, 0, 1F, 1f);
tessellator.addVertex(posX, posY + radius, posZ - radius);
tessellator.addVertex(posX, posY + radius, posZ + radius);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(0, 0, 1F, 0f);
tessellator.addVertex(posX + length, posY - radius, posZ - radius);
tessellator.addVertex(posX + length, posY + radius, posZ - radius);
tessellator.setColorRGBA_F(0, 0, 1F, 1f);
tessellator.addVertex(posX, posY + radius, posZ - radius);
tessellator.addVertex(posX, posY - radius, posZ - radius);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(0, 0, 1F, 0f);
tessellator.addVertex(posX + length, posY - radius, posZ + radius);
tessellator.addVertex(posX + length, posY + radius, posZ + radius);
tessellator.setColorRGBA_F(0, 0, 1F, 1f);
tessellator.addVertex(posX, posY + radius, posZ + radius);
tessellator.addVertex(posX, posY - radius, posZ + radius);
tessellator.draw();
if(limiter.power > 0) {
radius *= 2;
RenderHelper.disableStandardItemLighting();
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
GL11.glDisable(GL11.GL_ALPHA_TEST);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glDepthMask(false);
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(0, 0, 1F, 0f);
tessellator.addVertex(posX + length, posY - radius, posZ - radius);
tessellator.addVertex(posX + length, posY - radius, posZ + radius);
tessellator.setColorRGBA_F(0, 0, 1F, 1f);
tessellator.addVertex(posX, posY - radius, posZ + radius);
tessellator.addVertex(posX, posY - radius, posZ - radius);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(0, 0, 1F, 0f);
tessellator.addVertex(posX + length, posY + radius, posZ + radius);
tessellator.addVertex(posX + length, posY + radius, posZ - radius);
tessellator.setColorRGBA_F(0, 0, 1F, 1f);
tessellator.addVertex(posX, posY + radius, posZ - radius);
tessellator.addVertex(posX, posY + radius, posZ + radius);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(0, 0, 1F, 0f);
tessellator.addVertex(posX + length, posY - radius, posZ - radius);
tessellator.addVertex(posX + length, posY + radius, posZ - radius);
tessellator.setColorRGBA_F(0, 0, 1F, 1f);
tessellator.addVertex(posX, posY + radius, posZ - radius);
tessellator.addVertex(posX, posY - radius, posZ - radius);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(0, 0, 1F, 0f);
tessellator.addVertex(posX + length, posY - radius, posZ + radius);
tessellator.addVertex(posX + length, posY + radius, posZ + radius);
tessellator.setColorRGBA_F(0, 0, 1F, 1f);
tessellator.addVertex(posX, posY + radius, posZ + radius);
tessellator.addVertex(posX, posY - radius, posZ + radius);
tessellator.draw();
/*double iRadiusB = 0.3;
double oRadiusB = 2;
double iRadiusS = iRadiusB * 0.75;
double oRadiusS = oRadiusB * 0.60;
double bLength = rad;
int rot = (int) ((System.nanoTime()/100000000)%360) * 3;
GL11.glRotatef(rot, 1F, 0F, 0F);
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(0, 0, 1F, 0f);
tessellator.addVertex(posX + bLength, posY - oRadiusB, posZ - oRadiusS);
tessellator.addVertex(posX + bLength, posY - oRadiusB, posZ + oRadiusS);
tessellator.setColorRGBA_F(0, 0, 1F, 1f);
tessellator.addVertex(posX, posY - iRadiusB, posZ + iRadiusS);
tessellator.addVertex(posX, posY - iRadiusB, posZ - iRadiusS);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(0, 0, 1F, 0f);
tessellator.addVertex(posX + bLength, posY + oRadiusB, posZ - oRadiusS);
tessellator.addVertex(posX + bLength, posY + oRadiusB, posZ + oRadiusS);
tessellator.setColorRGBA_F(0, 0, 1F, 1f);
tessellator.addVertex(posX, posY + iRadiusB, posZ + iRadiusS);
tessellator.addVertex(posX, posY + iRadiusB, posZ - iRadiusS);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(0, 0, 1F, 0f);
tessellator.addVertex(posX + bLength, posY - oRadiusS, posZ - oRadiusB);
tessellator.addVertex(posX + bLength, posY + oRadiusS, posZ - oRadiusB);
tessellator.setColorRGBA_F(0, 0, 1F, 1f);
tessellator.addVertex(posX, posY + iRadiusS, posZ - iRadiusB);
tessellator.addVertex(posX, posY - iRadiusS, posZ - iRadiusB);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(0, 0, 1F, 0f);
tessellator.addVertex(posX + bLength, posY - oRadiusS, posZ + oRadiusB);
tessellator.addVertex(posX + bLength, posY + oRadiusS, posZ + oRadiusB);
tessellator.setColorRGBA_F(0, 0, 1F, 1f);
tessellator.addVertex(posX, posY + iRadiusS, posZ + iRadiusB);
tessellator.addVertex(posX, posY - iRadiusS, posZ + iRadiusB);
tessellator.draw();
iRadiusB *= 0.60;
oRadiusB *= 0.60;
iRadiusS = iRadiusB * 0.75;
oRadiusS = oRadiusB * 0.60;
bLength = 2.5;
GL11.glRotatef(-2 * rot, 1F, 0F, 0F);
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(0.25F, 0.25F, 1F, 1f);
tessellator.addVertex(posX + bLength, posY - oRadiusB, posZ - oRadiusS);
tessellator.addVertex(posX + bLength, posY - oRadiusB, posZ + oRadiusS);
tessellator.addVertex(posX, posY - iRadiusB, posZ + iRadiusS);
tessellator.addVertex(posX, posY - iRadiusB, posZ - iRadiusS);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(0.25F, 0.25F, 1F, 1f);
tessellator.addVertex(posX + bLength, posY + oRadiusB, posZ - oRadiusS);
tessellator.addVertex(posX + bLength, posY + oRadiusB, posZ + oRadiusS);
tessellator.addVertex(posX, posY + iRadiusB, posZ + iRadiusS);
tessellator.addVertex(posX, posY + iRadiusB, posZ - iRadiusS);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(0.25F, 0.25F, 1F, 1f);
tessellator.addVertex(posX + bLength, posY - oRadiusS, posZ - oRadiusB);
tessellator.addVertex(posX + bLength, posY + oRadiusS, posZ - oRadiusB);
tessellator.addVertex(posX, posY + iRadiusS, posZ - iRadiusB);
tessellator.addVertex(posX, posY - iRadiusS, posZ - iRadiusB);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(0.25F, 0.25F, 1F, 1f);
tessellator.addVertex(posX + bLength, posY - oRadiusS, posZ + oRadiusB);
tessellator.addVertex(posX + bLength, posY + oRadiusS, posZ + oRadiusB);
tessellator.addVertex(posX, posY + iRadiusS, posZ + iRadiusB);
tessellator.addVertex(posX, posY - iRadiusS, posZ + iRadiusB);
tessellator.draw();*/
}
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glShadeModel(GL11.GL_FLAT);
RenderHelper.enableStandardItemLighting();
GL11.glDepthMask(true);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glEnable(GL11.GL_TEXTURE_2D);
}
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
} }

View File

@ -319,7 +319,8 @@ public class TileEntityAMSBase extends TileEntity implements ISidedInventory, IS
} }
private float calcField(int a, int b, int c, int d) { private float calcField(int a, int b, int c, int d) {
return (float)Math.sqrt((Math.pow(a, 2) + Math.pow(b, 2) + Math.pow(c, 2) + Math.pow(d, 2)) / 4); //return (float)Math.sqrt((Math.pow(a, 2) + Math.pow(b, 2) + Math.pow(c, 2) + Math.pow(d, 2)) / 4);
return (float)(a + b + c + d) / 4;
} }
private int calcAvgHex(int h1, int h2) { private int calcAvgHex(int h1, int h2) {

View File

@ -298,14 +298,20 @@ public class TileEntityAMSEmitter extends TileEntity implements ISidedInventory,
if(heat > maxHeat) { if(heat > maxHeat) {
heat = maxHeat; heat = maxHeat;
locked = true; locked = true;
ExplosionLarge.spawnShock(worldObj, xCoord, yCoord, zCoord, 24, 3); ExplosionLarge.spawnBurst(worldObj, xCoord + 0.5, yCoord, zCoord + 0.5, 36, 3);
ExplosionLarge.spawnBurst(worldObj, xCoord, yCoord, zCoord, 24, 3); ExplosionLarge.spawnBurst(worldObj, xCoord + 0.5, yCoord, zCoord + 0.5, 36, 2.5);
ExplosionLarge.spawnBurst(worldObj, xCoord + 0.5, yCoord, zCoord + 0.5, 36, 2);
ExplosionLarge.spawnBurst(worldObj, xCoord + 0.5, yCoord, zCoord + 0.5, 36, 1.5);
ExplosionLarge.spawnBurst(worldObj, xCoord + 0.5, yCoord, zCoord + 0.5, 36, 1);
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:entity.oldExplosion", 10.0F, 1);
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:block.shutdown", 10.0F, 1.0F);
} }
power = Library.chargeTEFromItems(slots, 3, power, maxPower); power = Library.chargeTEFromItems(slots, 3, power, maxPower);
} else { } else {
//fire particles n stuff //fire particles n stuff
ExplosionLarge.spawnBurst(worldObj, xCoord + 0.5, yCoord - 0.5, zCoord + 0.5, rand.nextInt(10), 1);
efficiency = 0; efficiency = 0;
power = 0; power = 0;

View File

@ -312,8 +312,10 @@ public class TileEntityAMSLimiter extends TileEntity implements ISidedInventory,
if(heat > maxHeat) { if(heat > maxHeat) {
heat = maxHeat; heat = maxHeat;
locked = true; locked = true;
ExplosionLarge.spawnShock(worldObj, xCoord, yCoord, zCoord, 24, 3); ExplosionLarge.spawnShock(worldObj, xCoord + 0.5, yCoord, zCoord + 0.5, 24, 3);
ExplosionLarge.spawnBurst(worldObj, xCoord, yCoord, zCoord, 24, 3); ExplosionLarge.spawnBurst(worldObj, xCoord + 0.5, yCoord, zCoord + 0.5, 24, 3);
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:entity.oldExplosion", 10.0F, 1);
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:block.shutdown", 10.0F, 1.0F);
} }
power = Library.chargeTEFromItems(slots, 3, power, maxPower); power = Library.chargeTEFromItems(slots, 3, power, maxPower);