more hadron work, some UV and texturing, more nether stuff

This commit is contained in:
Bob 2020-12-05 00:24:57 +01:00
parent db47a1328a
commit ba08905bc1
18 changed files with 221 additions and 50 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 838 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 940 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1001 B

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

View File

@ -289,6 +289,7 @@ public class ModBlocks {
public static Block geysir_water;
public static Block geysir_chlorine;
public static Block geysir_vapor;
public static Block geysir_nether;
public static Block flame_war;
public static Block float_bomb;
@ -1026,7 +1027,7 @@ public class ModBlocks {
asphalt = new BlockGeneric(Material.rock).setBlockName("asphalt").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(100.0F).setBlockTextureName(RefStrings.MODID + ":asphalt");
reinforced_brick = new BlockGeneric(Material.rock).setBlockName("reinforced_brick").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(8000.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_brick");
reinforced_glass = new BlockNTMGlass(RefStrings.MODID + ":reinforced_glass", Material.rock).setBlockName("reinforced_glass").setCreativeTab(MainRegistry.blockTab).setLightOpacity(0).setHardness(15.0F).setResistance(200.0F);
reinforced_glass = new BlockNTMGlass(0, RefStrings.MODID + ":reinforced_glass", Material.rock).setBlockName("reinforced_glass").setCreativeTab(MainRegistry.blockTab).setLightOpacity(0).setHardness(15.0F).setResistance(200.0F);
reinforced_light = new BlockGeneric(Material.rock).setBlockName("reinforced_light").setCreativeTab(MainRegistry.blockTab).setLightLevel(1.0F).setHardness(15.0F).setResistance(300.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_light");
reinforced_sand = new BlockGeneric(Material.rock).setBlockName("reinforced_sand").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(400.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_sand");
reinforced_lamp_off = new ReinforcedLamp(Material.rock, false).setBlockName("reinforced_lamp_off").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(300.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_lamp_off");
@ -1096,9 +1097,9 @@ public class ModBlocks {
sand_uranium = new BlockFalling(Material.sand).setBlockName("sand_uranium").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.machineTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":sand_uranium");
sand_polonium = new BlockFalling(Material.sand).setBlockName("sand_polonium").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.machineTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":sand_polonium");
glass_uranium = new BlockNTMGlass(RefStrings.MODID + ":glass_uranium", Material.glass).setBlockName("glass_uranium").setLightLevel(5F/15F).setStepSound(Block.soundTypeGlass).setCreativeTab(MainRegistry.machineTab).setHardness(0.3F);
glass_trinitite = new BlockNTMGlass(RefStrings.MODID + ":glass_trinitite", Material.glass).setBlockName("glass_trinitite").setLightLevel(5F/15F).setStepSound(Block.soundTypeGlass).setCreativeTab(MainRegistry.machineTab).setHardness(0.3F);
glass_polonium = new BlockNTMGlass(RefStrings.MODID + ":glass_polonium", Material.glass).setBlockName("glass_polonium").setLightLevel(5F/15F).setStepSound(Block.soundTypeGlass).setCreativeTab(MainRegistry.machineTab).setHardness(0.3F);
glass_uranium = new BlockNTMGlass(1, RefStrings.MODID + ":glass_uranium", Material.glass).setBlockName("glass_uranium").setLightLevel(5F/15F).setStepSound(Block.soundTypeGlass).setCreativeTab(MainRegistry.machineTab).setHardness(0.3F);
glass_trinitite = new BlockNTMGlass(1, RefStrings.MODID + ":glass_trinitite", Material.glass).setBlockName("glass_trinitite").setLightLevel(5F/15F).setStepSound(Block.soundTypeGlass).setCreativeTab(MainRegistry.machineTab).setHardness(0.3F);
glass_polonium = new BlockNTMGlass(1, RefStrings.MODID + ":glass_polonium", Material.glass).setBlockName("glass_polonium").setLightLevel(5F/15F).setStepSound(Block.soundTypeGlass).setCreativeTab(MainRegistry.machineTab).setHardness(0.3F);
mush = new BlockMush(Material.plants).setBlockName("mush").setCreativeTab(MainRegistry.blockTab).setLightLevel(0.5F).setStepSound(Block.soundTypeGrass).setBlockTextureName(RefStrings.MODID + ":mush");
mush_block = new BlockMushHuge(Material.plants).setBlockName("mush_block").setLightLevel(1.0F).setStepSound(Block.soundTypeGrass).setHardness(0.2F).setBlockTextureName(RefStrings.MODID + ":mush_block_skin");
@ -1126,6 +1127,7 @@ public class ModBlocks {
geysir_water = new BlockGeysir(Material.rock).setBlockName("geysir_water").setStepSound(Block.soundTypeStone).setHardness(5.0F);
geysir_chlorine = new BlockGeysir(Material.rock).setBlockName("geysir_chlorine").setStepSound(Block.soundTypeStone).setHardness(5.0F);
geysir_vapor = new BlockGeysir(Material.rock).setBlockName("geysir_vapor").setStepSound(Block.soundTypeStone).setHardness(5.0F);
geysir_nether = new BlockGeysir(Material.rock).setBlockName("geysir_nether").setLightLevel(1.0F).setStepSound(Block.soundTypeStone).setHardness(2.0F);
nuke_gadget = new NukeGadget(Material.iron).setBlockName("nuke_gadget").setCreativeTab(MainRegistry.nukeTab).setHardness(5.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":theGadget");
nuke_boy = new NukeBoy(Material.iron).setBlockName("nuke_boy").setCreativeTab(MainRegistry.nukeTab).setHardness(5.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":lilBoy");
@ -1202,14 +1204,14 @@ public class ModBlocks {
hadron_plating_yellow = new BlockHadronPlating(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_plating_yellow").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_plating_yellow");
hadron_plating_striped = new BlockHadronPlating(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_plating_striped").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_plating_striped");
hadron_plating_voltz = new BlockHadronPlating(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_plating_voltz").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_plating_voltz");
hadron_plating_glass = new BlockNTMGlass(RefStrings.MODID + ":hadron_plating_glass", Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_plating_glass").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_plating_glass");
hadron_plating_glass = new BlockNTMGlass(0, RefStrings.MODID + ":hadron_plating_glass", Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_plating_glass").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_plating_glass");
hadron_coil_alloy = new BlockHadronCoil(Material.iron, 1).setStepSound(Block.soundTypeMetal).setBlockName("hadron_coil_alloy").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_coil_alloy");
hadron_coil_schrabidium = new BlockHadronCoil(Material.iron, 3).setStepSound(Block.soundTypeMetal).setBlockName("hadron_coil_schrabidium").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_coil_schrabidium");
hadron_coil_starmetal = new BlockHadronCoil(Material.iron, 10).setStepSound(Block.soundTypeMetal).setBlockName("hadron_coil_starmetal").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_coil_starmetal");
hadron_power = new BlockHadronPower(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_power").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_power");
hadron_diode = new BlockHadronDiode(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_diode").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
hadron_analysis = new BlockHadronPlating(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_analysis").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_analysis");
hadron_analysis_glass = new BlockNTMGlass(RefStrings.MODID + ":hadron_analysis_glass", Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_analysis_glass").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_analysis_glass");
hadron_analysis_glass = new BlockNTMGlass(0, RefStrings.MODID + ":hadron_analysis_glass", Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_analysis_glass").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_analysis_glass");
hadron_access = new BlockHadronAccess(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_access").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_access");
hadron_core = new BlockHadronCore(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_core").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_core");
@ -1325,7 +1327,7 @@ public class ModBlocks {
fwatz_conductor = new BlockPillar(Material.iron, RefStrings.MODID + ":block_combine_steel").setBlockName("fwatz_conductor").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fwatz_conductor_side");
fwatz_cooler = new BlockPillar(Material.iron, RefStrings.MODID + ":fwatz_cooler_top").setBlockName("fwatz_cooler").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fwatz_cooler");
fwatz_tank = new BlockNTMGlass(RefStrings.MODID + ":fwatz_tank", Material.iron).setBlockName("fwatz_tank").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
fwatz_tank = new BlockNTMGlass(0, RefStrings.MODID + ":fwatz_tank", Material.iron).setBlockName("fwatz_tank").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
fwatz_scaffold = new BlockGeneric(Material.iron).setBlockName("fwatz_scaffold").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fwatz_scaffold");
fwatz_hatch = new FWatzHatch(Material.iron).setBlockName("fwatz_hatch").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fwatz_computer");
fwatz_computer = new BlockGeneric(Material.iron).setBlockName("fwatz_computer").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fwatz_computer");
@ -1837,6 +1839,7 @@ public class ModBlocks {
GameRegistry.registerBlock(geysir_water, geysir_water.getUnlocalizedName());
GameRegistry.registerBlock(geysir_chlorine, geysir_chlorine.getUnlocalizedName());
GameRegistry.registerBlock(geysir_vapor, geysir_vapor.getUnlocalizedName());
GameRegistry.registerBlock(geysir_nether, geysir_nether.getUnlocalizedName());
//Nukes
GameRegistry.registerBlock(nuke_gadget, nuke_gadget.getUnlocalizedName());

View File

@ -25,8 +25,13 @@ public class BlockGeysir extends BlockContainer {
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":geysir_stone");
this.blockIcon = Blocks.stone.getIcon(0, 0);
if(this == ModBlocks.geysir_nether) {
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":geysir_nether");
this.blockIcon = Blocks.netherrack.getIcon(0, 0);
} else {
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":geysir_stone");
this.blockIcon = Blocks.stone.getIcon(0, 0);
}
}
@Override
@ -58,6 +63,10 @@ public class BlockGeysir extends BlockContainer {
p_149734_1_.spawnParticle("cloud", f, f1, f2, 0.0D, 0.1D, 0.0D);
}
if(this == ModBlocks.geysir_nether) {
p_149734_1_.spawnParticle("flame", x + 0.5F, y + 1.0625F, z + 0.5F, 0.0D, 0.0D, 0.0D);
}
}
}

View File

@ -8,9 +8,12 @@ import net.minecraft.block.BlockBreakable;
import net.minecraft.block.material.Material;
public class BlockNTMGlass extends BlockBreakable {
int renderLayer;
public BlockNTMGlass(String name, Material material) {
public BlockNTMGlass(int layer, String name, Material material) {
super(name, material, false);
this.renderLayer = layer;
}
public int quantityDropped(Random rand) {
@ -19,7 +22,7 @@ public class BlockNTMGlass extends BlockBreakable {
@SideOnly(Side.CLIENT)
public int getRenderBlockPass() {
return 1;
return renderLayer;
}
public boolean renderAsNormalBlock() {

View File

@ -63,11 +63,6 @@ public class HadronRecipes {
* @return either null (no recipe) or an ItemStack array with 2 non-null instances
*/
public static ItemStack[] getOutput(ItemStack in1, ItemStack in2, int momentum, boolean analysisOnly) {
System.out.println(in1);
System.out.println(in2);
System.out.println(momentum);
System.out.println(analysisOnly);
for(HadronRecipe r : recipes) {

View File

@ -32,9 +32,12 @@ public class GUIHadron extends GuiInfoContainer {
public void drawScreen(int mouseX, int mouseY, float f) {
super.drawScreen(mouseX, mouseY, f);
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 71, guiTop + 108, 34, 16, hadron.power, hadron.maxPower);
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 62, guiTop + 108, 70, 16, hadron.power, hadron.maxPower);
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 142, guiTop + 89, 18, 18, mouseX, mouseY, I18nUtil.resolveKeyArray("hadron.hopper0"));
if(hadron.hopperMode)
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 142, guiTop + 89, 18, 18, mouseX, mouseY, I18nUtil.resolveKeyArray("hadron.hopper1"));
else
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 142, guiTop + 89, 18, 18, mouseX, mouseY, I18nUtil.resolveKeyArray("hadron.hopper0"));
if(hadron.analysisOnly)
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 142, guiTop + 107, 18, 18, mouseX, mouseY, I18nUtil.resolveKeyArray("hadron.modeLine"));
@ -56,6 +59,12 @@ public class GUIHadron extends GuiInfoContainer {
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(hadron.xCoord, hadron.yCoord, hadron.zCoord, 0, 1));
}
//Toggle hopper mode
if(guiLeft + 142 <= x && guiLeft + 142 + 18 > x && guiTop + 89 < y && guiTop + 89 + 18 >= y) {
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(hadron.xCoord, hadron.yCoord, hadron.zCoord, 0, 2));
}
}
@Override
@ -77,5 +86,11 @@ public class GUIHadron extends GuiInfoContainer {
if(hadron.analysisOnly)
drawTexturedModalRect(guiLeft + 142, guiTop + 107, 206, 18, 18, 18);
if(hadron.hopperMode)
drawTexturedModalRect(guiLeft + 142, guiTop + 89, 206, 36, 18, 18);
int i = hadron.getPowerScaled(70);
drawTexturedModalRect(guiLeft + 62, guiTop + 108, 176, 60, i, 16);
}
}

View File

@ -650,6 +650,16 @@ public class HbmWorldGen implements IWorldGenerator {
if(world.getBlock(x, y + 1, z) == Blocks.air && world.getBlock(x, y, z) == Blocks.netherrack)
world.setBlock(x, y, z, ModBlocks.ore_nether_smoldering);
}
for(int k = 0; k < 1; k++){
int x = i + rand.nextInt(16);
int z = j + rand.nextInt(16);
int d = 16 + rand.nextInt(96);
for(int y = d - 5; y <= d; y++)
if(world.getBlock(x, y + 1, z) == Blocks.air && world.getBlock(x, y, z) == Blocks.netherrack)
world.setBlock(x, y, z, ModBlocks.geysir_nether);
}
}
private void generateEnd(World world, Random rand, int i, int j) {

View File

@ -832,7 +832,7 @@ public class ClientProxy extends ServerProxy {
if("hadron".equals(type)) {
for(int i = 0; i < 30; i++) {
/*for(int i = 0; i < 30; i++) {
EntityFX fx = null;
@ -852,7 +852,9 @@ public class ClientProxy extends ServerProxy {
fx.motionZ = rand.nextGaussian() * 0.1;
Minecraft.getMinecraft().effectRenderer.addEffect(fx);
}
}
}*/
Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleHadron(man, world, x, y, z));
}
}

View File

@ -0,0 +1,67 @@
package com.hbm.particle;
import java.util.Random;
import org.lwjgl.opengl.GL11;
import com.hbm.lib.RefStrings;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
public class ParticleHadron extends EntityFX {
private static final ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/particle/hadron.png");
private TextureManager theRenderEngine;
public ParticleHadron(TextureManager texman, World world, double x, double y, double z) {
super(world, x, y, z);
this.theRenderEngine = texman;
this.particleMaxAge = 10;
}
public int getFXLayer() {
return 3;
}
public void renderParticle(Tessellator tess, float interp, float x, float y, float z, float tx, float tz) {
this.theRenderEngine.bindTexture(texture);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_BLEND);
GL11.glAlphaFunc(GL11.GL_GREATER, 0);
GL11.glDepthMask(false);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
RenderHelper.disableStandardItemLighting();
tess.startDrawingQuads();
tess.setNormal(0.0F, 1.0F, 0.0F);
tess.setBrightness(240);
this.particleAlpha = 1 - (((float)this.particleAge + interp) / (float)this.particleMaxAge);
float scale = (this.particleAge + interp) * 0.15F;
tess.setColorRGBA_F(1.0F, 1.0F, 1.0F, this.particleAlpha);
float pX = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double)interp - interpPosX);
float pY = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double)interp - interpPosY);
float pZ = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double)interp - interpPosZ);
tess.addVertexWithUV((double)(pX - x * scale - tx * scale), (double)(pY - y * scale), (double)(pZ - z * scale - tz * scale), 1, 1);
tess.addVertexWithUV((double)(pX - x * scale + tx * scale), (double)(pY + y * scale), (double)(pZ - z * scale + tz * scale), 1, 0);
tess.addVertexWithUV((double)(pX + x * scale + tx * scale), (double)(pY + y * scale), (double)(pZ + z * scale + tz * scale), 0, 0);
tess.addVertexWithUV((double)(pX + x * scale - tx * scale), (double)(pY - y * scale), (double)(pZ + z * scale - tz * scale), 0, 1);
tess.draw();
GL11.glPolygonOffset(0.0F, 0.0F);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
GL11.glEnable(GL11.GL_LIGHTING);
}
}

