mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Fixed satellite loot being overridden by lunar mining ship
This commit is contained in:
parent
ea9dc777fb
commit
c5d1960842
@ -7,7 +7,7 @@ import net.minecraft.item.ItemStack;
|
|||||||
|
|
||||||
public class SatelliteLunarMiner extends SatelliteMiner {
|
public class SatelliteLunarMiner extends SatelliteMiner {
|
||||||
static {
|
static {
|
||||||
registerCargo(new WeightedRandomObject[] {
|
registerCargo(SatelliteLunarMiner.class, new WeightedRandomObject[] {
|
||||||
new WeightedRandomObject(new ItemStack(ModBlocks.moon_turf, 48), 5),
|
new WeightedRandomObject(new ItemStack(ModBlocks.moon_turf, 48), 5),
|
||||||
new WeightedRandomObject(new ItemStack(ModBlocks.moon_turf, 32), 7),
|
new WeightedRandomObject(new ItemStack(ModBlocks.moon_turf, 32), 7),
|
||||||
new WeightedRandomObject(new ItemStack(ModBlocks.moon_turf, 16), 5),
|
new WeightedRandomObject(new ItemStack(ModBlocks.moon_turf, 16), 5),
|
||||||
|
|||||||
@ -7,11 +7,46 @@ import net.minecraft.init.Items;
|
|||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
public class SatelliteMiner extends Satellite {
|
public class SatelliteMiner extends Satellite {
|
||||||
/**
|
/**
|
||||||
* {@link WeightedRandomObject} array with loot the satellite will deliver.
|
* {@link WeightedRandomObject} array with loot the satellite will deliver.
|
||||||
*/
|
*/
|
||||||
private static WeightedRandomObject[] CARGO = new WeightedRandomObject[] {
|
private static final HashMap<Class<? extends SatelliteMiner>, WeightedRandomObject[]> CARGO = new HashMap<>();
|
||||||
|
|
||||||
|
public long lastOp;
|
||||||
|
|
||||||
|
public SatelliteMiner() {
|
||||||
|
this.satIface = Interfaces.NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void writeToNBT(NBTTagCompound nbt) {
|
||||||
|
nbt.setLong("lastOp", lastOp);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void readFromNBT(NBTTagCompound nbt) {
|
||||||
|
lastOp = nbt.getLong("lastOp");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Replaces cargo of the satellite.
|
||||||
|
* @param cargo - Array of {@link WeightedRandomObject} representing the loot that will be delivered.
|
||||||
|
*/
|
||||||
|
public static void registerCargo(Class<? extends SatelliteMiner> minerSatelliteClass, WeightedRandomObject[] cargo) {
|
||||||
|
CARGO.put(minerSatelliteClass, cargo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets items the satellite can deliver.
|
||||||
|
* @return - Array of {@link WeightedRandomObject} of satellite loot.
|
||||||
|
*/
|
||||||
|
public WeightedRandomObject[] getCargo() {
|
||||||
|
return CARGO.get(getClass());
|
||||||
|
}
|
||||||
|
|
||||||
|
static {
|
||||||
|
registerCargo(SatelliteMiner.class, new WeightedRandomObject[] {
|
||||||
new WeightedRandomObject(new ItemStack(ModItems.powder_aluminium, 3), 10),
|
new WeightedRandomObject(new ItemStack(ModItems.powder_aluminium, 3), 10),
|
||||||
new WeightedRandomObject(new ItemStack(ModItems.powder_iron, 3), 10),
|
new WeightedRandomObject(new ItemStack(ModItems.powder_iron, 3), 10),
|
||||||
new WeightedRandomObject(new ItemStack(ModItems.powder_titanium, 2), 8),
|
new WeightedRandomObject(new ItemStack(ModItems.powder_titanium, 2), 8),
|
||||||
@ -39,35 +74,6 @@ public class SatelliteMiner extends Satellite {
|
|||||||
new WeightedRandomObject(new ItemStack(ModItems.crystal_trixite, 1), 1),
|
new WeightedRandomObject(new ItemStack(ModItems.crystal_trixite, 1), 1),
|
||||||
new WeightedRandomObject(new ItemStack(ModItems.crystal_starmetal, 1), 1),
|
new WeightedRandomObject(new ItemStack(ModItems.crystal_starmetal, 1), 1),
|
||||||
new WeightedRandomObject(new ItemStack(ModItems.crystal_lithium, 2), 4)
|
new WeightedRandomObject(new ItemStack(ModItems.crystal_lithium, 2), 4)
|
||||||
};
|
});
|
||||||
|
|
||||||
public long lastOp;
|
|
||||||
|
|
||||||
public SatelliteMiner() {
|
|
||||||
this.satIface = Interfaces.NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void writeToNBT(NBTTagCompound nbt) {
|
|
||||||
nbt.setLong("lastOp", lastOp);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void readFromNBT(NBTTagCompound nbt) {
|
|
||||||
lastOp = nbt.getLong("lastOp");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Replaces cargo of the satellite.
|
|
||||||
* @param cargo - Array of {@link WeightedRandomObject} representing the loot that will be delivered.
|
|
||||||
*/
|
|
||||||
public static void registerCargo(WeightedRandomObject[] cargo) {
|
|
||||||
CARGO = cargo;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets items the satellite can deliver.
|
|
||||||
* @return - Array of {@link WeightedRandomObject} of satellite loot.
|
|
||||||
*/
|
|
||||||
public WeightedRandomObject[] getCargo() {
|
|
||||||
return CARGO;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user