Skip to content

Commit 9d7ec4a

Browse files
committed
Probably final Tracked commit
- Add option for quantum assembler dupe tick time - Fix fission reactor meltdown logic ( math ) - Dont send any empty packets
1 parent 9088dcb commit 9d7ec4a

6 files changed

Lines changed: 47 additions & 36 deletions

File tree

build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,5 @@ task releaseJars(type: Copy) {
137137
from coreJar
138138
from nuclearJar
139139
from forcefieldJar
140-
from missilesJar
141140
destinationDir= new File('/releaseJarsOnly/')
142141
}

src/api/physica/api/core/tile/ITileBase.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,10 @@ default void sendDescPacket()
160160
List<Object> list = new ArrayList<>();
161161
writeSynchronizationPacket(list, null);
162162
packetTile.addData(list);
163-
163+
if (list.isEmpty())
164+
{
165+
return;
166+
}
164167
PacketSystem.INSTANCE.sendToAllAround(packetTile, This());
165168
}
166169
}

src/api/physica/library/location/GridLocation.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,14 @@ public float getDistance(double x2, double y2, double z2)
8888
return MathHelper.sqrt_double(d3 * d3 + d4 * d4 + d5 * d5);
8989
}
9090

91+
public double getDistanceSquared(double x2, double y2, double z2)
92+
{
93+
double d3 = xCoord - x2;
94+
double d4 = yCoord - y2;
95+
double d5 = zCoord - z2;
96+
return d3 * d3 + d4 * d4 + d5 * d5;
97+
}
98+
9199
public float getDistance(VectorLocation vector)
92100
{
93101
double d3 = xCoord - vector.x;

src/nuclear/physica/nuclear/common/configuration/ConfigNuclearPhysics.java

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,26 @@
1313

1414
public class ConfigNuclearPhysics implements IContent {
1515

16-
public static String CATEGORY = "NUCLEAR_PHYSICS";
16+
public static String CATEGORY = "NUCLEAR_PHYSICS";
1717

18-
public static float ANTIMATTER_CREATION_SPEED = 1f;
19-
public static boolean ENABLE_PARTICLE_COLLISION = true;
20-
public static boolean ENABLE_PARTICLE_CHUNKLOADING = true;
21-
public static float TURBINE_STEAM_TO_RF_RATIO = 2f;
18+
public static float ANTIMATTER_CREATION_SPEED = 1f;
19+
public static boolean ENABLE_PARTICLE_COLLISION = true;
20+
public static boolean ENABLE_PARTICLE_CHUNKLOADING = true;
21+
public static float TURBINE_STEAM_TO_RF_RATIO = 2f;
2222

23-
public static HashSet<String> PROTECTED_WORLDS = new HashSet<>(Arrays.asList("spawn", "creative"));
24-
public static HashSet<String> QUANTUM_ASSEMBLER_BLACKLIST = new HashSet<>();
25-
public static boolean FLIP_BLACKLIST_TO_WHITELIST = false;
23+
public static HashSet<String> PROTECTED_WORLDS = new HashSet<>(Arrays.asList("spawn", "creative"));
24+
public static HashSet<String> QUANTUM_ASSEMBLER_BLACKLIST = new HashSet<>();
25+
public static int QUANTUM_ASSEMBLER_TICKS_REQUIRED = 120;
26+
public static boolean FLIP_BLACKLIST_TO_WHITELIST = false;
2627

27-
public static int URANIUM_ORE_MIN_Y = 10;
28-
public static int URANIUM_ORE_MAX_Y = 40;
29-
public static int URANIUM_ORE_COUNT = 20;
30-
public static int URANIUM_ORE_BRANCH_SIZE = 3;
31-
public static int URANIUM_ORE_HARVEST_LEVEL = 3;
28+
public static int URANIUM_ORE_MIN_Y = 10;
29+
public static int URANIUM_ORE_MAX_Y = 40;
30+
public static int URANIUM_ORE_COUNT = 20;
31+
public static int URANIUM_ORE_BRANCH_SIZE = 3;
32+
public static int URANIUM_ORE_HARVEST_LEVEL = 3;
3233

33-
public static int PLASMA_STRENGTH = 8;
34-
public static int DARK_MATTER_USES = 8;
34+
public static int PLASMA_STRENGTH = 8;
35+
public static int DARK_MATTER_USES = 8;
3536

3637
@Override
3738
public void register(LoadPhase phase)
@@ -58,6 +59,7 @@ public void register(LoadPhase phase)
5859

5960
QUANTUM_ASSEMBLER_BLACKLIST = new HashSet<>(
6061
Arrays.asList(configuration.getStringList("quantum_assembler_blacklist", CATEGORY, QUANTUM_ASSEMBLER_BLACKLIST.toArray(new String[0]), "Items which are blacklisted from use in the quantum assembler")));
62+
QUANTUM_ASSEMBLER_TICKS_REQUIRED = configuration.getInt("quantum_assembler_ticks_required", CATEGORY, QUANTUM_ASSEMBLER_TICKS_REQUIRED, 0, 100000, "How meny ticks that are required to dupe one item in the assembler");
6163
FLIP_BLACKLIST_TO_WHITELIST = configuration.getBoolean("flip_blacklist_to_whitelist", CATEGORY, FLIP_BLACKLIST_TO_WHITELIST, "True to turn the blacklist into a whitelist; False to ignore");
6264

6365
TURBINE_STEAM_TO_RF_RATIO = configuration.getFloat("turbineSteamToRfRatio", CATEGORY, TURBINE_STEAM_TO_RF_RATIO, 0.01f, 100f, "Ratio for turbines to convert one ml of steam into rf.");

src/nuclear/physica/nuclear/common/tile/TileFissionReactor.java

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -271,25 +271,24 @@ public void performMeltdown()
271271
World().setBlockToAir(loc.xCoord, loc.yCoord, loc.zCoord);
272272
return;
273273
}
274-
int power = (int) (temperature / 125.0f);
275274
setInventorySlotContents(SLOT_INPUT, null);
276-
GridLocation location = new GridLocation(loc.xCoord, loc.yCoord, loc.zCoord);
277-
for (int i = -power; i <= power; i++)
278-
{
279-
for (int j = -power; j <= power; j++)
280-
{
281-
for (int k = -power; k <= power; k++)
282-
{
283-
location.set(loc.xCoord + i, loc.yCoord + j, loc.zCoord + k);
284-
Block block = location.getBlock(World());
285-
if (block == Blocks.water || block == Blocks.flowing_water)
286-
{
287-
location.setBlockAirNonUpdate(World());
288-
}
289-
}
290-
}
291-
}
292-
World().createExplosion(null, loc.xCoord, loc.yCoord, loc.zCoord, 8, true);
275+
GridLocation currentLocation = new GridLocation(loc.xCoord, loc.yCoord, loc.zCoord);
276+
final int size = 10;
277+
for (int i = -size; i <= size; i++) {
278+
for (int j = -size; j <= size; j++) {
279+
for (int k = -size; k <= size; k++) {
280+
if (loc.getDistanceSquared(loc.xCoord + i, loc.yCoord + j, loc.zCoord + k) >= size * size) {
281+
continue;
282+
}
283+
currentLocation.set(loc.xCoord + i, loc.yCoord + j, loc.zCoord + k);
284+
Block block = currentLocation.getBlock(World());
285+
if (block == Blocks.water || block == Blocks.flowing_water) {
286+
currentLocation.setBlockAirNonUpdate(World());
287+
}
288+
}
289+
}
290+
}
291+
World().createExplosion(null, loc.xCoord, loc.yCoord, loc.zCoord, size, true);
293292
World().setBlock(loc.xCoord, loc.yCoord, loc.zCoord, NuclearBlockRegister.blockMeltedReactor);
294293
}
295294

src/nuclear/physica/nuclear/common/tile/TileQuantumAssembler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
public class TileQuantumAssembler extends TileBasePoweredContainer implements IGuiInterface {
2424

25-
public static final int TICKS_REQUIRED = 120;
25+
public static final int TICKS_REQUIRED = ConfigNuclearPhysics.QUANTUM_ASSEMBLER_TICKS_REQUIRED;
2626
public static final int SLOT_INPUT = 6;
2727
public static final int SLOT_OUTPUT = 7;
2828
public static final int POWER_USAGE = ElectricityUtilities.convertEnergy(71000, Unit.WATT, Unit.RF);

0 commit comments

Comments
 (0)