View File

@ -0,0 +1,12 @@
package com.hbm.particle;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.world.World;
//TODO: everything
public class ParticleLargeFlame extends EntityFX {
protected ParticleLargeFlame(World world, double x, double y, double z) {
super(world, x, y, z);
}
}

View File

@ -4,12 +4,15 @@ import java.util.List;
import java.util.Random;
import com.hbm.blocks.ModBlocks;
import com.hbm.entity.particle.EntityGasFlameFX;
import com.hbm.entity.particle.EntityOrangeFX;
import com.hbm.entity.projectile.EntityShrapnel;
import com.hbm.entity.projectile.EntityWaterSplash;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
@ -84,6 +87,26 @@ public class TileEntityGeysir extends TileEntity {
}
}
private void fire() {
int range = 32;
if(worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5).expand(range, range, range)).isEmpty())
return;
if(worldObj.rand.nextInt(3) == 0) {
EntityShrapnel fx = new EntityShrapnel(worldObj, xCoord + 0.5, yCoord + 1.5, zCoord + 0.5);
fx.motionX = worldObj.rand.nextGaussian() * 0.05;
fx.motionZ = worldObj.rand.nextGaussian() * 0.05;
fx.motionY = 0.5 + worldObj.rand.nextDouble() * timer * 0.01;
worldObj.spawnEntityInWorld(fx);
}
if(timer % 2 == 0) //TODO: replace with actual particle
worldObj.spawnEntityInWorld(new EntityGasFlameFX(worldObj, this.xCoord + 0.5F, this.yCoord + 1.1F, this.zCoord + 0.5F, worldObj.rand.nextGaussian() * 0.05, 0.2, worldObj.rand.nextGaussian() * 0.05));
}
private int getDelay() {
Block b = worldObj.getBlock(xCoord, yCoord, zCoord);
@ -102,6 +125,10 @@ public class TileEntityGeysir extends TileEntity {
return (meta == 0 ? 20 : 30 + rand.nextInt(20));
} else if(b == ModBlocks.geysir_nether) {
return (meta == 0 ? (rand.nextBoolean() ? 300 : 450) : 80 + rand.nextInt(60));
}
return 0;
@ -112,17 +139,16 @@ public class TileEntityGeysir extends TileEntity {
Block b = worldObj.getBlock(xCoord, yCoord, zCoord);
if(b == ModBlocks.geysir_water) {
water();
} else if(b == ModBlocks.geysir_chlorine) {
chlorine();
} else if(b == ModBlocks.geysir_vapor) {
vapor();
} else if(b == ModBlocks.geysir_nether) {
fire();
}
}

View File

@ -30,7 +30,7 @@ public class TileEntityHadron extends TileEntityMachineBase implements IConsumer
public static final long maxPower = 1000000000;
public boolean isOn = false;
public boolean analysisOnly = true;
public boolean analysisOnly = false;
public boolean hopperMode = false;
public TileEntityHadron() {
@ -50,11 +50,14 @@ public class TileEntityHadron extends TileEntityMachineBase implements IConsumer
drawPower();
if(this.isOn && particles.size() < maxParticles && slots[0] != null && slots[1] != null && power >= maxPower * 0.75) {
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata());
particles.add(new Particle(slots[0], slots[1], dir, xCoord, yCoord, zCoord));
this.decrStackSize(0, 1);
this.decrStackSize(1, 1);
power -= maxPower * 0.75;
if(!hopperMode || (slots[0].stackSize > 1 && slots[1].stackSize > 1)) {
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata());
particles.add(new Particle(slots[0], slots[1], dir, xCoord, yCoord, zCoord));
this.decrStackSize(0, 1);
this.decrStackSize(1, 1);
power -= maxPower * 0.75;
}
}
if(!particles.isEmpty())
@ -74,6 +77,27 @@ public class TileEntityHadron extends TileEntityMachineBase implements IConsumer
this.networkPack(data, 50);
}
}
private void process(Particle p) {
ItemStack[] result = HadronRecipes.getOutput(p.item1, p.item2, p.momentum, analysisOnly);
if(result == null)
return;
if((slots[2] == null || (slots[2].getItem() == result[0].getItem() && slots[2].stackSize < slots[2].getMaxStackSize())) &&
(slots[3] == null || (slots[3].getItem() == result[1].getItem() && slots[3].stackSize < slots[3].getMaxStackSize()))) {
for(int i = 2; i <= 3; i++ ) {
//System.out.println("yes");
if(slots[i] == null)
slots[i] = result[i - 2].copy();
else
slots[i].stackSize++;
}
}
}
@Override
public void networkUnpack(NBTTagCompound data) {
@ -118,16 +142,10 @@ public class TileEntityHadron extends TileEntityMachineBase implements IConsumer
}
}
private void finishParticle(Particle p, boolean analysisOnly) {
private void finishParticle(Particle p) {
particlesToRemove.add(p);
worldObj.playSoundEffect(p.posX, p.posY, p.posZ, "random.orb", 10, 1);
ItemStack[] out = HadronRecipes.getOutput(p.item1, p.item2, p.momentum, analysisOnly);
if(out != null) {
slots[2] = out[0];
slots[3] = out[1];
}
process(p);
}
static final int maxParticles = 1;
@ -160,6 +178,10 @@ public class TileEntityHadron extends TileEntityMachineBase implements IConsumer
nbt.setBoolean("analysis", analysisOnly);
nbt.setBoolean("hopperMode", hopperMode);
}
public int getPowerScaled(int i) {
return (int)(power * i / maxPower);
}
@Override
public void setPower(long i) {
@ -197,8 +219,10 @@ public class TileEntityHadron extends TileEntityMachineBase implements IConsumer
boolean expired = false;
public Particle(ItemStack item1, ItemStack item2, ForgeDirection dir, int posX, int posY, int posZ) {
this.item1 = item1;
this.item2 = item2;
this.item1 = item1.copy();
this.item2 = item2.copy();
this.item1.stackSize = 1;
this.item2.stackSize = 1;
this.dir = dir;
this.posX = posX;
this.posY = posY;
@ -216,8 +240,8 @@ public class TileEntityHadron extends TileEntityMachineBase implements IConsumer
this.expired = true;
particlesToRemove.add(this);
worldObj.newExplosion(null, posX + 0.5, posY + 0.5, posZ + 0.5, 10, false, false);
System.out.println("Last dir: " + dir.name());
System.out.println("Last pos: " + posX + " " + posY + " " + posZ);
//System.out.println("Last dir: " + dir.name());
//System.out.println("Last pos: " + posX + " " + posY + " " + posZ);
Thread.currentThread().dumpStack();
}
@ -267,7 +291,7 @@ public class TileEntityHadron extends TileEntityMachineBase implements IConsumer
if(p.analysis != 3)
p.expire();
else
this.finishParticle(p, false);
this.finishParticle(p);
return;
}
@ -275,6 +299,9 @@ public class TileEntityHadron extends TileEntityMachineBase implements IConsumer
if(block.getMaterial() != Material.air && block != ModBlocks.hadron_diode)
p.expire();
if(block == ModBlocks.hadron_diode)
p.isCheckExempt = true;
if(coilValue(worldObj.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ)) > 0)
p.isCheckExempt = true;
}
@ -388,8 +415,8 @@ public class TileEntityHadron extends TileEntityMachineBase implements IConsumer
continue;
}
System.out.println("Was exempt: " + p.isCheckExempt);
worldObj.setBlock(a, b, c, Blocks.dirt);
//System.out.println("Was exempt: " + p.isCheckExempt);
//worldObj.setBlock(a, b, c, Blocks.dirt);
p.expire();
}
@ -413,7 +440,7 @@ public class TileEntityHadron extends TileEntityMachineBase implements IConsumer
//if operating in line accelerator mode, halt after 2 blocks and staart the reading
if(this.analysisOnly && p.analysis == 2) {
this.finishParticle(p, true);
this.finishParticle(p);
}
} else {
@ -509,7 +536,7 @@ public class TileEntityHadron extends TileEntityMachineBase implements IConsumer
List<ForgeDirection> dirs = getRandomDirs();
System.out.println("Starting as " + dir.name());
//System.out.println("Starting as " + dir.name());
//let's look at every direction we could go in
for(ForgeDirection d : dirs) {
@ -517,19 +544,19 @@ public class TileEntityHadron extends TileEntityMachineBase implements IConsumer
if(d == dir || d == dir.getOpposite())
continue;
System.out.println("Trying " + d.name());
//System.out.println("Trying " + d.name());
//there is air! we can pass!
if(worldObj.getBlock(x + d.offsetX, y + d.offsetY, z + d.offsetZ).getMaterial() == Material.air) {
if(validDir == ForgeDirection.UNKNOWN) {
validDir = d;
System.out.println("yes");
//System.out.println("yes");
//it seems like there are two or more possible ways, which is not allowed without a diode
//sorry kid, nothing personal
} else {
System.out.println("what");
//System.out.println("what");
p.expire();
return;
}

View File

@ -18,7 +18,7 @@ public class TileEntityMachineAmgen extends TileEntity implements ISource {
public List<IConsumer> list = new ArrayList();
public long power;
public long maxPower = 100;
public long maxPower = 500;
boolean tact = false;
@Override
@ -47,6 +47,8 @@ public class TileEntityMachineAmgen extends TileEntity implements ISource {
power += 100;
} else if(b == ModBlocks.geysir_vapor) {
power += 50;
} else if(b == ModBlocks.geysir_nether) {
power += 500;
} else if(b == Blocks.lava) {
power += 100;