Skip to content

Commit

Permalink
Probably final Tracked commit
Browse files Browse the repository at this point in the history
- Add option for quantum assembler dupe tick time
- Fix fission reactor meltdown logic ( math )
- Dont send any empty packets
  • Loading branch information
aurilisdev committed Mar 26, 2020
1 parent 9088dcb commit 9d7ec4a
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 36 deletions.
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,5 @@ task releaseJars(type: Copy) {
from coreJar
from nuclearJar
from forcefieldJar
from missilesJar
destinationDir= new File('/releaseJarsOnly/')
}
5 changes: 4 additions & 1 deletion src/api/physica/api/core/tile/ITileBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,10 @@ default void sendDescPacket()
List<Object> list = new ArrayList<>();
writeSynchronizationPacket(list, null);
packetTile.addData(list);

if (list.isEmpty())
{
return;
}
PacketSystem.INSTANCE.sendToAllAround(packetTile, This());
}
}
Expand Down
8 changes: 8 additions & 0 deletions src/api/physica/library/location/GridLocation.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ public float getDistance(double x2, double y2, double z2)
return MathHelper.sqrt_double(d3 * d3 + d4 * d4 + d5 * d5);
}

public double getDistanceSquared(double x2, double y2, double z2)
{
double d3 = xCoord - x2;
double d4 = yCoord - y2;
double d5 = zCoord - z2;
return d3 * d3 + d4 * d4 + d5 * d5;
}

public float getDistance(VectorLocation vector)
{
double d3 = xCoord - vector.x;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,26 @@

public class ConfigNuclearPhysics implements IContent {

public static String CATEGORY = "NUCLEAR_PHYSICS";
public static String CATEGORY = "NUCLEAR_PHYSICS";

public static float ANTIMATTER_CREATION_SPEED = 1f;
public static boolean ENABLE_PARTICLE_COLLISION = true;
public static boolean ENABLE_PARTICLE_CHUNKLOADING = true;
public static float TURBINE_STEAM_TO_RF_RATIO = 2f;
public static float ANTIMATTER_CREATION_SPEED = 1f;
public static boolean ENABLE_PARTICLE_COLLISION = true;
public static boolean ENABLE_PARTICLE_CHUNKLOADING = true;
public static float TURBINE_STEAM_TO_RF_RATIO = 2f;

public static HashSet<String> PROTECTED_WORLDS = new HashSet<>(Arrays.asList("spawn", "creative"));
public static HashSet<String> QUANTUM_ASSEMBLER_BLACKLIST = new HashSet<>();
public static boolean FLIP_BLACKLIST_TO_WHITELIST = false;
public static HashSet<String> PROTECTED_WORLDS = new HashSet<>(Arrays.asList("spawn", "creative"));
public static HashSet<String> QUANTUM_ASSEMBLER_BLACKLIST = new HashSet<>();
public static int QUANTUM_ASSEMBLER_TICKS_REQUIRED = 120;
public static boolean FLIP_BLACKLIST_TO_WHITELIST = false;

public static int URANIUM_ORE_MIN_Y = 10;
public static int URANIUM_ORE_MAX_Y = 40;
public static int URANIUM_ORE_COUNT = 20;
public static int URANIUM_ORE_BRANCH_SIZE = 3;
public static int URANIUM_ORE_HARVEST_LEVEL = 3;
public static int URANIUM_ORE_MIN_Y = 10;
public static int URANIUM_ORE_MAX_Y = 40;
public static int URANIUM_ORE_COUNT = 20;
public static int URANIUM_ORE_BRANCH_SIZE = 3;
public static int URANIUM_ORE_HARVEST_LEVEL = 3;

public static int PLASMA_STRENGTH = 8;
public static int DARK_MATTER_USES = 8;
public static int PLASMA_STRENGTH = 8;
public static int DARK_MATTER_USES = 8;

@Override
public void register(LoadPhase phase)
Expand All @@ -58,6 +59,7 @@ public void register(LoadPhase phase)

QUANTUM_ASSEMBLER_BLACKLIST = new HashSet<>(
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")));
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");
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");

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.");
Expand Down
35 changes: 17 additions & 18 deletions src/nuclear/physica/nuclear/common/tile/TileFissionReactor.java
Original file line number Diff line number Diff line change
Expand Up @@ -271,25 +271,24 @@ public void performMeltdown()
World().setBlockToAir(loc.xCoord, loc.yCoord, loc.zCoord);
return;
}
int power = (int) (temperature / 125.0f);
setInventorySlotContents(SLOT_INPUT, null);
GridLocation location = new GridLocation(loc.xCoord, loc.yCoord, loc.zCoord);
for (int i = -power; i <= power; i++)
{
for (int j = -power; j <= power; j++)
{
for (int k = -power; k <= power; k++)
{
location.set(loc.xCoord + i, loc.yCoord + j, loc.zCoord + k);
Block block = location.getBlock(World());
if (block == Blocks.water || block == Blocks.flowing_water)
{
location.setBlockAirNonUpdate(World());
}
}
}
}
World().createExplosion(null, loc.xCoord, loc.yCoord, loc.zCoord, 8, true);
GridLocation currentLocation = new GridLocation(loc.xCoord, loc.yCoord, loc.zCoord);
final int size = 10;
for (int i = -size; i <= size; i++) {
for (int j = -size; j <= size; j++) {
for (int k = -size; k <= size; k++) {
if (loc.getDistanceSquared(loc.xCoord + i, loc.yCoord + j, loc.zCoord + k) >= size * size) {
continue;
}
currentLocation.set(loc.xCoord + i, loc.yCoord + j, loc.zCoord + k);
Block block = currentLocation.getBlock(World());
if (block == Blocks.water || block == Blocks.flowing_water) {
currentLocation.setBlockAirNonUpdate(World());
}
}
}
}
World().createExplosion(null, loc.xCoord, loc.yCoord, loc.zCoord, size, true);
World().setBlock(loc.xCoord, loc.yCoord, loc.zCoord, NuclearBlockRegister.blockMeltedReactor);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

public class TileQuantumAssembler extends TileBasePoweredContainer implements IGuiInterface {

public static final int TICKS_REQUIRED = 120;
public static final int TICKS_REQUIRED = ConfigNuclearPhysics.QUANTUM_ASSEMBLER_TICKS_REQUIRED;
public static final int SLOT_INPUT = 6;
public static final int SLOT_OUTPUT = 7;
public static final int POWER_USAGE = ElectricityUtilities.convertEnergy(71000, Unit.WATT, Unit.RF);
Expand Down

0 comments on commit 9d7ec4a

Please sign in to comment.