Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/1.20.1' into 1.20.1
Browse files Browse the repository at this point in the history
  • Loading branch information
screret committed Oct 24, 2023
2 parents 88bdedf + 8b3e342 commit a7d5c92
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- fix Dyson Sphere Casing recipe
- fix lang issues
- add Atomic Casing recipe
- fix dyson crash on fabric

0.0.2.a:
- fix fabric
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ public interface IDysonSystem {

void tick();

void setDirty();
void setChanged();
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void tick(ServerLevel level) {
}

timeNeededMaintenance++;
this.system.setDirty();
this.system.setChanged();
return;
}

Expand All @@ -59,13 +59,13 @@ public float getCollapseChance() {
public void needsMaintenance() {
this.needsMaintenance = true;
this.timeNeededMaintenance++;
this.system.setDirty();
this.system.setChanged();
}

public void fixMaintenance() {
this.needsMaintenance = false;
this.timeNeededMaintenance = 0;
this.system.setDirty();
this.system.setChanged();
}

public void setCollapsed() {
Expand All @@ -75,7 +75,7 @@ public void setCollapsed() {

private boolean calculateTime(int timeSinceLastTick) {
setTimeActive(timeSinceLastTick + getTimeActive());
this.system.setDirty();
this.system.setChanged();
var value = getTimeActive() - MINIMUM_MAINTENANCE_TIME;
if (value > 0) {
setTimeActive(value);
Expand All @@ -86,7 +86,7 @@ private boolean calculateTime(int timeSinceLastTick) {

public void setControllerPos(BlockPos controllerPos) {
this.controllerPos = controllerPos;
this.system.setDirty();
this.system.setChanged();
}

public void save(CompoundTag tag) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ public void tick() {
}
}

@Override
public void setChanged() {
this.setDirty();
}

public void load(CompoundTag arg) {
if (arg.contains("dysonSphere", Tag.TAG_COMPOUND)) {
this.currentActiveSunBlock = DysonSphere.load(arg.getCompound("dysonSphere"), this);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package argent_matter.gcys.common.machine.multiblock;

import argent_matter.gcys.api.space.planet.Planet;
import argent_matter.gcys.common.data.GCySBlocks;
import argent_matter.gcys.common.data.GCySEntities;
import argent_matter.gcys.common.data.GCySItems;
Expand Down Expand Up @@ -115,8 +116,11 @@ public void handleDisplayClick(String componentData, ClickData clickData) {
private void onSaveSlotChanged() {
ItemStack saveStack = this.configSaveSlot.getStackInSlot(0);
if (GCySItems.ID_CHIP.isIn(saveStack)) {
Planet planet = PlanetIdChipBehaviour.getPlanetFromStack(saveStack);
if (planet == null) return;

ItemStack keyCardStack = GCySItems.KEYCARD.asStack(1);
KeyCardBehaviour.setSavedStation(keyCardStack, PlanetIdChipBehaviour.getSpaceStationId(saveStack), PlanetIdChipBehaviour.getPlanetFromStack(saveStack));
KeyCardBehaviour.setSavedStation(keyCardStack, PlanetIdChipBehaviour.getSpaceStationId(saveStack), planet);
this.configLoadSlot.setStackInSlot(0, keyCardStack);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ public static void init(RegistrateLangProvider provider) {
provider.add("metaitem.planet_id_circuit.id", "Currently selected planet: ");
provider.add("metaitem.planet_id_circuit.station", "To in-orbit space station (ID: %s)");

// materials

// machines
provider.add("gcys.machine.satellite_jammer.jammed", "Jammed %s");
provider.add("gcys.machine.satellite_jammer.position", "At %s");
Expand All @@ -71,6 +69,7 @@ public static void init(RegistrateLangProvider provider) {
provider.add("key.startRocket", "Start RocketEntity");
provider.add("key.categories.gcys", "Gregicality Space");

// GUIs
provider.add("menu.gcys.dyson_sphere.needs_maintenance", "DYSON SPHERE REQUIRES MAINTENANCE");
provider.add("menu.gcys.dyson_sphere.time_since_needed_maintenance", "Time since last maintenance: %s seconds");
provider.add("menu.gcys.dyson_sphere.implosion_chance", "Chance of implosion: %.2f%%");
Expand Down

0 comments on commit a7d5c92

Please sign in to comment.