mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-08-10 17:55:44 +00:00
guh
This commit is contained in:
parent
ab5e5d9be2
commit
6d6d15136c
@ -8,7 +8,12 @@
|
||||
|
||||
## Changed
|
||||
* AUTOCAL's `first` and `last` instructions now support variable substitution
|
||||
* Spy satellites now have the `getsmog` command, checking for soot pollution on the current target coordinate
|
||||
|
||||
## Fixed
|
||||
* Fixed pile fuel loader temperature reading not working
|
||||
* Fixed mining satellite NEI handling
|
||||
* Fixed crash caused by non-miner satellite ID chips in the cargo landing pad
|
||||
* Potentially fixed ID-shift affecting satellites launched pre-update
|
||||
* Fixed xenium resonator item mapping being incorrect, creating a relay satellite instead
|
||||
* Fixed a potential crash caused by accessing out-of-range data on the radar satellite
|
||||
@ -1028,7 +1028,7 @@ public class AssemblyMachineRecipes extends GenericRecipes<GenericRecipe> {
|
||||
new ComparableStack(ModItems.circuit, 24, EnumCircuitType.BISMOID),
|
||||
new ComparableStack(ModItems.part_generic, 16, EnumPartType.LDE),
|
||||
new ComparableStack(ModItems.circuit, 1, EnumCircuitType.CONTROLLER_ADVANCED)));
|
||||
this.register(new GenericRecipe("ass.detectorsat").setup(1_200, 25_000).outputItems(new ItemStack(ModItems.satellite, 1, EnumSatType.RAY_SCAN.ordinal()))
|
||||
this.register(new GenericRecipe("ass.rayscansat").setup(1_200, 25_000).outputItems(new ItemStack(ModItems.satellite, 1, EnumSatType.RAY_SCAN.ordinal()))
|
||||
.inputItems(new OreDictStack(BIGMT.shell(), 16),
|
||||
new ComparableStack(ModItems.photo_panel, 32),
|
||||
new OreDictStack(SBD.wireDense(), 16),
|
||||
|
||||
@ -24,7 +24,7 @@ public abstract class SatelliteBase {
|
||||
public String tx = "";
|
||||
|
||||
public int getID() {
|
||||
return XSatelliteRegistry.satellites.indexOf(this.getClass());
|
||||
return XSatelliteRegistry.idToClass.inverse().get(this.getClass());
|
||||
}
|
||||
|
||||
public abstract String getType();
|
||||
|
||||
@ -53,7 +53,7 @@ public class SatelliteDetector extends SatelliteBase {
|
||||
|
||||
public RadiationBurst getBurstFromIndex(String cmd) {
|
||||
if(cachedResults.size() <= 0) return null;
|
||||
int index = IRORInteractive.parseInt(cmd, 0, cachedResults.size()) - 1;
|
||||
int index = IRORInteractive.parseInt(cmd, 1, cachedResults.size()) - 1;
|
||||
return cachedResults.get(index);
|
||||
}
|
||||
|
||||
|
||||
@ -4,12 +4,17 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.hbm.handler.pollution.PollutionHandler;
|
||||
import com.hbm.handler.pollution.PollutionHandler.PollutionData;
|
||||
import com.hbm.handler.pollution.PollutionHandler.PollutionType;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class SatelliteMapper extends SatelliteBase {
|
||||
|
||||
public static final String CMD_TARGET_LOADED = "targetloaded";
|
||||
public static final String CMD_GETSMOG = "getsmog";
|
||||
public static final String CMD_SPOT_PLAYER = "spotplayers";
|
||||
|
||||
public static final int SPOT_PLAYER_MAX_RANGE = 250;
|
||||
@ -28,6 +33,16 @@ public class SatelliteMapper extends SatelliteBase {
|
||||
return;
|
||||
}
|
||||
|
||||
if(cmd[0].equals(CMD_GETSMOG)) {
|
||||
|
||||
PollutionData data = PollutionHandler.getPollutionData(world, this.targetX, 255, this.targetZ);
|
||||
if(data != null) {
|
||||
float soot = data.pollution[PollutionType.SOOT.ordinal()];
|
||||
this.tx = "" + (int) Math.ceil(soot);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if(cmd[0].equals(CMD_SPOT_PLAYER)) {
|
||||
|
||||
List<String> names = new ArrayList();
|
||||
|
||||
@ -103,7 +103,7 @@ public class SatelliteRadar extends SatelliteBase {
|
||||
|
||||
public Entity getTargetFromIndex(String cmd) {
|
||||
if(filteredRadarResults.size() <= 0) return null;
|
||||
int index = IRORInteractive.parseInt(cmd, 0, filteredRadarResults.size()) - 1;
|
||||
int index = IRORInteractive.parseInt(cmd, 1, filteredRadarResults.size()) - 1;
|
||||
Entity target = filteredRadarResults.get(index);
|
||||
if(target.isDead) return null;
|
||||
return target;
|
||||
|
||||
@ -68,7 +68,7 @@ public class SatelliteRayScan extends SatelliteBase {
|
||||
|
||||
public RayEvent getEventFromIndex(String cmd) {
|
||||
if(cachedResults.size() <= 0) return null;
|
||||
int index = IRORInteractive.parseInt(cmd, 0, cachedResults.size()) - 1;
|
||||
int index = IRORInteractive.parseInt(cmd, 1, cachedResults.size()) - 1;
|
||||
return cachedResults.get(index);
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.hbm.saveddata.satellites;
|
||||
|
||||
import com.google.common.collect.HashBiMap;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.special.ItemSatellite.EnumSatType;
|
||||
@ -8,23 +9,36 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class XSatelliteRegistry {
|
||||
|
||||
public static final List<Class<? extends SatelliteBase>> satellites = new ArrayList<>();
|
||||
public static final HashBiMap<Integer, Class<? extends SatelliteBase>> idToClass = HashBiMap.create(20);
|
||||
public static final HashMap<ComparableStack, Class<? extends SatelliteBase>> itemToClass = new HashMap<>();
|
||||
|
||||
public static void register() {
|
||||
|
||||
// ID mapping
|
||||
idToClass.put(0, SatelliteMapper.class);
|
||||
idToClass.put(1, SatelliteScanner.class);
|
||||
idToClass.put(2, SatelliteRadar.class);
|
||||
idToClass.put(3, SatelliteDeathRay.class);
|
||||
idToClass.put(4, SatelliteResonator.class);
|
||||
idToClass.put(5, SatelliteRelay.class);
|
||||
idToClass.put(6, SatelliteMiner.class);
|
||||
idToClass.put(7, SatelliteLunarMiner.class);
|
||||
idToClass.put(8, SatelliteHorizons.class);
|
||||
idToClass.put(9, SatellitePrecisionLaser.class);
|
||||
idToClass.put(10, SatelliteDetector.class);
|
||||
idToClass.put(11, SatelliteRayScan.class);
|
||||
|
||||
// item to sat type mapping
|
||||
registerSatellite(SatelliteMapper.class, new ComparableStack(ModItems.satellite, 1, EnumSatType.SPY));
|
||||
registerSatellite(SatelliteScanner.class, new ComparableStack(ModItems.satellite, 1, EnumSatType.SCANNER));
|
||||
registerSatellite(SatelliteRadar.class, new ComparableStack(ModItems.satellite, 1, EnumSatType.RADAR));
|
||||
registerSatellite(SatelliteDeathRay.class, new ComparableStack(ModItems.satellite, 1, EnumSatType.DEATH_RAY));
|
||||
registerSatellite(SatelliteResonator.class, new ComparableStack(ModItems.satellite, 1, EnumSatType.XENIUM_RESONATOR));
|
||||
registerSatellite(SatelliteRelay.class, new ComparableStack(ModItems.satellite, 1, EnumSatType.XENIUM_RESONATOR));
|
||||
registerSatellite(SatelliteRelay.class, new ComparableStack(ModItems.satellite, 1, EnumSatType.RELAY));
|
||||
registerSatellite(SatelliteMiner.class, new ComparableStack(ModItems.satellite, 1, EnumSatType.MINER_ASTRO));
|
||||
registerSatellite(SatelliteLunarMiner.class, new ComparableStack(ModItems.satellite, 1, EnumSatType.MINER_LUNAR));
|
||||
registerSatellite(SatelliteHorizons.class, ModItems.sat_gerald);
|
||||
@ -32,13 +46,12 @@ public class XSatelliteRegistry {
|
||||
registerSatellite(SatelliteDetector.class, new ComparableStack(ModItems.satellite, 1, EnumSatType.DETECTOR));
|
||||
registerSatellite(SatelliteRayScan.class, new ComparableStack(ModItems.satellite, 1, EnumSatType.RAY_SCAN));
|
||||
|
||||
|
||||
// and all the legacy crap
|
||||
registerSatellite(SatelliteMapper.class, ModItems.sat_mapper);
|
||||
registerSatellite(SatelliteScanner.class, ModItems.sat_scanner);
|
||||
registerSatellite(SatelliteRadar.class, ModItems.sat_radar);
|
||||
registerSatellite(SatelliteDeathRay.class, ModItems.sat_laser);
|
||||
registerSatellite(SatelliteResonator.class, ModItems.sat_resonator);
|
||||
registerSatellite(SatelliteRelay.class, ModItems.sat_foeq);
|
||||
registerSatellite(SatelliteMiner.class, ModItems.sat_miner);
|
||||
registerSatellite(SatelliteLunarMiner.class, ModItems.sat_lunar_miner);
|
||||
}
|
||||
@ -51,14 +64,12 @@ public class XSatelliteRegistry {
|
||||
@Deprecated
|
||||
public static void registerSatellite(Class<? extends SatelliteBase> sat, Item item) {
|
||||
if(!itemToClass.containsKey(item) && !itemToClass.containsValue(sat)) {
|
||||
satellites.add(sat);
|
||||
itemToClass.put(new ComparableStack(item), sat);
|
||||
}
|
||||
}
|
||||
|
||||
public static void registerSatellite(Class<? extends SatelliteBase> sat, ComparableStack item) {
|
||||
if(!itemToClass.containsKey(item) && !itemToClass.containsValue(sat)) {
|
||||
satellites.add(sat);
|
||||
itemToClass.put(item, sat);
|
||||
}
|
||||
}
|
||||
@ -67,7 +78,6 @@ public class XSatelliteRegistry {
|
||||
if(world.isRemote) return;
|
||||
|
||||
SatelliteSavedData data = SatelliteSavedData.getData(world);
|
||||
|
||||
SatelliteBase existing = data.sats.get(freq);
|
||||
|
||||
if(existing != null) {
|
||||
@ -87,7 +97,7 @@ public class XSatelliteRegistry {
|
||||
|
||||
public static SatelliteBase createFromId(int i) {
|
||||
try {
|
||||
return satellites.get(i).newInstance();
|
||||
return idToClass.get(i).newInstance();
|
||||
} catch(Exception e) { }
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -182,7 +182,7 @@ public class TileEntityMachineSatDock extends TileEntity implements ISidedInvent
|
||||
|
||||
if(rocket.getDataWatcher().getWatchableObjectInt(16) == 1 && rocket.timer == 50) {
|
||||
SatelliteBase sat = data.getSatFromFreq(ISatChip.getFreqS(slots[15]));
|
||||
if(sat != null) unloadCargo((SatelliteMiner) sat);
|
||||
if(sat instanceof SatelliteMiner) unloadCargo((SatelliteMiner) sat);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
11
src/main/resources/assets/hbm/manual/satellite/detector.json
Normal file
11
src/main/resources/assets/hbm/manual/satellite/detector.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "Wideband Radio Emission Detector Satellite",
|
||||
"icon": ["hbm:item.satellite", 1, 9],
|
||||
"trigger": [["hbm:item.satellite", 1, 9]],
|
||||
"title": {
|
||||
"en_US": "Wideband Radio Emission Detector Satellite"
|
||||
},
|
||||
"content": {
|
||||
"en_US": "The wideband radio emission detector is a type of [[satellite|Satellite]] that can detect certain types of high-energy events from the entire map, albeit with low accuracy. The detector can only give a very rough idea of where such an event is taking place, for more accurate results, the area needs to be scanned wither with a [[spy satellite|Spy Satellite]] or [[narrowband scanner|Narrowband Emission Scanning Satellite]].<br><br>The types of events this satellite can pick up are as follows:<br>* Mini nuke explosions (low intensity, accuracy <10,000m)<br>* Radar (medium intensity, accuracy <2,500m)<br>* Particle accelerator operations (medium intensity, accuracy <2,500m)<br>Nuclear explosions (high intensity, accuracy <500m)<br><br>Events are timed, medium intense ones are the shortest lived as they only show up for half a second, while other events can show up for multiple seconds or even up to a minute. It is therefore important to scan any given area multiple times in rapid succession to get an accurate result.<br><br>* '§esurvey§r' will report any recent events that have not timed out yet. The detector's field of view covers the entire map, so there is no range limitations. All detected results are saved to an internal list.<br>* '§ecount§r' will write the amount of detected events to RX.<br>* '§egettype §eindex§r' will write the type (LOW/MEDIUM/HIGH) of the specified event to RX.<br>* '§egetposition §eindex§r' will write the estimated X/Z position of the specified event to RX. The coordinated are separated by semicolon.<br><br>See also:<br>* [[Satellite]]<br>* [[Satellite Ground Station]]"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "Narrowband Emission Scanning Satellite",
|
||||
"icon": ["hbm:item.satellite", 1, 10],
|
||||
"trigger": [["hbm:item.satellite", 1, 10]],
|
||||
"title": {
|
||||
"en_US": "Narrowband Emission Scanning Satellite"
|
||||
},
|
||||
"content": {
|
||||
"en_US": "The narrowband scanner can detect certain high-energy events with high precision in a small area. While the [[wideband detector|Wideband Radio Emission Detector Satellite]] can only give a rough estimation of where a small number of things are happening, the narrowband scanner can detect more types of emission and pinpint their location.<br><br>Types of emissions that can be detected include:<br>* '§6NEUTRON_EMISSION§r' from nuclear reactors<br>* '§6HIGH_ENERGY_PARTICLES§r' from fusion reacotrs and particle accelerators<br>* '§6RADAR_WAVES§r' from terrestrial radar<br>* '§6RADIO_WAVES§r' from satellite ground stations with active TX<br><br>Like with the wideband detector, these emissions are timed, certain events only happen once or in a time interval, so for best results, repeated scans over a timespan are recommended.<br><br>* '§esurvey§r' will perform a scan with a radius of 250m around the target location. The results are saved in an internal list.<br>* '§ecount§r' will write the amount of scan results to RX.<br>* '§egetinfo §eindex§r' will write the specified entry's emission type to RX.<br>* '§egetposition §eindex§r' will write the X/Z position of the specified event to RX. The coordinated are separated by semicolon.<br><br>See also:<br>* [[Satellite]]<br>* [[Satellite Ground Station]]"
|
||||
}
|
||||
}
|
||||
@ -6,6 +6,6 @@
|
||||
"en_US": "Satellite"
|
||||
},
|
||||
"content": {
|
||||
"en_US": "Satellites can be launched into earth orbit using a [[Soyuz]] rocket. Satellites communicate with items and blocks on earth using frequencies, so in order to actually use one, it's necessary to set a random frequency in the satellite ID manager, and then copying that ID to another item, for example a satellite chip.<br><br>Some satellites can perform minor tasks when linked with certain items, like the [[depth scanning satellite|Depth Scanning Satellite]] enabling the neutrino lens, or the [[xenium resonator satellite|Xenium Resonator Satellite]] connected to a satellite laser designator allowing for short range line of sight teleportation. Satellites however are the most powerful when paired with [[Redstone over Radio]] by linking them to a [[ground station|Satellite Ground Station]].<br><br>By using a [[RoR reader|Redstone-over-Radio Reader]], ground stations can receive the RX value, which is received from the connected satellite. Each satellite can only provide one RX value at a time, and the value persists until it changes. The contents of RX depend on what function the satellite has performed prior.<br><br>By using a ground station's TX command, commands can be relayed to the connected satellite. Most commands vary between satellite types, however all satellites have a ground target, i.e. the spot on the surface they are aiming at.<br><br>The common target commands are as follows:<br>* '§esettarget §ex §ez§r' (Example RoR: '§6tx!settarget §6200 §6300§r')<br>* '§egettarget§r' (Example RoR: '§6tx!gettarget§r'), writes the current target X and Z separated by semicolon to the ground station's RX<br>* '§egettargetx§r'<br>* '§egettargetz§r'<br><br>See also:<br>* [[Spy Satellite]]<br>* [[Depth Scanning Satellite]]<br>* [[Radar Satellite]]<br>* [[Asteroid Mining Ship]]<br>* [[Lunar Mining Ship]]<br>* [[Orbital Precision Laser]]<br>* [[Orbital Death Ray]]<br>* [[Xenium Resonator Satellite]]<br>* [[Relay Satellite]]"
|
||||
"en_US": "Satellites can be launched into earth orbit using a [[Soyuz]] rocket. Satellites communicate with items and blocks on earth using frequencies, so in order to actually use one, it's necessary to set a random frequency in the satellite ID manager, and then copying that ID to another item, for example a satellite chip.<br><br>Some satellites can perform minor tasks when linked with certain items, like the [[depth scanning satellite|Depth Scanning Satellite]] enabling the neutrino lens, or the [[xenium resonator satellite|Xenium Resonator Satellite]] connected to a satellite laser designator allowing for short range line of sight teleportation. Satellites however are the most powerful when paired with [[Redstone over Radio]] by linking them to a [[ground station|Satellite Ground Station]].<br><br>By using a [[RoR reader|Redstone-over-Radio Reader]], ground stations can receive the RX value, which is received from the connected satellite. Each satellite can only provide one RX value at a time, and the value persists until it changes. The contents of RX depend on what function the satellite has performed prior.<br><br>By using a ground station's TX command, commands can be relayed to the connected satellite. Most commands vary between satellite types, however all satellites have a ground target, i.e. the spot on the surface they are aiming at.<br><br>The common target commands are as follows:<br>* '§esettarget §ex §ez§r' (Example RoR: '§6tx!settarget §6200 §6300§r')<br>* '§egettarget§r' (Example RoR: '§6tx!gettarget§r'), writes the current target X and Z separated by semicolon to the ground station's RX<br>* '§egettargetx§r'<br>* '§egettargetz§r'<br><br>See also:<br>* [[Spy Satellite]]<br>* [[Depth Scanning Satellite]]<br>* [[Radar Satellite]]<br>* [[Asteroid Mining Ship]]<br>* [[Lunar Mining Ship]]<br>* [[Orbital Precision Laser]]<br>* [[Orbital Death Ray]]<br>* [[Xenium Resonator Satellite]]<br>* [[Relay Satellite]]<br>* [[Wideband Radio Emission Detector Satellite]]"
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,6 +6,6 @@
|
||||
"en_US": "Spy Satellite"
|
||||
},
|
||||
"content": {
|
||||
"en_US": "The spy satellite allows remote viewing of earth's surface. Due to RoR pixel displays not existing as of now, surface mapping functionality does not yet work. However, they can be used in detecting loaded chunks and spotting players in a small radius.<br><br>* '§etargetloaded§r' writes 'TRUE' or 'FALSE' to RX depending on if the chunk that the satellite is pointed at is loaded or not.<br>* '§espotplayers§r' detects surface players in a 250 block radius and writes all names separated by semicolon to RX.<br><br>See also:<br>* [[Satellite]]<br>* [[Satellite Ground Station]]"
|
||||
"en_US": "The spy satellite allows remote viewing of earth's surface. Due to RoR pixel displays not existing as of now, surface mapping functionality does not yet work. However, they can be used in detecting loaded chunks and spotting players in a small radius.<br><br>* '§etargetloaded§r' writes 'TRUE' or 'FALSE' to RX depending on if the chunk that the satellite is pointed at is loaded or not.<br>* '$egetsmog$r' writes the numeric value (rounded up) of the current target position's soot pollution to RX.<br>* '§espotplayers§r' detects surface players in a 250 block radius and writes all names separated by semicolon to RX.<br><br>See also:<br>* [[Satellite]]<br>* [[Satellite Ground Station]]"
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user