Skip to content
This repository has been archived by the owner on Dec 29, 2024. It is now read-only.

Beamline #31

Closed
wants to merge 177 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
5348287
Part of beamline implementation
Elisis Sep 1, 2022
437bd4c
Duplicate abstract class to fix 'implements' problem with Tec's
Elisis Sep 1, 2022
f04d22f
Add beamline input hatch
Elisis Sep 1, 2022
9dfdc6f
Finish beamline implementation
Elisis Sep 2, 2022
b67cd1a
Add casing class, mu-metal, permalloy
Elisis Sep 10, 2022
45fd21f
Merge b67cd1a9427988324248f7f378604286bcfe3b96 into 1be3f27318b45f15f…
Elisis Sep 10, 2022
52e6935
spotlessApply
Sep 10, 2022
577d87a
Merge pull request #34 from GTNewHorizons/beamline-spotless-fixes
Dream-Master Sep 10, 2022
32beea7
More casings, recipes, etc.
Elisis Sep 12, 2022
9b16bd8
spotless
Elisis Sep 12, 2022
19ba304
Resolve conflict
Elisis Sep 12, 2022
25a17d1
Merge 19ba30480a8ccfe805b1e66c49b2fb7d008955b4 into 1be3f27318b45f15f…
Elisis Sep 12, 2022
3eba426
spotlessApply
Sep 12, 2022
d1fabfa
Merge pull request #35 from GTNewHorizons/beamline-spotless-fixes
Elisis Sep 12, 2022
e49f652
Fix duplication from merge lol
Elisis Sep 12, 2022
241e9ae
spotless
Elisis Sep 12, 2022
27d4890
Merge pull request #37 from GTNewHorizons/master
Elisis Sep 19, 2022
2c273fd
Update GT version
Elisis Nov 1, 2022
a27228d
Add LINAC multiblock functionality
Elisis Nov 1, 2022
2932a0c
Merge branch 'beamline' of https://github.com/GTNewHorizons/GTNH-Lant…
Elisis Nov 1, 2022
a0a1f99
Fix NPE
Elisis Nov 1, 2022
fa6dcbe
Merge branch 'master' into beamline
Elisis Nov 1, 2022
3424b2b
Fix merge import fuckery
Elisis Nov 1, 2022
aa3a85a
Fix LINAC structure blueprint/construction
Elisis Nov 1, 2022
f3e9a3c
Spotless :thunkban:
Elisis Nov 1, 2022
a50f890
Actually fix structure check/construction
Elisis Nov 2, 2022
878b200
Specify unit of energy
Elisis Nov 20, 2022
ff6ffea
Add 'acceleratable' quality, localisation of particle naming
Elisis Nov 20, 2022
9285c77
Some niceties for master that i cba doing later on
Elisis Nov 20, 2022
4753091
Add LINAC focus, energy, rate, particle mechanic, add tricorder messa…
Elisis Nov 20, 2022
df3fa62
Add recipes
Elisis Nov 20, 2022
0299e9b
Add locale for particles, LINAC tricorder message
Elisis Nov 20, 2022
aab4c0a
Remove debug prints
Elisis Nov 20, 2022
994df39
Spotless
Elisis Nov 20, 2022
01a5620
udate BS
Dream-Master Nov 20, 2022
48dc526
Add source chamber multi and its recipes
Elisis Nov 21, 2022
2dd2964
Override beamline content toString for hatch tricorder info
Elisis Nov 23, 2022
0ecc0e7
Fix initial input not appearing
Elisis Nov 23, 2022
3162888
Add more particles, specify units of mass, energy
Elisis Dec 6, 2022
76d2e5e
Add hardcoded type for shielded glass, add mm-lattice crafting item
Elisis Dec 6, 2022
466da96
Add textures for various casing blocks
Elisis Dec 6, 2022
d4e0bc7
Add fine wire, etc. items for mu-metal material
Elisis Dec 6, 2022
5ac6d8d
Add neutron recipe, take into account potential differences in energy…
Elisis Dec 6, 2022
b5e8177
Re-add phosgene recipe, add mm-lattice and glass recipes
Elisis Dec 6, 2022
7c32a0f
Spotless
Elisis Dec 6, 2022
63311d9
Bump BW & GT versions
Elisis Dec 31, 2022
1b81073
Add mod source tooltip to beamline pipe item
Elisis Dec 31, 2022
8ef8853
Add Thorium-234 material
Elisis Dec 31, 2022
693b236
Remove TODOs
Elisis Dec 31, 2022
5f754fe
Add map for cooling fluid inputs/outputs
Elisis Dec 31, 2022
b06df36
Remove logs and TODOs
Elisis Dec 31, 2022
2496635
Clarify javadoc
Elisis Dec 31, 2022
dda2320
Blah blah
Elisis Dec 31, 2022
f5c1f54
Merge branch 'master' into beamline
Elisis Jan 17, 2023
e07f24e
Fix merge issues
Elisis Jan 17, 2023
03c5e71
[ci skip] Update buildscript to RetroFuturaGradle
mitchej123 Jan 29, 2023
171d2d9
[ci skip] Add git-blame-ignore-revs for spotlessApply
mitchej123 Jan 29, 2023
053b176
Fix spotless requirements, apply spotless
Elisis Jan 31, 2023
6f6b717
Fix CoreMod dep
Elisis Feb 11, 2023
1c6ee2b
Simplify getting particle from ID, remove unnecessary logs etc.
Elisis Feb 11, 2023
768ffd3
Comments
Elisis Mar 20, 2023
7f47263
Merge branch 'master' into beamline
Elisis Mar 20, 2023
cc8734c
Fix imports
Elisis Apr 1, 2023
385e5cd
Add synchrotron multiblock basics, add tiered antennae blocks
Elisis Apr 30, 2023
00471ef
Add photolithography mask items
Elisis Apr 30, 2023
fed0b24
Merge branch 'master' into beamline
Elisis Apr 30, 2023
76f4343
Remove logs
Elisis Apr 30, 2023
cfc95cb
Merge branch 'beamline' of https://github.com/GTNewHorizons/GTNH-Lant…
Elisis Apr 30, 2023
7107bc5
Merge pull request #56 from GTNewHorizons/ForgeDirection
Elisis May 1, 2023
e9b73a8
Update references to BW's old casingAdvanced, byte texture methods
Elisis May 1, 2023
78eb29c
Replace bytes with ForgeDirection objects
Elisis May 1, 2023
3ae4ea0
Spotless
Elisis May 1, 2023
d9be985
Fix dependencies (again), bump deprecated texture methods
Elisis May 1, 2023
f8a06d5
Switch to MetaPipeEntity#getTexture from IMetaTileEntity~
Elisis May 1, 2023
b54c04f
Add recipes for masks
Elisis May 2, 2023
bccbdbd
Merge branch 'master' into beamline
Elisis May 2, 2023
0440c0c
Un-spotlessify synchrotron structure
Elisis Jun 5, 2023
44d9d81
Merge branch 'master' into beamline
Elisis Jun 5, 2023
89aa1f6
Add T3 mask recipes
Elisis Jun 7, 2023
d03a167
Spotless
Elisis Jun 7, 2023
aba8905
Merge branch 'master' of https://github.com/GTNewHorizons/GTNH-Lantha…
Elisis Jul 16, 2023
7562f83
Add charge quantity to Particle object
Elisis Jul 18, 2023
bd48136
Add more hatch-adding functionality to synchrotron + add to structure
Elisis Jul 18, 2023
7a2bd77
Forgot to add latest changes
Elisis Jul 18, 2023
c84f842
Structure ist komplett
Elisis Aug 10, 2023
5af1faf
Merge branch 'master' into beamline
Elisis Aug 10, 2023
83f151d
Tweak LINAC math
Elisis Aug 30, 2023
e8fab6f
Fix hatch orientation issue
Elisis Aug 30, 2023
4aad45a
Make synchrotron functional, still not yet completed
Elisis Aug 30, 2023
609e913
Merge branch 'master' into beamline
Elisis Sep 6, 2023
7da24db
Fix math for energy
Elisis Sep 6, 2023
6c29b4b
Merge branch 'beamline' of https://github.com/GTNewHorizons/GTNH-Lant…
Elisis Sep 6, 2023
d061676
Fix math for focus, add more tricorder info
Elisis Sep 9, 2023
39e244d
Fix recipe for T2 mask
Elisis Sep 19, 2023
3cd6e7e
Add Lanthanum hexaboride source chamber electrode, super coolant option
Elisis Sep 20, 2023
981733c
Functional target chamber structure
Elisis Sep 26, 2023
f41cb61
Fix Werkstoff IDs, add more to target chamber recipe functionality
Elisis Sep 29, 2023
dbd655f
Resolve slight ID range conflict
Elisis Sep 29, 2023
95772f2
Merge branch 'master' into beamline
Elisis Sep 29, 2023
db5ab73
Fix merge artifact
Elisis Sep 29, 2023
2f54aff
Update bs
Elisis Sep 29, 2023
92b89b7
Merge branch 'master' into beamline
Elisis Nov 4, 2023
d303726
Fix typo
Elisis Nov 4, 2023
915f5e3
Add dedicated hatch for focus items for the target chamber
Elisis Nov 4, 2023
bb282eb
Fix focus input bus behaviour
Elisis Nov 4, 2023
ef79f86
Fix Target Chamber recipe map, add durability reduction for foci
Elisis Nov 4, 2023
9f00d20
Remove debug logging, fix occasional NPE
Elisis Nov 4, 2023
df844cd
Add forbidden wafer recipe generation variable
Elisis Nov 5, 2023
bdc1cd9
Add autogenned components
Elisis Nov 5, 2023
c987da0
Fix recipe conflict issue, allow items to be consumed again
Elisis Nov 5, 2023
ba6cd2f
Add more to recipe autogeneration, enable NEI
Elisis Nov 5, 2023
aff4d81
Fix recipe maxEnergy always being zero, remove logs
Elisis Nov 5, 2023
fecebe5
Add tricorder info for the target chamber
Elisis Nov 6, 2023
de1fb9a
Add particle items, fix TC recipe page
Elisis Nov 6, 2023
1358f91
Add fake particle item to TC recipe NEI page
Elisis Nov 12, 2023
fe240a1
Fix TC NEI page layout, allow identical input items to be used for mu…
Elisis Nov 13, 2023
c0246d3
Adjust 'recipes' popup location on NEI page
Elisis Nov 13, 2023
70784f7
Fix SC NEI page, add particle item to output
Elisis Nov 14, 2023
e5a3265
Remove logs, fix localisation, adjust SC NEI page
Elisis Nov 15, 2023
5196908
Remove dreamcraft dep
Elisis Dec 2, 2023
025ac05
Bump GT5U
Elisis Dec 15, 2023
9893e92
Revert above change, need to branch off
Elisis Dec 15, 2023
5c65024
Bump GT5U
Elisis Dec 15, 2023
da64bea
Rework beamline recipes to support miozune's recipeadder refactor
Elisis Dec 16, 2023
10b26a4
Merge pull request #76 from GTNewHorizons/beamline-with-ra
Elisis Dec 16, 2023
d37aa56
Merge branch 'master' into beamline
Elisis Dec 16, 2023
da5880a
Remove some imports
Elisis Dec 16, 2023
18588ed
Merge branch 'beamline' of https://github.com/GTNewHorizons/GTNH-Lant…
Elisis Dec 16, 2023
8f1d9fe
Merge pull request #77 from GTNewHorizons/beamline-with-ra
Elisis Dec 16, 2023
1926f93
Remove duplicate methods in multis
Elisis Dec 16, 2023
7825f32
adjust some energies for ICs
Elisis Dec 20, 2023
b799942
Adjust math for synchrotron and linac to broaden the possible range o…
Elisis Dec 20, 2023
af72e36
Add beamline-related recipes
Elisis Dec 20, 2023
cee015b
Add photomask textures (thanks EmeraldsEmerald), and fix texture doma…
Elisis Jan 16, 2024
0227eff
Allow for survival autoplacing
Elisis Jan 21, 2024
597a68e
Bring over DT and Digester changes from master to beamline
Elisis Apr 4, 2024
fa2e191
Merge and fix merge artifacts
Elisis Apr 4, 2024
e9b3ba4
Merge branch 'master' into beamline
Elisis May 10, 2024
8a813d5
update
Dream-Master May 10, 2024
03b1dc8
update
Dream-Master May 10, 2024
bee8373
update core mod
Dream-Master May 10, 2024
e09036d
Add focus manipulator & antenna recipes
Elisis May 10, 2024
28ba13c
Merge
Elisis May 10, 2024
4692632
Fix BlockRenderer preview for LINAC, SC, TC, add recipes to some casi…
Elisis May 10, 2024
a8ad2e7
Spotless
Elisis May 10, 2024
60e35ac
Add Partially Consumed tooltip & overlay for masks in the TC NEI page
Elisis May 10, 2024
c7c9a07
update + sa
Dream-Master May 10, 2024
c35ba33
Fix LINAc NEI preview, improve tooltip information for several multis
Elisis May 11, 2024
79e91d4
Merge branch 'beamline' of https://github.com/GTNewHorizons/GTNH-Lant…
Elisis May 11, 2024
a01b61a
Spotless
Elisis May 11, 2024
4eb6a56
Detatch beamline hatch textures from EM data textures
Elisis May 11, 2024
4f7ea2b
Fix mistake, set standard item texture domain properly
Elisis May 11, 2024
39b37d6
sa
Dream-Master May 11, 2024
eab0385
Fix Target Receptacle name, add TC casing recipes
Elisis May 14, 2024
6e77dce
Spotless
Elisis May 14, 2024
32b66b4
Merge branch 'beamline' of https://github.com/GTNewHorizons/GTNH-Lant…
Elisis May 14, 2024
c727261
update
Dream-Master May 14, 2024
195d766
Fix Synchrotron NEI preview, clarify TC addRecipe method
Elisis May 15, 2024
654e89e
Merge branch 'beamline' of https://github.com/GTNewHorizons/GTNH-Lant…
Elisis May 15, 2024
759665d
Add to synchrotron tooltip
Elisis May 16, 2024
a55a036
Fix ugly Synchrotron structure
Elisis May 16, 2024
99b7b03
Fix beamline hatch texture issues
Elisis May 16, 2024
426edc9
Add textures (credit goes to juan_elcazador/BlueHero233 for the non-T…
Elisis May 16, 2024
58d649e
Spotless
Elisis May 16, 2024
404b74d
Add No Coolant shutdown reason to LINAC
Elisis May 16, 2024
b6cedb4
update
Dream-Master May 17, 2024
48ed380
Add coolant error messages for Synchrotron and LINAC
Elisis May 18, 2024
7ef3ad6
Merge branch 'beamline' of https://github.com/GTNewHorizons/GTNH-Lant…
Elisis May 18, 2024
8a80cd8
Merge branch 'beamline' of https://github.com/GTNewHorizons/GTNH-Lant…
Elisis May 18, 2024
7ddf946
Merge branch 'beamline' of https://github.com/GTNewHorizons/GTNH-Lant…
Elisis May 18, 2024
4c4bd79
update
Dream-Master May 19, 2024
6bbf3af
Recipes and correct power usage of multis
Elisis May 23, 2024
70cce40
Merge branch 'beamline' of https://github.com/GTNewHorizons/GTNH-Lant…
Elisis May 23, 2024
c86a991
Spotmore
Elisis May 23, 2024
0c5cadd
Update spotless
eigenraven May 25, 2024
9e2e983
Merge branch 'master' into beamline
eigenraven May 25, 2024
d702121
Merge branch 'master' into beamline
eigenraven May 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ dependencies {
api('com.github.GTNewHorizons:GT5-Unofficial:5.09.46.23:dev')
implementation('com.github.GTNewHorizons:GTplusplus:1.12.10:dev')
implementation('com.github.GTNewHorizons:GoodGenerator:0.9.5:dev')
implementation('com.github.GTNewHorizons:NewHorizonsCoreMod:2.4.8:dev')
}
2 changes: 2 additions & 0 deletions repositories.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// Add any additional repositories for your dependencies here

repositories {
mavenLocal()

}
53 changes: 30 additions & 23 deletions src/main/java/com/elisis/gtnhlanth/GTNHLanthanides.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
package com.elisis.gtnhlanth;

import java.util.Arrays;
import java.util.logging.Logger;

import net.minecraftforge.oredict.OreDictionary;

import com.elisis.gtnhlanth.common.CommonProxy;
import com.elisis.gtnhlanth.common.register.BotWerkstoffMaterialPool;
import com.elisis.gtnhlanth.common.register.LanthItemList;
import com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool;
import com.elisis.gtnhlanth.common.tileentity.recipe.beamline.BeamlineRecipeLoader;
import com.elisis.gtnhlanth.loader.BotRecipes;
import com.elisis.gtnhlanth.loader.RecipeLoader;
import com.github.bartimaeusnek.bartworks.API.WerkstoffAdderRegistry;
import com.github.bartimaeusnek.bartworks.system.material.Werkstoff;

import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
Expand All @@ -21,8 +18,6 @@
import cpw.mods.fml.common.event.FMLLoadCompleteEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_Log;

@Mod(
modid = Tags.MODID,
Expand All @@ -46,9 +41,13 @@ public class GTNHLanthanides {

@EventHandler
public static void preInit(FMLPreInitializationEvent e) {

WerkstoffAdderRegistry.addWerkstoffAdder(new WerkstoffMaterialPool());
WerkstoffAdderRegistry.addWerkstoffAdder(new BotWerkstoffMaterialPool());
LanthItemList.register();

LanthItemList.registerTypical();
LanthItemList.registerGTMTE();

// GregTech_API.sAfterGTPostload.add(new ZPMRubberChanges());
proxy.preInit(e);
}
Expand All @@ -61,37 +60,45 @@ public static void init(FMLInitializationEvent e) {

@EventHandler
public static void postInit(FMLPostInitializationEvent e) {

RecipeLoader.loadGeneral();
RecipeLoader.loadLanthanideRecipes();
RecipeLoader.addRandomChemCrafting();
RecipeLoader.loadAccelerator();

BeamlineRecipeLoader.load();

BotRecipes.addGTRecipe();
// RecipeLoader.loadZylonRecipes();
proxy.postInit(e);
// GT_Log.out.print(FluidRegistry.getFluid("Sodium Tungstate").getName());

GT_Log.out.print(
Arrays.toString(
Werkstoff.werkstoffNameHashMap.keySet()
.toArray()));
GT_Log.out.print(
Arrays.toString(
Werkstoff.werkstoffHashMap.keySet()
.toArray()));

GT_Log.out.print(
"HMMM " + Arrays.toString(
OreDictionary
.getOreIDs(WerkstoffMaterialPool.DephosphatedSamariumConcentrate.get(OrePrefixes.dust, 1))));
// GT_Log.out.print(Arrays.toString(Werkstoff.werkstoffNameHashMap.keySet().toArray()));
// GT_Log.out.print(Arrays.toString(Werkstoff.werkstoffHashMap.keySet().toArray()));

/*
* GT_Log.out.print("HMMM " + Arrays.toString(OreDictionary.getOreIDs(
* WerkstoffMaterialPool.DephosphatedSamariumConcentrate.get(OrePrefixes.dust, 1))));
*/
}

@EventHandler
public static void onModLoadingComplete(FMLLoadCompleteEvent e) {
GT_Log.out.print("AAAAAAAAAAAAAA");
// GT_Log.out.print("AAAAAAAAAAAAAA " + new
// ItemStack(LanthItemList.maskMap.get(MaskList.CPU)).getUnlocalizedName());
//
GT_Log.out.print("We are done loading");
// GT_Log.out.print("We are done loading");
BotRecipes.removeRecipes();
RecipeLoader.removeCeriumSources();

GT_Log.out.print("blah blah " + WerkstoffMaterialPool.PTMEGElastomer.hasGenerationFeature(OrePrefixes.ingot));
/*
* for (GT_ItemStack stack : BeamlineRecipeAdder.instance.TargetChamberRecipes.mRecipeItemMap.keySet()) {
* GT_Log.out.print(" Recipes for: " + stack.mItem.getUnlocalizedName() + ": "); for (GT_Recipe recipe :
* BeamlineRecipeAdder.instance.TargetChamberRecipes.mRecipeItemMap.get(stack)) {
* GT_Log.out.print(Arrays.toString(recipe.mOutputs)); } }
*/

// GT_Log.out.print("blah blah " +
// WerkstoffMaterialPool.PTMEGElastomer.hasGenerationFeature(OrePrefixes.ingot));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package com.elisis.gtnhlanth.common.beamline;

public class BeamInformation {

private float energy; // in keV
private int rate;

private Particle particle;
private int particleId;

private float focus;

public BeamInformation(float energy, int rate, int particleId, float focus) {
this.energy = energy;
this.rate = rate;
this.particleId = particleId;
this.particle = Particle.values()[particleId];
this.focus = focus;
}

public float getEnergy() {
return this.energy;
}

public int getRate() {
return this.rate;
}

public Particle getParticle() {
return this.particle;
}

public int getParticleId() {
return this.particleId;
}

public float getFocus() {
return this.focus;
}

@Override
public String toString() {
return "Energy=" + this.getEnergy()
+ ",Rate="
+ this.getRate()
+ ",Particle="
+ this.getParticleId()
+ ",Focus="
+ this.getFocus();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package com.elisis.gtnhlanth.common.beamline;

import net.minecraft.nbt.NBTTagCompound;

import com.github.technus.tectech.mechanics.dataTransport.DataPacket;

public class BeamLinePacket extends DataPacket<BeamInformation> {

public BeamLinePacket(BeamInformation content) {
super(content);
}

public BeamLinePacket(NBTTagCompound compound) {
super(compound);
}

@Override
protected BeamInformation contentFromNBT(NBTTagCompound nbt) {
/*
* NBTTagCompound compound = nbt.getCompoundTag("beamline");
*/
return new BeamInformation(
nbt.getFloat("energy"),
nbt.getInteger("rate"),
nbt.getInteger("particleId"),
nbt.getInteger("focus"));
}

@Override
protected NBTTagCompound contentToNBT() {

NBTTagCompound compound = new NBTTagCompound();

compound.setFloat("energy", content.getEnergy());
compound.setInteger("rate", content.getRate());
compound.setInteger("particleId", content.getParticleId());
compound.setFloat("focus", content.getFocus());

return compound;
}

@Override
public boolean extraCheck() {
// TODO Auto-generated method stub
return true;
}

@Override
protected BeamInformation unifyContentWith(BeamInformation arg0) {
throw new NoSuchMethodError("Unavailable to unify beam info data packet");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.elisis.gtnhlanth.common.beamline;

import net.minecraftforge.common.util.ForgeDirection;

import gregtech.api.interfaces.metatileentity.IMetaTileEntity;

public interface IConnectsToBeamline extends IMetaTileEntity {

boolean canConnect(ForgeDirection side);

IConnectsToBeamline getNext(IConnectsToBeamline source);

boolean isDataInputFacing(ForgeDirection side);
}
71 changes: 71 additions & 0 deletions src/main/java/com/elisis/gtnhlanth/common/beamline/Particle.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
package com.elisis.gtnhlanth.common.beamline;

import net.minecraft.util.StatCollector;

public enum Particle {

ELECTRON(true, 0, 0.511f, 5000, "electron", "e\u207B", -1, null),
PHOTON(false, 1, 0, 0, "photon", "\u03B3", 0, null),
NEUTRON(false, 2, 939.57f, 15000, "neutron", "n\u2070", 0, null),
PROTON(true, 3, 938.27f, 15000, "proton", "p\u207A", 1, null),
ALPHA(true, 4, 3727.38f, 8000, "alpha", "\u03B1", 2, null);

private boolean canAcc;

private float restMass; // in MeV

private float maxSourceEnergy; // in keV

private String name;
private String shortName;

private float charge; // in multiples of elemental charge

private String chargeSpecial;

private Particle(boolean canAcc, int id, float restMass, float maxSourceEnergy, String name, String shortName,
float charge, String chargeSpecial) { // ID
// is
// symbolic
// only
this.canAcc = canAcc;
this.restMass = restMass;
this.maxSourceEnergy = maxSourceEnergy;
this.name = name;
this.shortName = shortName;
this.charge = charge;
this.chargeSpecial = chargeSpecial;
}

public float getMass() {
return this.restMass;
}

public float getCharge() {
return this.charge;
}

public String getChargeSpecial() {
return this.chargeSpecial;
}

public boolean canAccelerate() {
return this.canAcc;
}

public float maxSourceEnergy() {
return this.maxSourceEnergy;
}

public String getName() {
return this.name;
}

public String getLocalisedName() {
return StatCollector.translateToLocal("particle." + this.name) + " (" + this.shortName + ")";
}

public static Particle getParticleFromId(int id) {
return Particle.values()[id];
}
}
Loading