diff options
| author | Tec <daniel112092@gmail.com> | 2019-07-13 20:30:57 +0200 |
|---|---|---|
| committer | Tec <daniel112092@gmail.com> | 2019-07-13 20:30:57 +0200 |
| commit | e7d27642960690b73044dd5ecf9227d43a88fcbb (patch) | |
| tree | 75472e642db25ff11e4e50502f291c4f8380111b /src/main/java/com | |
| parent | 8f159adc12a15e8e7e2ebfc44acc69058128d064 (diff) | |
| parent | 99708323b391b108d035ba483da82f4aa2211b1c (diff) | |
| download | GT5-Unofficial-e7d27642960690b73044dd5ecf9227d43a88fcbb.tar.gz GT5-Unofficial-e7d27642960690b73044dd5ecf9227d43a88fcbb.tar.bz2 GT5-Unofficial-e7d27642960690b73044dd5ecf9227d43a88fcbb.zip | |
Merge branch 'betterParametrizers' into BassAddons
# Conflicts:
# src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java
# src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java
Diffstat (limited to 'src/main/java/com')
31 files changed, 420 insertions, 124 deletions
diff --git a/src/main/java/com/github/technus/tectech/TecTech.java b/src/main/java/com/github/technus/tectech/TecTech.java index 6f1c4fc7a0..337f493801 100644 --- a/src/main/java/com/github/technus/tectech/TecTech.java +++ b/src/main/java/com/github/technus/tectech/TecTech.java @@ -4,6 +4,7 @@ import com.github.technus.tectech.loader.MainLoader; import com.github.technus.tectech.loader.TecTechConfig; import com.github.technus.tectech.mechanics.ConvertFloat; import com.github.technus.tectech.mechanics.ConvertInteger; +import com.github.technus.tectech.mechanics.chunkData.ChunkDataHandler; import com.github.technus.tectech.mechanics.elementalMatter.core.commands.GiveEM; import com.github.technus.tectech.mechanics.elementalMatter.core.commands.ListEM; import com.github.technus.tectech.proxy.CommonProxy; @@ -34,6 +35,8 @@ public class TecTech { private static IngameErrorLog moduleAdminErrorLogs; public static TecTechConfig configTecTech; + public static ChunkDataHandler chunkDataHandler=new ChunkDataHandler(); + /** * For Loader.isModLoaded checks during the runtime */ @@ -93,4 +96,9 @@ public class TecTech { pEvent.registerServerCommand(new GiveEM()); } } + + @Mod.EventHandler + public void onServerStarting(FMLServerStartingEvent aEvent) { + chunkDataHandler.onServerStarting(); + } } diff --git a/src/main/java/com/github/technus/tectech/Util.java b/src/main/java/com/github/technus/tectech/Util.java index c550203874..e333e70137 100644 --- a/src/main/java/com/github/technus/tectech/Util.java +++ b/src/main/java/com/github/technus/tectech/Util.java @@ -41,7 +41,7 @@ public final class Util { @SuppressWarnings("ComparatorMethodParameterNotUsed") public static <K, V extends Comparable<? super V>> SortedSet<Map.Entry<K, V>> entriesSortedByValues(Map<K, V> map) { - SortedSet<Map.Entry<K, V>> sortedEntries = new TreeSet<Map.Entry<K, V>>( + SortedSet<Map.Entry<K, V>> sortedEntries = new TreeSet<>( (e1, e2) -> { int res = e1.getValue().compareTo(e2.getValue()); return res != 0 ? res : 1; // Special fix to preserve items with equal values @@ -1159,7 +1159,7 @@ public final class Util { c++;//depth } output.add("}"); - return output.toArray(new String[output.size()]); + return output.toArray(new String[0]); } private static final Pattern matchE_ = Pattern.compile("(E,(E,)+)"); diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/AspectDefinitionCompatEnabled.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/AspectDefinitionCompatEnabled.java index 91523326db..da930a1d79 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/AspectDefinitionCompatEnabled.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/AspectDefinitionCompatEnabled.java @@ -30,7 +30,7 @@ public final class AspectDefinitionCompatEnabled extends AspectDefinitionCompat aspectToDef.put("perditio",magic_entropy); ArrayList<Aspect> list=Aspect.getCompoundAspects(); - Aspect[] array= list.toArray(new Aspect[list.size()]); + Aspect[] array= list.toArray(new Aspect[0]); while (!list.isEmpty()) { for (Aspect aspect : array) { if (list.contains(aspect)) { diff --git a/src/main/java/com/github/technus/tectech/loader/MainLoader.java b/src/main/java/com/github/technus/tectech/loader/MainLoader.java index 884436a144..425849668d 100644 --- a/src/main/java/com/github/technus/tectech/loader/MainLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/MainLoader.java @@ -239,14 +239,11 @@ public final class MainLoader { } public static void addAfterGregTechPostLoadRunner() { - GregTech_API.sAfterGTPostload.add(new Runnable() { - @Override - public void run() { - if(TecTech.configTecTech.NERF_FUSION) { - FixBrokenFusionRecipes(); - } - GT_MetaTileEntity_EM_collider.setValues(getFuelValue(Materials.Helium.getPlasma(125))); + GregTech_API.sAfterGTPostload.add(() -> { + if(TecTech.configTecTech.NERF_FUSION) { + FixBrokenFusionRecipes(); } + GT_MetaTileEntity_EM_collider.setValues(getFuelValue(Materials.Helium.getPlasma(125))); }); } diff --git a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java index dcd7f526d7..f96794c795 100644 --- a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java @@ -17,7 +17,6 @@ import net.minecraft.item.ItemStack; import static com.github.technus.tectech.CommonValues.V;
import static com.github.technus.tectech.thing.CustomItemList.*;
-import static com.github.technus.tectech.thing.CustomItemList.eM_dynamotunnel9001;
/**
* Created by danie_000 on 16.11.2016.
diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java new file mode 100644 index 0000000000..f0669431a9 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java @@ -0,0 +1,32 @@ +package com.github.technus.tectech.mechanics.anomaly; + +import com.github.technus.tectech.mechanics.chunkData.ChunkDataHandler; +import com.github.technus.tectech.mechanics.chunkData.ChunkMetaDataHandler; +import cpw.mods.fml.common.gameevent.TickEvent; +import net.minecraft.nbt.NBTTagCompound; + +import java.util.HashMap; + +public class AnomalyHandler implements ChunkMetaDataHandler { + + @Override + public String getTagName() { + return "Anomaly"; + } + + @Override + public void mergeData(NBTTagCompound target, NBTTagCompound loadedData) { + target.setInteger("intensity", + target.getInteger("intensity")+loadedData.getInteger("intensity")); + } + + @Override + public NBTTagCompound createData() { + return new NBTTagCompound(); + } + + @Override + public void TickData(HashMap<Integer, ChunkDataHandler.ChunkHashMap> data, TickEvent.ServerTickEvent event) { + + } +} diff --git a/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkDataHandler.java b/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkDataHandler.java new file mode 100644 index 0000000000..50a92d6178 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkDataHandler.java @@ -0,0 +1,229 @@ +package com.github.technus.tectech.mechanics.chunkData; + +import cpw.mods.fml.common.gameevent.TickEvent; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraftforge.event.world.ChunkDataEvent; + +import java.util.*; + +public class ChunkDataHandler { + private final String BASE_TAG_NAME ="TecTechData"; + private final HashMap<Integer,HashMap<ChunkCoordIntPair, NBTChunk>> dimensionWiseChunkData=new HashMap<>(); + private final HashMap<String,HashMap<Integer,ChunkHashMap >> dimensionWiseMetaChunkData=new HashMap<>(); + private final HashMap<String,ChunkMetaDataHandler> metaDataHandlerHashMap =new HashMap<>(); + + public void handleChunkSaveEvent(ChunkDataEvent.Save event) { + HashMap<ChunkCoordIntPair, NBTChunk> dimensionData=dimensionWiseChunkData.get(event.world.provider.dimensionId); + NBTChunk chunkData =dimensionData!=null?dimensionData.get(event.getChunk().getChunkCoordIntPair()):null; + if(chunkData==null) { + event.getData().removeTag(BASE_TAG_NAME); + } else { + chunkData.isLoaded=true; + event.getData().setTag(BASE_TAG_NAME,chunkData.data); + } + } + + public void handleChunkLoadEvent(ChunkDataEvent.Load event) { + NBTTagCompound loadedTag=event.getData().getCompoundTag(BASE_TAG_NAME); + if(loadedTag.hasNoTags()){ + return; + } + + int dimId=event.world.provider.dimensionId; + HashMap<ChunkCoordIntPair, NBTChunk> dimensionMemory= + dimensionWiseChunkData.computeIfAbsent(dimId, this::createDimensionData); + + ChunkCoordIntPair chunkCoordIntPair=event.getChunk().getChunkCoordIntPair(); + NBTChunk chunkMemory =dimensionMemory.get(chunkCoordIntPair); + Set<String> loadedKeys=loadedTag.func_150296_c(); + + if(chunkMemory==null) { + chunkMemory=new NBTChunk(loadedTag,true); + dimensionMemory.put(chunkCoordIntPair,chunkMemory); + for (String s :loadedKeys) { + dimensionWiseMetaChunkData.get(s).get(dimId).putLoaded(chunkCoordIntPair, loadedTag.getCompoundTag(s)); + } + }else if(!chunkMemory.isLoaded) { + chunkMemory.isLoaded=true; + + Set<String> tagsDuplicated=new HashSet(loadedKeys); + tagsDuplicated.retainAll(chunkMemory.data.func_150296_c()); + + if (tagsDuplicated.isEmpty()) { + for (String s:loadedKeys) { + NBTTagCompound tag=loadedTag.getCompoundTag(s); + chunkMemory.data.setTag(s,tag); + dimensionWiseMetaChunkData.get(s).get(dimId).putLoaded(chunkCoordIntPair,tag); + } + } else { + for (String s : loadedKeys) { + NBTTagCompound memory=chunkMemory.data.getCompoundTag(s); + if(tagsDuplicated.contains(s)){ + metaDataHandlerHashMap.get(s).mergeData(memory,loadedTag.getCompoundTag(s)); + }else { + chunkMemory.data.setTag(s,loadedTag.getCompoundTag(s)); + dimensionWiseMetaChunkData.get(s).get(dimId).putLoaded(chunkCoordIntPair,memory); + } + } + } + } + } + + public void tickData(TickEvent.ServerTickEvent event){ + dimensionWiseMetaChunkData.forEach((k, v) -> metaDataHandlerHashMap.get(k).TickData(v, event)); + } + + public void onServerStarting() { + dimensionWiseChunkData.clear(); + dimensionWiseMetaChunkData.clear(); + } + + public void registerChunkMetaDataHandler(ChunkMetaDataHandler handler){ + metaDataHandlerHashMap.put(handler.getTagName(),handler); + dimensionWiseMetaChunkData.put(handler.getTagName(),new HashMap<>()); + } + + public NBTTagCompound getChunkData(ChunkMetaDataHandler handler, World world, Chunk chunk){ + return getChunkData(handler,world.provider.dimensionId,chunk.getChunkCoordIntPair()); + } + + public NBTTagCompound getChunkData(ChunkMetaDataHandler handler, int world, ChunkCoordIntPair chunk){ + return dimensionWiseMetaChunkData.get(handler.getTagName()).get(world).get(chunk); + } + + public NBTTagCompound computeIfAbsentChunkData(ChunkMetaDataHandler handler, World world, Chunk chunk){ + return computeIfAbsentChunkData(handler,world.provider.dimensionId,chunk.getChunkCoordIntPair()); + } + + public NBTTagCompound computeIfAbsentChunkData(ChunkMetaDataHandler handler, int world, ChunkCoordIntPair chunk){ + return dimensionWiseMetaChunkData.get(handler.getTagName()).get(world) + .computeIfAbsent(chunk,chunkCoordIntPair -> handler.createData()); + } + + public HashMap<Integer,ChunkHashMap> getChunkData(ChunkMetaDataHandler chunkMetaDataHandler){ + return dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()); + } + + public ChunkHashMap getChunkData(ChunkMetaDataHandler chunkMetaDataHandler,World world){ + return dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()).get(world.provider.dimensionId); + } + + public ChunkHashMap getChunkData(ChunkMetaDataHandler chunkMetaDataHandler,int world){ + return dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()).get(world); + } + + private HashMap<ChunkCoordIntPair, NBTChunk> createDimensionData(Integer dim) { + HashMap<ChunkCoordIntPair, NBTChunk> map = new HashMap<>(); + for (String meta : metaDataHandlerHashMap.keySet()) { + dimensionWiseMetaChunkData.get(meta).put(dim, new ChunkHashMap(meta, map)); + } + return map; + } + + public static class ChunkHashMap implements Map<ChunkCoordIntPair,NBTTagCompound>{ + private final HashMap<ChunkCoordIntPair,NBTChunk> storage; + private final HashMap<ChunkCoordIntPair,NBTTagCompound> storageMeta=new HashMap<>(1024); + private final String meta; + + private ChunkHashMap(String meta, HashMap<ChunkCoordIntPair, NBTChunk> storage) { + this.storage =storage; + this.meta=meta; + } + + private void putLoaded(ChunkCoordIntPair key, NBTTagCompound value) { + storageMeta.put(key, value); + } + + @Override + public NBTTagCompound remove(Object key) { + NBTTagCompound compound=storageMeta.remove(key); + if(compound!=null) { + NBTChunk chunk = storage.get(key); + chunk.data.removeTag(meta); + if(chunk.data.hasNoTags()){ + storage.remove(key); + } + } + return compound; + } + + @Override + public NBTTagCompound put(ChunkCoordIntPair key, NBTTagCompound value) { + NBTChunk chunk = storage.get(key); + if(chunk==null){ + NBTTagCompound base=new NBTTagCompound(); + base.setTag(meta,value); + storage.put(key,new NBTChunk(base,false)); + }else { + chunk.data.setTag(meta,value); + } + return storageMeta.put(key, value); + } + + @Override + public int size() { + return storageMeta.size(); + } + + @Override + public boolean isEmpty() { + return storageMeta.isEmpty(); + } + + @Override + public NBTTagCompound get(Object key) { + return storageMeta.get(key); + } + + @Override + public void clear() { + entrySet().forEach(this::remove); + } + + @Override + public void putAll(Map<? extends ChunkCoordIntPair, ? extends NBTTagCompound> m) { + m.forEach(this::put); + } + + @Override + public boolean containsKey(Object key) { + return storageMeta.containsKey(key); + } + + @Override + public boolean containsValue(Object value) { + return storageMeta.containsValue(value); + } + + @Override + public Set<ChunkCoordIntPair> keySet() { + return storageMeta.keySet(); + } + + @Override + public Collection<NBTTagCompound> values() { + return storageMeta.values(); + } + + @Override + public Set<Entry<ChunkCoordIntPair, NBTTagCompound>> entrySet() { + return storageMeta.entrySet(); + } + } + + private static class NBTChunk { + private final NBTTagCompound data; + private boolean isLoaded; + + private NBTChunk(NBTTagCompound data, boolean isLoaded) { + if(data==null){ + data=new NBTTagCompound(); + } + this.data = data; + this.isLoaded = isLoaded; + } + } +} diff --git a/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkMetaDataHandler.java b/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkMetaDataHandler.java new file mode 100644 index 0000000000..420f24f46d --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkMetaDataHandler.java @@ -0,0 +1,14 @@ +package com.github.technus.tectech.mechanics.chunkData; + +import cpw.mods.fml.common.gameevent.TickEvent; +import net.minecraft.nbt.NBTTagCompound; + +import java.util.HashMap; + +public interface ChunkMetaDataHandler { + String getTagName(); + void mergeData(NBTTagCompound target, NBTTagCompound loadedData); + NBTTagCompound createData(); + void TickData(HashMap<Integer, ChunkDataHandler.ChunkHashMap> data, TickEvent.ServerTickEvent event); +} + diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalDecay.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalDecay.java index 7f56ee8e5b..7d5e079876 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalDecay.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalDecay.java @@ -8,7 +8,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElem * Created by danie_000 on 22.10.2016. */ public final class cElementalDecay { - public static final cElementalDecay[] noDecay = (cElementalDecay[]) null; + public static final cElementalDecay[] noDecay = null; //DECAY IMPOSSIBLE!!! //Do not use regular NULL java will not make it work with varargs!!! //Or cast null into ARRAY type but this static is more convenient!!! diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalStackMap.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalStackMap.java index 19f5789804..fb6acec084 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalStackMap.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalStackMap.java @@ -48,12 +48,12 @@ abstract class cElementalStackMap implements Comparable<cElementalStackMap> { public final cElementalDefinitionStack[] values() { Collection<cElementalDefinitionStack> var = map.values(); - return var.toArray(new cElementalDefinitionStack[var.size()]); + return var.toArray(new cElementalDefinitionStack[0]); } public final iElementalDefinition[] keys() { Set<iElementalDefinition> var = map.keySet(); - return var.toArray(new iElementalDefinition[var.size()]); + return var.toArray(new iElementalDefinition[0]); } public long getCountOfAllAmounts(){ diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/commands/GiveEM.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/commands/GiveEM.java index ad8d1ad8c8..333359949f 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/commands/GiveEM.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/commands/GiveEM.java @@ -45,8 +45,7 @@ public class GiveEM implements ICommand { }else{ TecTech.LOGGER.info("Spawninig EM for "+((EntityPlayerMP) sender).getDisplayName()+" - "+Arrays.toString(args)); - ArrayList<String> list=new ArrayList<>(); - list.addAll(Arrays.asList(args)); + ArrayList<String> list = new ArrayList<>(Arrays.asList(args)); String energy=list.remove(0); cElementalDefinitionStack def= getDefinitionStack(list); diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/commands/ListEM.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/commands/ListEM.java index 9e034f4655..20110c0b0d 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/commands/ListEM.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/commands/ListEM.java @@ -29,7 +29,7 @@ public class ListEM implements ICommand { sender.addChatMessage(new ChatComponentText(" Available Classes: tag - name")); Map<Byte,Method> binds= cElementalDefinition.getBindsComplex(); for (Map.Entry<Byte,Method> e:binds.entrySet()) { - sender.addChatMessage(new ChatComponentText(String.valueOf((char)e.getKey().byteValue())+" - "+e.getValue().getReturnType().getSimpleName())); + sender.addChatMessage(new ChatComponentText((char) e.getKey().byteValue() +" - "+e.getValue().getReturnType().getSimpleName())); } }else if(args.length==1){ sender.addChatMessage(new ChatComponentText(" Available Primitives: symbol - name")); diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/rElementalRecipe.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/rElementalRecipe.java index c2fd9a81d4..e191cc0e0a 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/rElementalRecipe.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/rElementalRecipe.java @@ -38,13 +38,7 @@ public class rElementalRecipe implements Comparable<rElementalRecipe> { if(compare!=0) { return compare; } - if(ID>o.ID) { - return 1; - } - if(ID<o.ID) { - return -1; - } - return 0; + return Short.compare(ID, o.ID); } @Override diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/rElementalRecipeMap.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/rElementalRecipeMap.java index c289fc94ae..ed5e46f43f 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/rElementalRecipeMap.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/rElementalRecipeMap.java @@ -15,11 +15,7 @@ public class rElementalRecipeMap {//TODO FIX } public rElementalRecipe put(rElementalRecipe in) { - HashMap<Short, rElementalRecipe> r = recipes.get(in.inEM); - if (r == null) { - r = new HashMap<>(); - recipes.put(in.inEM, r); - } + HashMap<Short, rElementalRecipe> r = recipes.computeIfAbsent(in.inEM, k -> new HashMap<>()); return r.put(in.ID, in);//IF THIS RETURN SHIT, it means that inputs are using the exact same types of matter as input - (non amount wise collision) //It is either bad, or unimportant if you use different id's } diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/templates/cElementalPrimitive.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/templates/cElementalPrimitive.java index bcd46c579a..749d5c687b 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/templates/cElementalPrimitive.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/templates/cElementalPrimitive.java @@ -251,13 +251,7 @@ public abstract class cElementalPrimitive extends cElementalDefinition { public final int compareTo(iElementalDefinition o) { if (getClassType() == o.getClassType()) { int oID = ((cElementalPrimitive) o).ID; - if (ID > oID) { - return 1; - } - if (ID < oID) { - return -1; - } - return 0; + return Integer.compare(ID, oID); } return compareClassID(o); } diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/atom/dAtomDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/atom/dAtomDefinition.java index 99e80b7be2..86d31bfb1b 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/atom/dAtomDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/atom/dAtomDefinition.java @@ -396,35 +396,35 @@ public final class dAtomDefinition extends cElementalDefinition { switch (decayMode) { case -2: if(TecTech.RANDOM.nextBoolean() && ElectronCapture(decaysList)) { - return decaysList.toArray(new cE |
