generated from tilera/1710mod
feat: fixes, features
...and me being too lazy to write a proper commit message
This commit is contained in:
parent
a1ecb870e3
commit
2f77e5c471
|
@ -27,13 +27,14 @@ import atomicscience.fenlie.TFissionReactor;
|
||||||
import atomicscience.fenlie.TNuclearBoiler;
|
import atomicscience.fenlie.TNuclearBoiler;
|
||||||
import atomicscience.fenlie.TReactorTap;
|
import atomicscience.fenlie.TReactorTap;
|
||||||
import atomicscience.hecheng.BElectromagnet;
|
import atomicscience.hecheng.BElectromagnet;
|
||||||
|
import atomicscience.hecheng.BElectromagnetBoiler;
|
||||||
import atomicscience.hecheng.BElectromagnetGlass;
|
import atomicscience.hecheng.BElectromagnetGlass;
|
||||||
import atomicscience.hecheng.BFusionReactor;
|
import atomicscience.hecheng.BFusionReactor;
|
||||||
import atomicscience.hecheng.BPlasma;
|
import atomicscience.hecheng.BPlasma;
|
||||||
import atomicscience.hecheng.IBAccelerator;
|
import atomicscience.hecheng.IBAccelerator;
|
||||||
import atomicscience.hecheng.IBPlasma;
|
import atomicscience.hecheng.IBPlasma;
|
||||||
import atomicscience.hecheng.IBSiren;
|
import atomicscience.hecheng.IBSiren;
|
||||||
import atomicscience.hecheng.TElectromagnet;
|
import atomicscience.hecheng.TElectromagnetBoiler;
|
||||||
import atomicscience.hecheng.TFusionReactor;
|
import atomicscience.hecheng.TFusionReactor;
|
||||||
import atomicscience.jiqi.BChemicalExtractor;
|
import atomicscience.jiqi.BChemicalExtractor;
|
||||||
import atomicscience.jiqi.BFunnel;
|
import atomicscience.jiqi.BFunnel;
|
||||||
|
@ -130,6 +131,7 @@ public class AtomicScience {
|
||||||
public static Block bFusionReactor;
|
public static Block bFusionReactor;
|
||||||
public static BPlasma bPlasma;
|
public static BPlasma bPlasma;
|
||||||
public static Block bElectromagnet;
|
public static Block bElectromagnet;
|
||||||
|
public static Block bElectromagnetBoiler;
|
||||||
public static Block bChemicalExtractor;
|
public static Block bChemicalExtractor;
|
||||||
public static Block bSiren;
|
public static Block bSiren;
|
||||||
public static Block bElectromagnetGlass;
|
public static Block bElectromagnetGlass;
|
||||||
|
@ -219,7 +221,8 @@ public class AtomicScience {
|
||||||
bThermometer = new BThermometer();
|
bThermometer = new BThermometer();
|
||||||
bFusionReactor = new BFusionReactor();
|
bFusionReactor = new BFusionReactor();
|
||||||
bPlasma = new BPlasma();
|
bPlasma = new BPlasma();
|
||||||
bElectromagnet = new BElectromagnet();
|
bElectromagnet= new BElectromagnet();
|
||||||
|
bElectromagnetBoiler = new BElectromagnetBoiler();
|
||||||
bChemicalExtractor = new BChemicalExtractor();
|
bChemicalExtractor = new BChemicalExtractor();
|
||||||
bSiren = new BSiren();
|
bSiren = new BSiren();
|
||||||
bElectromagnetGlass = new BElectromagnetGlass();
|
bElectromagnetGlass = new BElectromagnetGlass();
|
||||||
|
@ -297,6 +300,7 @@ public class AtomicScience {
|
||||||
GameRegistry.registerBlock(bFusionReactor, "bFusionReactor");
|
GameRegistry.registerBlock(bFusionReactor, "bFusionReactor");
|
||||||
GameRegistry.registerBlock(bPlasma, IBPlasma.class, "bPlasma");
|
GameRegistry.registerBlock(bPlasma, IBPlasma.class, "bPlasma");
|
||||||
GameRegistry.registerBlock(bElectromagnet, "bElectromagnet");
|
GameRegistry.registerBlock(bElectromagnet, "bElectromagnet");
|
||||||
|
GameRegistry.registerBlock(bElectromagnetBoiler, "bElectromagnetBoiler");
|
||||||
GameRegistry.registerBlock(bChemicalExtractor, "bChemicalExtractor");
|
GameRegistry.registerBlock(bChemicalExtractor, "bChemicalExtractor");
|
||||||
GameRegistry.registerBlock(bSiren, IBSiren.class, "bSiren");
|
GameRegistry.registerBlock(bSiren, IBSiren.class, "bSiren");
|
||||||
GameRegistry.registerBlock(bElectromagnetGlass, "bElectromagnetGlass");
|
GameRegistry.registerBlock(bElectromagnetGlass, "bElectromagnetGlass");
|
||||||
|
@ -328,8 +332,7 @@ public class AtomicScience {
|
||||||
AtomicScience.CONFIGURATION.save();
|
AtomicScience.CONFIGURATION.save();
|
||||||
MinecraftForge.EVENT_BUS.register(itCellAntimatter);
|
MinecraftForge.EVENT_BUS.register(itCellAntimatter);
|
||||||
MinecraftForge.EVENT_BUS.register(FulminationEventHandler.INSTANCE);
|
MinecraftForge.EVENT_BUS.register(FulminationEventHandler.INSTANCE);
|
||||||
OreDictionary.registerOre("ingotUranium", itUranium);
|
OreDictionary.registerOre("breederUranium", itUranium);
|
||||||
OreDictionary.registerOre("breederUranium", new ItemStack(itUranium, 1, 1));
|
|
||||||
OreDictionary.registerOre("blockRadioactive", blockRadioactive);
|
OreDictionary.registerOre("blockRadioactive", blockRadioactive);
|
||||||
OreDictionary.registerOre("cellEmpty", itCell);
|
OreDictionary.registerOre("cellEmpty", itCell);
|
||||||
OreDictionary.registerOre("cellUranium", itCellUranium);
|
OreDictionary.registerOre("cellUranium", itCellUranium);
|
||||||
|
@ -357,7 +360,7 @@ public class AtomicScience {
|
||||||
GameRegistry.registerTileEntity(TTurbine.class, "ASTurbine");
|
GameRegistry.registerTileEntity(TTurbine.class, "ASTurbine");
|
||||||
GameRegistry.registerTileEntity(TNuclearBoiler.class, "ASNuclearBoiler");
|
GameRegistry.registerTileEntity(TNuclearBoiler.class, "ASNuclearBoiler");
|
||||||
GameRegistry.registerTileEntity(TThermometer.class, "ASThermometer");
|
GameRegistry.registerTileEntity(TThermometer.class, "ASThermometer");
|
||||||
GameRegistry.registerTileEntity(TElectromagnet.class, "ASElectromagnet");
|
GameRegistry.registerTileEntity(TElectromagnetBoiler.class, "ASElectromagnetBoiler");
|
||||||
GameRegistry.registerTileEntity(TChemicalExtractor.class,
|
GameRegistry.registerTileEntity(TChemicalExtractor.class,
|
||||||
"ASChemicalExtractor");
|
"ASChemicalExtractor");
|
||||||
GameRegistry.registerTileEntity(TFunnel.class, "ASFunnel");
|
GameRegistry.registerTileEntity(TFunnel.class, "ASFunnel");
|
||||||
|
@ -399,140 +402,8 @@ public class AtomicScience {
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void postInit(FMLPostInitializationEvent event) {
|
public void postInit(FMLPostInitializationEvent event) {
|
||||||
UniversalRecipes.init();
|
UniversalRecipes.init();
|
||||||
if (Loader.isModLoaded("IC2")) {
|
Recipes.addRecipes();
|
||||||
OreDictionary.registerOre("cellEmpty", itCell);
|
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(
|
|
||||||
itYellowcake, GameRegistry.findItem("IC2", "reactorUraniumSimple")));
|
|
||||||
Item ic2FluidCell = GameRegistry.findItem("IC2", "itemFluidCell");
|
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(ic2FluidCell, itCell));
|
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(itCell, "cellEmpty"));
|
|
||||||
}
|
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(
|
|
||||||
new ItemStack(itCellAntimatter, 1, 1), itCellAntimatter,
|
|
||||||
itCellAntimatter, itCellAntimatter, itCellAntimatter, itCellAntimatter,
|
|
||||||
itCellAntimatter, itCellAntimatter, itCellAntimatter));
|
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(
|
|
||||||
new ItemStack(itCellAntimatter, 8, 0),
|
|
||||||
new Object[] {new ItemStack(itCellAntimatter, 1, 1)}));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
|
||||||
new ItemStack(bFunnel, 2), " B ", "B B", "B B", 'B', "ingotBronze"));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(bFunnel, 2), " B ",
|
|
||||||
"B B", "B B", 'B', "ingotIron"));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
|
||||||
bAtomicAssembler, "CCC", "SXS", "SSS", 'X', bCentrifuge, 'C',
|
|
||||||
"calclavia:CIRCUIT_T3", 'S', "plateSteel"));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
|
||||||
bFulminationGenerator, "OSO", "SCS", "OSO", 'O', Blocks.obsidian, 'C',
|
|
||||||
"calclavia:CIRCUIT_T2", 'S', "plateSteel"));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
|
||||||
bAccelerator, "SCS", "CMC", "SCS", 'M', "calclavia:MOTOR", 'C',
|
|
||||||
"calclavia:CIRCUIT_T3", 'S', "plateSteel"));
|
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(
|
|
||||||
bElectromagnetGlass, new Object[] {bElectromagnet, Blocks.glass}));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
|
||||||
bCentrifuge,
|
|
||||||
new Object[] {"BSB", "MCM", "BSB", Character.valueOf('C'),
|
|
||||||
"calclavia:CIRCUIT_T2", Character.valueOf('S'),
|
|
||||||
"plateSteel", Character.valueOf('B'), "ingotBronze",
|
|
||||||
Character.valueOf('M'), "calclavia:MOTOR"}));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
|
||||||
bNuclearBoiler,
|
|
||||||
new Object[] {"S S", "FBF", "SMS", Character.valueOf('F'),
|
|
||||||
Blocks.furnace, Character.valueOf('S'), "plateSteel",
|
|
||||||
Character.valueOf('B'), Items.bucket,
|
|
||||||
Character.valueOf('M'), "calclavia:MOTOR"}));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
|
||||||
bChemicalExtractor,
|
|
||||||
new Object[] {"BSB", "MCM", "BSB", Character.valueOf('C'),
|
|
||||||
"calclavia:CIRCUIT_T3", Character.valueOf('S'),
|
|
||||||
"plateSteel", Character.valueOf('B'), "ingotBronze",
|
|
||||||
Character.valueOf('M'), "calclavia:MOTOR"}));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
|
||||||
new ItemStack(bSiren, 2),
|
|
||||||
new Object[] {"NPN", Character.valueOf('N'), Blocks.noteblock,
|
|
||||||
Character.valueOf('P'), "plateBronze"}));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
|
||||||
bFissionReactor,
|
|
||||||
new Object[] {"SCS", "MEM", "SCS", Character.valueOf('E'), "cellEmpty",
|
|
||||||
Character.valueOf('C'), "calclavia:CIRCUIT_T2",
|
|
||||||
Character.valueOf('S'), "plateSteel",
|
|
||||||
Character.valueOf('M'), "calclavia:MOTOR"}));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
|
||||||
bFusionReactor,
|
|
||||||
new Object[] {"CPC", "PFP", "CPC", Character.valueOf('P'), "plateSteel",
|
|
||||||
Character.valueOf('F'), bFissionReactor,
|
|
||||||
Character.valueOf('C'), "calclavia:CIRCUIT_T3"}));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
|
||||||
bTurbine, new Object[] {" B ", "BMB", " B ", Character.valueOf('B'),
|
|
||||||
"plateBronze", Character.valueOf('M'),
|
|
||||||
"calclavia:MOTOR"}));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
|
||||||
bReactorTap,
|
|
||||||
new Object[] {"SBS", "TMT", "SBS", Character.valueOf('S'),
|
|
||||||
"plateBronze", Character.valueOf('T'), "ingotBronze",
|
|
||||||
Character.valueOf('M'), "calclavia:MOTOR",
|
|
||||||
Character.valueOf('B'), Items.bucket}));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
|
||||||
new ItemStack(itCell, 16),
|
|
||||||
new Object[] {" T ", "TGT", " T ", Character.valueOf('T'), "ingotTin",
|
|
||||||
Character.valueOf('G'), Blocks.glass}));
|
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(itCellWater),
|
|
||||||
itCell, Items.water_bucket));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
|
||||||
ElectricItemHelper.getUncharged(new ItemStack(itThermometer)),
|
|
||||||
new Object[] {"SSS", "GCG", "GSG", Character.valueOf('S'), "ingotSteel",
|
|
||||||
Character.valueOf('G'), Blocks.glass,
|
|
||||||
Character.valueOf('C'), "calclavia:CIRCUIT_T1"}));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
|
||||||
bThermometer, new Object[] {"SSS", "SWS", "SSS", Character.valueOf('S'),
|
|
||||||
"ingotSteel", Character.valueOf('W'),
|
|
||||||
ElectricItemHelper.getUncharged(
|
|
||||||
new ItemStack(itThermometer))}));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
|
||||||
bControlRod, new Object[] {"I", "I", "I", Character.valueOf('I'),
|
|
||||||
Items.iron_ingot}));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
|
||||||
itCellUranium,
|
|
||||||
new Object[] {"CUC", "CUC", "CUC", Character.valueOf('U'),
|
|
||||||
"ingotUranium", Character.valueOf('C'), "cellEmpty"}));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
|
||||||
itCellBreederFuel,
|
|
||||||
new Object[] {"CUC", "CUC", "CUC", Character.valueOf('U'),
|
|
||||||
"breederUranium", Character.valueOf('C'), "cellEmpty"}));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
|
||||||
new ItemStack(bElectromagnet, 2),
|
|
||||||
new Object[] {"BBB", "BMB", "BBB", Character.valueOf('B'),
|
|
||||||
"ingotBronze", Character.valueOf('M'),
|
|
||||||
"calclavia:MOTOR"}));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
|
||||||
new ItemStack(bElectromagnet, 2),
|
|
||||||
new Object[] {"BBB", "BMB", "BBB", Character.valueOf('B'), "ingotIron",
|
|
||||||
Character.valueOf('M'), "calclavia:MOTOR"}));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
|
||||||
itHazmatHelmet,
|
|
||||||
new Object[] {"SSS", "BAB", "SCS", Character.valueOf('A'),
|
|
||||||
Items.leather_helmet, Character.valueOf('C'),
|
|
||||||
"calclavia:CIRCUIT_T1", Character.valueOf('S'),
|
|
||||||
Blocks.wool}));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
|
||||||
itHazmatChestplate,
|
|
||||||
new Object[] {"SSS", "BAB", "SCS", Character.valueOf('A'),
|
|
||||||
Items.leather, Character.valueOf('C'),
|
|
||||||
"calclavia:CIRCUIT_T1", Character.valueOf('S'),
|
|
||||||
Blocks.wool}));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
|
||||||
itHazmanLeggings,
|
|
||||||
new Object[] {"SSS", "BAB", "SCS", Character.valueOf('A'),
|
|
||||||
Items.leather_leggings, Character.valueOf('C'),
|
|
||||||
"calclavia:CIRCUIT_T1", Character.valueOf('S'),
|
|
||||||
Blocks.wool}));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
|
||||||
itHazmatBoots,
|
|
||||||
new Object[] {"SSS", "BAB", "SCS", Character.valueOf('A'),
|
|
||||||
Items.leather_boots, Character.valueOf('C'),
|
|
||||||
"calclavia:CIRCUIT_T1", Character.valueOf('S'),
|
|
||||||
Blocks.wool}));
|
|
||||||
EntityRegistry.registerGlobalEntityID(
|
EntityRegistry.registerGlobalEntityID(
|
||||||
EMatter.class, "ASParticle", EntityRegistry.findGlobalUniqueEntityId());
|
EMatter.class, "ASParticle", EntityRegistry.findGlobalUniqueEntityId());
|
||||||
EntityRegistry.registerModEntity(EMatter.class, "ASParticle", 49, this, 80,
|
EntityRegistry.registerModEntity(EMatter.class, "ASParticle", 49, this, 80,
|
||||||
|
@ -645,20 +516,6 @@ public class AtomicScience {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void textureHook(Post event) {
|
|
||||||
// TODO: WTF
|
|
||||||
// if (event.map == Minecraft.getMinecraft().renderEngine.field_94155_m) {
|
|
||||||
|
|
||||||
FLUID_URANIUM_HEXAFLOURIDE.setIcons(
|
|
||||||
event.map.registerIcon("atomicscience:uraniumHexafluoride"));
|
|
||||||
// TODO: might override railcraft icon?
|
|
||||||
FLUID_STEAM.setIcons(event.map.registerIcon("atomicscience:steam"));
|
|
||||||
FLUID_TOXIC_WASTE.setIcons(
|
|
||||||
event.map.registerIcon("atomicscience:toxicWaste"));
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: WTF
|
// TODO: WTF
|
||||||
// @EventHandler public void serverStarting(FMLServerStartingEvent event) {
|
// @EventHandler public void serverStarting(FMLServerStartingEvent event) {
|
||||||
// FlagRegistry.registerModFlag(
|
// FlagRegistry.registerModFlag(
|
||||||
|
|
|
@ -14,55 +14,62 @@ import net.minecraftforge.fluids.BlockFluidClassic;
|
||||||
import universalelectricity.core.vector.Vector3;
|
import universalelectricity.core.vector.Vector3;
|
||||||
|
|
||||||
public class BToxicWaste extends BlockFluidClassic {
|
public class BToxicWaste extends BlockFluidClassic {
|
||||||
public BToxicWaste(String name) {
|
public BToxicWaste(String name) {
|
||||||
super(AtomicScience.FLUID_TOXIC_WASTE, Material.water);
|
super(AtomicScience.FLUID_TOXIC_WASTE, Material.water);
|
||||||
this.setBlockName("atomicscience:" + name);
|
this.setBlockName("atomicscience:" + name);
|
||||||
this.setCreativeTab(TabAS.INSTANCE);
|
this.setCreativeTab(TabAS.INSTANCE);
|
||||||
this.setHardness(100.0F);
|
this.setHardness(100.0F);
|
||||||
this.setLightOpacity(3);
|
this.setLightOpacity(3);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int tickRate(World par1World) {
|
|
||||||
return 20;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void randomDisplayTick(World par1World, int x, int y, int z,
|
|
||||||
Random par5Random) {
|
|
||||||
super.randomDisplayTick(par1World, x, y, z, par5Random);
|
|
||||||
if (par5Random.nextInt(100) == 0) {
|
|
||||||
double d5 = (double)((float)x + par5Random.nextFloat());
|
|
||||||
double d7 = (double)y + this.maxY;
|
|
||||||
double d6 = (double)((float)z + par5Random.nextFloat());
|
|
||||||
par1World.spawnParticle("suspended", d5, d7, d6, 0.0D, 0.0D, 0.0D);
|
|
||||||
par1World.playSound(d5, d7, d6, "liquid.lavapop",
|
|
||||||
0.2F + par5Random.nextFloat() * 0.2F,
|
|
||||||
0.9F + par5Random.nextFloat() * 0.15F, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (par5Random.nextInt(200) == 0) {
|
@Override
|
||||||
par1World.playSound((double)x, (double)y, (double)z, "liquid.lava",
|
public int tickRate(World par1World) {
|
||||||
0.2F + par5Random.nextFloat() * 0.2F,
|
return 20;
|
||||||
0.9F + par5Random.nextFloat() * 0.15F, false);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEntityCollidedWithBlock(World par1World, int x, int y, int z,
|
public void randomDisplayTick(World par1World, int x, int y, int z,
|
||||||
Entity entity) {
|
Random par5Random) {
|
||||||
if (entity instanceof EntityLiving) {
|
super.randomDisplayTick(par1World, x, y, z, par5Random);
|
||||||
entity.attackEntityFrom(DamageSource.wither, 3);
|
if (par5Random.nextInt(100) == 0) {
|
||||||
PoisonRadiation.INSTANCE.poisonEntity(
|
double d5 = (double) ((float) x + par5Random.nextFloat());
|
||||||
new Vector3((double)x, (double)y, (double)z), (EntityLiving)entity,
|
double d7 = (double) y + this.maxY;
|
||||||
4);
|
double d6 = (double) ((float) z + par5Random.nextFloat());
|
||||||
|
par1World.spawnParticle("suspended", d5, d7, d6, 0.0D, 0.0D, 0.0D);
|
||||||
|
par1World.playSound(d5, d7, d6, "liquid.lavapop",
|
||||||
|
0.2F + par5Random.nextFloat() * 0.2F,
|
||||||
|
0.9F + par5Random.nextFloat() * 0.15F, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (par5Random.nextInt(200) == 0) {
|
||||||
|
par1World.playSound((double) x, (double) y, (double) z, "liquid.lava",
|
||||||
|
0.2F + par5Random.nextFloat() * 0.2F,
|
||||||
|
0.9F + par5Random.nextFloat() * 0.15F, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public void onEntityCollidedWithBlock(World par1World, int x, int y, int z,
|
||||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
Entity entity) {
|
||||||
this.blockIcon = iconRegister.registerIcon("atomicscience:toxicWaste");
|
if (entity instanceof EntityLiving) {
|
||||||
AtomicScience.FLUID_TOXIC_WASTE.setIcons(this.blockIcon);
|
entity.attackEntityFrom(DamageSource.wither, 3);
|
||||||
}
|
PoisonRadiation.INSTANCE.poisonEntity(
|
||||||
|
new Vector3((double) x, (double) y, (double) z), (EntityLiving) entity,
|
||||||
|
4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||||
|
this.blockIcon = iconRegister.registerIcon("atomicscience:toxicWaste");
|
||||||
|
AtomicScience.FLUID_TOXIC_WASTE.setIcons(this.blockIcon);
|
||||||
|
|
||||||
|
// TODO: WTF
|
||||||
|
AtomicScience.FLUID_URANIUM_HEXAFLOURIDE.setIcons(
|
||||||
|
iconRegister.registerIcon("atomicscience:uraniumHexafluoride"));
|
||||||
|
// TODO: might override railcraft icon?
|
||||||
|
AtomicScience.FLUID_STEAM.setIcons(
|
||||||
|
iconRegister.registerIcon("atomicscience:steam"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
239
src/main/java/atomicscience/Recipes.java
Normal file
239
src/main/java/atomicscience/Recipes.java
Normal file
|
@ -0,0 +1,239 @@
|
||||||
|
package atomicscience;
|
||||||
|
|
||||||
|
import atomicscience.recipe.RecipeBuilder;
|
||||||
|
import atomicscience.recipe.ShapedOreRecipeAdapter;
|
||||||
|
import atomicscience.recipe.ShapelessOreRecipeAdapter;
|
||||||
|
import basiccomponents.common.BasicComponents;
|
||||||
|
import cpw.mods.fml.common.Loader;
|
||||||
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.init.Items;
|
||||||
|
import net.minecraft.item.ItemArmor;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
|
import universalelectricity.core.item.ElectricItemHelper;
|
||||||
|
|
||||||
|
public class Recipes {
|
||||||
|
/**
|
||||||
|
* Registers the recipes and OreDictionary entries.
|
||||||
|
*/
|
||||||
|
public static void addRecipes() {
|
||||||
|
OreDictionary.registerOre("cellEmpty", AtomicScience.itCell);
|
||||||
|
if (Loader.isModLoaded("IC2")) {
|
||||||
|
new RecipeBuilder(new ShapelessOreRecipeAdapter())
|
||||||
|
.output(AtomicScience.itYellowcake)
|
||||||
|
.ingredient(GameRegistry.findItem("IC2", "reactorUraniumSimple"))
|
||||||
|
.register();
|
||||||
|
|
||||||
|
new RecipeBuilder(new ShapelessOreRecipeAdapter())
|
||||||
|
.output(GameRegistry.findItem("IC2", "itemFluidCell"))
|
||||||
|
.ingredient(AtomicScience.itCell)
|
||||||
|
.register();
|
||||||
|
|
||||||
|
new RecipeBuilder(new ShapelessOreRecipeAdapter())
|
||||||
|
.output(AtomicScience.itCell)
|
||||||
|
.ingredient("cellEmpty")
|
||||||
|
.register();
|
||||||
|
}
|
||||||
|
|
||||||
|
new RecipeBuilder(new ShapelessOreRecipeAdapter())
|
||||||
|
.output(new ItemStack(AtomicScience.itCellAntimatter, 1, 1))
|
||||||
|
.ingredient(AtomicScience.itCellAntimatter)
|
||||||
|
.ingredient(AtomicScience.itCellAntimatter)
|
||||||
|
.ingredient(AtomicScience.itCellAntimatter)
|
||||||
|
.ingredient(AtomicScience.itCellAntimatter)
|
||||||
|
.ingredient(AtomicScience.itCellAntimatter)
|
||||||
|
.ingredient(AtomicScience.itCellAntimatter)
|
||||||
|
.ingredient(AtomicScience.itCellAntimatter)
|
||||||
|
.ingredient(AtomicScience.itCellAntimatter)
|
||||||
|
.register();
|
||||||
|
|
||||||
|
new RecipeBuilder(new ShapelessOreRecipeAdapter())
|
||||||
|
.output(AtomicScience.itCellAntimatter, 8)
|
||||||
|
.ingredient(new ItemStack(AtomicScience.itCellAntimatter, 1, 1))
|
||||||
|
.register();
|
||||||
|
|
||||||
|
new RecipeBuilder(new ShapedOreRecipeAdapter())
|
||||||
|
.output(AtomicScience.bFunnel, 2)
|
||||||
|
.pattern(" B ", "B B", "B B")
|
||||||
|
.ingredient('B', "ingotBronze")
|
||||||
|
.register();
|
||||||
|
|
||||||
|
new RecipeBuilder(new ShapedOreRecipeAdapter())
|
||||||
|
.output(AtomicScience.bFunnel, 2)
|
||||||
|
.pattern(" I ", "I I", "I I")
|
||||||
|
.ingredient('I', "ingotIron")
|
||||||
|
.register();
|
||||||
|
|
||||||
|
new RecipeBuilder(new ShapedOreRecipeAdapter())
|
||||||
|
.output(AtomicScience.bAtomicAssembler)
|
||||||
|
.pattern("CCC", "SXS", "SSS")
|
||||||
|
.ingredient('X', AtomicScience.bCentrifuge)
|
||||||
|
.ingredient('C', BasicComponents.itemCircuitElite)
|
||||||
|
.ingredient('S', "plateSteel")
|
||||||
|
.register();
|
||||||
|
|
||||||
|
new RecipeBuilder(new ShapedOreRecipeAdapter())
|
||||||
|
.output(AtomicScience.bFulminationGenerator)
|
||||||
|
.pattern("OSO", "SCS", "OSO")
|
||||||
|
.ingredient('O', Blocks.obsidian)
|
||||||
|
.ingredient('C', BasicComponents.itemCircuitAdvanced)
|
||||||
|
.ingredient('S', "plateSteel")
|
||||||
|
.register();
|
||||||
|
|
||||||
|
new RecipeBuilder(new ShapedOreRecipeAdapter())
|
||||||
|
.output(AtomicScience.bAccelerator)
|
||||||
|
.pattern("SCS", "CMC", "SCS")
|
||||||
|
.ingredient('M', BasicComponents.itemMotor)
|
||||||
|
.ingredient('C', BasicComponents.itemCircuitElite)
|
||||||
|
.ingredient('S', "plateSteel")
|
||||||
|
.register();
|
||||||
|
|
||||||
|
new RecipeBuilder(new ShapelessOreRecipeAdapter())
|
||||||
|
.output(AtomicScience.bElectromagnetGlass)
|
||||||
|
.ingredient(AtomicScience.bElectromagnet)
|
||||||
|
.ingredient(Blocks.glass)
|
||||||
|
.register();
|
||||||
|
|
||||||
|
new RecipeBuilder(new ShapedOreRecipeAdapter())
|
||||||
|
.output(AtomicScience.bCentrifuge)
|
||||||
|
.pattern("BSB", "MCM", "BSB")
|
||||||
|
.ingredient('C', BasicComponents.itemCircuitAdvanced)
|
||||||
|
.ingredient('S', "plateSteel")
|
||||||
|
.ingredient('B', "ingotBronze")
|
||||||
|
.ingredient('M', BasicComponents.itemMotor)
|
||||||
|
.register();
|
||||||
|
|
||||||
|
new RecipeBuilder(new ShapedOreRecipeAdapter())
|
||||||
|
.output(AtomicScience.bNuclearBoiler)
|
||||||
|
.pattern("S S", "FBF", "SMS")
|
||||||
|
.ingredient('F', Blocks.furnace)
|
||||||
|
.ingredient('S', "plateSteel")
|
||||||
|
.ingredient('B', Items.bucket)
|
||||||
|
.ingredient('M', BasicComponents.itemMotor)
|
||||||
|
.register();
|
||||||
|
|
||||||
|
new RecipeBuilder(new ShapedOreRecipeAdapter())
|
||||||
|
.output(AtomicScience.bChemicalExtractor)
|
||||||
|
.pattern("BSB", "MCM", "BSB")
|
||||||
|
.ingredient('C', BasicComponents.itemCircuitElite)
|
||||||
|
.ingredient('S', "plateSteel")
|
||||||
|
.ingredient('B', "ingotBronze")
|
||||||
|
.ingredient('M', BasicComponents.itemMotor)
|
||||||
|
.register();
|
||||||
|
|
||||||
|
new RecipeBuilder(new ShapedOreRecipeAdapter())
|
||||||
|
.output(AtomicScience.bSiren, 2)
|
||||||
|
.pattern("NPN")
|
||||||
|
.ingredient('N', Blocks.noteblock)
|
||||||
|
.ingredient('P', "plateBronze")
|
||||||
|
.register();
|
||||||
|
|
||||||
|
new RecipeBuilder(new ShapedOreRecipeAdapter())
|
||||||
|
.output(AtomicScience.bFissionReactor)
|
||||||
|
.pattern("SCS", "MEM", "SCS")
|
||||||
|
.ingredient('E', "cellEmpty")
|
||||||
|
.ingredient('C', BasicComponents.itemCircuitAdvanced)
|
||||||
|
.ingredient('S', "plateSteel")
|
||||||
|
.ingredient('M', BasicComponents.itemMotor)
|
||||||
|
.register();
|
||||||
|
|
||||||
|
new RecipeBuilder(new ShapedOreRecipeAdapter())
|
||||||
|
.output(AtomicScience.bFusionReactor)
|
||||||
|
.pattern("CPC", "PFP", "CPC")
|
||||||
|
.ingredient('P', "plateSteel")
|
||||||
|
.ingredient('F', AtomicScience.bFissionReactor)
|
||||||
|
.ingredient('C', BasicComponents.itemCircuitElite)
|
||||||
|
.register();
|
||||||
|
|
||||||
|
new RecipeBuilder(new ShapedOreRecipeAdapter())
|
||||||
|
.output(AtomicScience.bTurbine)
|
||||||
|
.pattern(" B ", "BMB", " B ")
|
||||||
|
.ingredient('B', "plateBronze")
|
||||||
|
.ingredient('M', BasicComponents.itemMotor)
|
||||||
|
.register();
|
||||||
|
|
||||||
|
new RecipeBuilder(new ShapedOreRecipeAdapter())
|
||||||
|
.output(AtomicScience.bReactorTap)
|
||||||
|
.pattern("SBS", "TMT", "SBS")
|
||||||
|
.ingredient('S', "plateBronze")
|
||||||
|
.ingredient('M', BasicComponents.itemMotor)
|
||||||
|
.ingredient('B', Items.bucket)
|
||||||
|
.register();
|
||||||
|
|
||||||
|
new RecipeBuilder(new ShapedOreRecipeAdapter())
|
||||||
|
.output(AtomicScience.itCell, 16)
|
||||||
|
.pattern(" T ", "TGT", " T ")
|
||||||
|
.ingredient('T', "ingotTin")
|
||||||
|
.ingredient('G', Blocks.glass)
|
||||||
|
.register();
|
||||||
|
|
||||||
|
new RecipeBuilder(new ShapelessOreRecipeAdapter())
|
||||||
|
.output(AtomicScience.itCellWater)
|
||||||
|
.ingredient(AtomicScience.itCell)
|
||||||
|
.ingredient(Items.water_bucket)
|
||||||
|
.register();
|
||||||
|
|
||||||
|
new RecipeBuilder(new ShapedOreRecipeAdapter())
|
||||||
|
.output(ElectricItemHelper.getUncharged(AtomicScience.itThermometer))
|
||||||
|
.pattern("SSS", "GCG", "GSG")
|
||||||
|
.ingredient('S', "ingotSteel")
|
||||||
|
.ingredient('G', Blocks.glass)
|
||||||
|
.ingredient('C', BasicComponents.itemCircuitBasic)
|
||||||
|
.register();
|
||||||
|
|
||||||
|
new RecipeBuilder(new ShapedOreRecipeAdapter())
|
||||||
|
.output(AtomicScience.bThermometer)
|
||||||
|
.pattern("SSS", "SWS", "SSS")
|
||||||
|
.ingredient('S', "ingotSteel")
|
||||||
|
.ingredient(
|
||||||
|
'W', ElectricItemHelper.getUncharged(AtomicScience.itThermometer))
|
||||||
|
.register();
|
||||||
|
|
||||||
|
new RecipeBuilder(new ShapedOreRecipeAdapter())
|
||||||
|
.output(AtomicScience.bControlRod)
|
||||||
|
.pattern("I", "I", "I")
|
||||||
|
.ingredient('I', Items.iron_ingot)
|
||||||
|
.register();
|
||||||
|
|
||||||
|
new RecipeBuilder(new ShapedOreRecipeAdapter())
|
||||||
|
.output(AtomicScience.itCellUranium)
|
||||||
|
.pattern("CUC", "CUC", "CUC")
|
||||||
|
.ingredient('U', AtomicScience.itUranium)
|
||||||
|
.ingredient('C', "cellEmpty")
|
||||||
|
.register();
|
||||||
|
|
||||||
|
new RecipeBuilder(new ShapedOreRecipeAdapter())
|
||||||
|
.output(AtomicScience.itCellBreederFuel)
|
||||||
|
.pattern("CUC", "CUC", "CUC")
|
||||||
|
.ingredient('C', "cellEmpty")
|
||||||
|
.ingredient('U', "breederUranium")
|
||||||
|
.register();
|
||||||
|
|
||||||
|
new RecipeBuilder(new ShapedOreRecipeAdapter())
|
||||||
|
.output(AtomicScience.bElectromagnet, 2)
|
||||||
|
.pattern("BBB", "BMB", "BBB")
|
||||||
|
.ingredient('B', "ingotBronze")
|
||||||
|
.ingredient('M', BasicComponents.itemMotor)
|
||||||
|
.register();
|
||||||
|
|
||||||
|
new RecipeBuilder(new ShapedOreRecipeAdapter())
|
||||||
|
.output(AtomicScience.bElectromagnet, 2)
|
||||||
|
.pattern("III", "IMI", "III")
|
||||||
|
.ingredient('I', Items.iron_ingot)
|
||||||
|
.ingredient('M', BasicComponents.itemMotor)
|
||||||
|
.register();
|
||||||
|
|
||||||
|
for (ItemArmor armorPiece :
|
||||||
|
new ItemArmor[] {Items.leather_helmet, Items.leather_chestplate,
|
||||||
|
Items.leather_leggings, Items.leather_boots}) {
|
||||||
|
new RecipeBuilder(new ShapedOreRecipeAdapter())
|
||||||
|
.output(AtomicScience.itHazmatHelmet)
|
||||||
|
.pattern("SSS", " A ", "SCS")
|
||||||
|
.ingredient('A', armorPiece)
|
||||||
|
.ingredient('C', BasicComponents.itemCircuitBasic)
|
||||||
|
.ingredient('S', Blocks.wool)
|
||||||
|
.register();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -12,167 +12,174 @@ import universalelectricity.core.electricity.ElectricityPack;
|
||||||
|
|
||||||
public class TAtomicAssembler extends TInventory {
|
public class TAtomicAssembler extends TInventory {
|
||||||
|
|
||||||
public final int SMELTING_TICKS = 1200;
|
public final int SMELTING_TICKS = 1200;
|
||||||
public final float DIAN = 10000.0F;
|
public final float DIAN = 10000.0F;
|
||||||
public int smeltingTicks = 0;
|
public int smeltingTicks = 0;
|
||||||
public float rotationYaw1;
|
public float rotationYaw1;
|
||||||
public float rotationYaw2;
|
public float rotationYaw2;
|
||||||
public float rotationYaw3;
|
public float rotationYaw3;
|
||||||
public EntityItem entityItem;
|
public EntityItem entityItem;
|
||||||
|
|
||||||
public void updateEntity() {
|
@Override
|
||||||
super.updateEntity();
|
public void updateEntity() {
|
||||||
if (!this.isDisabled()) {
|
super.updateEntity();
|
||||||
if (!this.worldObj.isRemote) {
|
if (!this.isDisabled()) {
|
||||||
|
if (!this.worldObj.isRemote) {
|
||||||
|
if (this.canWork()) {
|
||||||
|
double var10000 = super.wattsReceived;
|
||||||
|
this.getClass();
|
||||||
|
if (var10000 >= 10000.0D) {
|
||||||
|
if (this.smeltingTicks == 0) {
|
||||||
|
this.getClass();
|
||||||
|
this.smeltingTicks = 1200;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.smeltingTicks > 0) {
|
||||||
|
--this.smeltingTicks;
|
||||||
|
if (this.smeltingTicks < 1) {
|
||||||
|
this.work();
|
||||||
|
this.smeltingTicks = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.smeltingTicks = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
super.wattsReceived = 0.0D;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.smeltingTicks = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (super.ticks % 10L == 0L) {
|
||||||
|
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord,
|
||||||
|
this.zCoord);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.worldObj.isRemote && this.smeltingTicks > 0) {
|
||||||
|
if (super.ticks % 600L == 0L) {
|
||||||
|
this.worldObj.playSoundEffect(
|
||||||
|
(double) this.xCoord, (double) this.yCoord, (double) this.zCoord,
|
||||||
|
SoundManager.ASSEMBLER, 0.7F, 1.0F);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.rotationYaw1 += 3.0F;
|
||||||
|
this.rotationYaw2 += 2.0F;
|
||||||
|
++this.rotationYaw3;
|
||||||
|
ItemStack var3 = this.getStackInSlot(6);
|
||||||
|
if (var3 != null) {
|
||||||
|
var3 = var3.copy();
|
||||||
|
var3.stackSize = 1;
|
||||||
|
if (this.entityItem == null) {
|
||||||
|
this.entityItem = new EntityItem(this.worldObj, 0.0D, 0.0D, 0.0D, var3);
|
||||||
|
} else if (!var3.isItemEqual(this.entityItem.getEntityItem())) {
|
||||||
|
this.entityItem = new EntityItem(this.worldObj, 0.0D, 0.0D, 0.0D, var3);
|
||||||
|
}
|
||||||
|
|
||||||
|
++this.entityItem.age;
|
||||||
|
} else {
|
||||||
|
this.entityItem = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ElectricityPack getRequest() {
|
||||||
|
return this.canWork()
|
||||||
|
? new ElectricityPack(10000.0D / this.getVoltage(), this.getVoltage())
|
||||||
|
: new ElectricityPack();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDataPacket(NetworkManager arg0,
|
||||||
|
S35PacketUpdateTileEntity arg1) {
|
||||||
|
NBTTagCompound nbt = arg1.func_148857_g();
|
||||||
|
|
||||||
|
this.smeltingTicks = nbt.getInteger("smeltingTicks");
|
||||||
|
super.disabledTicks = nbt.getInteger("disabledTicks");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Packet getDescriptionPacket() {
|
||||||
|
NBTTagCompound nbt = new NBTTagCompound();
|
||||||
|
|
||||||
|
nbt.setInteger("smeltingTicks", this.smeltingTicks);
|
||||||
|
nbt.setInteger("disabledTicks", super.disabledTicks);
|
||||||
|
|
||||||
|
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord,
|
||||||
|
this.getBlockMetadata(), nbt);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void openInventory() {
|
||||||
|
if (!this.worldObj.isRemote) {
|
||||||
|
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean canWork() {
|
||||||
|
if (super.containingItems[6] != null) {
|
||||||
|
for (int i = 0; i < 6; ++i) {
|
||||||
|
if (super.containingItems[i] == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (super.containingItems[i].getItem() != AtomicScience.itCellStrangeMatter) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.containingItems[6].stackSize < 64;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void work() {
|
||||||
if (this.canWork()) {
|
if (this.canWork()) {
|
||||||
double var10000 = super.wattsReceived;
|
for (int i = 0; i <= 5; ++i) {
|
||||||
this.getClass();
|
if (super.containingItems[i] != null) {
|
||||||
if (var10000 >= 10000.0D) {
|
super.containingItems[i].setItemDamage(
|
||||||
if (this.smeltingTicks == 0) {
|
super.containingItems[i].getItemDamage() + 1);
|
||||||
this.getClass();
|
if (super.containingItems[i].getItemDamage() >= 64) {
|
||||||
this.smeltingTicks = 1200;
|
super.containingItems[i] = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.smeltingTicks > 0) {
|
if (super.containingItems[6] != null) {
|
||||||
--this.smeltingTicks;
|
++super.containingItems[6].stackSize;
|
||||||
if (this.smeltingTicks < 1) {
|
|
||||||
this.work();
|
|
||||||
this.smeltingTicks = 0;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.smeltingTicks = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
super.wattsReceived = 0.0D;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.smeltingTicks = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (super.ticks % 10L == 0L) {
|
|
||||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord,
|
|
||||||
this.zCoord);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.worldObj.isRemote && this.smeltingTicks > 0) {
|
|
||||||
if (super.ticks % 600L == 0L) {
|
|
||||||
this.worldObj.playSoundEffect(
|
|
||||||
(double)this.xCoord, (double)this.yCoord, (double)this.zCoord,
|
|
||||||
SoundManager.ASSEMBLER, 0.7F, 1.0F);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.rotationYaw1 += 3.0F;
|
|
||||||
this.rotationYaw2 += 2.0F;
|
|
||||||
++this.rotationYaw3;
|
|
||||||
ItemStack var3 = this.getStackInSlot(6);
|
|
||||||
if (var3 != null) {
|
|
||||||
var3 = var3.copy();
|
|
||||||
var3.stackSize = 1;
|
|
||||||
if (this.entityItem == null) {
|
|
||||||
this.entityItem =
|
|
||||||
new EntityItem(this.worldObj, 0.0D, 0.0D, 0.0D, var3);
|
|
||||||
} else if (!var3.isItemEqual(this.entityItem.getEntityItem())) {
|
|
||||||
this.entityItem =
|
|
||||||
new EntityItem(this.worldObj, 0.0D, 0.0D, 0.0D, var3);
|
|
||||||
}
|
|
||||||
|
|
||||||
++this.entityItem.age;
|
|
||||||
} else {
|
|
||||||
this.entityItem = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public ElectricityPack getRequest() {
|
@Override
|
||||||
return this.canWork()
|
public void readFromNBT(NBTTagCompound nbt) {
|
||||||
? new ElectricityPack(10000.0D / this.getVoltage(), this.getVoltage())
|
super.readFromNBT(nbt);
|
||||||
: new ElectricityPack();
|
this.smeltingTicks = nbt.getInteger("smeltingTicks");
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDataPacket(NetworkManager arg0,
|
|
||||||
S35PacketUpdateTileEntity arg1) {
|
|
||||||
NBTTagCompound nbt = arg1.func_148857_g();
|
|
||||||
|
|
||||||
this.smeltingTicks = nbt.getInteger("smeltingTicks");
|
|
||||||
super.disabledTicks = nbt.getInteger("disabledTicks");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Packet getDescriptionPacket() {
|
|
||||||
NBTTagCompound nbt = new NBTTagCompound();
|
|
||||||
|
|
||||||
nbt.setInteger("smeltingTicks", this.smeltingTicks);
|
|
||||||
nbt.setInteger("disabledTicks", super.disabledTicks);
|
|
||||||
|
|
||||||
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord,
|
|
||||||
this.getBlockMetadata(), nbt);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void openInventory() {
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canWork() {
|
@Override
|
||||||
if (super.containingItems[6] != null) {
|
public void writeToNBT(NBTTagCompound nbt) {
|
||||||
for (int i = 0; i < 6; ++i) {
|
super.writeToNBT(nbt);
|
||||||
if (super.containingItems[i] == null) {
|
nbt.setInteger("smeltingTicks", this.smeltingTicks);
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (super.containingItems[i].getItem() !=
|
|
||||||
AtomicScience.itCellStrangeMatter) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return super.containingItems[6].stackSize < 64;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void work() {
|
@Override
|
||||||
if (this.canWork()) {
|
public double getVoltage() {
|
||||||
for (int i = 0; i <= 5; ++i) {
|
return UniversalElectricity.isVoltageSensitive ? 480.0D : 120.0D;
|
||||||
if (super.containingItems[i] != null) {
|
|
||||||
super.containingItems[i].setItemDamage(
|
|
||||||
super.containingItems[i].getItemDamage() + 1);
|
|
||||||
if (super.containingItems[i].getItemDamage() >= 64) {
|
|
||||||
super.containingItems[i] = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (super.containingItems[6] != null) {
|
|
||||||
++super.containingItems[6].stackSize;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void readFromNBT(NBTTagCompound nbt) {
|
@Override
|
||||||
super.readFromNBT(nbt);
|
public int getSizeInventory() {
|
||||||
this.smeltingTicks = nbt.getInteger("smeltingTicks");
|
return 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void writeToNBT(NBTTagCompound nbt) {
|
@Override
|
||||||
super.writeToNBT(nbt);
|
public boolean isItemValidForSlot(int slotID, ItemStack itemStack) {
|
||||||
nbt.setInteger("smeltingTicks", this.smeltingTicks);
|
return slotID == 6
|
||||||
}
|
? itemStack.isStackable()
|
||||||
|
: itemStack.getItem() == AtomicScience.itCellStrangeMatter;
|
||||||
public double getVoltage() {
|
}
|
||||||
return UniversalElectricity.isVoltageSensitive ? 480.0D : 120.0D;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getSizeInventory() { return 7; }
|
|
||||||
|
|
||||||
public boolean isItemValidForSlot(int slotID, ItemStack itemStack) {
|
|
||||||
return slotID == 6
|
|
||||||
? true
|
|
||||||
: itemStack.getItem() == AtomicScience.itCellStrangeMatter;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -237,7 +237,7 @@ public class TAutoBuilder
|
||||||
targetPosition =
|
targetPosition =
|
||||||
(new Vector3((double)x, 1.0D, (double)z)).add(diDian);
|
(new Vector3((double)x, 1.0D, (double)z)).add(diDian);
|
||||||
targetPosition.setBlock(
|
targetPosition.setBlock(
|
||||||
this.worldObj, AtomicScience.bElectromagnet);
|
this.worldObj, AtomicScience.bElectromagnetBoiler);
|
||||||
targetPosition =
|
targetPosition =
|
||||||
(new Vector3((double)x, -1.0D, (double)z)).add(diDian);
|
(new Vector3((double)x, -1.0D, (double)z)).add(diDian);
|
||||||
targetPosition.setBlock(
|
targetPosition.setBlock(
|
||||||
|
@ -329,7 +329,6 @@ public class TAutoBuilder
|
||||||
}
|
}
|
||||||
|
|
||||||
public static enum AutoBuilderType {
|
public static enum AutoBuilderType {
|
||||||
|
|
||||||
JIA_SU_QI("Particle Accelerator"),
|
JIA_SU_QI("Particle Accelerator"),
|
||||||
FEN_LIE("Fission Reactor"),
|
FEN_LIE("Fission Reactor"),
|
||||||
HE_CHENG("Fusion Reactor"),
|
HE_CHENG("Fusion Reactor"),
|
||||||
|
|
16
src/main/java/atomicscience/TileEntityFilteredSlot.java
Normal file
16
src/main/java/atomicscience/TileEntityFilteredSlot.java
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
package atomicscience;
|
||||||
|
|
||||||
|
import net.minecraft.inventory.IInventory;
|
||||||
|
import net.minecraft.inventory.Slot;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class TileEntityFilteredSlot extends Slot {
|
||||||
|
public TileEntityFilteredSlot(IInventory arg0, int arg1, int arg2, int arg3) {
|
||||||
|
super(arg0, arg1, arg2, arg3);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isItemValid(ItemStack arg0) {
|
||||||
|
return this.inventory.isItemValidForSlot(this.getSlotIndex(), arg0);
|
||||||
|
}
|
||||||
|
}
|
|
@ -263,7 +263,7 @@ public class EMatter extends Entity implements IEntityAdditionalSpawnData {
|
||||||
}
|
}
|
||||||
|
|
||||||
super.worldObj.playSoundEffect(
|
super.worldObj.playSoundEffect(
|
||||||
super.posX, super.posY, super.posZ, "atomicscience.antimatter", 1.5F,
|
super.posX, super.posY, super.posZ, SoundManager.ANTIMATTER, 1.5F,
|
||||||
1.0F - super.worldObj.rand.nextFloat() * 0.3F);
|
1.0F - super.worldObj.rand.nextFloat() * 0.3F);
|
||||||
this.setDead();
|
this.setDead();
|
||||||
}
|
}
|
||||||
|
@ -276,13 +276,11 @@ public class EMatter extends Entity implements IEntityAdditionalSpawnData {
|
||||||
public static boolean canExist(World worldObj, Vector3 position,
|
public static boolean canExist(World worldObj, Vector3 position,
|
||||||
ForgeDirection facing) {
|
ForgeDirection facing) {
|
||||||
if (position.getBlock(worldObj) != Blocks.air) {
|
if (position.getBlock(worldObj) != Blocks.air) {
|
||||||
AtomicScience.LOGGER.info("block not air " + position);
|
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i <= 1; ++i) {
|
for (int i = 0; i <= 1; ++i) {
|
||||||
ForgeDirection dir = ForgeDirection.getOrientation(i);
|
ForgeDirection dir = ForgeDirection.getOrientation(i);
|
||||||
if (!isElectromagnet(worldObj, position, dir)) {
|
if (!isElectromagnet(worldObj, position, dir)) {
|
||||||
AtomicScience.LOGGER.info("not alectromagnet " + position);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,124 +19,144 @@ import universalelectricity.core.vector.Vector3;
|
||||||
import universalelectricity.prefab.tile.TileEntityAdvanced;
|
import universalelectricity.prefab.tile.TileEntityAdvanced;
|
||||||
|
|
||||||
public class TReactorTap extends TileEntityAdvanced implements IFluidHandler {
|
public class TReactorTap extends TileEntityAdvanced implements IFluidHandler {
|
||||||
|
private final Set<FluidTank> tanks = new HashSet<>();
|
||||||
|
private long lastFindTime = -1L;
|
||||||
|
|
||||||
private final Set<FluidTank> tanks = new HashSet<>();
|
@Override
|
||||||
private long lastFindTime = -1L;
|
public void updateEntity() {
|
||||||
|
super.updateEntity();
|
||||||
|
|
||||||
public void find() {
|
if (!this.worldObj.isRemote && this.ticks % 20 == 0) {
|
||||||
this.tanks.clear();
|
FluidTank optimalTank = this.getOptimalTank();
|
||||||
final World world = this.worldObj;
|
if (optimalTank == null)
|
||||||
final Vector3 position = new Vector3(this);
|
return;
|
||||||
Pathfinder finder = (new Pathfinder(new IPathCallBack() {
|
ForgeDirection rotation =
|
||||||
public Set getConnectedNodes(Pathfinder finder, Vector3 currentNode) {
|
ForgeDirection.getOrientation(this.worldObj.getBlockMetadata(
|
||||||
HashSet<Vector3> neighbors = new HashSet<>();
|
this.xCoord, this.yCoord, this.zCoord));
|
||||||
|
|
||||||
for (int i = 0; i < 6; ++i) {
|
Vector3 neighborPos = new Vector3(this).modifyPositionFromSide(rotation);
|
||||||
ForgeDirection direction = ForgeDirection.getOrientation(i);
|
if (neighborPos.getTileEntity(this.worldObj) instanceof IFluidHandler) {
|
||||||
Vector3 positionx = currentNode.clone().modifyPositionFromSide(direction);
|
IFluidHandler fHandler =
|
||||||
Block connectedBlockID = positionx.getBlock(world);
|
(IFluidHandler)neighborPos.getTileEntity(this.worldObj);
|
||||||
if (connectedBlockID == Blocks.air ||
|
int drained =
|
||||||
connectedBlockID instanceof BlockLiquid ||
|
fHandler.fill(rotation.getOpposite(), optimalTank.getFluid(), true);
|
||||||
connectedBlockID instanceof BFissionReactor) {
|
|
||||||
neighbors.add(positionx);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return neighbors;
|
if (drained != 0)
|
||||||
|
optimalTank.drain(drained, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void find() {
|
||||||
|
this.tanks.clear();
|
||||||
|
final World world = this.worldObj;
|
||||||
|
final Vector3 position = new Vector3(this);
|
||||||
|
Pathfinder finder =
|
||||||
|
(new Pathfinder(new IPathCallBack() {
|
||||||
|
public Set getConnectedNodes(Pathfinder finder, Vector3 currentNode) {
|
||||||
|
HashSet<Vector3> neighbors = new HashSet<>();
|
||||||
|
|
||||||
|
for (int i = 0; i < 6; ++i) {
|
||||||
|
ForgeDirection direction = ForgeDirection.getOrientation(i);
|
||||||
|
Vector3 positionx =
|
||||||
|
currentNode.clone().modifyPositionFromSide(direction);
|
||||||
|
Block connectedBlockID = positionx.getBlock(world);
|
||||||
|
if (connectedBlockID == Blocks.air ||
|
||||||
|
connectedBlockID instanceof BlockLiquid ||
|
||||||
|
connectedBlockID instanceof BFissionReactor) {
|
||||||
|
neighbors.add(positionx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean onSearch(Pathfinder finder, Vector3 node) {
|
return neighbors;
|
||||||
if (node.getTileEntity(world) instanceof TFissionReactor) {
|
}
|
||||||
finder.results.add(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
return node.distanceTo(position) > 6.0D;
|
public boolean onSearch(Pathfinder finder, Vector3 node) {
|
||||||
|
if (node.getTileEntity(world) instanceof TFissionReactor) {
|
||||||
|
finder.results.add(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return node.distanceTo(position) > 6.0D;
|
||||||
|
}
|
||||||
}))
|
}))
|
||||||
.init((new Vector3(this))
|
.init((new Vector3(this))
|
||||||
.modifyPositionFromSide(
|
.modifyPositionFromSide(
|
||||||
ForgeDirection.getOrientation(this.getBlockMetadata())
|
ForgeDirection.getOrientation(this.getBlockMetadata())
|
||||||
.getOpposite()));
|
.getOpposite()));
|
||||||
for (Vector3 node : (Set<Vector3>) finder.results) {
|
for (Vector3 node : (Set<Vector3>)finder.results) {
|
||||||
TileEntity tileEntity = node.getTileEntity(this.worldObj);
|
TileEntity tileEntity = node.getTileEntity(this.worldObj);
|
||||||
if (tileEntity instanceof TFissionReactor) {
|
if (tileEntity instanceof TFissionReactor) {
|
||||||
this.tanks.add(((TFissionReactor) tileEntity).wasteTank);
|
this.tanks.add(((TFissionReactor)tileEntity).wasteTank);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
this.lastFindTime = this.worldObj.getWorldTime();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public FluidTank getOptimalTank() {
|
this.lastFindTime = this.worldObj.getWorldTime();
|
||||||
if (this.lastFindTime == -1L ||
|
}
|
||||||
this.worldObj.getWorldTime() - this.lastFindTime > 20L) {
|
|
||||||
this.find();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.tanks.size() <= 0) {
|
public FluidTank getOptimalTank() {
|
||||||
return null;
|
if (this.lastFindTime == -1L ||
|
||||||
}
|
this.worldObj.getWorldTime() - this.lastFindTime > 20L) {
|
||||||
|
this.find();
|
||||||
FluidTank optimalTank = null;
|
|
||||||
for (FluidTank tank : this.tanks) {
|
|
||||||
if (this.getLiquidSafe(tank.getFluid()) > this.getLiquidSafe(optimalTank.getFluid())) {
|
|
||||||
optimalTank = tank;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return optimalTank;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getLiquidSafe(FluidStack stack) {
|
if (this.tanks.size() <= 0) {
|
||||||
return stack != null ? stack.amount : 0;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUpdate() {
|
FluidTank optimalTank = null;
|
||||||
return false;
|
for (FluidTank tank : this.tanks) {
|
||||||
|
int optimalTankContent =
|
||||||
|
optimalTank == null ? 0 : optimalTank.getFluidAmount();
|
||||||
|
if (tank.getFluidAmount() > optimalTankContent) {
|
||||||
|
optimalTank = tank;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
|
return optimalTank;
|
||||||
return 0;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public int fill(int tankIndex, FluidStack resource, boolean doFill) {
|
public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
|
public int fill(int tankIndex, FluidStack resource, boolean doFill) {
|
||||||
return this.getOptimalTank() != null
|
return 0;
|
||||||
? this.getOptimalTank().drain(maxDrain, doDrain)
|
}
|
||||||
: null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
|
||||||
public FluidStack drain(ForgeDirection arg0, FluidStack arg1, boolean arg2) {
|
return this.getOptimalTank() != null
|
||||||
return this.getOptimalTank() != null &&
|
? this.getOptimalTank().drain(maxDrain, doDrain)
|
||||||
arg1.getFluid() == this.getOptimalTank().getFluid().getFluid()
|
: null;
|
||||||
? this.drain(arg0, arg1.amount, arg2)
|
}
|
||||||
: null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canDrain(ForgeDirection arg0, Fluid arg1) {
|
public FluidStack drain(ForgeDirection arg0, FluidStack arg1, boolean arg2) {
|
||||||
return this.getOptimalTank() != null &&
|
return this.getOptimalTank() != null &&
|
||||||
this.getOptimalTank().getFluid().getFluid() == arg1 &&
|
arg1.getFluid() == this.getOptimalTank().getFluid().getFluid()
|
||||||
this.getOptimalTank().getFluidAmount() != 0;
|
? this.drain(arg0, arg1.amount, arg2)
|
||||||
}
|
: null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FluidTankInfo[] getTankInfo(ForgeDirection arg0) {
|
public boolean canDrain(ForgeDirection arg0, Fluid arg1) {
|
||||||
if (arg0.ordinal() != this.getBlockMetadata())
|
return this.getOptimalTank() != null &&
|
||||||
return null;
|
this.getOptimalTank().getFluid().getFluid() == arg1 &&
|
||||||
|
this.getOptimalTank().getFluidAmount() != 0;
|
||||||
|
}
|
||||||
|
|
||||||
this.find();
|
@Override
|
||||||
return (FluidTankInfo[]) this.tanks.stream()
|
public FluidTankInfo[] getTankInfo(ForgeDirection arg0) {
|
||||||
.map(FluidTankInfo::new)
|
if (arg0.ordinal() != this.getBlockMetadata())
|
||||||
.toArray();
|
return null;
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
this.find();
|
||||||
public boolean canFill(ForgeDirection arg0, Fluid arg1) {
|
return (FluidTankInfo[])this.tanks.stream()
|
||||||
return false;
|
.map(FluidTankInfo::new)
|
||||||
}
|
.toArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canFill(ForgeDirection arg0, Fluid arg1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,14 +5,15 @@ import atomicscience.jiqi.BBase;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class BElectromagnet extends BBase implements IElectromagnet {
|
public class BElectromagnet extends BBase implements IElectromagnet {
|
||||||
private IIcon iconTop;
|
protected IIcon iconTop;
|
||||||
|
|
||||||
public BElectromagnet() { super("electromagnet"); }
|
public BElectromagnet() { this("electromagnet"); }
|
||||||
|
|
||||||
|
public BElectromagnet(String id) { super(id); }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(int side, int metadata) {
|
public IIcon getIcon(int side, int metadata) {
|
||||||
|
@ -23,15 +24,8 @@ public class BElectromagnet extends BBase implements IElectromagnet {
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||||
super.registerBlockIcons(iconRegister);
|
super.registerBlockIcons(iconRegister);
|
||||||
this.iconTop = iconRegister.registerIcon(
|
this.iconTop = iconRegister.registerIcon("atomicscience:electromagnet_top");
|
||||||
this.getUnlocalizedName().replace("tile.", "") + "_top");
|
this.blockIcon = iconRegister.registerIcon("atomicscience:electromagnet");
|
||||||
this.blockIcon = iconRegister.registerIcon(
|
|
||||||
this.getUnlocalizedName().replace("tile.", ""));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public TileEntity createNewTileEntity(World var1, int meta) {
|
|
||||||
return new TElectromagnet();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
package atomicscience.hecheng;
|
||||||
|
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public class BElectromagnetBoiler extends BElectromagnet {
|
||||||
|
public BElectromagnetBoiler() { super("electromagnetBoiler"); }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity createNewTileEntity(World var1, int meta) {
|
||||||
|
return new TElectromagnetBoiler();
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,7 +2,7 @@ package atomicscience.hecheng;
|
||||||
|
|
||||||
import atomicscience.api.IElectromagnet;
|
import atomicscience.api.IElectromagnet;
|
||||||
import atomicscience.api.Plasma;
|
import atomicscience.api.Plasma;
|
||||||
import atomicscience.hecheng.TElectromagnet;
|
import atomicscience.hecheng.TElectromagnetBoiler;
|
||||||
import atomicscience.jiqi.BBase;
|
import atomicscience.jiqi.BBase;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
@ -50,9 +50,9 @@ public class BPlasma extends BBase implements Plasma.IPlasma {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
TileEntity var10 = zhaoDiDian.getTileEntity(worldObj);
|
TileEntity var10 = zhaoDiDian.getTileEntity(worldObj);
|
||||||
if (var10 instanceof TElectromagnet) {
|
if (var10 instanceof TElectromagnetBoiler) {
|
||||||
((TElectromagnet) var10)
|
((TElectromagnetBoiler) var10)
|
||||||
.setTemperature(((TElectromagnet) var10).getTemperature() + 100.0F);
|
.setTemperature(((TElectromagnetBoiler) var10).getTemperature() + 100.0F);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||||
import universalelectricity.core.vector.Vector3;
|
import universalelectricity.core.vector.Vector3;
|
||||||
import universalelectricity.prefab.tile.TileEntityAdvanced;
|
import universalelectricity.prefab.tile.TileEntityAdvanced;
|
||||||
|
|
||||||
public class TElectromagnet extends TileEntityAdvanced implements ITemperature {
|
public class TElectromagnetBoiler extends TileEntityAdvanced implements ITemperature {
|
||||||
public static final int MAX_TEMP = 5000;
|
public static final int MAX_TEMP = 5000;
|
||||||
private float temperature = 0.0F;
|
private float temperature = 0.0F;
|
||||||
|
|
|
@ -3,7 +3,6 @@ package atomicscience.hecheng;
|
||||||
import atomicscience.AtomicScience;
|
import atomicscience.AtomicScience;
|
||||||
import atomicscience.jiqi.TInventory;
|
import atomicscience.jiqi.TInventory;
|
||||||
import calclavia.lib.render.ITagRender;
|
import calclavia.lib.render.ITagRender;
|
||||||
import com.google.common.io.ByteArrayDataInput;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.ISidedInventory;
|
import net.minecraft.inventory.ISidedInventory;
|
||||||
|
|
|
@ -2,6 +2,7 @@ package atomicscience.jiqi;
|
||||||
|
|
||||||
import atomicscience.AtomicScience;
|
import atomicscience.AtomicScience;
|
||||||
import atomicscience.TAtomicAssembler;
|
import atomicscience.TAtomicAssembler;
|
||||||
|
import atomicscience.TileEntityFilteredSlot;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.player.InventoryPlayer;
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
import net.minecraft.inventory.Container;
|
import net.minecraft.inventory.Container;
|
||||||
|
@ -14,13 +15,13 @@ public class CAssembler extends Container {
|
||||||
public CAssembler(InventoryPlayer par1InventoryPlayer,
|
public CAssembler(InventoryPlayer par1InventoryPlayer,
|
||||||
TAtomicAssembler tileEntity) {
|
TAtomicAssembler tileEntity) {
|
||||||
this.tileEntity = tileEntity;
|
this.tileEntity = tileEntity;
|
||||||
this.addSlotToContainer(new Slot(tileEntity, 0, 80, 40));
|
this.addSlotToContainer(new TileEntityFilteredSlot(tileEntity, 0, 80, 40));
|
||||||
this.addSlotToContainer(new Slot(tileEntity, 1, 53, 56));
|
this.addSlotToContainer(new TileEntityFilteredSlot(tileEntity, 1, 53, 56));
|
||||||
this.addSlotToContainer(new Slot(tileEntity, 2, 107, 56));
|
this.addSlotToContainer(new TileEntityFilteredSlot(tileEntity, 2, 107, 56));
|
||||||
this.addSlotToContainer(new Slot(tileEntity, 3, 53, 88));
|
this.addSlotToContainer(new TileEntityFilteredSlot(tileEntity, 3, 53, 88));
|
||||||
this.addSlotToContainer(new Slot(tileEntity, 4, 107, 88));
|
this.addSlotToContainer(new TileEntityFilteredSlot(tileEntity, 4, 107, 88));
|
||||||
this.addSlotToContainer(new Slot(tileEntity, 5, 80, 103));
|
this.addSlotToContainer(new TileEntityFilteredSlot(tileEntity, 5, 80, 103));
|
||||||
this.addSlotToContainer(new Slot(tileEntity, 6, 80, 72));
|
this.addSlotToContainer(new TileEntityFilteredSlot(tileEntity, 6, 80, 72));
|
||||||
|
|
||||||
int var3;
|
int var3;
|
||||||
for (var3 = 0; var3 < 3; ++var3) {
|
for (var3 = 0; var3 < 3; ++var3) {
|
||||||
|
@ -62,6 +63,7 @@ public class CAssembler extends Container {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
} else if (!this.getSlot(6).getHasStack() &&
|
} else if (!this.getSlot(6).getHasStack() &&
|
||||||
|
itemStack.isStackable() &&
|
||||||
!this.mergeItemStack(itemStack, 6, 7, false)) {
|
!this.mergeItemStack(itemStack, 6, 7, false)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,89 +14,99 @@ import universalelectricity.core.block.IConductor;
|
||||||
import universalelectricity.prefab.tile.TileEntityAdvanced;
|
import universalelectricity.prefab.tile.TileEntityAdvanced;
|
||||||
|
|
||||||
public class TFunnel
|
public class TFunnel
|
||||||
extends TileEntityAdvanced implements ISteamReceptor, IFluidHandler {
|
extends TileEntityAdvanced implements ISteamReceptor, IFluidHandler {
|
||||||
|
|
||||||
public IConductor connectedWire = null;
|
public IConductor connectedWire = null;
|
||||||
public final FluidTank gasTank;
|
public final FluidTank gasTank;
|
||||||
|
|
||||||
public TFunnel() {
|
public TFunnel() {
|
||||||
this.gasTank = new FluidTank(AtomicScience.FLUID_STEAM, 0, 20000);
|
this.gasTank = new FluidTank(AtomicScience.FLUID_STEAM, 0, 20000);
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: WTF
|
@Override
|
||||||
// this.gasTank.setTankPressure(10);
|
public void updateEntity() {
|
||||||
}
|
super.updateEntity();
|
||||||
|
if (!this.worldObj.isRemote && super.ticks % 20L == 0L) {
|
||||||
@Override
|
TileEntity tileEntity = this.worldObj.getTileEntity(
|
||||||
public void updateEntity() {
|
this.xCoord, this.yCoord + 1, this.zCoord);
|
||||||
super.updateEntity();
|
if (tileEntity instanceof ISteamReceptor) {
|
||||||
if (super.ticks % 20L == 0L) {
|
FluidStack drainStack =
|
||||||
TileEntity tileEntity = this.worldObj.getTileEntity(
|
this.gasTank.drain(AtomicScience.STEAM_RATIO, true);
|
||||||
this.xCoord, this.yCoord + 1, this.zCoord);
|
if (drainStack != null) {
|
||||||
if (tileEntity != null && tileEntity instanceof ISteamReceptor) {
|
int nengLiang = drainStack.amount;
|
||||||
FluidStack drainStack = this.gasTank.drain(AtomicScience.STEAM_RATIO, true);
|
((ISteamReceptor)tileEntity)
|
||||||
if (drainStack != null) {
|
.onReceiveSteam(nengLiang - nengLiang / 4);
|
||||||
int nengLiang = drainStack.amount;
|
|
||||||
((ISteamReceptor) tileEntity)
|
|
||||||
.onReceiveSteam(nengLiang - nengLiang / 4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
if (tileEntity instanceof IFluidHandler) {
|
||||||
public void readFromNBT(NBTTagCompound nbt) {
|
IFluidHandler fHandler = ((IFluidHandler)tileEntity);
|
||||||
super.readFromNBT(nbt);
|
|
||||||
NBTTagCompound gasCompound = nbt.getCompoundTag("gas");
|
|
||||||
this.gasTank.setFluid(FluidStack.loadFluidStackFromNBT(gasCompound));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
int transferred =
|
||||||
public void writeToNBT(NBTTagCompound nbt) {
|
fHandler.fill(ForgeDirection.DOWN,
|
||||||
super.writeToNBT(nbt);
|
this.gasTank.getFluid(),
|
||||||
if (this.gasTank.getFluid() != null) {
|
true);
|
||||||
NBTTagCompound compound = new NBTTagCompound();
|
|
||||||
this.gasTank.getFluid().writeToNBT(compound);
|
|
||||||
nbt.setTag("gas", compound);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
if (transferred != 0)
|
||||||
public void onReceiveSteam(int amount) {
|
this.gasTank.drain(transferred, true);
|
||||||
this.gasTank.fill(new FluidStack(AtomicScience.FLUID_STEAM,
|
}
|
||||||
amount * AtomicScience.STEAM_RATIO),
|
|
||||||
true);
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
|
public void readFromNBT(NBTTagCompound nbt) {
|
||||||
return 0;
|
super.readFromNBT(nbt);
|
||||||
}
|
NBTTagCompound gasCompound = nbt.getCompoundTag("gas");
|
||||||
|
this.gasTank.setFluid(FluidStack.loadFluidStackFromNBT(gasCompound));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
|
public void writeToNBT(NBTTagCompound nbt) {
|
||||||
return this.gasTank.drain(maxDrain, doDrain);
|
super.writeToNBT(nbt);
|
||||||
|
if (this.gasTank.getFluid() != null) {
|
||||||
|
NBTTagCompound compound = new NBTTagCompound();
|
||||||
|
this.gasTank.getFluid().writeToNBT(compound);
|
||||||
|
nbt.setTag("gas", compound);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canDrain(ForgeDirection arg0, Fluid arg1) {
|
public void onReceiveSteam(int amount) {
|
||||||
return arg1 == AtomicScience.FLUID_STEAM &&
|
this.gasTank.fill(new FluidStack(AtomicScience.FLUID_STEAM,
|
||||||
this.gasTank.getFluidAmount() > 0;
|
amount * AtomicScience.STEAM_RATIO),
|
||||||
}
|
true);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canFill(ForgeDirection arg0, Fluid arg1) {
|
public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
|
||||||
return false;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FluidStack drain(ForgeDirection arg0, FluidStack arg1, boolean arg2) {
|
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
|
||||||
return arg1.getFluid() == AtomicScience.FLUID_STEAM
|
return this.gasTank.drain(maxDrain, doDrain);
|
||||||
? this.gasTank.drain(arg1.amount, arg2)
|
}
|
||||||
: null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FluidTankInfo[] getTankInfo(ForgeDirection arg0) {
|
public boolean canDrain(ForgeDirection arg0, Fluid arg1) {
|
||||||
return new FluidTankInfo[] { new FluidTankInfo(this.gasTank) };
|
return arg1 == AtomicScience.FLUID_STEAM &&
|
||||||
}
|
this.gasTank.getFluidAmount() > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canFill(ForgeDirection arg0, Fluid arg1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FluidStack drain(ForgeDirection arg0, FluidStack arg1, boolean arg2) {
|
||||||
|
return arg1.getFluid() == AtomicScience.FLUID_STEAM
|
||||||
|
? this.gasTank.drain(arg1.amount, arg2)
|
||||||
|
: null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FluidTankInfo[] getTankInfo(ForgeDirection arg0) {
|
||||||
|
return new FluidTankInfo[] {new FluidTankInfo(this.gasTank)};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
14
src/main/java/atomicscience/recipe/IRecipeAdapter.java
Normal file
14
src/main/java/atomicscience/recipe/IRecipeAdapter.java
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
package atomicscience.recipe;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.item.crafting.IRecipe;
|
||||||
|
|
||||||
|
public interface IRecipeAdapter {
|
||||||
|
public void setOutput(ItemStack item);
|
||||||
|
|
||||||
|
public void setPattern(String... pattern);
|
||||||
|
|
||||||
|
public void addIngredient(Object... ingredients);
|
||||||
|
|
||||||
|
public IRecipe create();
|
||||||
|
}
|
49
src/main/java/atomicscience/recipe/RecipeBuilder.java
Normal file
49
src/main/java/atomicscience/recipe/RecipeBuilder.java
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
package atomicscience.recipe;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class RecipeBuilder {
|
||||||
|
IRecipeAdapter adapter;
|
||||||
|
|
||||||
|
public RecipeBuilder(IRecipeAdapter adapter) { this.adapter = adapter; }
|
||||||
|
|
||||||
|
public RecipeBuilder output(ItemStack stack) {
|
||||||
|
this.adapter.setOutput(stack);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RecipeBuilder output(Item item) {
|
||||||
|
this.adapter.setOutput(new ItemStack(item));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RecipeBuilder output(Block block) {
|
||||||
|
this.adapter.setOutput(new ItemStack(block));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RecipeBuilder output(Block block, int count) {
|
||||||
|
this.adapter.setOutput(new ItemStack(block, count));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RecipeBuilder output(Item item, int count) {
|
||||||
|
this.adapter.setOutput(new ItemStack(item, count));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RecipeBuilder pattern(String... pat) {
|
||||||
|
this.adapter.setPattern(pat);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RecipeBuilder ingredient(Object... i) {
|
||||||
|
this.adapter.addIngredient(i);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void register() { GameRegistry.addRecipe(this.adapter.create()); }
|
||||||
|
}
|
|
@ -0,0 +1,41 @@
|
||||||
|
package atomicscience.recipe;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.item.crafting.IRecipe;
|
||||||
|
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||||
|
|
||||||
|
public class ShapedOreRecipeAdapter implements IRecipeAdapter {
|
||||||
|
ItemStack output;
|
||||||
|
String[] pattern;
|
||||||
|
ArrayList<Object> ingredients = new ArrayList<>();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setOutput(ItemStack item) {
|
||||||
|
this.output = item;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setPattern(String... pattern) {
|
||||||
|
this.pattern = pattern;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addIngredient(Object... ingredients) {
|
||||||
|
this.ingredients.add(ingredients[0]);
|
||||||
|
this.ingredients.add(ingredients[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IRecipe create() {
|
||||||
|
ArrayList<Object> args = new ArrayList<>();
|
||||||
|
|
||||||
|
for (String pat : this.pattern)
|
||||||
|
args.add(pat);
|
||||||
|
|
||||||
|
for (Object ing : this.ingredients)
|
||||||
|
args.add(ing);
|
||||||
|
|
||||||
|
return new ShapedOreRecipe(this.output, args.toArray());
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
package atomicscience.recipe;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.item.crafting.IRecipe;
|
||||||
|
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||||
|
|
||||||
|
public class ShapelessOreRecipeAdapter implements IRecipeAdapter {
|
||||||
|
ItemStack output;
|
||||||
|
ArrayList<Object> ingredients = new ArrayList<>();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setOutput(ItemStack item) {
|
||||||
|
this.output = item;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setPattern(String... pattern) {
|
||||||
|
throw new UnsupportedOperationException("Shapeless recipe has no pattern!");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addIngredient(Object... ingredients) {
|
||||||
|
this.ingredients.add(ingredients[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IRecipe create() {
|
||||||
|
return new ShapelessOreRecipe(this.output, this.ingredients.toArray());
|
||||||
|
}
|
||||||
|
}
|
|
@ -52,7 +52,7 @@ public class GFissionReactor extends GuiContainerBase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerBackgroundLayer(float par1, int x, int y) {
|
protected void drawGuiContainerBackgroundLayer(float par1, int x, int y) {
|
||||||
//super.drawGuiContainerBackgroundLayer(par1, x, y);
|
super.drawGuiContainerBackgroundLayer(par1, x, y);
|
||||||
this.drawSlot(78, 20);
|
this.drawSlot(78, 20);
|
||||||
if (this.tileEntity.wasteTank.getFluid() != null) {
|
if (this.tileEntity.wasteTank.getFluid() != null) {
|
||||||
int toxicity1 = this.tileEntity.wasteTank.getFluidAmount();
|
int toxicity1 = this.tileEntity.wasteTank.getFluidAmount();
|
||||||
|
|
|
@ -24,8 +24,9 @@ item.atomicscience\:uranium.0.name=Uranium-235
|
||||||
item.atomicscience\:uranium.1.name=Uranium-238
|
item.atomicscience\:uranium.1.name=Uranium-238
|
||||||
item.atomicscience\:rodFissileFuel.name=Fissile Fuel Rod
|
item.atomicscience\:rodFissileFuel.name=Fissile Fuel Rod
|
||||||
item.atomicscience\:rodBreederFuel.name=Breeder Fuel Rod
|
item.atomicscience\:rodBreederFuel.name=Breeder Fuel Rod
|
||||||
item.atomicscience\:uraniumHexafluoride.name=Uranium Hexafluoride
|
fluid.uranium_hexafluoride=Uranium Hexafluoride
|
||||||
item.atomicscience\:steam.name=Steam
|
fluid.steam=Steam
|
||||||
|
fluid.toxic_waste=Toxic Waste
|
||||||
|
|
||||||
## Blocks
|
## Blocks
|
||||||
tile.atomicscience\:reactorTap.name=Reactor Drain
|
tile.atomicscience\:reactorTap.name=Reactor Drain
|
||||||
|
@ -38,6 +39,7 @@ tile.atomicscience\:turbine.name=Reactor Turbine
|
||||||
tile.atomicscience\:radioactive.name=Radioactive Material
|
tile.atomicscience\:radioactive.name=Radioactive Material
|
||||||
tile.atomicscience\:thermometer.name=Thermometer
|
tile.atomicscience\:thermometer.name=Thermometer
|
||||||
tile.atomicscience\:electromagnet.name=Electromagnet
|
tile.atomicscience\:electromagnet.name=Electromagnet
|
||||||
|
tile.atomicscience\:electromagnetBoiler.name=Electromagnet Boiler
|
||||||
tile.atomicscience\:chemicalExtractor.name=Chemical Extractor
|
tile.atomicscience\:chemicalExtractor.name=Chemical Extractor
|
||||||
tile.atomicscience\:siren.name=Siren
|
tile.atomicscience\:siren.name=Siren
|
||||||
tile.atomicscience\:electromagnetGlass.name=Electromagnet Glass
|
tile.atomicscience\:electromagnetGlass.name=Electromagnet Glass
|
||||||
|
@ -48,4 +50,4 @@ tile.atomicscience\:accelerator.name=Particle Accelerator
|
||||||
tile.atomicscience\:instantBuilder.name=Instant Builder
|
tile.atomicscience\:instantBuilder.name=Instant Builder
|
||||||
tile.atomicscience\:fulmination.name=Fulmination Generator
|
tile.atomicscience\:fulmination.name=Fulmination Generator
|
||||||
tile.atomicscience\:atomicAssembler.name=Atomic Assembler
|
tile.atomicscience\:atomicAssembler.name=Atomic Assembler
|
||||||
tile.atomicscience\:toxicWaste.name=Toxic Waste
|
tile.atomicscience\:toxicWaste.name=Toxic Waste
|
||||||
|
|
Loading…
Reference in a new issue