diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d3451a403..f110ddc9e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,9 +31,9 @@ jobs: - name: Build Angular run: npm run build --prefix buildSrc/src/main/resources/website - name: Setup Fabric files - run: ./gradlew fabric:setupFiles -PminecraftVersion="${{ matrix.minecraft }}" -PpatreonApiKey="${{ secrets.PATREON_API_KEY }}" + run: ./gradlew fabric:setupFiles -PminecraftVersion="${{ matrix.minecraft }}" -PcrowdinApiKey="${{ secrets.CROWDIN_API_KEY }}" -PpatreonApiKey="${{ secrets.PATREON_API_KEY }}" - name: Setup Forge files - run: ./gradlew forge:setupFiles -PminecraftVersion="${{ matrix.minecraft }}" -PpatreonApiKey="${{ secrets.PATREON_API_KEY }}" + run: ./gradlew forge:setupFiles -PminecraftVersion="${{ matrix.minecraft }}" - name: Build ${{ matrix.minecraft }} run: ./gradlew build -PminecraftVersion="${{ matrix.minecraft }}" - name: Build ${{ matrix.minecraft }} (server) diff --git a/.github/workflows/crowdin.yml b/.github/workflows/crowdin.yml index c5e431a2e..002b45638 100644 --- a/.github/workflows/crowdin.yml +++ b/.github/workflows/crowdin.yml @@ -10,7 +10,7 @@ jobs: - name: Upload Translations to Crowdin env: MY_KEY: ${{ secrets.CROWDIN_API_KEY }} - if: ${{ env.MY_KEY != '' && github.ref == 'refs/heads/master' }} + if: ${{ env.MY_KEY != '' }} uses: crowdin/github-action@master with: upload_sources: true diff --git a/.gitignore b/.gitignore index 013fd061b..e0f944749 100644 --- a/.gitignore +++ b/.gitignore @@ -44,6 +44,7 @@ forge/src/main/resources/META-INF **/website/*.json **/website/src/app/entity/generated **/website/src/styles.css +**/website/src/theme.scss **/website/.gitignore fabric.mod.json mtr.accesswidener diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 243c9a9f0..8333d896b 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -4,6 +4,7 @@ repositories { dependencies { implementation "com.google.code.gson:gson:+" + implementation "com.github.crowdin:crowdin-api-client-java:+" implementation "it.unimi.dsi:fastutil:+" implementation "commons-io:commons-io:+" implementation "org.apache.httpcomponents:httpmime:+" @@ -14,6 +15,7 @@ dependencies { repositories { flatDir { dirs "../libs" } + maven { url "https://jitpack.io" } } java { diff --git a/buildSrc/src/main/java/org/mtr/mod/BuildTools.java b/buildSrc/src/main/java/org/mtr/mod/BuildTools.java index 4aff07f7d..50a243c60 100644 --- a/buildSrc/src/main/java/org/mtr/mod/BuildTools.java +++ b/buildSrc/src/main/java/org/mtr/mod/BuildTools.java @@ -1,5 +1,8 @@ package org.mtr.mod; +import com.crowdin.client.Client; +import com.crowdin.client.core.model.Credentials; +import com.crowdin.client.translations.model.CrowdinTranslationCreateProjectBuildForm; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -30,6 +33,8 @@ import java.util.Locale; import java.util.Map; import java.util.stream.Stream; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; public class BuildTools { @@ -42,6 +47,7 @@ public class BuildTools { private final int majorVersion; private static final Logger LOGGER = LogManager.getLogger("Build"); + private static final long CROWDIN_PROJECT_ID = 455212; public BuildTools(String minecraftVersion, String loader, Project project) throws IOException { this.minecraftVersion = minecraftVersion; @@ -108,6 +114,32 @@ public String getForgeVersion() { return getJson("https://files.minecraftforge.net/net/minecraftforge/forge/promotions_slim.json").getAsJsonObject().getAsJsonObject("promos").get(minecraftVersion + "-latest").getAsString(); } + public void downloadTranslations(String key) throws IOException, InterruptedException { + if (!key.isEmpty()) { + final CrowdinTranslationCreateProjectBuildForm crowdinTranslationCreateProjectBuildForm = new CrowdinTranslationCreateProjectBuildForm(); + crowdinTranslationCreateProjectBuildForm.setSkipUntranslatedStrings(false); + crowdinTranslationCreateProjectBuildForm.setSkipUntranslatedFiles(false); + crowdinTranslationCreateProjectBuildForm.setExportApprovedOnly(false); + + final Client client = new Client(new Credentials(key, null)); + final long buildId = client.getTranslationsApi().buildProjectTranslation(CROWDIN_PROJECT_ID, crowdinTranslationCreateProjectBuildForm).getData().getId(); + + while (!client.getTranslationsApi().checkBuildStatus(CROWDIN_PROJECT_ID, buildId).getData().getStatus().equals("finished")) { + Thread.sleep(1000); + } + + try (final InputStream inputStream = new URL(client.getTranslationsApi().downloadProjectTranslations(CROWDIN_PROJECT_ID, buildId).getData().getUrl()).openStream()) { + try (final ZipInputStream zipInputStream = new ZipInputStream(inputStream)) { + ZipEntry zipEntry; + while ((zipEntry = zipInputStream.getNextEntry()) != null) { + FileUtils.write(path.resolve("src/main/resources/assets/mtr/lang").resolve(zipEntry.getName().toLowerCase(Locale.ENGLISH)).toFile(), IOUtils.toString(zipInputStream, StandardCharsets.UTF_8), StandardCharsets.UTF_8); + zipInputStream.closeEntry(); + } + } + } + } + } + public void generateTranslations() throws IOException { final StringBuilder stringBuilder = new StringBuilder("package org.mtr.mod.generated.lang;import org.mtr.mapping.holder.MutableText;import org.mtr.mapping.holder.Text;import org.mtr.mapping.mapper.GraphicsHolder;import org.mtr.mapping.mapper.TextHelper;public interface TranslationProvider{\n"); JsonParser.parseString(FileUtils.readFileToString(path.resolve("src/main/resources/assets/mtr/lang/en_us.json").toFile(), StandardCharsets.UTF_8)).getAsJsonObject().entrySet().forEach(entry -> { diff --git a/buildSrc/src/main/resources/website/src/app/app.component.ts b/buildSrc/src/main/resources/website/src/app/app.component.ts index 53fe5fecc..3d26623ef 100644 --- a/buildSrc/src/main/resources/website/src/app/app.component.ts +++ b/buildSrc/src/main/resources/website/src/app/app.component.ts @@ -13,7 +13,6 @@ import {LargeTileComponent} from "./component/large-button/large-tile.component" @Component({ selector: "app-root", - standalone: true, imports: [ MatStepperModule, MatProgressSpinnerModule, diff --git a/buildSrc/src/main/resources/website/src/app/component/accordion/accordion.component.ts b/buildSrc/src/main/resources/website/src/app/component/accordion/accordion.component.ts index b0ba2d4d5..47d932c5e 100644 --- a/buildSrc/src/main/resources/website/src/app/component/accordion/accordion.component.ts +++ b/buildSrc/src/main/resources/website/src/app/component/accordion/accordion.component.ts @@ -1,22 +1,16 @@ import {Component, EventEmitter, Input, Output, TemplateRef} from "@angular/core"; import {MatButtonModule} from "@angular/material/button"; import {MatIconModule} from "@angular/material/icon"; -import {MatAccordion, MatExpansionPanel, MatExpansionPanelActionRow, MatExpansionPanelContent, MatExpansionPanelHeader, MatExpansionPanelTitle} from "@angular/material/expansion"; +import {MatExpansionModule} from "@angular/material/expansion"; import {MatTooltip} from "@angular/material/tooltip"; import {NgTemplateOutlet} from "@angular/common"; @Component({ selector: "app-accordion", - standalone: true, imports: [ MatButtonModule, MatIconModule, - MatAccordion, - MatExpansionPanel, - MatExpansionPanelActionRow, - MatExpansionPanelContent, - MatExpansionPanelHeader, - MatExpansionPanelTitle, + MatExpansionModule, MatTooltip, NgTemplateOutlet, ], diff --git a/buildSrc/src/main/resources/website/src/app/component/autocomplete/autocomplete.component.ts b/buildSrc/src/main/resources/website/src/app/component/autocomplete/autocomplete.component.ts index f81e15d20..c61ab3fee 100644 --- a/buildSrc/src/main/resources/website/src/app/component/autocomplete/autocomplete.component.ts +++ b/buildSrc/src/main/resources/website/src/app/component/autocomplete/autocomplete.component.ts @@ -5,7 +5,6 @@ import {FormGroup, ReactiveFormsModule} from "@angular/forms"; @Component({ selector: "app-autocomplete", - standalone: true, imports: [ MatInputModule, MatAutocompleteModule, diff --git a/buildSrc/src/main/resources/website/src/app/component/edit-vehicle-model-part/edit-vehicle-model-part.dialog.html b/buildSrc/src/main/resources/website/src/app/component/edit-vehicle-model-part/edit-vehicle-model-part.dialog.html index f65b58e95..d1cdb20e7 100644 --- a/buildSrc/src/main/resources/website/src/app/component/edit-vehicle-model-part/edit-vehicle-model-part.dialog.html +++ b/buildSrc/src/main/resources/website/src/app/component/edit-vehicle-model-part/edit-vehicle-model-part.dialog.html @@ -99,6 +99,10 @@

Model Parts

Next Station (UK) + + Default Text + +
X Padding diff --git a/buildSrc/src/main/resources/website/src/app/component/edit-vehicle-model-part/edit-vehicle-model-part.dialog.ts b/buildSrc/src/main/resources/website/src/app/component/edit-vehicle-model-part/edit-vehicle-model-part.dialog.ts index 13f55ece0..af5190d7d 100644 --- a/buildSrc/src/main/resources/website/src/app/component/edit-vehicle-model-part/edit-vehicle-model-part.dialog.ts +++ b/buildSrc/src/main/resources/website/src/app/component/edit-vehicle-model-part/edit-vehicle-model-part.dialog.ts @@ -4,19 +4,18 @@ import {MatButtonModule} from "@angular/material/button"; import {MatTooltipModule} from "@angular/material/tooltip"; import {DataService} from "../../service/data.service"; import {MatIconModule} from "@angular/material/icon"; -import {ModelPropertiesPartWrapper} from "../../entity/generated/modelPropertiesPartWrapper"; +import {ModelPropertiesPartWrapperDTO} from "../../entity/generated/modelPropertiesPartWrapper"; import {FormControl, FormGroup, FormsModule, ReactiveFormsModule} from "@angular/forms"; import {MatFormField, MatLabel} from "@angular/material/form-field"; import {MatInput} from "@angular/material/input"; import {CREATE_MODEL_PROPERTIES_PART} from "../edit-vehicle-model-parts/edit-vehicle-model-parts.dialog"; import {MatSelectModule} from "@angular/material/select"; import {CdkTextareaAutosize} from "@angular/cdk/text-field"; -import {VehicleModelWrapper} from "../../entity/generated/vehicleModelWrapper"; -import {PartPosition} from "../../entity/generated/partPosition"; +import {VehicleModelWrapperDTO} from "../../entity/generated/vehicleModelWrapper"; +import {PartPositionDTO} from "../../entity/generated/partPosition"; import {MatCheckboxModule} from "@angular/material/checkbox"; @Component({ - standalone: true, imports: [ MatDialogModule, MatButtonModule, @@ -36,7 +35,7 @@ import {MatCheckboxModule} from "@angular/material/checkbox"; }) export class EditVehicleModelPartDialog { private readonly dialogRef = inject(MatDialogRef); - private readonly data = inject<{ model: VehicleModelWrapper, modelPropertiesPart: ModelPropertiesPartWrapper }>(MAT_DIALOG_DATA); + private readonly data = inject<{ model: VehicleModelWrapperDTO, modelPropertiesPart: ModelPropertiesPartWrapperDTO }>(MAT_DIALOG_DATA); protected readonly modelPartNames: string[] = []; protected readonly formGroup; @@ -176,7 +175,7 @@ export class EditVehicleModelPartDialog { this.dialogRef.close(); } - private static positionsToString(positions: PartPosition[]) { + private static positionsToString(positions: PartPositionDTO[]) { return positions.map(position => `${position.x}, ${position.y}, ${position.z}`).join("\n"); } @@ -186,12 +185,12 @@ export class EditVehicleModelPartDialog { const coordinate = parseFloat(coordinateString.replace(/[^\d-.]/g, "")); return Number.isNaN(coordinate) ? 0 : coordinate; }); - return new PartPosition(coordinates[0] ?? 0, coordinates[1] ?? 0, coordinates[2] ?? 0); + return new PartPositionDTO(coordinates[0] ?? 0, coordinates[1] ?? 0, coordinates[2] ?? 0); }); } private static formatPositions(positionsString: string) { - const positions: PartPosition[] = []; + const positions: PartPositionDTO[] = []; EditVehicleModelPartDialog.stringToPositions(positionsString).forEach(position => positions.push(position)); return EditVehicleModelPartDialog.positionsToString(positions); } diff --git a/buildSrc/src/main/resources/website/src/app/component/edit-vehicle-model-parts/edit-vehicle-model-parts.dialog.ts b/buildSrc/src/main/resources/website/src/app/component/edit-vehicle-model-parts/edit-vehicle-model-parts.dialog.ts index eca40d51d..729dc3287 100644 --- a/buildSrc/src/main/resources/website/src/app/component/edit-vehicle-model-parts/edit-vehicle-model-parts.dialog.ts +++ b/buildSrc/src/main/resources/website/src/app/component/edit-vehicle-model-parts/edit-vehicle-model-parts.dialog.ts @@ -3,16 +3,16 @@ import {MAT_DIALOG_DATA, MatDialog, MatDialogModule, MatDialogRef} from "@angula import {MatButtonModule} from "@angular/material/button"; import {MatTooltipModule} from "@angular/material/tooltip"; import {DataService} from "../../service/data.service"; -import {VehicleModelWrapper} from "../../entity/generated/vehicleModelWrapper"; +import {VehicleModelWrapperDTO} from "../../entity/generated/vehicleModelWrapper"; import {MatTable, MatTableModule} from "@angular/material/table"; -import {ModelPropertiesPartWrapper} from "../../entity/generated/modelPropertiesPartWrapper"; +import {ModelPropertiesPartWrapperDTO} from "../../entity/generated/modelPropertiesPartWrapper"; import {MatIconModule} from "@angular/material/icon"; import {MatCheckboxModule} from "@angular/material/checkbox"; -import {PositionDefinition} from "../../entity/generated/positionDefinition"; +import {PositionDefinitionDTO} from "../../entity/generated/positionDefinition"; import {EditVehicleModelPartDialog} from "../edit-vehicle-model-part/edit-vehicle-model-part.dialog"; import {FormControl, FormGroup, ReactiveFormsModule} from "@angular/forms"; -const MAIN_COLUMNS: { id: string, title: string, formatData: (modelPropertiesPart: ModelPropertiesPartWrapper) => string }[] = [ +const MAIN_COLUMNS: { id: string, title: string, formatData: (modelPropertiesPart: ModelPropertiesPartWrapperDTO) => string }[] = [ {id: "positionDefinition", title: "Model Part", formatData: modelPropertiesPart => modelPropertiesPart.positionDefinition.name}, {id: "positions", title: "Positions", formatData: modelPropertiesPart => modelPropertiesPart.positionDefinition.positions.map(({x, y, z}) => `(${x}, ${y}, ${z})`).join("\n")}, {id: "positionsFlipped", title: "Flipped Positions", formatData: modelPropertiesPart => modelPropertiesPart.positionDefinition.positionsFlipped.map(({x, y, z}) => `(${x}, ${y}, ${z})`).join("\n")}, @@ -21,13 +21,13 @@ const MAIN_COLUMNS: { id: string, title: string, formatData: (modelPropertiesPar {id: "type", title: "Type", formatData: modelPropertiesPart => modelPropertiesPart.type}, ]; -const DOOR_COLUMNS: { id: string, title: string, formatData: (modelPropertiesPart: ModelPropertiesPartWrapper) => string }[] = [ +const DOOR_COLUMNS: { id: string, title: string, formatData: (modelPropertiesPart: ModelPropertiesPartWrapperDTO) => string }[] = [ {id: "doorXMultiplier", title: "Door X Multiplier", formatData: modelPropertiesPart => modelPropertiesPart.doorXMultiplier !== 0 || modelPropertiesPart.doorZMultiplier !== 0 ? modelPropertiesPart.doorXMultiplier.toString() : ""}, {id: "doorZMultiplier", title: "Door Z Multiplier", formatData: modelPropertiesPart => modelPropertiesPart.doorXMultiplier !== 0 || modelPropertiesPart.doorZMultiplier !== 0 ? modelPropertiesPart.doorZMultiplier.toString() : ""}, {id: "doorAnimationType", title: "Door Animation", formatData: modelPropertiesPart => modelPropertiesPart.doorXMultiplier !== 0 || modelPropertiesPart.doorZMultiplier !== 0 ? modelPropertiesPart.doorAnimationType : ""}, ]; -const DISPLAY_COLUMNS: { id: string, title: string, formatData: (modelPropertiesPart: ModelPropertiesPartWrapper) => string }[] = [ +const DISPLAY_COLUMNS: { id: string, title: string, formatData: (modelPropertiesPart: ModelPropertiesPartWrapperDTO) => string }[] = [ {id: "displayXPadding", title: "X Padding", formatData: modelPropertiesPart => modelPropertiesPart.type === "DISPLAY" ? modelPropertiesPart.displayXPadding.toString() : ""}, {id: "displayYPadding", title: "Y Padding", formatData: modelPropertiesPart => modelPropertiesPart.type === "DISPLAY" ? modelPropertiesPart.displayYPadding.toString() : ""}, {id: "displayColorCjk", title: "CJK Text Colour", formatData: modelPropertiesPart => modelPropertiesPart.type === "DISPLAY" ? modelPropertiesPart.displayColorCjk : ""}, @@ -39,15 +39,14 @@ const DISPLAY_COLUMNS: { id: string, title: string, formatData: (modelProperties {id: "displayDefaultText", title: "Default Text", formatData: modelPropertiesPart => modelPropertiesPart.type === "DISPLAY" ? modelPropertiesPart.displayDefaultText : ""}, ]; -export const CREATE_MODEL_PROPERTIES_PART = () => new ModelPropertiesPartWrapper( - new PositionDefinition(""), +export const CREATE_MODEL_PROPERTIES_PART = () => new ModelPropertiesPartWrapperDTO( + new PositionDefinitionDTO(""), "NORMAL", "EXTERIOR", "NORMAL", 0, 0, "FF9900", "FF9900", 1.5, 2, 0, "DESTINATION", "Not In Service", 0, 0, "STANDARD", ); @Component({ - standalone: true, imports: [ MatDialogModule, MatButtonModule, @@ -61,14 +60,14 @@ export const CREATE_MODEL_PROPERTIES_PART = () => new ModelPropertiesPartWrapper styleUrl: "edit-vehicle-model-parts.dialog.css", }) export class EditVehicleModelPartsDialog { - @ViewChild(MatTable) table?: MatTable; + @ViewChild(MatTable) table?: MatTable; private readonly dialogRef = inject(MatDialogRef); - private readonly model = inject(MAT_DIALOG_DATA); + private readonly model = inject(MAT_DIALOG_DATA); private readonly dialog = inject(MatDialog); protected readonly modelPartNames: string[] = []; protected readonly allColumns = [...MAIN_COLUMNS, ...DOOR_COLUMNS, ...DISPLAY_COLUMNS]; protected readonly displayedColumnNames: string[] = []; - protected readonly dataSource: ModelPropertiesPartWrapper[] = []; + protected readonly dataSource: ModelPropertiesPartWrapperDTO[] = []; protected readonly formGroup; protected hasNormal = false; protected hasFloorOrDoorway = false; @@ -144,11 +143,11 @@ export class EditVehicleModelPartsDialog { this.edit(modelPropertiesPart); } - edit(modelPropertiesPart: ModelPropertiesPartWrapper) { + edit(modelPropertiesPart: ModelPropertiesPartWrapperDTO) { this.dialog.open(EditVehicleModelPartDialog, {data: {model: this.model, modelPropertiesPart}}).afterClosed().subscribe(() => this.filterData()); } - delete(modelPropertiesPart: ModelPropertiesPartWrapper) { + delete(modelPropertiesPart: ModelPropertiesPartWrapperDTO) { modelPropertiesPart.positionDefinition.name = ""; this.filterData(); this.dataService.update(); diff --git a/buildSrc/src/main/resources/website/src/app/component/edit-vehicle-model-properties/edit-vehicle-model-properties.dialog.ts b/buildSrc/src/main/resources/website/src/app/component/edit-vehicle-model-properties/edit-vehicle-model-properties.dialog.ts index 776407e38..7f16cdba2 100644 --- a/buildSrc/src/main/resources/website/src/app/component/edit-vehicle-model-properties/edit-vehicle-model-properties.dialog.ts +++ b/buildSrc/src/main/resources/website/src/app/component/edit-vehicle-model-properties/edit-vehicle-model-properties.dialog.ts @@ -9,12 +9,11 @@ import {FormatStringListPipe} from "../../pipe/formatStringListPipe"; import {FormatFileNamePipe} from "../../pipe/formatFileNamePipe"; import {AutocompleteComponent} from "../autocomplete/autocomplete.component"; import {MatCheckboxModule} from "@angular/material/checkbox"; -import {VehicleModelWrapper} from "../../entity/generated/vehicleModelWrapper"; +import {VehicleModelWrapperDTO} from "../../entity/generated/vehicleModelWrapper"; import {CREATE_MODEL} from "../edit/edit.component"; -import {VehicleResourceWrapper} from "../../entity/generated/vehicleResourceWrapper"; +import {VehicleResourceWrapperDTO} from "../../entity/generated/vehicleResourceWrapper"; @Component({ - standalone: true, imports: [ MatDialogModule, MatButtonModule, @@ -29,7 +28,7 @@ import {VehicleResourceWrapper} from "../../entity/generated/vehicleResourceWrap }) export class EditVehicleModelPropertiesDialog { private readonly dialogRef = inject(MatDialogRef); - private readonly data = inject<{ vehicleResource: VehicleResourceWrapper, model: VehicleModelWrapper }>(MAT_DIALOG_DATA); + private readonly data = inject<{ vehicleResource: VehicleResourceWrapperDTO, model: VehicleModelWrapperDTO }>(MAT_DIALOG_DATA); private readonly customModelList: { [key: string]: number }; private readonly minecraftModelList: { [key: string]: number }; private readonly customTextureList: { [key: string]: number }; diff --git a/buildSrc/src/main/resources/website/src/app/component/edit-vehicle-properties/edit-vehicle-properties.dialog.ts b/buildSrc/src/main/resources/website/src/app/component/edit-vehicle-properties/edit-vehicle-properties.dialog.ts index 414bed7cb..2caf2c184 100644 --- a/buildSrc/src/main/resources/website/src/app/component/edit-vehicle-properties/edit-vehicle-properties.dialog.ts +++ b/buildSrc/src/main/resources/website/src/app/component/edit-vehicle-properties/edit-vehicle-properties.dialog.ts @@ -11,10 +11,9 @@ import {MatTooltipModule} from "@angular/material/tooltip"; import {SoundComponent} from "../sound/sound.component"; import {DataService} from "../../service/data.service"; import {CREATE_VEHICLE_RESOURCE} from "../edit/edit.component"; -import {VehicleResourceWrapper} from "../../entity/generated/vehicleResourceWrapper"; +import {VehicleResourceWrapperDTO} from "../../entity/generated/vehicleResourceWrapper"; @Component({ - standalone: true, imports: [ MatDialogModule, MatButtonModule, @@ -32,66 +31,66 @@ import {VehicleResourceWrapper} from "../../entity/generated/vehicleResourceWrap }) export class EditVehiclePropertiesDialog { private readonly dialogRef = inject(MatDialogRef); - private readonly vehicleResource = inject(MAT_DIALOG_DATA); + private readonly vehicleResourceWrapperDTO = inject(MAT_DIALOG_DATA); protected readonly formGroup; constructor(private readonly dataService: DataService) { this.formGroup = new FormGroup({ - id: new FormControl(this.vehicleResource.id), - name: new FormControl(this.vehicleResource.name), - color: new FormControl(`#${this.vehicleResource.color}`), - transportMode: new FormControl(this.vehicleResource.transportMode), - description: new FormControl(this.vehicleResource.description), - wikipediaArticle: new FormControl(this.vehicleResource.wikipediaArticle), - length: new FormControl(this.vehicleResource.length), - width: new FormControl(this.vehicleResource.width), - hasTwoBogies: new FormControl(this.vehicleResource.bogie1Position !== this.vehicleResource.bogie2Position), - bogiePosition: new FormControl(this.vehicleResource.bogie1Position), - bogie1Position: new FormControl(this.vehicleResource.bogie1Position), - bogie2Position: new FormControl(this.vehicleResource.bogie2Position), - couplingPadding1: new FormControl(this.vehicleResource.couplingPadding1), - couplingPadding2: new FormControl(this.vehicleResource.couplingPadding2), - hasGangway1: new FormControl(this.vehicleResource.hasGangway1), - hasGangway2: new FormControl(this.vehicleResource.hasGangway2), - hasBarrier1: new FormControl(this.vehicleResource.hasBarrier1), - hasBarrier2: new FormControl(this.vehicleResource.hasBarrier2), - soundType: new FormControl(!this.vehicleResource.bveSoundBaseResource && (this.vehicleResource.legacySpeedSoundBaseResource || this.vehicleResource.legacyDoorSoundBaseResource) ? "legacy" : "bve"), - bveSoundBaseResource: new FormControl(this.vehicleResource.bveSoundBaseResource), - legacySpeedSoundBaseResource: new FormControl(this.vehicleResource.legacySpeedSoundBaseResource), - legacySpeedSoundCount: new FormControl(this.vehicleResource.legacySpeedSoundCount), - legacyUseAccelerationSoundsWhenCoasting: new FormControl(this.vehicleResource.legacyUseAccelerationSoundsWhenCoasting), - legacyConstantPlaybackSpeed: new FormControl(this.vehicleResource.legacyConstantPlaybackSpeed), - legacyDoorSoundBaseResource: new FormControl(this.vehicleResource.legacyDoorSoundBaseResource), - legacyDoorCloseSoundTime: new FormControl(this.vehicleResource.legacyDoorCloseSoundTime), + id: new FormControl(this.vehicleResourceWrapperDTO.id), + name: new FormControl(this.vehicleResourceWrapperDTO.name), + color: new FormControl(`#${this.vehicleResourceWrapperDTO.color}`), + transportMode: new FormControl(this.vehicleResourceWrapperDTO.transportMode), + description: new FormControl(this.vehicleResourceWrapperDTO.description), + wikipediaArticle: new FormControl(this.vehicleResourceWrapperDTO.wikipediaArticle), + length: new FormControl(this.vehicleResourceWrapperDTO.length), + width: new FormControl(this.vehicleResourceWrapperDTO.width), + hasTwoBogies: new FormControl(this.vehicleResourceWrapperDTO.bogie1Position !== this.vehicleResourceWrapperDTO.bogie2Position), + bogiePosition: new FormControl(this.vehicleResourceWrapperDTO.bogie1Position), + bogie1Position: new FormControl(this.vehicleResourceWrapperDTO.bogie1Position), + bogie2Position: new FormControl(this.vehicleResourceWrapperDTO.bogie2Position), + couplingPadding1: new FormControl(this.vehicleResourceWrapperDTO.couplingPadding1), + couplingPadding2: new FormControl(this.vehicleResourceWrapperDTO.couplingPadding2), + hasGangway1: new FormControl(this.vehicleResourceWrapperDTO.hasGangway1), + hasGangway2: new FormControl(this.vehicleResourceWrapperDTO.hasGangway2), + hasBarrier1: new FormControl(this.vehicleResourceWrapperDTO.hasBarrier1), + hasBarrier2: new FormControl(this.vehicleResourceWrapperDTO.hasBarrier2), + soundType: new FormControl(!this.vehicleResourceWrapperDTO.bveSoundBaseResource && (this.vehicleResourceWrapperDTO.legacySpeedSoundBaseResource || this.vehicleResourceWrapperDTO.legacyDoorSoundBaseResource) ? "legacy" : "bve"), + bveSoundBaseResource: new FormControl(this.vehicleResourceWrapperDTO.bveSoundBaseResource), + legacySpeedSoundBaseResource: new FormControl(this.vehicleResourceWrapperDTO.legacySpeedSoundBaseResource), + legacySpeedSoundCount: new FormControl(this.vehicleResourceWrapperDTO.legacySpeedSoundCount), + legacyUseAccelerationSoundsWhenCoasting: new FormControl(this.vehicleResourceWrapperDTO.legacyUseAccelerationSoundsWhenCoasting), + legacyConstantPlaybackSpeed: new FormControl(this.vehicleResourceWrapperDTO.legacyConstantPlaybackSpeed), + legacyDoorSoundBaseResource: new FormControl(this.vehicleResourceWrapperDTO.legacyDoorSoundBaseResource), + legacyDoorCloseSoundTime: new FormControl(this.vehicleResourceWrapperDTO.legacyDoorCloseSoundTime), }); } onSave() { const newData = this.formGroup.getRawValue(); const defaultVehicleResource = CREATE_VEHICLE_RESOURCE(); - this.vehicleResource.id = newData.id ?? defaultVehicleResource.id; - this.vehicleResource.name = newData.name ?? defaultVehicleResource.name; - this.vehicleResource.color = newData.color?.substring(1).toUpperCase() ?? defaultVehicleResource.color; - this.vehicleResource.transportMode = newData.transportMode ?? defaultVehicleResource.transportMode; - this.vehicleResource.description = newData.description ?? defaultVehicleResource.description; - this.vehicleResource.wikipediaArticle = newData.wikipediaArticle ?? defaultVehicleResource.wikipediaArticle; - this.vehicleResource.length = Math.max(0.5, newData.length ?? defaultVehicleResource.length); - this.vehicleResource.width = Math.max(0.5, newData.width ?? defaultVehicleResource.width); - this.vehicleResource.bogie1Position = (newData.hasTwoBogies ? newData.bogie1Position : newData.bogiePosition) ?? defaultVehicleResource.bogie1Position; - this.vehicleResource.bogie2Position = (newData.hasTwoBogies ? newData.bogie2Position : newData.bogiePosition) ?? defaultVehicleResource.bogie2Position; - this.vehicleResource.couplingPadding1 = Math.max(0, newData.couplingPadding1 ?? defaultVehicleResource.couplingPadding1); - this.vehicleResource.couplingPadding2 = Math.max(0, newData.couplingPadding2 ?? defaultVehicleResource.couplingPadding2); - this.vehicleResource.hasGangway1 = newData.hasGangway1 ?? defaultVehicleResource.hasGangway1; - this.vehicleResource.hasGangway2 = newData.hasGangway2 ?? defaultVehicleResource.hasGangway2; - this.vehicleResource.hasBarrier1 = newData.hasBarrier1 ?? defaultVehicleResource.hasBarrier1; - this.vehicleResource.hasBarrier2 = newData.hasBarrier2 ?? defaultVehicleResource.hasBarrier2; - this.vehicleResource.bveSoundBaseResource = (newData.soundType === "bve" ? newData.bveSoundBaseResource : "") ?? defaultVehicleResource.bveSoundBaseResource; - this.vehicleResource.legacySpeedSoundBaseResource = (newData.soundType === "bve" ? "" : newData.legacySpeedSoundBaseResource) ?? defaultVehicleResource.legacySpeedSoundBaseResource; - this.vehicleResource.legacySpeedSoundCount = Math.max(1, Math.round((newData.soundType === "bve" ? 0 : newData.legacySpeedSoundCount) ?? defaultVehicleResource.legacySpeedSoundCount)); - this.vehicleResource.legacyUseAccelerationSoundsWhenCoasting = (newData.soundType === "bve" ? false : newData.legacyUseAccelerationSoundsWhenCoasting) ?? defaultVehicleResource.legacyUseAccelerationSoundsWhenCoasting; - this.vehicleResource.legacyConstantPlaybackSpeed = (newData.soundType === "bve" ? false : newData.legacyConstantPlaybackSpeed) ?? defaultVehicleResource.legacyConstantPlaybackSpeed; - this.vehicleResource.legacyDoorSoundBaseResource = (newData.soundType === "bve" ? "" : newData.legacyDoorSoundBaseResource) ?? defaultVehicleResource.legacyDoorSoundBaseResource; - this.vehicleResource.legacyDoorCloseSoundTime = Math.max(0, Math.min(1, (newData.soundType === "bve" ? 0 : newData.legacyDoorCloseSoundTime) ?? defaultVehicleResource.legacyDoorCloseSoundTime)); + this.vehicleResourceWrapperDTO.id = newData.id ?? defaultVehicleResource.id; + this.vehicleResourceWrapperDTO.name = newData.name ?? defaultVehicleResource.name; + this.vehicleResourceWrapperDTO.color = newData.color?.substring(1).toUpperCase() ?? defaultVehicleResource.color; + this.vehicleResourceWrapperDTO.transportMode = newData.transportMode ?? defaultVehicleResource.transportMode; + this.vehicleResourceWrapperDTO.description = newData.description ?? defaultVehicleResource.description; + this.vehicleResourceWrapperDTO.wikipediaArticle = newData.wikipediaArticle ?? defaultVehicleResource.wikipediaArticle; + this.vehicleResourceWrapperDTO.length = Math.max(0.5, newData.length ?? defaultVehicleResource.length); + this.vehicleResourceWrapperDTO.width = Math.max(0.5, newData.width ?? defaultVehicleResource.width); + this.vehicleResourceWrapperDTO.bogie1Position = (newData.hasTwoBogies ? newData.bogie1Position : newData.bogiePosition) ?? defaultVehicleResource.bogie1Position; + this.vehicleResourceWrapperDTO.bogie2Position = (newData.hasTwoBogies ? newData.bogie2Position : newData.bogiePosition) ?? defaultVehicleResource.bogie2Position; + this.vehicleResourceWrapperDTO.couplingPadding1 = Math.max(0, newData.couplingPadding1 ?? defaultVehicleResource.couplingPadding1); + this.vehicleResourceWrapperDTO.couplingPadding2 = Math.max(0, newData.couplingPadding2 ?? defaultVehicleResource.couplingPadding2); + this.vehicleResourceWrapperDTO.hasGangway1 = newData.hasGangway1 ?? defaultVehicleResource.hasGangway1; + this.vehicleResourceWrapperDTO.hasGangway2 = newData.hasGangway2 ?? defaultVehicleResource.hasGangway2; + this.vehicleResourceWrapperDTO.hasBarrier1 = newData.hasBarrier1 ?? defaultVehicleResource.hasBarrier1; + this.vehicleResourceWrapperDTO.hasBarrier2 = newData.hasBarrier2 ?? defaultVehicleResource.hasBarrier2; + this.vehicleResourceWrapperDTO.bveSoundBaseResource = (newData.soundType === "bve" ? newData.bveSoundBaseResource : "") ?? defaultVehicleResource.bveSoundBaseResource; + this.vehicleResourceWrapperDTO.legacySpeedSoundBaseResource = (newData.soundType === "bve" ? "" : newData.legacySpeedSoundBaseResource) ?? defaultVehicleResource.legacySpeedSoundBaseResource; + this.vehicleResourceWrapperDTO.legacySpeedSoundCount = Math.max(1, Math.round((newData.soundType === "bve" ? 0 : newData.legacySpeedSoundCount) ?? defaultVehicleResource.legacySpeedSoundCount)); + this.vehicleResourceWrapperDTO.legacyUseAccelerationSoundsWhenCoasting = (newData.soundType === "bve" ? false : newData.legacyUseAccelerationSoundsWhenCoasting) ?? defaultVehicleResource.legacyUseAccelerationSoundsWhenCoasting; + this.vehicleResourceWrapperDTO.legacyConstantPlaybackSpeed = (newData.soundType === "bve" ? false : newData.legacyConstantPlaybackSpeed) ?? defaultVehicleResource.legacyConstantPlaybackSpeed; + this.vehicleResourceWrapperDTO.legacyDoorSoundBaseResource = (newData.soundType === "bve" ? "" : newData.legacyDoorSoundBaseResource) ?? defaultVehicleResource.legacyDoorSoundBaseResource; + this.vehicleResourceWrapperDTO.legacyDoorCloseSoundTime = Math.max(0, Math.min(1, (newData.soundType === "bve" ? 0 : newData.legacyDoorCloseSoundTime) ?? defaultVehicleResource.legacyDoorCloseSoundTime)); this.dataService.update(); this.dialogRef.close(); } diff --git a/buildSrc/src/main/resources/website/src/app/component/edit/edit.component.ts b/buildSrc/src/main/resources/website/src/app/component/edit/edit.component.ts index febff0531..2ec91020c 100644 --- a/buildSrc/src/main/resources/website/src/app/component/edit/edit.component.ts +++ b/buildSrc/src/main/resources/website/src/app/component/edit/edit.component.ts @@ -15,15 +15,14 @@ import {FormatFileNamePipe} from "../../pipe/formatFileNamePipe"; import {FormatStringListPipe} from "../../pipe/formatStringListPipe"; import {EditVehicleModelPropertiesDialog} from "../edit-vehicle-model-properties/edit-vehicle-model-properties.dialog"; import {EditVehicleModelPartsDialog} from "../edit-vehicle-model-parts/edit-vehicle-model-parts.dialog"; -import {VehicleResourceWrapper} from "../../entity/generated/vehicleResourceWrapper"; -import {VehicleModelWrapper} from "../../entity/generated/vehicleModelWrapper"; +import {VehicleResourceWrapperDTO} from "../../entity/generated/vehicleResourceWrapper"; +import {VehicleModelWrapperDTO} from "../../entity/generated/vehicleModelWrapper"; -export const CREATE_VEHICLE_RESOURCE = () => new VehicleResourceWrapper("my_vehicle", "My Custom Vehicle", Math.floor(Math.random() * 0xFFFFFF).toString(16).toUpperCase().padStart(6, "0"), "TRAIN", 25, 2, -8.5, 8.5, 0, 0, "This is my custom vehicle!", "", false, false, false, false, 0, "a_train", "", 0, false, false, "", 0); -export const CREATE_MODEL = () => new VehicleModelWrapper("", "", "", "", true, 1, "", "", "", "", "", "", 1.5, 2.25, 1, 0.5, "", "", "", "", "", "", 2.25, 1, 1.25, 0.25); +export const CREATE_VEHICLE_RESOURCE = () => new VehicleResourceWrapperDTO("my_vehicle", "My Custom Vehicle", Math.floor(Math.random() * 0xFFFFFF).toString(16).toUpperCase().padStart(6, "0"), "TRAIN", 25, 2, -8.5, 8.5, 0, 0, "This is my custom vehicle!", "", false, false, false, false, 0, "a_train", "", 0, false, false, "", 0); +export const CREATE_MODEL = () => new VehicleModelWrapperDTO("", "", "", "", true, 1, "", "", "", "", "", "", 1.5, 2.25, 1, 0.5, "", "", "", "", "", "", 2.25, 1, 1.25, 0.25); @Component({ selector: "app-edit", - standalone: true, imports: [ MatButtonModule, MatIconModule, @@ -53,28 +52,28 @@ export class EditComponent { return CREATE_MODEL(); } - editDetails(vehicleResource: VehicleResourceWrapper) { - this.dialog.open(EditVehiclePropertiesDialog, {data: vehicleResource}); + editDetails(vehicleResourceWrapperDTO: VehicleResourceWrapperDTO) { + this.dialog.open(EditVehiclePropertiesDialog, {data: vehicleResourceWrapperDTO}); } - editModelProperties(vehicleResource: VehicleResourceWrapper, model: VehicleModelWrapper) { - this.dialog.open(EditVehicleModelPropertiesDialog, {data: {vehicleResource, model}}); + editModelProperties(vehicleResourceWrapperDTO: VehicleResourceWrapperDTO, vehicleModelWrapperDTO: VehicleModelWrapperDTO) { + this.dialog.open(EditVehicleModelPropertiesDialog, {data: {vehicleResource: vehicleResourceWrapperDTO, model: vehicleModelWrapperDTO}}); } - editModelParts(model: VehicleModelWrapper) { - this.dialog.open(EditVehicleModelPartsDialog, {data: model, maxWidth: "90vw", maxHeight: "90vh"}); + editModelParts(vehicleModelWrapperDTO: VehicleModelWrapperDTO) { + this.dialog.open(EditVehicleModelPartsDialog, {data: vehicleModelWrapperDTO, maxWidth: "90vw", maxHeight: "90vh"}); } - canEditModelParts(model: VehicleModelWrapper) { - return this.dataService.minecraftModelResources().some(minecraftModel => model.modelResource === minecraftModel.modelResource); + canEditModelParts(vehicleModelWrapperDTO: VehicleModelWrapperDTO) { + return this.dataService.minecraftModelResources().some(minecraftModel => vehicleModelWrapperDTO.modelResource === minecraftModel.modelResource); } scroll(target: number, content: HTMLDivElement) { setTimeout(() => content.scrollTo({top: target, behavior: "smooth"}), content.scrollTop < target ? 200 : 0); } - getAllModelsPropertiesAndDefinitions(vehicleResource: VehicleResourceWrapper) { - return vehicleResource.bogie1Position === vehicleResource.bogie2Position ? [vehicleResource.models, vehicleResource.bogie1Models] : [vehicleResource.models, vehicleResource.bogie1Models, vehicleResource.bogie2Models]; + getAllModelsPropertiesAndDefinitions(vehicleResourceWrapperDTO: VehicleResourceWrapperDTO) { + return vehicleResourceWrapperDTO.bogie1Position === vehicleResourceWrapperDTO.bogie2Position ? [vehicleResourceWrapperDTO.models, vehicleResourceWrapperDTO.bogie1Models] : [vehicleResourceWrapperDTO.models, vehicleResourceWrapperDTO.bogie1Models, vehicleResourceWrapperDTO.bogie2Models]; } manageModels() { diff --git a/buildSrc/src/main/resources/website/src/app/component/export/export.component.ts b/buildSrc/src/main/resources/website/src/app/component/export/export.component.ts index 6f8ecd968..4c9523969 100644 --- a/buildSrc/src/main/resources/website/src/app/component/export/export.component.ts +++ b/buildSrc/src/main/resources/website/src/app/component/export/export.component.ts @@ -8,7 +8,6 @@ import {LargeTileComponent} from "../large-button/large-tile.component"; @Component({ selector: "app-export", - standalone: true, imports: [ MatButtonModule, MatInputModule, diff --git a/buildSrc/src/main/resources/website/src/app/component/large-button/large-tile.component.ts b/buildSrc/src/main/resources/website/src/app/component/large-button/large-tile.component.ts index e252ba2f1..305e7907f 100644 --- a/buildSrc/src/main/resources/website/src/app/component/large-button/large-tile.component.ts +++ b/buildSrc/src/main/resources/website/src/app/component/large-button/large-tile.component.ts @@ -5,7 +5,6 @@ import {NgTemplateOutlet} from "@angular/common"; @Component({ selector: "app-large-tile", - standalone: true, imports: [ MatIconModule, MatRippleModule, diff --git a/buildSrc/src/main/resources/website/src/app/component/manage-resources/manage-resources.dialog.ts b/buildSrc/src/main/resources/website/src/app/component/manage-resources/manage-resources.dialog.ts index a00f17ee2..a164d857a 100644 --- a/buildSrc/src/main/resources/website/src/app/component/manage-resources/manage-resources.dialog.ts +++ b/buildSrc/src/main/resources/website/src/app/component/manage-resources/manage-resources.dialog.ts @@ -8,7 +8,6 @@ import {MatExpansionModule} from "@angular/material/expansion"; import {DataService} from "../../service/data.service"; @Component({ - standalone: true, imports: [ MatDialogModule, MatButtonModule, diff --git a/buildSrc/src/main/resources/website/src/app/component/prepare/prepare.component.ts b/buildSrc/src/main/resources/website/src/app/component/prepare/prepare.component.ts index e2aeabcfd..0d8a5a288 100644 --- a/buildSrc/src/main/resources/website/src/app/component/prepare/prepare.component.ts +++ b/buildSrc/src/main/resources/website/src/app/component/prepare/prepare.component.ts @@ -9,7 +9,6 @@ import {MatDividerModule} from "@angular/material/divider"; @Component({ selector: "app-prepare", - standalone: true, imports: [ MatButtonModule, MatIconModule, @@ -47,7 +46,6 @@ export class PrepareComponent { } @Component({ - standalone: true, imports: [ MatDialogModule, MatButtonModule, diff --git a/buildSrc/src/main/resources/website/src/app/component/preview/preview.component.ts b/buildSrc/src/main/resources/website/src/app/component/preview/preview.component.ts index 3534a3a91..84d01c830 100644 --- a/buildSrc/src/main/resources/website/src/app/component/preview/preview.component.ts +++ b/buildSrc/src/main/resources/website/src/app/component/preview/preview.component.ts @@ -6,7 +6,6 @@ import {MatButtonModule} from "@angular/material/button"; @Component({ selector: "app-preview", - standalone: true, imports: [ MatButtonModule, MatSlideToggleModule, diff --git a/buildSrc/src/main/resources/website/src/app/component/sound/sound.component.ts b/buildSrc/src/main/resources/website/src/app/component/sound/sound.component.ts index 8b65def45..34a85eca0 100644 --- a/buildSrc/src/main/resources/website/src/app/component/sound/sound.component.ts +++ b/buildSrc/src/main/resources/website/src/app/component/sound/sound.component.ts @@ -6,7 +6,6 @@ import {DataService} from "../../service/data.service"; @Component({ selector: "app-sound", - standalone: true, imports: [ MatButtonModule, MatIconModule, diff --git a/buildSrc/src/main/resources/website/src/app/component/uploader/uploader.component.ts b/buildSrc/src/main/resources/website/src/app/component/uploader/uploader.component.ts index 0f4e0740f..69342ef3d 100644 --- a/buildSrc/src/main/resources/website/src/app/component/uploader/uploader.component.ts +++ b/buildSrc/src/main/resources/website/src/app/component/uploader/uploader.component.ts @@ -5,7 +5,6 @@ import {MatIconModule} from "@angular/material/icon"; @Component({ selector: "app-uploader", - standalone: true, imports: [ MatProgressSpinnerModule, MatIconModule, diff --git a/buildSrc/src/main/resources/website/src/app/service/data.service.ts b/buildSrc/src/main/resources/website/src/app/service/data.service.ts index aaf89c5e5..849972e64 100644 --- a/buildSrc/src/main/resources/website/src/app/service/data.service.ts +++ b/buildSrc/src/main/resources/website/src/app/service/data.service.ts @@ -1,11 +1,11 @@ import {Injectable} from "@angular/core"; -import {ResourceWrapper} from "../entity/generated/resourceWrapper"; +import {ResourceWrapperDTO} from "../entity/generated/resourceWrapper"; import {HttpClient} from "@angular/common/http"; import {catchError, EMPTY, Observable} from "rxjs"; @Injectable({providedIn: "root"}) export class DataService { - private resourceWrapper?: ResourceWrapper; + private resourceWrapperDTO?: ResourceWrapperDTO; private status: "loading" | "ok" | "error" = "loading"; constructor(private readonly httpClient: HttpClient) { @@ -13,25 +13,25 @@ export class DataService { } public update(skipResourceWrapperSync = false) { - const tempResourceWrapper = this.resourceWrapper; - if (this.resourceWrapper) { - const resourceWrapperCopy: ResourceWrapper = JSON.parse(JSON.stringify(this.resourceWrapper)); - resourceWrapperCopy.minecraftModelResources.length = 0; - resourceWrapperCopy.minecraftTextureResources.length = 0; - this.sendPostRequest("operation/update", resourceWrapperCopy, "text/plain", () => { + const tempResourceWrapperDTO = this.resourceWrapperDTO; + if (this.resourceWrapperDTO) { + const resourceWrapperDTOCopy: ResourceWrapperDTO = JSON.parse(JSON.stringify(this.resourceWrapperDTO)); + resourceWrapperDTOCopy.minecraftModelResources.length = 0; + resourceWrapperDTOCopy.minecraftTextureResources.length = 0; + this.sendPostRequest("operation/update", resourceWrapperDTOCopy, "text/plain", () => { if (skipResourceWrapperSync) { - this.resourceWrapper = tempResourceWrapper; + this.resourceWrapperDTO = tempResourceWrapperDTO; } }); } } public create() { - this.resourceWrapper = new ResourceWrapper(); + this.resourceWrapperDTO = new ResourceWrapperDTO(); } public reset() { - this.resourceWrapper = undefined; + this.resourceWrapperDTO = undefined; this.sendGetRequest("upload/reset"); } @@ -52,23 +52,23 @@ export class DataService { } public vehicles() { - return this.resourceWrapper?.vehicles ?? []; + return this.resourceWrapperDTO?.vehicles ?? []; } public models() { - return this.resourceWrapper?.modelResources ?? []; + return this.resourceWrapperDTO?.modelResources ?? []; } public textures() { - return this.resourceWrapper?.textureResources ?? []; + return this.resourceWrapperDTO?.textureResources ?? []; } public minecraftModelResources() { - return this.resourceWrapper?.minecraftModelResources ?? []; + return this.resourceWrapperDTO?.minecraftModelResources ?? []; } public minecraftTextureResources() { - return this.resourceWrapper?.minecraftTextureResources ?? []; + return this.resourceWrapperDTO?.minecraftTextureResources ?? []; } public getStatus() { @@ -76,32 +76,32 @@ export class DataService { } public hasData() { - return !!this.resourceWrapper; + return !!this.resourceWrapperDTO; } public isMinecraftPaused() { - return this.resourceWrapper?.isMinecraftPaused ?? true; + return this.resourceWrapperDTO?.isMinecraftPaused ?? true; } public getExportDirectory() { - return this.resourceWrapper?.exportDirectory ?? ""; + return this.resourceWrapperDTO?.exportDirectory ?? ""; } public sendGetRequest(endpoint: string, callback?: () => void) { - this.sendRequest(this.httpClient.get(DataService.getUrl(endpoint)), callback); + this.sendRequest(this.httpClient.get(DataService.getUrl(endpoint)), callback); } public sendPostRequest(endpoint: string, body: any, contentType?: string, callback?: () => void) { - this.sendRequest(this.httpClient.post(DataService.getUrl(endpoint), body, contentType ? {headers: {"content-type": contentType}} : undefined), callback); + this.sendRequest(this.httpClient.post(DataService.getUrl(endpoint), body, contentType ? {headers: {"content-type": contentType}} : undefined), callback); } - private sendRequest(request: Observable, callback?: () => void) { + private sendRequest(request: Observable, callback?: () => void) { request.pipe(catchError(() => { this.status = "error"; return EMPTY; })).subscribe(data => { this.status = "ok"; - this.resourceWrapper = data; + this.resourceWrapperDTO = data; if (callback) { callback(); } diff --git a/buildSrc/src/main/resources/website/src/index.html b/buildSrc/src/main/resources/website/src/index.html index 849158d18..e47c20247 100644 --- a/buildSrc/src/main/resources/website/src/index.html +++ b/buildSrc/src/main/resources/website/src/index.html @@ -5,7 +5,7 @@ Resource Pack Creator - + diff --git a/fabric/build.gradle b/fabric/build.gradle index 7bbb3e93a..d911653c0 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -51,7 +51,7 @@ tasks.register("setupWebsiteFiles") { outputs.upToDateWhen { false } from zipTree("../libs/Transport-Simulation-Core-Build-Tools.jar") into "../buildSrc/src/main/resources" - include "website/*.json", "website/src/styles.css" + include "website/*.json", "website/src/styles.css", "website/src/theme.scss" } Generator.generateTypeScript(project, "schema/resource", "../buildSrc/src/main/resources/website/src/app/entity/generated") @@ -104,6 +104,7 @@ tasks.register("setupFiles") { delete fileTree("src/main/resources/wthit_plugins.json") } + buildTools.downloadTranslations(crowdinApiKey) buildTools.generateTranslations() buildTools.copyLootTables() buildTools.copyFontDefinition() diff --git a/fabric/src/main/java/org/mtr/init/ModMenuConfig.java b/fabric/src/main/java/org/mtr/init/ModMenuConfig.java index 478189a64..e11454172 100644 --- a/fabric/src/main/java/org/mtr/init/ModMenuConfig.java +++ b/fabric/src/main/java/org/mtr/init/ModMenuConfig.java @@ -2,12 +2,13 @@ import com.terraformersmc.modmenu.api.ConfigScreenFactory; import com.terraformersmc.modmenu.api.ModMenuApi; +import org.mtr.mapping.holder.Screen; import org.mtr.mod.screen.ConfigScreen; public final class ModMenuConfig implements ModMenuApi { @Override public ConfigScreenFactory getModConfigScreenFactory() { - return parent -> new ConfigScreen(); + return parent -> new ConfigScreen(new Screen(parent)); } } diff --git a/fabric/src/main/java/org/mtr/legacy/resource/LegacyVehicleResource.java b/fabric/src/main/java/org/mtr/legacy/resource/LegacyVehicleResource.java index 1477a437e..a4a5b09b7 100644 --- a/fabric/src/main/java/org/mtr/legacy/resource/LegacyVehicleResource.java +++ b/fabric/src/main/java/org/mtr/legacy/resource/LegacyVehicleResource.java @@ -115,108 +115,107 @@ public void convert(ObjectArrayList vehicleResources, String id baseObject.addProperty("legacyDoorCloseSoundTime", door_close_sound_time); baseObject.addProperty("legacyDoorCloseSoundTime", door_close_sound_time); - final int currentCar = i == 0 ? 1 : i == 2 ? 2 : 0; - final int totalCars = i == 3 ? 1 : 3; - - boolean isObj = false; - boolean reversed = false; - final ObjectArrayList modelObjects = new ObjectArrayList<>(); - final String[] modelSplit = splitWithEmptyStrings(model, '|'); - for (int j = 0; j < modelSplit.length; j += 2) { - final String[] conditions = j + 1 < modelSplit.length ? splitWithEmptyStrings(modelSplit[j + 1], ';') : new String[]{}; - if (conditions.length < 2 || matchesFilter(conditions[1].split(","), currentCar, totalCars) <= matchesFilter(conditions[0].split(","), currentCar, totalCars)) { - final JsonObject modelObject = new JsonObject(); - modelObject.addProperty("modelResource", modelSplit[j]); - modelObject.addProperty("textureResource", texture_id); - modelObject.addProperty("flipTextureV", flipV); - modelObjects.add(modelObject); - if (modelSplit[j].endsWith(".obj")) { - isObj = true; - } - if (conditions.length >= 3 && conditions[2].equals("reversed")) { - reversed = true; - } - } - } - - final JsonArray positionDefinitionsArray = new JsonArray(); - final JsonArray partsArray = new JsonArray(); - - try { - processModel(currentCar, totalCars, isObj, reversed, propertiesObject.getAsJsonArray("parts_normal"), positionDefinitionsArray, partsArray, doorMax, "NORMAL", null, null); - } catch (Exception ignored) { - } - try { - processModel(currentCar, totalCars, isObj, reversed, propertiesObject.getAsJsonArray("parts_head_1"), positionDefinitionsArray, partsArray, doorMax, "NORMAL", "1", "%1"); - } catch (Exception ignored) { - } - try { - processModel(currentCar, totalCars, isObj, reversed, propertiesObject.getAsJsonArray("parts_head_2"), positionDefinitionsArray, partsArray, doorMax, "NORMAL", "-1", "%1"); - } catch (Exception ignored) { - } - try { - processModel(currentCar, totalCars, isObj, reversed, propertiesObject.getAsJsonArray("parts_head_1_headlights"), positionDefinitionsArray, partsArray, doorMax, "ON_ROUTE_FORWARDS", "1", "%1"); - } catch (Exception ignored) { - } - try { - processModel(currentCar, totalCars, isObj, reversed, propertiesObject.getAsJsonArray("parts_head_2_headlights"), positionDefinitionsArray, partsArray, doorMax, "ON_ROUTE_BACKWARDS", "-1", "%1"); - } catch (Exception ignored) { - } - try { - processModel(currentCar, totalCars, isObj, reversed, propertiesObject.getAsJsonArray("parts_head_1_tail_lights"), positionDefinitionsArray, partsArray, doorMax, "ON_ROUTE_BACKWARDS", "1", "%1"); - } catch (Exception ignored) { - } - try { - processModel(currentCar, totalCars, isObj, reversed, propertiesObject.getAsJsonArray("parts_head_2_tail_lights"), positionDefinitionsArray, partsArray, doorMax, "ON_ROUTE_FORWARDS", "-1", "%1"); - } catch (Exception ignored) { - } - try { - processModel(currentCar, totalCars, isObj, reversed, propertiesObject.getAsJsonArray("parts_end_1"), positionDefinitionsArray, partsArray, doorMax, "NORMAL", "%1", "1"); - } catch (Exception ignored) { - } - try { - processModel(currentCar, totalCars, isObj, reversed, propertiesObject.getAsJsonArray("parts_end_2"), positionDefinitionsArray, partsArray, doorMax, "NORMAL", "%1", "-1"); - } catch (Exception ignored) { - } - try { - processModel(currentCar, totalCars, isObj, reversed, propertiesObject.getAsJsonArray("parts_door_opened"), positionDefinitionsArray, partsArray, doorMax, "DOORS_OPENED", null, null); - } catch (Exception ignored) { - } - try { - processModel(currentCar, totalCars, isObj, reversed, propertiesObject.getAsJsonArray("parts_door_closed"), positionDefinitionsArray, partsArray, doorMax, "DOORS_CLOSED", null, null); - } catch (Exception ignored) { - } - try { - processModel(currentCar, totalCars, isObj, reversed, propertiesObject.getAsJsonArray("parts"), positionDefinitionsArray, partsArray, doorMax, null, null, null); - } catch (Exception ignored) { - } - - final JsonObject modelPropertiesObject = new JsonObject(); - modelPropertiesObject.addProperty("modelYOffset", 1); - modelPropertiesObject.addProperty("gangwayInnerSideResource", (gangway_connection_id.isEmpty() ? texture_id : gangway_connection_id) + "_connector_side.png"); - modelPropertiesObject.addProperty("gangwayInnerTopResource", (gangway_connection_id.isEmpty() ? texture_id : gangway_connection_id) + "_connector_roof.png"); - modelPropertiesObject.addProperty("gangwayInnerBottomResource", (gangway_connection_id.isEmpty() ? texture_id : gangway_connection_id) + "_connector_floor.png"); - modelPropertiesObject.addProperty("gangwayOuterSideResource", (gangway_connection_id.isEmpty() ? texture_id : gangway_connection_id) + "_connector_exterior.png"); - modelPropertiesObject.addProperty("gangwayOuterTopResource", (gangway_connection_id.isEmpty() ? texture_id : gangway_connection_id) + "_connector_exterior.png"); - modelPropertiesObject.addProperty("gangwayOuterBottomResource", (gangway_connection_id.isEmpty() ? texture_id : gangway_connection_id) + "_connector_exterior.png"); - modelPropertiesObject.addProperty("gangwayWidth", 1.5); - modelPropertiesObject.addProperty("gangwayHeight", 2.25); - modelPropertiesObject.addProperty("gangwayYOffset", 1); - modelPropertiesObject.addProperty("gangwayZOffset", 0.5); - modelPropertiesObject.addProperty("barrierInnerSideResource", train_barrier_id + "_exterior.png"); - modelPropertiesObject.addProperty("barrierOuterSideResource", train_barrier_id + "_exterior.png"); - modelPropertiesObject.addProperty("barrierWidth", 2.25); - modelPropertiesObject.addProperty("barrierHeight", 1); - modelPropertiesObject.addProperty("barrierYOffset", 1.25); - modelPropertiesObject.addProperty("barrierZOffset", 0.25); - modelPropertiesObject.add("parts", partsArray); - - final JsonObject positionDefinitionsObject = new JsonObject(); - positionDefinitionsObject.add("positionDefinitions", positionDefinitionsArray); - + final double finalDoorMax = doorMax; vehicleResources.add(new VehicleResource( new JsonReader(baseObject), - modelObjects.stream().map(modelObject -> new VehicleModel(new JsonReader(modelObject), new JsonReader(modelPropertiesObject), new JsonReader(positionDefinitionsObject), id, resourceProvider)).collect(Collectors.toCollection(ObjectArrayList::new)), + (currentCar, totalCars) -> { + boolean isObj = false; + boolean reversed = false; + final ObjectArrayList modelObjects = new ObjectArrayList<>(); + final String[] modelSplit = splitWithEmptyStrings(model, '|'); + for (int j = 0; j < modelSplit.length; j += 2) { + final String[] conditions = j + 1 < modelSplit.length ? splitWithEmptyStrings(modelSplit[j + 1], ';') : new String[]{}; + if (conditions.length < 2 || matchesFilter(conditions[1].split(","), currentCar, totalCars) <= matchesFilter(conditions[0].split(","), currentCar, totalCars)) { + final JsonObject modelObject = new JsonObject(); + modelObject.addProperty("modelResource", modelSplit[j]); + modelObject.addProperty("textureResource", texture_id); + modelObject.addProperty("flipTextureV", flipV); + modelObjects.add(modelObject); + if (modelSplit[j].endsWith(".obj")) { + isObj = true; + } + if (conditions.length >= 3 && conditions[2].equals("reversed")) { + reversed = true; + } + } + } + + final JsonArray positionDefinitionsArray = new JsonArray(); + final JsonArray partsArray = new JsonArray(); + + try { + processModel(currentCar, totalCars, isObj, reversed, propertiesObject.getAsJsonArray("parts_normal"), positionDefinitionsArray, partsArray, finalDoorMax, "NORMAL", null, null); + } catch (Exception ignored) { + } + try { + processModel(currentCar, totalCars, isObj, reversed, propertiesObject.getAsJsonArray("parts_head_1"), positionDefinitionsArray, partsArray, finalDoorMax, "NORMAL", "1", "%1"); + } catch (Exception ignored) { + } + try { + processModel(currentCar, totalCars, isObj, reversed, propertiesObject.getAsJsonArray("parts_head_2"), positionDefinitionsArray, partsArray, finalDoorMax, "NORMAL", "-1", "%1"); + } catch (Exception ignored) { + } + try { + processModel(currentCar, totalCars, isObj, reversed, propertiesObject.getAsJsonArray("parts_head_1_headlights"), positionDefinitionsArray, partsArray, finalDoorMax, "ON_ROUTE_FORWARDS", "1", "%1"); + } catch (Exception ignored) { + } + try { + processModel(currentCar, totalCars, isObj, reversed, propertiesObject.getAsJsonArray("parts_head_2_headlights"), positionDefinitionsArray, partsArray, finalDoorMax, "ON_ROUTE_BACKWARDS", "-1", "%1"); + } catch (Exception ignored) { + } + try { + processModel(currentCar, totalCars, isObj, reversed, propertiesObject.getAsJsonArray("parts_head_1_tail_lights"), positionDefinitionsArray, partsArray, finalDoorMax, "ON_ROUTE_BACKWARDS", "1", "%1"); + } catch (Exception ignored) { + } + try { + processModel(currentCar, totalCars, isObj, reversed, propertiesObject.getAsJsonArray("parts_head_2_tail_lights"), positionDefinitionsArray, partsArray, finalDoorMax, "ON_ROUTE_FORWARDS", "-1", "%1"); + } catch (Exception ignored) { + } + try { + processModel(currentCar, totalCars, isObj, reversed, propertiesObject.getAsJsonArray("parts_end_1"), positionDefinitionsArray, partsArray, finalDoorMax, "NORMAL", "%1", "1"); + } catch (Exception ignored) { + } + try { + processModel(currentCar, totalCars, isObj, reversed, propertiesObject.getAsJsonArray("parts_end_2"), positionDefinitionsArray, partsArray, finalDoorMax, "NORMAL", "%1", "-1"); + } catch (Exception ignored) { + } + try { + processModel(currentCar, totalCars, isObj, reversed, propertiesObject.getAsJsonArray("parts_door_opened"), positionDefinitionsArray, partsArray, finalDoorMax, "DOORS_OPENED", null, null); + } catch (Exception ignored) { + } + try { + processModel(currentCar, totalCars, isObj, reversed, propertiesObject.getAsJsonArray("parts_door_closed"), positionDefinitionsArray, partsArray, finalDoorMax, "DOORS_CLOSED", null, null); + } catch (Exception ignored) { + } + try { + processModel(currentCar, totalCars, isObj, reversed, propertiesObject.getAsJsonArray("parts"), positionDefinitionsArray, partsArray, finalDoorMax, null, null, null); + } catch (Exception ignored) { + } + + final JsonObject modelPropertiesObject = new JsonObject(); + modelPropertiesObject.addProperty("modelYOffset", 1); + modelPropertiesObject.addProperty("gangwayInnerSideResource", (gangway_connection_id.isEmpty() ? texture_id : gangway_connection_id) + "_connector_side.png"); + modelPropertiesObject.addProperty("gangwayInnerTopResource", (gangway_connection_id.isEmpty() ? texture_id : gangway_connection_id) + "_connector_roof.png"); + modelPropertiesObject.addProperty("gangwayInnerBottomResource", (gangway_connection_id.isEmpty() ? texture_id : gangway_connection_id) + "_connector_floor.png"); + modelPropertiesObject.addProperty("gangwayOuterSideResource", (gangway_connection_id.isEmpty() ? texture_id : gangway_connection_id) + "_connector_exterior.png"); + modelPropertiesObject.addProperty("gangwayOuterTopResource", (gangway_connection_id.isEmpty() ? texture_id : gangway_connection_id) + "_connector_exterior.png"); + modelPropertiesObject.addProperty("gangwayOuterBottomResource", (gangway_connection_id.isEmpty() ? texture_id : gangway_connection_id) + "_connector_exterior.png"); + modelPropertiesObject.addProperty("gangwayWidth", 1.5); + modelPropertiesObject.addProperty("gangwayHeight", 2.25); + modelPropertiesObject.addProperty("gangwayYOffset", 1); + modelPropertiesObject.addProperty("gangwayZOffset", 0.5); + modelPropertiesObject.addProperty("barrierInnerSideResource", train_barrier_id + "_exterior.png"); + modelPropertiesObject.addProperty("barrierOuterSideResource", train_barrier_id + "_exterior.png"); + modelPropertiesObject.addProperty("barrierWidth", 2.25); + modelPropertiesObject.addProperty("barrierHeight", 1); + modelPropertiesObject.addProperty("barrierYOffset", 1.25); + modelPropertiesObject.addProperty("barrierZOffset", 0.25); + modelPropertiesObject.add("parts", partsArray); + + final JsonObject positionDefinitionsObject = new JsonObject(); + positionDefinitionsObject.add("positionDefinitions", positionDefinitionsArray); + return modelObjects.stream().map(modelObject -> new VehicleModel(new JsonReader(modelObject), new JsonReader(modelPropertiesObject), new JsonReader(positionDefinitionsObject), id, resourceProvider)).collect(Collectors.toCollection(ObjectArrayList::new)); + }, resourceProvider )); } else { @@ -308,24 +307,25 @@ private void processModel(int currentCar, int totalCars, boolean isObj, boolean partsObject.addProperty("type", "NORMAL"); } + final boolean mirror = tryGetBoolean(propertiesPartsObject, "mirror"); final double doorXMultiplier; final double doorZMultiplier; if (propertiesPartsObject.has("door_offset")) { switch (tryGet(propertiesPartsObject, "door_offset").toUpperCase(Locale.ENGLISH)) { case "LEFT_NEGATIVE": - doorXMultiplier = 1; + doorXMultiplier = mirror ? -1 : 1; doorZMultiplier = -doorMax; break; case "RIGHT_NEGATIVE": - doorXMultiplier = -1; + doorXMultiplier = mirror ? 1 : -1; doorZMultiplier = -doorMax; break; case "LEFT_POSITIVE": - doorXMultiplier = 1; + doorXMultiplier = mirror ? -1 : 1; doorZMultiplier = doorMax; break; case "RIGHT_POSITIVE": - doorXMultiplier = -1; + doorXMultiplier = mirror ? 1 : -1; doorZMultiplier = doorMax; break; default: @@ -371,7 +371,6 @@ private void processModel(int currentCar, int totalCars, boolean isObj, boolean positionDefinitionObject.add("positionsFlipped", reversed ? positionDefinitionPositionsArray : positionDefinitionPositionsFlippedArray); positionDefinitionsArray.add(positionDefinitionObject); - final boolean mirror = tryGetBoolean(propertiesPartsObject, "mirror"); processPositions(propertiesPartsObject, "positions", reversed, mirror ? positionDefinitionPositionsFlippedArray : positionDefinitionPositionsArray); processPositions(propertiesPartsObject, "positions_flipped", reversed, positionDefinitionPositionsFlippedArray); diff --git a/fabric/src/main/java/org/mtr/mod/Init.java b/fabric/src/main/java/org/mtr/mod/Init.java index 007da1594..e76a5a049 100644 --- a/fabric/src/main/java/org/mtr/mod/Init.java +++ b/fabric/src/main/java/org/mtr/mod/Init.java @@ -6,7 +6,7 @@ import org.apache.logging.log4j.Logger; import org.mtr.core.Main; import org.mtr.core.data.Position; -import org.mtr.core.operation.GenerateOrClearByDepotName; +import org.mtr.core.operation.DepotOperationByName; import org.mtr.core.operation.SetTime; import org.mtr.core.serializer.SerializedDataBase; import org.mtr.core.servlet.OperationProcessor; @@ -37,6 +37,7 @@ import javax.annotation.Nullable; import java.io.InputStream; import java.io.InputStreamReader; +import java.lang.management.ManagementFactory; import java.net.HttpURLConnection; import java.net.ServerSocket; import java.net.URL; @@ -71,6 +72,7 @@ public final class Init implements Utilities { private static final Object2ObjectAVLTreeMap RIDING_PLAYERS = new Object2ObjectAVLTreeMap<>(); public static void init() { + LOGGER.info("Starting Minecraft with arguments:\n{}", String.join("\n", ManagementFactory.getRuntimeMXBean().getInputArguments())); AsciiArt.print(); Blocks.init(); Items.init(); @@ -87,6 +89,7 @@ public static void init() { REGISTRY.registerPacket(PacketDeleteData.class, PacketDeleteData::new); REGISTRY.registerPacket(PacketDeleteRailAction.class, PacketDeleteRailAction::new); REGISTRY.registerPacket(PacketDepotClear.class, PacketDepotClear::new); + REGISTRY.registerPacket(PacketDepotInstantDeploy.class, PacketDepotInstantDeploy::new); REGISTRY.registerPacket(PacketDepotGenerate.class, PacketDepotGenerate::new); REGISTRY.registerPacket(PacketDriveTrain.class, PacketDriveTrain::new); REGISTRY.registerPacket(PacketFetchArrivals.class, PacketFetchArrivals::new); @@ -115,13 +118,15 @@ public static void init() { // Register command REGISTRY.registerCommand("mtr", commandBuilderMtr -> { // Generate depot(s) by name - commandBuilderMtr.then("generate", commandBuilderGenerate -> generateOrClearDepotsFromCommand(commandBuilderGenerate, true)); + commandBuilderMtr.then("generate", commandBuilderGenerate -> depotOperationFromCommand(commandBuilderGenerate, DepotOperation.GENERATE)); // Clear depot(s) by name - commandBuilderMtr.then("clear", commandBuilderClear -> generateOrClearDepotsFromCommand(commandBuilderClear, false)); + commandBuilderMtr.then("clear", commandBuilderClear -> depotOperationFromCommand(commandBuilderClear, DepotOperation.CLEAR)); + // Instant deploy depot(s) by name + commandBuilderMtr.then("instantDeploy", commandBuilderInstantDeploy -> depotOperationFromCommand(commandBuilderInstantDeploy, DepotOperation.INSTANT_DEPLOY)); // Force copy a world backup from one folder another - commandBuilderMtr.then("forceCopyWorld", commandBuilderForceCopy -> { - commandBuilderForceCopy.permissionLevel(4); - commandBuilderForceCopy.then("worldDirectory", StringArgumentType.string(), innerCommandBuilder1 -> innerCommandBuilder1.then("backupDirectory", StringArgumentType.string(), innerCommandBuilder2 -> innerCommandBuilder2.executes(contextHandler -> { + commandBuilderMtr.then("restoreWorld", commandBuilderRestoreWorld -> { + commandBuilderRestoreWorld.permissionLevel(4); + commandBuilderRestoreWorld.then("worldDirectory", StringArgumentType.string(), innerCommandBuilder1 -> innerCommandBuilder1.then("backupDirectory", StringArgumentType.string(), innerCommandBuilder2 -> innerCommandBuilder2.executes(contextHandler -> { final Path runPath = contextHandler.getServer().getRunDirectory().toPath(); final Path worldDirectory = runPath.resolve(contextHandler.getString("worldDirectory")); final Path backupDirectory = runPath.resolve(contextHandler.getString("backupDirectory")); @@ -350,23 +355,23 @@ public static String randomString() { return Integer.toHexString(new Random().nextInt()); } - private static void generateOrClearDepotsFromCommand(CommandBuilder commandBuilder, boolean isGenerate) { + private static void depotOperationFromCommand(CommandBuilder commandBuilder, DepotOperation depotOperation) { commandBuilder.permissionLevel(2); commandBuilder.executes(contextHandler -> { - contextHandler.sendSuccess((isGenerate ? TranslationProvider.COMMAND_MTR_GENERATE_ALL : TranslationProvider.COMMAND_MTR_CLEAR_ALL).key, true); - return generateOrClearDepotsFromCommand(contextHandler.getWorld(), "", isGenerate); + contextHandler.sendSuccess(depotOperation.translationHolderAll.key, true); + return depotOperationFromCommand(contextHandler.getWorld(), "", depotOperation); }); commandBuilder.then("name", StringArgumentType.greedyString(), innerCommandBuilder -> innerCommandBuilder.executes(contextHandler -> { final String filter = contextHandler.getString("name"); - contextHandler.sendSuccess((isGenerate ? TranslationProvider.COMMAND_MTR_GENERATE_FILTER : TranslationProvider.COMMAND_MTR_CLEAR_FILTER).key, true, filter); - return generateOrClearDepotsFromCommand(contextHandler.getWorld(), filter, isGenerate); + contextHandler.sendSuccess(depotOperation.translationHolderName.key, true, filter); + return depotOperationFromCommand(contextHandler.getWorld(), filter, depotOperation); })); } - private static int generateOrClearDepotsFromCommand(World world, String filter, boolean isGenerate) { - final GenerateOrClearByDepotName generateByDepotName = new GenerateOrClearByDepotName(); - generateByDepotName.setFilter(filter); - sendMessageC2S(isGenerate ? OperationProcessor.GENERATE_BY_DEPOT_NAME : OperationProcessor.CLEAR_BY_DEPOT_NAME, world.getServer(), world, generateByDepotName, null, null); + private static int depotOperationFromCommand(World world, String filter, DepotOperation depotOperation) { + final DepotOperationByName depotOperationByName = new DepotOperationByName(); + depotOperationByName.setFilter(filter); + sendMessageC2S(depotOperation.operation, world.getServer(), world, depotOperationByName, null, null); return 1; } @@ -376,4 +381,20 @@ private static void updatePlayer(ServerPlayerEntity serverPlayerEntity, boolean serverPlayerEntity.setNoClipMapped(isRiding); ((PlayerTeleportationStateAccessor) serverPlayerEntity.data).setInTeleportationState(isRiding); } + + private enum DepotOperation { + GENERATE(TranslationProvider.COMMAND_MTR_GENERATE_ALL, TranslationProvider.COMMAND_MTR_GENERATE_FILTER, OperationProcessor.GENERATE_BY_DEPOT_NAME), + CLEAR(TranslationProvider.COMMAND_MTR_CLEAR_ALL, TranslationProvider.COMMAND_MTR_CLEAR_FILTER, OperationProcessor.CLEAR_BY_DEPOT_NAME), + INSTANT_DEPLOY(TranslationProvider.COMMAND_MTR_INSTANT_DEPLOY_ALL, TranslationProvider.COMMAND_MTR_INSTANT_DEPLOY_FILTER, OperationProcessor.INSTANT_DEPLOY_BY_DEPOT_NAME); + + private final TranslationProvider.TranslationHolder translationHolderAll; + private final TranslationProvider.TranslationHolder translationHolderName; + private final String operation; + + DepotOperation(TranslationProvider.TranslationHolder translationHolderAll, TranslationProvider.TranslationHolder translationHolderName, String operation) { + this.translationHolderAll = translationHolderAll; + this.translationHolderName = translationHolderName; + this.operation = operation; + } + } } diff --git a/fabric/src/main/java/org/mtr/mod/block/BlockEscalatorSide.java b/fabric/src/main/java/org/mtr/mod/block/BlockEscalatorSide.java index d027df078..007972f0f 100644 --- a/fabric/src/main/java/org/mtr/mod/block/BlockEscalatorSide.java +++ b/fabric/src/main/java/org/mtr/mod/block/BlockEscalatorSide.java @@ -18,6 +18,13 @@ public BlockState getStateForNeighborUpdate2(BlockState state, Direction directi } } + @Nonnull + @Override + public VoxelShape getCullingShape2(BlockState state, BlockView world, BlockPos pos) { + // Prevents culling optimization mods from culling our see-through escalator side + return VoxelShapes.empty(); + } + @Nonnull @Override public VoxelShape getCollisionShape2(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { diff --git a/fabric/src/main/java/org/mtr/mod/block/BlockEyeCandy.java b/fabric/src/main/java/org/mtr/mod/block/BlockEyeCandy.java index 76f76c405..8a18bb092 100644 --- a/fabric/src/main/java/org/mtr/mod/block/BlockEyeCandy.java +++ b/fabric/src/main/java/org/mtr/mod/block/BlockEyeCandy.java @@ -23,11 +23,19 @@ public BlockState getPlacementState2(ItemPlacementContext ctx) { return getDefaultState2().with(new Property<>(FACING.data), ctx.getPlayerFacing().data); } + @Nonnull @Override public VoxelShape getCollisionShape2(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { return VoxelShapes.empty(); } + @Nonnull + @Override + public VoxelShape getCullingShape2(BlockState state, BlockView world, BlockPos pos) { + // Prevents culling optimization mods from culling our fully transparent block + return VoxelShapes.empty(); + } + @Override public void addBlockProperties(List> properties) { properties.add(FACING); diff --git a/fabric/src/main/java/org/mtr/mod/packet/PacketDepotClear.java b/fabric/src/main/java/org/mtr/mod/packet/PacketDepotClear.java index 3c9f1f28c..718a22a2c 100644 --- a/fabric/src/main/java/org/mtr/mod/packet/PacketDepotClear.java +++ b/fabric/src/main/java/org/mtr/mod/packet/PacketDepotClear.java @@ -1,6 +1,6 @@ package org.mtr.mod.packet; -import org.mtr.core.operation.GenerateOrClearByDepotIds; +import org.mtr.core.operation.DepotOperationByIds; import org.mtr.core.serializer.JsonReader; import org.mtr.core.serializer.SerializedDataBase; import org.mtr.core.servlet.OperationProcessor; @@ -15,7 +15,7 @@ public PacketDepotClear(PacketBufferReceiver packetBufferReceiver) { super(packetBufferReceiver); } - public PacketDepotClear(GenerateOrClearByDepotIds contentObject) { + public PacketDepotClear(DepotOperationByIds contentObject) { super(Utilities.getJsonObjectFromData(contentObject).toString()); } @@ -30,7 +30,7 @@ protected PacketRequestResponseBase getInstance(String content) { @Override protected SerializedDataBase getDataInstance(JsonReader jsonReader) { - return new GenerateOrClearByDepotIds(jsonReader); + return new DepotOperationByIds(jsonReader); } @Nonnull diff --git a/fabric/src/main/java/org/mtr/mod/packet/PacketDepotGenerate.java b/fabric/src/main/java/org/mtr/mod/packet/PacketDepotGenerate.java index ac22356b2..68df4c23a 100644 --- a/fabric/src/main/java/org/mtr/mod/packet/PacketDepotGenerate.java +++ b/fabric/src/main/java/org/mtr/mod/packet/PacketDepotGenerate.java @@ -1,6 +1,6 @@ package org.mtr.mod.packet; -import org.mtr.core.operation.GenerateOrClearByDepotIds; +import org.mtr.core.operation.DepotOperationByIds; import org.mtr.core.serializer.JsonReader; import org.mtr.core.serializer.SerializedDataBase; import org.mtr.core.servlet.OperationProcessor; @@ -15,7 +15,7 @@ public PacketDepotGenerate(PacketBufferReceiver packetBufferReceiver) { super(packetBufferReceiver); } - public PacketDepotGenerate(GenerateOrClearByDepotIds contentObject) { + public PacketDepotGenerate(DepotOperationByIds contentObject) { super(Utilities.getJsonObjectFromData(contentObject).toString()); } @@ -30,7 +30,7 @@ protected PacketRequestResponseBase getInstance(String content) { @Override protected SerializedDataBase getDataInstance(JsonReader jsonReader) { - return new GenerateOrClearByDepotIds(jsonReader); + return new DepotOperationByIds(jsonReader); } @Nonnull diff --git a/fabric/src/main/java/org/mtr/mod/packet/PacketDepotInstantDeploy.java b/fabric/src/main/java/org/mtr/mod/packet/PacketDepotInstantDeploy.java new file mode 100644 index 000000000..0fd74bea6 --- /dev/null +++ b/fabric/src/main/java/org/mtr/mod/packet/PacketDepotInstantDeploy.java @@ -0,0 +1,46 @@ +package org.mtr.mod.packet; + +import org.mtr.core.operation.DepotOperationByIds; +import org.mtr.core.serializer.JsonReader; +import org.mtr.core.serializer.SerializedDataBase; +import org.mtr.core.servlet.OperationProcessor; +import org.mtr.core.tool.Utilities; +import org.mtr.mapping.tool.PacketBufferReceiver; + +import javax.annotation.Nonnull; + +public final class PacketDepotInstantDeploy extends PacketRequestResponseBase { + + public PacketDepotInstantDeploy(PacketBufferReceiver packetBufferReceiver) { + super(packetBufferReceiver); + } + + public PacketDepotInstantDeploy(DepotOperationByIds contentObject) { + super(Utilities.getJsonObjectFromData(contentObject).toString()); + } + + private PacketDepotInstantDeploy(String content) { + super(content); + } + + @Override + protected PacketRequestResponseBase getInstance(String content) { + return new PacketDepotInstantDeploy(content); + } + + @Override + protected SerializedDataBase getDataInstance(JsonReader jsonReader) { + return new DepotOperationByIds(jsonReader); + } + + @Nonnull + @Override + protected String getKey() { + return OperationProcessor.INSTANT_DEPLOY_BY_DEPOT_IDS; + } + + @Override + protected ResponseType responseType() { + return ResponseType.NONE; + } +} diff --git a/fabric/src/main/java/org/mtr/mod/packet/PacketUpdateData.java b/fabric/src/main/java/org/mtr/mod/packet/PacketUpdateData.java index 2860a1c5c..c322ddfeb 100644 --- a/fabric/src/main/java/org/mtr/mod/packet/PacketUpdateData.java +++ b/fabric/src/main/java/org/mtr/mod/packet/PacketUpdateData.java @@ -73,7 +73,7 @@ private static void update(JsonReader jsonReader) { final MinecraftClientData minecraftClientData = MinecraftClientData.getInstance(); new UpdateDataResponse(jsonReader, minecraftClientData).write(); new UpdateDataResponse(jsonReader, MinecraftClientData.getDashboardInstance()).write(); - minecraftClientData.vehicles.forEach(vehicle -> vehicle.vehicleExtraData.immutablePath.forEach(pathData -> pathData.writePathCache(minecraftClientData, vehicle.getTransportMode()))); + minecraftClientData.vehicles.forEach(vehicle -> vehicle.vehicleExtraData.immutablePath.forEach(pathData -> pathData.writePathCache(new MinecraftClientData()))); DynamicTextureCache.instance.reload(); } } diff --git a/fabric/src/main/java/org/mtr/mod/packet/PacketUpdateVehiclesLifts.java b/fabric/src/main/java/org/mtr/mod/packet/PacketUpdateVehiclesLifts.java index b53d98946..d4ccc2ce5 100644 --- a/fabric/src/main/java/org/mtr/mod/packet/PacketUpdateVehiclesLifts.java +++ b/fabric/src/main/java/org/mtr/mod/packet/PacketUpdateVehiclesLifts.java @@ -47,7 +47,7 @@ protected void runClientInbound(JsonReader jsonReader) { if (hasUpdate1 || hasUpdate2) { if (hasUpdate1) { - minecraftClientData.vehicles.forEach(vehicle -> vehicle.vehicleExtraData.immutablePath.forEach(pathData -> pathData.writePathCache(minecraftClientData, vehicle.getTransportMode()))); + minecraftClientData.vehicles.forEach(vehicle -> vehicle.vehicleExtraData.immutablePath.forEach(pathData -> pathData.writePathCache(new MinecraftClientData()))); } minecraftClientData.sync(); } diff --git a/fabric/src/main/java/org/mtr/mod/render/MainRenderer.java b/fabric/src/main/java/org/mtr/mod/render/MainRenderer.java index d4a2a0842..ac120fdfc 100644 --- a/fabric/src/main/java/org/mtr/mod/render/MainRenderer.java +++ b/fabric/src/main/java/org/mtr/mod/render/MainRenderer.java @@ -7,6 +7,7 @@ import org.mtr.mapping.mapper.EntityRenderer; import org.mtr.mapping.mapper.GraphicsHolder; import org.mtr.mapping.mapper.OptimizedRenderer; +import org.mtr.mapping.tool.ColorHelper; import org.mtr.mod.InitClient; import org.mtr.mod.client.CustomResourceLoader; import org.mtr.mod.client.DynamicTextureCache; @@ -174,10 +175,23 @@ public static String getInterchangeRouteNames(Consumer { + int newR = (int) (r * flashingProgress); + int newG = (int) (g * flashingProgress); + int newB = (int) (b * flashingProgress); + + newColor[0] = (a << 24) | (newR << 16) | (newG << 8) | newB; + }); + return newColor[0]; + } + private static long getMillisElapsed() { final long millisElapsed = InitClient.getGameMillis() - lastRenderedMillis; final long gameMillisElapsed = (long) (MinecraftClient.getInstance().getLastFrameDuration() * 50); diff --git a/fabric/src/main/java/org/mtr/mod/render/RenderPIDS.java b/fabric/src/main/java/org/mtr/mod/render/RenderPIDS.java index f9a2793c6..dc432a4b8 100644 --- a/fabric/src/main/java/org/mtr/mod/render/RenderPIDS.java +++ b/fabric/src/main/java/org/mtr/mod/render/RenderPIDS.java @@ -117,7 +117,26 @@ private void render(T entity, BlockPos blockPos, Direction facing, ObjectArrayLi renderCustomMessage = true; languageIndex = languageTicks % customMessageSplit.length; } else { - destinationSplit = arrivalResponse.getDestination().split("\\|"); + final String[] tempDestinationSplit = arrivalResponse.getDestination().split("\\|"); + if (arrivalResponse.getRouteNumber().isEmpty()) { + destinationSplit = tempDestinationSplit; + } else { + final String[] tempNumberSplit = arrivalResponse.getRouteNumber().split("\\|"); + int destinationIndex = 0; + int numberIndex = 0; + final ObjectArrayList newDestinations = new ObjectArrayList<>(); + while (true) { + final String newDestination = String.format("%s %s", tempNumberSplit[numberIndex % tempNumberSplit.length], tempDestinationSplit[destinationIndex % tempDestinationSplit.length]); + if (newDestinations.contains(newDestination)) { + break; + } else { + newDestinations.add(newDestination); + } + destinationIndex++; + numberIndex++; + } + destinationSplit = newDestinations.toArray(new String[0]); + } final int messageCount = destinationSplit.length + (customMessage.isEmpty() ? 0 : customMessageSplit.length); renderCustomMessage = languageTicks % messageCount >= destinationSplit.length; languageIndex = (languageTicks % messageCount) - (renderCustomMessage ? destinationSplit.length : 0); diff --git a/fabric/src/main/java/org/mtr/mod/render/RenderRails.java b/fabric/src/main/java/org/mtr/mod/render/RenderRails.java index a33db457c..190363a44 100644 --- a/fabric/src/main/java/org/mtr/mod/render/RenderRails.java +++ b/fabric/src/main/java/org/mtr/mod/render/RenderRails.java @@ -50,6 +50,7 @@ public class RenderRails implements IGui { private static final Identifier WOOL_TEXTURE = new Identifier("textures/block/white_wool.png"); private static final Identifier ONE_WAY_RAIL_ARROW_TEXTURE = new Identifier(Init.MOD_ID, "textures/block/one_way_rail_arrow.png"); private static final int INVALID_NODE_CHECK_RADIUS = 16; + private static final double LIGHT_REFERENCE_OFFSET = 0.1; private static final ModelSmallCube MODEL_SMALL_CUBE = new ModelSmallCube(new Identifier(Init.MOD_ID, "textures/block/white.png")); public static void render() { @@ -273,11 +274,12 @@ private static void renderRailStandard(ClientWorld clientWorld, Rail rail, float // Render default rail or coloured rail if (renderType[0] || renderState.hasColor) { - final int color = renderState.hasColor ? RailType.getRailColor(rail) : ARGB_WHITE; + int color = renderState.hasColor ? renderState == RenderState.FLASHING ? MainRenderer.getFlashingColor(RailType.getRailColor(rail)) : RailType.getRailColor(rail) : ARGB_WHITE; + final Identifier texture = renderType[1] && !renderType[0] ? IRON_BLOCK_TEXTURE : defaultTexture; renderWithinRenderDistance(rail, (blockPos, x1, z1, x2, z2, x3, z3, x4, z4, y1, y2) -> { final float textureOffset = (((int) (x1 + z1)) % 4) * 0.25F; - final int light = renderState == RenderState.FLASHING ? MainRenderer.getFlashingLight() : renderState == RenderState.COLORED ? GraphicsHolder.getDefaultLight() : LightmapTextureManager.pack(clientWorld.getLightLevel(LightType.getBlockMapped(), blockPos), clientWorld.getLightLevel(LightType.getSkyMapped(), blockPos)); + final int light = renderState == RenderState.FLASHING || renderState == RenderState.COLORED ? GraphicsHolder.getDefaultLight() : LightmapTextureManager.pack(clientWorld.getLightLevel(LightType.getBlockMapped(), blockPos), clientWorld.getLightLevel(LightType.getSkyMapped(), blockPos)); MainRenderer.scheduleRender(texture, false, QueuedRenderLayer.EXTERIOR, (graphicsHolder, offset) -> { IDrawing.drawTexture(graphicsHolder, x1, y1 + yOffset, z1, x2, y1 + yOffset + SMALL_OFFSET, z2, x3, y2 + yOffset, z3, x4, y2 + yOffset + SMALL_OFFSET, z4, offset, u1 < 0 ? 0 : u1, v1 < 0 ? 0.1875F + textureOffset : v1, u2 < 0 ? 1 : u2, v2 < 0 ? 0.3125F + textureOffset : v2, Direction.UP, color, light); IDrawing.drawTexture(graphicsHolder, x2, y1 + yOffset + SMALL_OFFSET, z2, x1, y1 + yOffset, z1, x4, y2 + yOffset + SMALL_OFFSET, z4, x3, y2 + yOffset, z3, offset, u1 < 0 ? 0 : u1, v1 < 0 ? 0.1875F + textureOffset : v1, u2 < 0 ? 1 : u2, v2 < 0 ? 0.3125F + textureOffset : v2, Direction.UP, color, light); @@ -294,13 +296,13 @@ private static void renderSignalsStandard(ClientWorld clientWorld, Rail rail) { for (int i = 0; i < colors.size(); i++) { final int rawColor = colors.getInt(i); - final int color = ARGB_BLACK | rawColor; final boolean shouldFlash = blockedSignalColors.contains(rawColor); + final int color = shouldFlash ? MainRenderer.getFlashingColor(ARGB_BLACK | rawColor) : ARGB_BLACK | rawColor; final float u1 = width * i + 1 - width * colors.size() / 2; final float u2 = u1 + width; renderWithinRenderDistance(rail, (blockPos, x1, z1, x2, z2, x3, z3, x4, z4, y1, y2) -> { - final int light = shouldFlash ? MainRenderer.getFlashingLight() : LightmapTextureManager.pack(clientWorld.getLightLevel(LightType.getBlockMapped(), blockPos), clientWorld.getLightLevel(LightType.getSkyMapped(), blockPos)); + final int light = shouldFlash ? GraphicsHolder.getDefaultLight() : LightmapTextureManager.pack(clientWorld.getLightLevel(LightType.getBlockMapped(), blockPos), clientWorld.getLightLevel(LightType.getSkyMapped(), blockPos)); MainRenderer.scheduleRender(WOOL_TEXTURE, false, shouldFlash ? QueuedRenderLayer.EXTERIOR : QueuedRenderLayer.LIGHT, (graphicsHolder, offset) -> { IDrawing.drawTexture(graphicsHolder, x1, y1 + 0.125, z1, x2, y1 + 0.125 + SMALL_OFFSET, z2, x3, y2 + 0.125, z3, x4, y2 + 0.125 + SMALL_OFFSET, z4, offset, u1, 0, u2, 1, Direction.UP, color, light); IDrawing.drawTexture(graphicsHolder, x4, y2 + 0.125 + SMALL_OFFSET, z4, x3, y2 + 0.125, z3, x2, y1 + 0.125 + SMALL_OFFSET, z2, x1, y1 + 0.125, z1, offset, u1, 0, u2, 1, Direction.UP, color, light); @@ -316,7 +318,7 @@ private static void renderWithinRenderDistance(Rail rail, RenderRailWithBlockPos final int renderDistance = MinecraftClientHelper.getRenderDistance() * 16; rail.railMath.render((x1, z1, x2, z2, x3, z3, x4, z4, y1, y2) -> { - final BlockPos blockPos = Init.newBlockPos(x1, y1, z1); + final BlockPos blockPos = Init.newBlockPos(x1, y1 + LIGHT_REFERENCE_OFFSET, z1); final int distance = blockPos.getManhattanDistance(cameraBlockPos); if (distance <= renderDistance) { if (distance < 32) { diff --git a/fabric/src/main/java/org/mtr/mod/render/RenderSignalBase.java b/fabric/src/main/java/org/mtr/mod/render/RenderSignalBase.java index 8b0e20d32..df3a5e357 100644 --- a/fabric/src/main/java/org/mtr/mod/render/RenderSignalBase.java +++ b/fabric/src/main/java/org/mtr/mod/render/RenderSignalBase.java @@ -67,7 +67,6 @@ public final void render(T entity, float tickDelta, GraphicsHolder graphicsHolde final boolean occupied = aspects.right().contains(signalColor); final float x = xStart + j * 0.03125F; final float width = 0.03125F / (filterColors.isEmpty() || filterColors.contains(signalColor) ? 1 : 8); - final int lightNew = occupied ? MainRenderer.getFlashingLight() : GraphicsHolder.getDefaultLight(); MainRenderer.scheduleRender(new Identifier(Init.MOD_ID, "textures/block/white.png"), false, occupied ? QueuedRenderLayer.EXTERIOR : QueuedRenderLayer.LIGHT, (graphicsHolderNew, offset) -> { storedMatrixTransformationsNew.transform(graphicsHolderNew, offset); IDrawing.drawTexture( @@ -77,7 +76,7 @@ public final void render(T entity, float tickDelta, GraphicsHolder graphicsHolde x + 0.03125F, colorIndicatorHeight, -0.15625F - width, x, colorIndicatorHeight, -0.15625F - width, 0, 0, 1, 1, - Direction.UP, signalColor | ARGB_BLACK, lightNew + Direction.UP, MainRenderer.getFlashingColor(signalColor | ARGB_BLACK), GraphicsHolder.getDefaultLight() ); graphicsHolderNew.pop(); }); diff --git a/fabric/src/main/java/org/mtr/mod/render/RenderVehicles.java b/fabric/src/main/java/org/mtr/mod/render/RenderVehicles.java index d693b8241..bbb6b0863 100644 --- a/fabric/src/main/java/org/mtr/mod/render/RenderVehicles.java +++ b/fabric/src/main/java/org/mtr/mod/render/RenderVehicles.java @@ -95,7 +95,7 @@ public static void render(long millisElapsed, Vector3d cameraShakeOffset) { final GangwayMovementPositions gangwayMovementPositions1 = new GangwayMovementPositions(renderVehicleTransformationHelperAbsolute, false); final GangwayMovementPositions gangwayMovementPositions2 = new GangwayMovementPositions(renderVehicleTransformationHelperAbsolute, true); // Vehicle resource cache - final VehicleResourceCache vehicleResourceCache = vehicleResource.cachedVehicleResource.getData(false); + final VehicleResourceCache vehicleResourceCache = vehicleResource.getCachedVehicleResource(carNumber, vehicle.vehicleExtraData.immutableVehicleCars.size()).getData(false); // Find open doorways (close to platform blocks, unlocked platform screen doors, or unlocked automatic platform gates) final ObjectArrayList openDoorways; if (vehicleResourceCache != null && fromResourcePackCreator) { @@ -136,10 +136,10 @@ public static void render(long millisElapsed, Vector3d cameraShakeOffset) { // Each car can have more than one model defined RenderVehicleHelper.renderModel(renderVehicleTransformationHelperOffset, oscillationAmount, storedMatrixTransformations -> { if (OptimizedRenderer.hasOptimizedRendering()) { - vehicleResource.queue(storedMatrixTransformations, vehicle, renderVehicleTransformationHelperAbsolute.light, openDoorways); + vehicleResource.queue(storedMatrixTransformations, vehicle, carNumber, vehicle.vehicleExtraData.immutableVehicleCars.size(), renderVehicleTransformationHelperAbsolute.light, openDoorways); } - vehicleResource.iterateModels((modelIndex, model) -> { + vehicleResource.iterateModels(carNumber, vehicle.vehicleExtraData.immutableVehicleCars.size(), (modelIndex, model) -> { model.render(storedMatrixTransformations, vehicle, carNumber, scrollingDisplayIndexTracker, renderVehicleTransformationHelperAbsolute.light, openDoorways); while (modelIndex >= previousGangwayPositionsList.size()) { diff --git a/fabric/src/main/java/org/mtr/mod/resource/BlockbenchModelValidator.java b/fabric/src/main/java/org/mtr/mod/resource/BlockbenchModelValidator.java index bfb67c613..aa061d2c1 100644 --- a/fabric/src/main/java/org/mtr/mod/resource/BlockbenchModelValidator.java +++ b/fabric/src/main/java/org/mtr/mod/resource/BlockbenchModelValidator.java @@ -5,6 +5,7 @@ import org.mtr.libraries.com.google.gson.JsonElement; import org.mtr.libraries.com.google.gson.JsonObject; import org.mtr.libraries.com.google.gson.JsonPrimitive; +import org.mtr.mod.Init; import javax.annotation.Nullable; import java.math.BigDecimal; @@ -32,15 +33,19 @@ public static void validate(JsonObject modelObject, String id, @Nullable BiConsu modelObject.addProperty("modded_entity_version", "Fabric 1.17+"); modelObject.remove("fabricOptions"); - modelObject.getAsJsonArray("textures").forEach(textureElement -> { - final JsonObject textureObject = textureElement.getAsJsonObject(); - textureObject.remove("path"); - textureObject.remove("source"); - if (assertTrue != null) { - final String relativePath = textureObject.get("relative_path").getAsString(); - assertTrue.accept(relativePath.startsWith("../../textures/vehicle/") || relativePath.startsWith("../../textures/overlay/"), relativePath); - } - }); + try { + modelObject.getAsJsonArray("textures").forEach(textureElement -> { + final JsonObject textureObject = textureElement.getAsJsonObject(); + textureObject.remove("path"); + textureObject.remove("source"); + if (assertTrue != null) { + final String relativePath = textureObject.get("relative_path").getAsString(); + assertTrue.accept(relativePath.startsWith("../../textures/vehicle/") || relativePath.startsWith("../../textures/overlay/"), relativePath); + } + }); + } catch (Exception ignored) { + Init.LOGGER.warn("Failed to read textures from Blockbench model [{}]", id); + } } /** diff --git a/fabric/src/main/java/org/mtr/mod/resource/VehicleResource.java b/fabric/src/main/java/org/mtr/mod/resource/VehicleResource.java index b331edef3..ff95d6155 100644 --- a/fabric/src/main/java/org/mtr/mod/resource/VehicleResource.java +++ b/fabric/src/main/java/org/mtr/mod/resource/VehicleResource.java @@ -3,6 +3,7 @@ import org.mtr.core.data.TransportMode; import org.mtr.core.serializer.ReaderBase; import org.mtr.core.tool.Utilities; +import org.mtr.libraries.it.unimi.dsi.fastutil.ints.Int2ObjectAVLTreeMap; import org.mtr.libraries.it.unimi.dsi.fastutil.objects.*; import org.mtr.mapping.holder.Box; import org.mtr.mapping.holder.MutableText; @@ -29,7 +30,10 @@ public final class VehicleResource extends VehicleResourceSchema { public final Supplier createVehicleSoundBase; - public final CachedResource cachedVehicleResource; + @Nullable + private final LegacyVehicleSupplier> extraModelsSupplier; + private final Int2ObjectAVLTreeMap>> allModels = new Int2ObjectAVLTreeMap<>(); + private final Int2ObjectAVLTreeMap>> cachedVehicleResource = new Int2ObjectAVLTreeMap<>(); private static final boolean[][] CHRISTMAS_LIGHT_STAGES = { {true, false, false, false}, @@ -86,15 +90,10 @@ public final class VehicleResource extends VehicleResourceSchema { {true, true, true, true}, }; - public VehicleResource(ReaderBase readerBase, @Nullable ObjectArrayList extraModels, ResourceProvider resourceProvider) { + public VehicleResource(ReaderBase readerBase, @Nullable LegacyVehicleSupplier> extraModelsSupplier, ResourceProvider resourceProvider) { super(readerBase, resourceProvider); updateData(readerBase); - - if (extraModels != null) { - models.addAll(extraModels); - } - - cachedVehicleResource = cachedVehicleResourceInitializer(); + this.extraModelsSupplier = extraModelsSupplier; createVehicleSoundBase = createVehicleSoundBaseInitializer(); } @@ -164,8 +163,8 @@ public VehicleResource(ReaderBase readerBase, ResourceProvider resourceProvider) this.models.addAll(models); this.bogie1Models.addAll(bogie1Models); this.bogie2Models.addAll(bogie2Models); - this.cachedVehicleResource = cachedVehicleResourceInitializer(); - this.createVehicleSoundBase = createVehicleSoundBaseInitializer(); + this.extraModelsSupplier = null; + createVehicleSoundBase = createVehicleSoundBaseInitializer(); } @Nonnull @@ -186,8 +185,14 @@ protected ResourceProvider bogie2ModelsResourceProviderParameter() { return resourceProvider; } - public void queue(StoredMatrixTransformations storedMatrixTransformations, VehicleExtension vehicle, int light, ObjectArrayList openDoorways) { - final VehicleResourceCache vehicleResourceCache = cachedVehicleResource.getData(false); + public CachedResource getCachedVehicleResource(int carNumber, int totalCars) { + final int newCarNumber = extraModelsSupplier == null ? 0 : carNumber; + final int newTotalCars = extraModelsSupplier == null ? 0 : totalCars; + return cachedVehicleResource.computeIfAbsent(newCarNumber, key -> new Int2ObjectAVLTreeMap<>()).computeIfAbsent(newTotalCars, key -> cachedVehicleResourceInitializer(newCarNumber, newTotalCars)); + } + + public void queue(StoredMatrixTransformations storedMatrixTransformations, VehicleExtension vehicle, int carNumber, int totalCars, int light, ObjectArrayList openDoorways) { + final VehicleResourceCache vehicleResourceCache = getCachedVehicleResource(carNumber, totalCars).getData(false); if (vehicleResourceCache != null) { if (openDoorways.isEmpty()) { queue(vehicleResourceCache.optimizedModelsDoorsClosed, storedMatrixTransformations, vehicle, light, true); @@ -198,7 +203,7 @@ public void queue(StoredMatrixTransformations storedMatrixTransformations, Vehic } public void queueBogie(int bogieIndex, StoredMatrixTransformations storedMatrixTransformations, VehicleExtension vehicle, int light) { - final VehicleResourceCache vehicleResourceCache = cachedVehicleResource.getData(false); + final VehicleResourceCache vehicleResourceCache = getCachedVehicleResource(0, 1).getData(false); if (vehicleResourceCache != null && Utilities.isBetween(bogieIndex, 0, 1)) { queue(bogieIndex == 0 ? vehicleResourceCache.optimizedModelsBogie1 : vehicleResourceCache.optimizedModelsBogie2, storedMatrixTransformations, vehicle, light, true); } @@ -252,8 +257,8 @@ public String getWikipediaArticle() { return wikipediaArticle; } - public void iterateModels(ModelConsumer modelConsumer) { - iterateModels(models, modelConsumer); + public void iterateModels(int carNumber, int totalCars, ModelConsumer modelConsumer) { + iterateModels(getAllModels(carNumber, totalCars), modelConsumer); } public void iterateBogieModels(int bogieIndex, ModelConsumer modelConsumer) { @@ -326,6 +331,14 @@ public boolean hasBarrier2() { return hasBarrier2; } + private ObjectArrayList getAllModels(int carNumber, int totalCars) { + if (extraModelsSupplier == null) { + return models; + } else { + return allModels.getOrDefault(carNumber, new Int2ObjectAVLTreeMap<>()).getOrDefault(totalCars, new ObjectArrayList<>()); + } + } + public static boolean matchesCondition(VehicleExtension vehicle, PartCondition partCondition, boolean noOpenDoorways) { switch (partCondition) { case AT_DEPOT: @@ -352,9 +365,16 @@ public void collectTags(Object2ObjectAVLTreeMap cachedVehicleResourceInitializer() { + private CachedResource cachedVehicleResourceInitializer(int carNumber, int totalCars) { return new CachedResource<>(() -> { CustomResourceLoader.OPTIMIZED_RENDERER_WRAPPER.beginReload(); + final ObjectArrayList allModelsList = allModels.computeIfAbsent(carNumber, key -> new Int2ObjectAVLTreeMap<>()).computeIfAbsent(totalCars, key -> new ObjectArrayList<>()); + allModelsList.clear(); + allModelsList.addAll(models); + + if (extraModelsSupplier != null) { + allModelsList.addAll(extraModelsSupplier.apply(carNumber, totalCars)); + } final ObjectArrayList floors = new ObjectArrayList<>(); final Object2ObjectOpenHashMap> materialGroupsModel = new Object2ObjectOpenHashMap<>(); @@ -367,7 +387,7 @@ private CachedResource cachedVehicleResourceInitializer() final Object2ObjectOpenHashMap> objModelsBogie2Model = new Object2ObjectOpenHashMap<>(); final ObjectArrayList doorways = new ObjectArrayList<>(); - forEachNonNull(models, dynamicVehicleModel -> dynamicVehicleModel.writeFloorsAndDoorways(floors, doorways, materialGroupsModel, materialGroupsModelDoorsClosed, objModelsModel, objModelsModelDoorsClosed)); + forEachNonNull(allModelsList, dynamicVehicleModel -> dynamicVehicleModel.writeFloorsAndDoorways(floors, doorways, materialGroupsModel, materialGroupsModelDoorsClosed, objModelsModel, objModelsModelDoorsClosed)); if (floors.isEmpty() && doorways.isEmpty()) { Init.LOGGER.info("[{}] No floors or doorways found in vehicle models", id); @@ -382,7 +402,7 @@ private CachedResource cachedVehicleResourceInitializer() } } - forEachNonNull(models, dynamicVehicleModel -> dynamicVehicleModel.modelProperties.iterateParts(modelPropertiesPart -> modelPropertiesPart.mapDoors(doorways))); + forEachNonNull(allModelsList, dynamicVehicleModel -> dynamicVehicleModel.modelProperties.iterateParts(modelPropertiesPart -> modelPropertiesPart.mapDoors(doorways))); forEachNonNull(bogie1Models, dynamicVehicleModel -> dynamicVehicleModel.writeFloorsAndDoorways(new ObjectArrayList<>(), new ObjectArrayList<>(), new Object2ObjectOpenHashMap<>(), materialGroupsBogie1Model, new Object2ObjectOpenHashMap<>(), objModelsBogie1Model)); forEachNonNull(bogie2Models, dynamicVehicleModel -> dynamicVehicleModel.writeFloorsAndDoorways(new ObjectArrayList<>(), new ObjectArrayList<>(), new Object2ObjectOpenHashMap<>(), materialGroupsBogie2Model, new Object2ObjectOpenHashMap<>(), objModelsBogie2Model)); @@ -491,4 +511,9 @@ private static void forEachNonNull(ObjectArrayList models, Consume public interface ModelConsumer { void accept(int index, DynamicVehicleModel dynamicVehicleModel); } + + @FunctionalInterface + public interface LegacyVehicleSupplier { + T apply(int carNumber, int totalCars); + } } diff --git a/fabric/src/main/java/org/mtr/mod/screen/BetaWarningScreen.java b/fabric/src/main/java/org/mtr/mod/screen/BetaWarningScreen.java index 38a34c89d..b595b9e84 100644 --- a/fabric/src/main/java/org/mtr/mod/screen/BetaWarningScreen.java +++ b/fabric/src/main/java/org/mtr/mod/screen/BetaWarningScreen.java @@ -80,10 +80,10 @@ public void tick2() { @Override public void onClose2() { - super.onClose2(); if (openTime >= FORCE_OPEN_DURATION) { Config.getClient().hideBetaWarningScreen(); Config.save(); + super.onClose2(); } } diff --git a/fabric/src/main/java/org/mtr/mod/screen/ConfigScreen.java b/fabric/src/main/java/org/mtr/mod/screen/ConfigScreen.java index a287ade5a..568ad9397 100644 --- a/fabric/src/main/java/org/mtr/mod/screen/ConfigScreen.java +++ b/fabric/src/main/java/org/mtr/mod/screen/ConfigScreen.java @@ -1,10 +1,10 @@ package org.mtr.mod.screen; -import org.mtr.mapping.holder.ButtonWidget; -import org.mtr.mapping.holder.ClickableWidget; -import org.mtr.mapping.holder.MutableText; -import org.mtr.mapping.holder.Util; -import org.mtr.mapping.mapper.*; +import org.mtr.mapping.holder.*; +import org.mtr.mapping.mapper.ButtonWidgetExtension; +import org.mtr.mapping.mapper.GraphicsHolder; +import org.mtr.mapping.mapper.OptimizedRenderer; +import org.mtr.mapping.mapper.TextHelper; import org.mtr.mod.Init; import org.mtr.mod.Patreon; import org.mtr.mod.client.DynamicTextureCache; @@ -14,7 +14,9 @@ import org.mtr.mod.data.IGui; import org.mtr.mod.generated.lang.TranslationProvider; -public class ConfigScreen extends ScreenExtension implements IGui { +import javax.annotation.Nullable; + +public class ConfigScreen extends MTRScreenBase implements IGui { private final Client client = Config.getClient(); @@ -31,8 +33,8 @@ public class ConfigScreen extends ScreenExtension implements IGui { private static final int BUTTON_WIDTH = 60; private static final int BUTTON_HEIGHT = TEXT_HEIGHT + TEXT_PADDING; - public ConfigScreen() { - super(); + public ConfigScreen(@Nullable Screen previousScreen) { + super(previousScreen); buttonShowAnnouncementMessages = new ButtonWidgetExtension(0, 0, 0, BUTTON_HEIGHT, TextHelper.literal(""), button -> { client.toggleChatAnnouncements(); diff --git a/fabric/src/main/java/org/mtr/mod/screen/DashboardListSelectorScreen.java b/fabric/src/main/java/org/mtr/mod/screen/DashboardListSelectorScreen.java index a59dcfae5..440bf0876 100644 --- a/fabric/src/main/java/org/mtr/mod/screen/DashboardListSelectorScreen.java +++ b/fabric/src/main/java/org/mtr/mod/screen/DashboardListSelectorScreen.java @@ -6,8 +6,6 @@ import org.mtr.libraries.it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.mtr.libraries.it.unimi.dsi.fastutil.objects.ObjectImmutableList; import org.mtr.mapping.holder.ClickableWidget; -import org.mtr.mapping.holder.MinecraftClient; -import org.mtr.mapping.holder.Screen; import org.mtr.mapping.mapper.ButtonWidgetExtension; import org.mtr.mapping.mapper.GraphicsHolder; import org.mtr.mapping.mapper.ScreenExtension; @@ -19,7 +17,7 @@ import javax.annotation.Nullable; -public class DashboardListSelectorScreen extends ScreenExtension implements IGui { +public class DashboardListSelectorScreen extends MTRScreenBase implements IGui { protected final ObjectImmutableList allData; protected final LongCollection selectedIds; @@ -28,22 +26,16 @@ public class DashboardListSelectorScreen extends ScreenExtension implements IGui protected final DashboardList selectedList; protected final ButtonWidgetExtension buttonDone; - private final ScreenExtension previousScreen; private final Runnable onClose; private final boolean isSingleSelect; private final boolean canRepeat; - public DashboardListSelectorScreen(@Nullable Runnable onClose, ObjectImmutableList allData, LongCollection selectedIds, boolean isSingleSelect, boolean canRepeat) { - this(null, onClose, allData, selectedIds, isSingleSelect, canRepeat); + public DashboardListSelectorScreen(ObjectImmutableList allData, LongCollection selectedIds, boolean isSingleSelect, boolean canRepeat, @Nullable ScreenExtension previousScreenExtension) { + this(null, allData, selectedIds, isSingleSelect, canRepeat, previousScreenExtension); } - public DashboardListSelectorScreen(@Nullable ScreenExtension previousScreen, ObjectImmutableList allData, LongCollection selectedIds, boolean isSingleSelect, boolean canRepeat) { - this(previousScreen, null, allData, selectedIds, isSingleSelect, canRepeat); - } - - private DashboardListSelectorScreen(@Nullable ScreenExtension previousScreen, @Nullable Runnable onClose, ObjectImmutableList allData, LongCollection selectedIds, boolean isSingleSelect, boolean canRepeat) { - super(); - this.previousScreen = previousScreen; + public DashboardListSelectorScreen(@Nullable Runnable onClose, ObjectImmutableList allData, LongCollection selectedIds, boolean isSingleSelect, boolean canRepeat, @Nullable ScreenExtension previousScreenExtension) { + super(previousScreenExtension); this.onClose = onClose; this.allData = allData; this.selectedIds = selectedIds; @@ -109,9 +101,6 @@ public void onClose2() { if (onClose != null) { onClose.run(); } - if (previousScreen != null) { - MinecraftClient.getInstance().openScreen(new Screen(previousScreen)); - } } @Override diff --git a/fabric/src/main/java/org/mtr/mod/screen/DashboardScreen.java b/fabric/src/main/java/org/mtr/mod/screen/DashboardScreen.java index afb0e99fe..9a6bf4f08 100644 --- a/fabric/src/main/java/org/mtr/mod/screen/DashboardScreen.java +++ b/fabric/src/main/java/org/mtr/mod/screen/DashboardScreen.java @@ -88,8 +88,8 @@ public DashboardScreen(TransportMode transportMode) { widgetMap.setMapOverlayMode(WorldMap.MapOverlayMode.CURRENT_Y); toggleButtons(); }); - buttonRailActions = new ButtonWidgetExtension(0, 0, 0, SQUARE_SIZE, TranslationProvider.GUI_MTR_RAIL_ACTIONS_BUTTON.getMutableText(), button -> MinecraftClient.getInstance().openScreen(new Screen(new RailActionsScreen()))); - buttonOptions = new ButtonWidgetExtension(0, 0, 0, SQUARE_SIZE, TextHelper.translatable("menu.options"), button -> MinecraftClient.getInstance().openScreen(new Screen(new ConfigScreen()))); + buttonRailActions = new ButtonWidgetExtension(0, 0, 0, SQUARE_SIZE, TranslationProvider.GUI_MTR_RAIL_ACTIONS_BUTTON.getMutableText(), button -> MinecraftClient.getInstance().openScreen(new Screen(new RailActionsScreen(this)))); + buttonOptions = new ButtonWidgetExtension(0, 0, 0, SQUARE_SIZE, TextHelper.translatable("menu.options"), button -> MinecraftClient.getInstance().openScreen(new Screen(new ConfigScreen(new Screen(this))))); buttonTransportSystemMap = new ButtonWidgetExtension(0, 0, 0, SQUARE_SIZE, TranslationProvider.GUI_MTR_TRANSPORT_SYSTEM_MAP.getMutableText(), button -> Util.getOperatingSystem().open(String.format("http://localhost:%s", InitClient.getServerPort()))); buttonResourcePackCreator = new ButtonWidgetExtension(0, 0, 0, SQUARE_SIZE, TranslationProvider.GUI_MTR_RESOURCE_PACK_CREATOR.getMutableText(), button -> Util.getOperatingSystem().open(String.format("http://localhost:%s/creator/", InitClient.getServerPort()))); diff --git a/fabric/src/main/java/org/mtr/mod/screen/DeleteConfirmationScreen.java b/fabric/src/main/java/org/mtr/mod/screen/DeleteConfirmationScreen.java index 84724d673..fab9e6e99 100644 --- a/fabric/src/main/java/org/mtr/mod/screen/DeleteConfirmationScreen.java +++ b/fabric/src/main/java/org/mtr/mod/screen/DeleteConfirmationScreen.java @@ -1,8 +1,6 @@ package org.mtr.mod.screen; import org.mtr.mapping.holder.ClickableWidget; -import org.mtr.mapping.holder.MinecraftClient; -import org.mtr.mapping.holder.Screen; import org.mtr.mapping.mapper.ButtonWidgetExtension; import org.mtr.mapping.mapper.GraphicsHolder; import org.mtr.mapping.mapper.ScreenExtension; @@ -12,24 +10,21 @@ import org.mtr.mod.data.IGui; import org.mtr.mod.generated.lang.TranslationProvider; -public class DeleteConfirmationScreen extends ScreenExtension implements IGui { +public class DeleteConfirmationScreen extends MTRScreenBase implements IGui { private final Runnable deleteCallback; private final String name; - private final DashboardScreen dashboardScreen; private final ButtonWidgetExtension buttonYes; private final ButtonWidgetExtension buttonNo; private static final int BUTTON_WIDTH = 100; private static final int BUTTON_HALF_PADDING = 10; - public DeleteConfirmationScreen(Runnable deleteCallback, String name, DashboardScreen dashboardScreen) { - super(); + public DeleteConfirmationScreen(Runnable deleteCallback, String name, ScreenExtension previousScreenExtension) { + super(previousScreenExtension); this.deleteCallback = deleteCallback; this.name = name; - this.dashboardScreen = dashboardScreen; - buttonYes = new ButtonWidgetExtension(0, 0, 0, SQUARE_SIZE, TextHelper.translatable("gui.yes"), button -> onYes()); buttonNo = new ButtonWidgetExtension(0, 0, 0, SQUARE_SIZE, TextHelper.translatable("gui.no"), button -> onNo()); } @@ -54,12 +49,6 @@ public void render(GraphicsHolder graphicsHolder, int mouseX, int mouseY, float } } - @Override - public void onClose2() { - super.onClose2(); - MinecraftClient.getInstance().openScreen(new Screen(dashboardScreen)); - } - private void onYes() { deleteCallback.run(); onClose2(); diff --git a/fabric/src/main/java/org/mtr/mod/screen/EditDepotScreen.java b/fabric/src/main/java/org/mtr/mod/screen/EditDepotScreen.java index 8493d858c..8c7f43d4f 100644 --- a/fabric/src/main/java/org/mtr/mod/screen/EditDepotScreen.java +++ b/fabric/src/main/java/org/mtr/mod/screen/EditDepotScreen.java @@ -2,9 +2,10 @@ import org.apache.commons.lang3.StringUtils; import org.mtr.core.data.*; -import org.mtr.core.operation.GenerateOrClearByDepotIds; +import org.mtr.core.operation.DepotOperationByIds; import org.mtr.core.operation.UpdateDataRequest; import org.mtr.core.tool.Utilities; +import org.mtr.libraries.it.unimi.dsi.fastutil.longs.Long2LongAVLTreeMap; import org.mtr.libraries.it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.mtr.libraries.it.unimi.dsi.fastutil.objects.ObjectImmutableList; import org.mtr.mapping.holder.ClickableWidget; @@ -21,6 +22,7 @@ import org.mtr.mod.generated.lang.TranslationProvider; import org.mtr.mod.packet.PacketDepotClear; import org.mtr.mod.packet.PacketDepotGenerate; +import org.mtr.mod.packet.PacketDepotInstantDeploy; import org.mtr.mod.packet.PacketUpdateData; import java.text.DateFormat; @@ -44,6 +46,7 @@ public class EditDepotScreen extends EditNameColorScreenBase { private final ButtonWidgetExtension buttonAddDeparture; private final ButtonWidgetExtension buttonEditInstructions; + private final ButtonWidgetExtension buttonInstantDeploy; private final ButtonWidgetExtension buttonGenerateRoute; private final ButtonWidgetExtension buttonClearTrains; private final CheckboxWidgetExtension checkboxRepeatIndefinitely; @@ -56,9 +59,10 @@ public class EditDepotScreen extends EditNameColorScreenBase { private static final int MAX_TRAINS_PER_HOUR = 5; private static final int DEFAULT_CRUISING_ALTITUDE = 256; private static final int TRAIN_FREQUENCY_MULTIPLIER = 4; + private static final Long2LongAVLTreeMap DEPOT_GENERATION_START_TIME = new Long2LongAVLTreeMap(); - public EditDepotScreen(Depot depot, TransportMode transportMode, DashboardScreen dashboardScreen) { - super(depot, dashboardScreen, TranslationProvider.GUI_MTR_DEPOT_NAME, TranslationProvider.GUI_MTR_DEPOT_COLOR); + public EditDepotScreen(Depot depot, TransportMode transportMode, ScreenExtension previousScreenExtension) { + super(depot, TranslationProvider.GUI_MTR_DEPOT_NAME, TranslationProvider.GUI_MTR_DEPOT_COLOR, previousScreenExtension); sliderX = GraphicsHolder.getTextWidth(getTimeString(0)) + TEXT_PADDING * 2; sliderWidthWithText = SLIDER_WIDTH + TEXT_PADDING + GraphicsHolder.getTextWidth(getSliderString(0)); @@ -101,25 +105,32 @@ public EditDepotScreen(Depot depot, TransportMode transportMode, DashboardScreen saveData(); final ObjectArrayList routes = new ObjectArrayList<>(MinecraftClientData.getFilteredDataSet(transportMode, MinecraftClientData.getDashboardInstance().routes)); Collections.sort(routes); - MinecraftClient.getInstance().openScreen(new Screen(new DashboardListSelectorScreen(this, new ObjectImmutableList<>(routes), data.getRouteIds(), false, true))); + MinecraftClient.getInstance().openScreen(new Screen(new DashboardListSelectorScreen(new ObjectImmutableList<>(routes), data.getRouteIds(), false, true, this))); + }); + buttonInstantDeploy = new ButtonWidgetExtension(0, 0, 0, SQUARE_SIZE, TranslationProvider.GUI_MTR_INSTANT_DEPLOY.getMutableText(), button -> { + saveData(); + final DepotOperationByIds depotOperationByIds = new DepotOperationByIds(); + depotOperationByIds.addDepotId(depot.getId()); + InitClient.REGISTRY_CLIENT.sendPacketToServer(new PacketDepotInstantDeploy(depotOperationByIds)); }); buttonGenerateRoute = new ButtonWidgetExtension(0, 0, 0, SQUARE_SIZE, TranslationProvider.GUI_MTR_REFRESH_PATH.getMutableText(), button -> { saveData(); - final GenerateOrClearByDepotIds generateOrClearByDepotIds = new GenerateOrClearByDepotIds(); - generateOrClearByDepotIds.addDepotId(depot.getId()); - InitClient.REGISTRY_CLIENT.sendPacketToServer(new PacketDepotGenerate(generateOrClearByDepotIds)); + final DepotOperationByIds depotOperationByIds = new DepotOperationByIds(); + depotOperationByIds.addDepotId(depot.getId()); + DEPOT_GENERATION_START_TIME.put(depot.getId(), System.currentTimeMillis()); + InitClient.REGISTRY_CLIENT.sendPacketToServer(new PacketDepotGenerate(depotOperationByIds)); }); buttonClearTrains = new ButtonWidgetExtension(0, 0, 0, SQUARE_SIZE, TranslationProvider.GUI_MTR_CLEAR_VEHICLES.getMutableText(), button -> { saveData(); - final GenerateOrClearByDepotIds generateOrClearByDepotIds = new GenerateOrClearByDepotIds(); - generateOrClearByDepotIds.addDepotId(depot.getId()); - InitClient.REGISTRY_CLIENT.sendPacketToServer(new PacketDepotClear(generateOrClearByDepotIds)); + final DepotOperationByIds depotOperationByIds = new DepotOperationByIds(); + depotOperationByIds.addDepotId(depot.getId()); + InitClient.REGISTRY_CLIENT.sendPacketToServer(new PacketDepotClear(depotOperationByIds)); }); checkboxRepeatIndefinitely = new CheckboxWidgetExtension(0, 0, 0, SQUARE_SIZE, true, button -> { saveData(); - final GenerateOrClearByDepotIds generateOrClearByDepotIds = new GenerateOrClearByDepotIds(); - generateOrClearByDepotIds.addDepotId(depot.getId()); - InitClient.REGISTRY_CLIENT.sendPacketToServer(new PacketDepotGenerate(generateOrClearByDepotIds)); + final DepotOperationByIds depotOperationByIds = new DepotOperationByIds(); + depotOperationByIds.addDepotId(depot.getId()); + InitClient.REGISTRY_CLIENT.sendPacketToServer(new PacketDepotGenerate(depotOperationByIds)); }); checkboxRepeatIndefinitely.setMessage2(TranslationProvider.GUI_MTR_REPEAT_INDEFINITELY.getText()); textFieldCruisingAltitude = new TextFieldWidgetExtension(0, 0, 0, SQUARE_SIZE, 5, TextCase.DEFAULT, "[^-\\d]", String.valueOf(DEFAULT_CRUISING_ALTITUDE)); @@ -131,13 +142,14 @@ protected void init2() { final int buttonWidth = (width - rightPanelsX) / 2; IDrawing.setPositionAndWidth(buttonEditInstructions, rightPanelsX, PANELS_START, buttonWidth * 2); - IDrawing.setPositionAndWidth(buttonGenerateRoute, rightPanelsX, PANELS_START + SQUARE_SIZE, buttonWidth * (showScheduleControls ? 1 : 2)); - IDrawing.setPositionAndWidth(buttonClearTrains, rightPanelsX + buttonWidth, PANELS_START + SQUARE_SIZE, buttonWidth); - IDrawing.setPositionAndWidth(checkboxRepeatIndefinitely, rightPanelsX, PANELS_START + SQUARE_SIZE * 2 + (showCruisingAltitude ? SQUARE_SIZE + TEXT_FIELD_PADDING : 0), buttonWidth * 2); + IDrawing.setPositionAndWidth(buttonInstantDeploy, rightPanelsX, PANELS_START + SQUARE_SIZE, buttonWidth * 2); + IDrawing.setPositionAndWidth(buttonGenerateRoute, rightPanelsX, PANELS_START + SQUARE_SIZE * 2, buttonWidth * (showScheduleControls ? 1 : 2)); + IDrawing.setPositionAndWidth(buttonClearTrains, rightPanelsX + buttonWidth, PANELS_START + SQUARE_SIZE * 2, buttonWidth); + IDrawing.setPositionAndWidth(checkboxRepeatIndefinitely, rightPanelsX, PANELS_START + SQUARE_SIZE * 3 + (showCruisingAltitude ? SQUARE_SIZE + TEXT_FIELD_PADDING : 0), buttonWidth * 2); checkboxRepeatIndefinitely.setChecked(data.getRepeatInfinitely()); final int cruisingAltitudeTextWidth = GraphicsHolder.getTextWidth(cruisingAltitudeText) + TEXT_PADDING * 2; - IDrawing.setPositionAndWidth(textFieldCruisingAltitude, rightPanelsX + Math.min(cruisingAltitudeTextWidth, buttonWidth * 2 - SQUARE_SIZE * 3) + TEXT_FIELD_PADDING / 2, PANELS_START + SQUARE_SIZE * 2 + TEXT_FIELD_PADDING / 2, SQUARE_SIZE * 3 - TEXT_FIELD_PADDING); + IDrawing.setPositionAndWidth(textFieldCruisingAltitude, rightPanelsX + Math.min(cruisingAltitudeTextWidth, buttonWidth * 2 - SQUARE_SIZE * 3) + TEXT_FIELD_PADDING / 2, PANELS_START + SQUARE_SIZE * 4 + TEXT_FIELD_PADDING / 2, SQUARE_SIZE * 3 - TEXT_FIELD_PADDING); textFieldCruisingAltitude.setText2(String.valueOf(data.getCruisingAltitude())); if (showScheduleControls) { @@ -166,6 +178,7 @@ protected void init2() { buttonAddDeparture.active = false; addChild(new ClickableWidget(buttonEditInstructions)); + addChild(new ClickableWidget(buttonInstantDeploy)); addChild(new ClickableWidget(buttonGenerateRoute)); if (showScheduleControls) { addChild(new ClickableWidget(buttonUseRealTime)); @@ -224,7 +237,7 @@ public void render(GraphicsHolder graphicsHolder, int mouseX, int mouseY, float super.render(graphicsHolder, mouseX, mouseY, delta); - final int yStartRightPane = PANELS_START + SQUARE_SIZE * (checkboxRepeatIndefinitely.visible ? 3 : 2) + (showCruisingAltitude ? SQUARE_SIZE + TEXT_FIELD_PADDING : 0) + TEXT_PADDING; + final int yStartRightPane = PANELS_START + SQUARE_SIZE * (checkboxRepeatIndefinitely.visible ? 4 : 3) + (showCruisingAltitude ? SQUARE_SIZE + TEXT_FIELD_PADDING : 0) + TEXT_PADDING; if (showCruisingAltitude) { graphicsHolder.drawText(cruisingAltitudeText, rightPanelsX + TEXT_PADDING, PANELS_START + SQUARE_SIZE * 2 + TEXT_PADDING + TEXT_FIELD_PADDING / 2, ARGB_WHITE, false, GraphicsHolder.getDefaultLight()); } @@ -352,13 +365,16 @@ private boolean checkDeparture(String text, boolean addToList, boolean removeFro private static String getSuccessfulSegmentsText(Depot depot) { final long lastGeneratedMillis = depot.getLastGeneratedMillis(); - if (lastGeneratedMillis == 0) { return ""; } - final long timeDifference = System.currentTimeMillis() - lastGeneratedMillis; - final StringBuilder stringBuilder = new StringBuilder(TranslationProvider.GUI_MTR_PATH_REFRESH_TIME.getString(getTimeDifferenceString(timeDifference))).append("|").append(DateFormat.getDateTimeInstance().format(new Date(lastGeneratedMillis))).append("||"); + final long generationStartTime = DEPOT_GENERATION_START_TIME.getOrDefault(depot.getId(), 0); + if (generationStartTime > lastGeneratedMillis) { + return TranslationProvider.GUI_MTR_PATH_GENERATING.getString(getTimeDifferenceString(System.currentTimeMillis() - generationStartTime)); + } + + final StringBuilder stringBuilder = new StringBuilder(TranslationProvider.GUI_MTR_PATH_REFRESH_TIME.getString(getTimeDifferenceString(System.currentTimeMillis() - lastGeneratedMillis))).append("|").append(DateFormat.getDateTimeInstance().format(new Date(lastGeneratedMillis))).append("||"); switch (depot.getLastGeneratedStatus()) { case SUCCESSFUL: @@ -398,14 +414,15 @@ private static String getTimeString(int hour) { private static String getTimeDifferenceString(long timeDifference) { final MutableText mutableText; - if (timeDifference >= HOURS_PER_DAY * 60 * 60 * MILLIS_PER_SECOND) { - mutableText = TranslationProvider.GUI_MTR_DAYS.getMutableText(timeDifference / (HOURS_PER_DAY * 60 * 60 * MILLIS_PER_SECOND)); - } else if (timeDifference >= 60 * 60 * MILLIS_PER_SECOND) { - mutableText = TranslationProvider.GUI_MTR_HOURS.getMutableText(timeDifference / (60 * 60 * MILLIS_PER_SECOND)); - } else if (timeDifference >= 60 * MILLIS_PER_SECOND) { - mutableText = TranslationProvider.GUI_MTR_MINUTES.getMutableText(timeDifference / (60 * MILLIS_PER_SECOND)); + final long newTimeDifference = Math.abs(timeDifference); + if (newTimeDifference >= HOURS_PER_DAY * 60 * 60 * MILLIS_PER_SECOND) { + mutableText = TranslationProvider.GUI_MTR_DAYS.getMutableText(newTimeDifference / (HOURS_PER_DAY * 60 * 60 * MILLIS_PER_SECOND)); + } else if (newTimeDifference >= 60 * 60 * MILLIS_PER_SECOND) { + mutableText = TranslationProvider.GUI_MTR_HOURS.getMutableText(newTimeDifference / (60 * 60 * MILLIS_PER_SECOND)); + } else if (newTimeDifference >= 60 * MILLIS_PER_SECOND) { + mutableText = TranslationProvider.GUI_MTR_MINUTES.getMutableText(newTimeDifference / (60 * MILLIS_PER_SECOND)); } else { - mutableText = TranslationProvider.GUI_MTR_SECONDS.getMutableText(timeDifference / MILLIS_PER_SECOND); + mutableText = TranslationProvider.GUI_MTR_SECONDS.getMutableText(newTimeDifference / MILLIS_PER_SECOND); } return mutableText.getString(); } diff --git a/fabric/src/main/java/org/mtr/mod/screen/EditNameColorScreenBase.java b/fabric/src/main/java/org/mtr/mod/screen/EditNameColorScreenBase.java index 0726c49c2..8d76da345 100644 --- a/fabric/src/main/java/org/mtr/mod/screen/EditNameColorScreenBase.java +++ b/fabric/src/main/java/org/mtr/mod/screen/EditNameColorScreenBase.java @@ -3,9 +3,7 @@ import org.mtr.core.data.NameColorDataBase; import org.mtr.core.tool.Utilities; import org.mtr.mapping.holder.ClickableWidget; -import org.mtr.mapping.holder.MinecraftClient; import org.mtr.mapping.holder.MutableText; -import org.mtr.mapping.holder.Screen; import org.mtr.mapping.mapper.GraphicsHolder; import org.mtr.mapping.mapper.ScreenExtension; import org.mtr.mapping.mapper.TextFieldWidgetExtension; @@ -14,24 +12,22 @@ import org.mtr.mod.data.IGui; import org.mtr.mod.generated.lang.TranslationProvider; -public abstract class EditNameColorScreenBase extends ScreenExtension implements Utilities, IGui { +public abstract class EditNameColorScreenBase extends MTRScreenBase implements Utilities, IGui { private int nameStart; private int colorStart; private int colorEnd; protected final T data; - private final DashboardScreen dashboardScreen; private final MutableText nameText; private final MutableText colorText; private final TextFieldWidgetExtension textFieldName; private final WidgetColorSelector colorSelector; - public EditNameColorScreenBase(T data, DashboardScreen dashboardScreen, TranslationProvider.TranslationHolder nameKey, TranslationProvider.TranslationHolder colorKey) { - super(); + public EditNameColorScreenBase(T data, TranslationProvider.TranslationHolder nameKey, TranslationProvider.TranslationHolder colorKey, ScreenExtension previousScreenExtension) { + super(previousScreenExtension); this.data = data; - this.dashboardScreen = dashboardScreen; nameText = nameKey.getMutableText(); colorText = colorKey.getMutableText(); @@ -48,7 +44,6 @@ public void tick2() { @Override public void onClose2() { super.onClose2(); - MinecraftClient.getInstance().openScreen(new Screen(dashboardScreen)); saveData(); } diff --git a/fabric/src/main/java/org/mtr/mod/screen/EditRouteScreen.java b/fabric/src/main/java/org/mtr/mod/screen/EditRouteScreen.java index 814ba83e2..d5c0bbdce 100644 --- a/fabric/src/main/java/org/mtr/mod/screen/EditRouteScreen.java +++ b/fabric/src/main/java/org/mtr/mod/screen/EditRouteScreen.java @@ -33,8 +33,8 @@ public class EditRouteScreen extends EditNameColorScreenBase implements I private static final int CHECKBOX_WIDTH = 160; - public EditRouteScreen(Route route, DashboardScreen dashboardScreen) { - super(route, dashboardScreen, TranslationProvider.GUI_MTR_ROUTE_NAME, TranslationProvider.GUI_MTR_ROUTE_COLOR); + public EditRouteScreen(Route route, ScreenExtension previousScreenExtension) { + super(route, TranslationProvider.GUI_MTR_ROUTE_NAME, TranslationProvider.GUI_MTR_ROUTE_COLOR, previousScreenExtension); textFieldLightRailRouteNumber = new TextFieldWidgetExtension(0, 0, 0, SQUARE_SIZE, 256, TextCase.DEFAULT, null, null); buttonRouteType = new ButtonWidgetExtension(0, 0, 0, SQUARE_SIZE, TranslationProvider.GUI_MTR_ADD_VALUE.getMutableText(), button -> setRouteType(route, route.getRouteType().next())); diff --git a/fabric/src/main/java/org/mtr/mod/screen/EditStationScreen.java b/fabric/src/main/java/org/mtr/mod/screen/EditStationScreen.java index a91013d89..a6b0d65c8 100644 --- a/fabric/src/main/java/org/mtr/mod/screen/EditStationScreen.java +++ b/fabric/src/main/java/org/mtr/mod/screen/EditStationScreen.java @@ -47,8 +47,8 @@ public class EditStationScreen extends EditNameColorScreenBase { private static final int EXIT_PANELS_START = SQUARE_SIZE * 3 + TEXT_FIELD_PADDING + TEXT_PADDING; - public EditStationScreen(Station station, DashboardScreen dashboardScreen) { - super(station, dashboardScreen, TranslationProvider.GUI_MTR_STATION_NAME, TranslationProvider.GUI_MTR_STATION_COLOR); + public EditStationScreen(Station station, ScreenExtension previousScreenExtension) { + super(station, TranslationProvider.GUI_MTR_STATION_NAME, TranslationProvider.GUI_MTR_STATION_COLOR, previousScreenExtension); textFieldZone = new TextFieldWidgetExtension(0, 0, 0, SQUARE_SIZE, DashboardScreen.MAX_COLOR_ZONE_LENGTH, TextCase.DEFAULT, "[^-\\d]", null); textFieldExitParentLetter = new TextFieldWidgetExtension(0, 0, 0, SQUARE_SIZE, 2, TextCase.UPPER, "[^A-Z]", "A"); textFieldExitParentNumber = new TextFieldWidgetExtension(0, 0, 0, SQUARE_SIZE, 2, TextCase.DEFAULT, "\\D", "1"); diff --git a/fabric/src/main/java/org/mtr/mod/screen/EyeCandyObjectSelectionScreen.java b/fabric/src/main/java/org/mtr/mod/screen/EyeCandyObjectSelectionScreen.java index 88184c6db..3099d8522 100644 --- a/fabric/src/main/java/org/mtr/mod/screen/EyeCandyObjectSelectionScreen.java +++ b/fabric/src/main/java/org/mtr/mod/screen/EyeCandyObjectSelectionScreen.java @@ -8,8 +8,8 @@ public class EyeCandyObjectSelectionScreen extends DashboardListSelectorScreen { private final Runnable updateData; - public EyeCandyObjectSelectionScreen(ScreenExtension previousScreen, ObjectImmutableList allData, LongCollection selectedIds, Runnable updateData) { - super(previousScreen, allData, selectedIds, true, false); + public EyeCandyObjectSelectionScreen(ObjectImmutableList allData, LongCollection selectedIds, Runnable updateData, ScreenExtension previousScreenExtension) { + super(allData, selectedIds, true, false, previousScreenExtension); this.updateData = updateData; } diff --git a/fabric/src/main/java/org/mtr/mod/screen/EyeCandyScreen.java b/fabric/src/main/java/org/mtr/mod/screen/EyeCandyScreen.java index 1cfd42354..6cf1de9f4 100644 --- a/fabric/src/main/java/org/mtr/mod/screen/EyeCandyScreen.java +++ b/fabric/src/main/java/org/mtr/mod/screen/EyeCandyScreen.java @@ -55,7 +55,7 @@ public EyeCandyScreen(BlockPos blockPos, BlockEyeCandy.BlockEntity blockEntity) } } - buttonSelectModel = new ButtonWidgetExtension(0, 0, 0, SQUARE_SIZE, button -> MinecraftClient.getInstance().openScreen(new Screen(new EyeCandyObjectSelectionScreen(this, new ObjectImmutableList<>(objectsForList), selectedModelIndices, this::sendUpdate)))); + buttonSelectModel = new ButtonWidgetExtension(0, 0, 0, SQUARE_SIZE, button -> MinecraftClient.getInstance().openScreen(new Screen(new EyeCandyObjectSelectionScreen(new ObjectImmutableList<>(objectsForList), selectedModelIndices, this::sendUpdate, this)))); buttonSelectModel.setMessage2(new Text(TextHelper.translatable("selectWorld.edit").data)); textFieldTranslateX = new TextFieldWidgetExtension(0, 0, 0, SQUARE_SIZE, MAX_NUMBER_TEXT_LENGTH, TextCase.DEFAULT, "[^\\d.-]", null); textFieldTranslateX.setChangedListener2(text -> sendUpdate()); diff --git a/fabric/src/main/java/org/mtr/mod/screen/FakePauseScreen.java b/fabric/src/main/java/org/mtr/mod/screen/FakePauseScreen.java index d4c05ef0d..f2e192122 100644 --- a/fabric/src/main/java/org/mtr/mod/screen/FakePauseScreen.java +++ b/fabric/src/main/java/org/mtr/mod/screen/FakePauseScreen.java @@ -2,11 +2,10 @@ import org.mtr.mapping.holder.MinecraftClient; import org.mtr.mapping.mapper.GraphicsHolder; -import org.mtr.mapping.mapper.ScreenExtension; import org.mtr.mod.data.IGui; import org.mtr.mod.generated.lang.TranslationProvider; -public class FakePauseScreen extends ScreenExtension implements IGui { +public class FakePauseScreen extends MTRScreenBase implements IGui { private long textCooldown; private final String dismissPauseScreenText = TranslationProvider.GUI_MTR_DISMISS_PAUSE_SCREEN.getString(); diff --git a/fabric/src/main/java/org/mtr/mod/screen/FileUploaderScreen.java b/fabric/src/main/java/org/mtr/mod/screen/FileUploaderScreen.java deleted file mode 100644 index ef8643942..000000000 --- a/fabric/src/main/java/org/mtr/mod/screen/FileUploaderScreen.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.mtr.mod.screen; - -import org.mtr.mapping.holder.MinecraftClient; -import org.mtr.mapping.holder.Screen; -import org.mtr.mapping.mapper.GraphicsHolder; -import org.mtr.mapping.mapper.ScreenExtension; -import org.mtr.mod.data.IGui; -import org.mtr.mod.generated.lang.TranslationProvider; - -import java.nio.file.Path; -import java.util.List; -import java.util.function.Consumer; - -public class FileUploaderScreen extends ScreenExtension implements IGui { - - private final ScreenExtension screen; - private final Consumer> filesCallback; - - public FileUploaderScreen(ScreenExtension screen, Consumer> filesCallback) { - super(); - this.screen = screen; - this.filesCallback = filesCallback; - } - - @Override - public void render(GraphicsHolder graphicsHolder, int mouseX, int mouseY, float delta) { - renderBackground(graphicsHolder); - super.render(graphicsHolder, mouseX, mouseY, delta); - graphicsHolder.drawCenteredText(TranslationProvider.GUI_MTR_DRAG_FILE_TO_UPLOAD.getMutableText(), width / 2, (height - TEXT_HEIGHT) / 2, ARGB_WHITE); - } - - @Override - public void filesDragged2(List paths) { - filesCallback.accept(paths); - onClose2(); - } - - @Override - public void onClose2() { - MinecraftClient.getInstance().openScreen(new Screen(screen)); - } -} diff --git a/fabric/src/main/java/org/mtr/mod/screen/GenericScreenBase.java b/fabric/src/main/java/org/mtr/mod/screen/GenericScreenBase.java deleted file mode 100644 index e22716cd6..000000000 --- a/fabric/src/main/java/org/mtr/mod/screen/GenericScreenBase.java +++ /dev/null @@ -1,193 +0,0 @@ -package org.mtr.mod.screen; - -import org.mtr.core.serializer.SerializedDataBase; -import org.mtr.mapping.holder.ClickableWidget; -import org.mtr.mapping.holder.MinecraftClient; -import org.mtr.mapping.holder.Screen; -import org.mtr.mapping.mapper.*; -import org.mtr.mapping.tool.TextCase; -import org.mtr.mod.data.IGui; - -import java.util.ArrayList; -import java.util.List; -import java.util.function.*; - -public abstract class GenericScreenBase extends ScreenExtension implements IGui { - - protected final T data; - protected final List> dataElements = new ArrayList<>(); - private final GenericScreenBase previousScreen; - - public GenericScreenBase(T data, GenericScreenBase previousScreen) { - super(); - this.data = data; - this.previousScreen = previousScreen; - } - - @Override - protected void init2() { - super.init2(); - int offsetY = 0; - for (final DataElementBase dataElement : dataElements) { - dataElement.init(this, SQUARE_SIZE + TEXT_HEIGHT + TEXT_PADDING + offsetY); - offsetY += dataElement.getWidgetHeight(); - } - } - - @Override - public void render(GraphicsHolder graphicsHolder, int mouseX, int mouseY, float delta) { - renderBackground(graphicsHolder); - super.render(graphicsHolder, mouseX, mouseY, delta); - int offsetY = 0; - for (final DataElementBase dataElement : dataElements) { - dataElement.render(graphicsHolder, SQUARE_SIZE + TEXT_HEIGHT + TEXT_PADDING + offsetY); - offsetY += dataElement.getWidgetHeight(); - } - } - - @Override - public void onClose2() { - MinecraftClient.getInstance().openScreen(new Screen(previousScreen)); - } - - @Override - public boolean isPauseScreen2() { - return false; - } - - protected static abstract class DataElementBase { - - final String title; - final Supplier getData; - final Consumer setData; - - static final int OFFSET_X = SQUARE_SIZE + PANEL_WIDTH + TEXT_PADDING; - - DataElementBase(String title, Supplier getData, Consumer setData) { - this.title = title; - this.getData = getData; - this.setData = setData; - } - - abstract void init(ScreenExtension screen, int offsetY); - - abstract int getWidgetHeight(); - - void render(GraphicsHolder graphicsHolder, int offsetY) { - graphicsHolder.drawText(title, SQUARE_SIZE, offsetY + getWidgetHeight() / 2, ARGB_WHITE, false, GraphicsHolder.getDefaultLight()); - } - } - - protected static final class BooleanDataElementBase extends DataElementBase { - - private final CheckboxWidgetExtension checkboxWidgetExtension; - - BooleanDataElementBase(String title, BooleanSupplier getData, Consumer setData) { - super(title, getData::getAsBoolean, setData); - checkboxWidgetExtension = new CheckboxWidgetExtension(SQUARE_SIZE, 0, PANEL_WIDTH * 2, SQUARE_SIZE, title, true, setData); - } - - @Override - void init(ScreenExtension screen, int offsetY) { - checkboxWidgetExtension.setChecked(getData.get()); - checkboxWidgetExtension.setY2(offsetY); - screen.addChild(new ClickableWidget(checkboxWidgetExtension)); - } - - @Override - int getWidgetHeight() { - return SQUARE_SIZE; - } - - @Override - void render(GraphicsHolder graphicsHolder, int offsetY) { - } - } - - protected static final class StringDataElementBase extends DataElementBase { - - private final TextFieldWidgetExtension textFieldWidgetExtension; - - StringDataElementBase(String title, Supplier getData, Consumer setData) { - super(title, getData, setData); - textFieldWidgetExtension = new TextFieldWidgetExtension(OFFSET_X + TEXT_FIELD_PADDING / 2, 0, PANEL_WIDTH - TEXT_FIELD_PADDING, SQUARE_SIZE, title, 256, TextCase.DEFAULT, null, title); - } - - @Override - void init(ScreenExtension screen, int offsetY) { - textFieldWidgetExtension.setText2(getData.get()); - textFieldWidgetExtension.setY2(TEXT_FIELD_PADDING / 2 + offsetY); - screen.addChild(new ClickableWidget(textFieldWidgetExtension)); - } - - @Override - int getWidgetHeight() { - return SQUARE_SIZE + TEXT_FIELD_PADDING; - } - } - - protected static final class IntegerDataElementBase extends DataElementBase { - - private final TextFieldWidgetExtension textFieldWidgetExtension; - - IntegerDataElementBase(String title, IntSupplier getData, IntConsumer setData) { - super(title, getData::getAsInt, setData::accept); - textFieldWidgetExtension = new TextFieldWidgetExtension(OFFSET_X + TEXT_FIELD_PADDING / 2, 0, PANEL_WIDTH - TEXT_FIELD_PADDING, SQUARE_SIZE, title, 16, TextCase.DEFAULT, "[^\\d-]", title); - } - - @Override - void init(ScreenExtension screen, int offsetY) { - textFieldWidgetExtension.setText2(getData.get().toString()); - textFieldWidgetExtension.setY2(TEXT_FIELD_PADDING / 2 + offsetY); - screen.addChild(new ClickableWidget(textFieldWidgetExtension)); - } - - @Override - int getWidgetHeight() { - return SQUARE_SIZE + TEXT_FIELD_PADDING; - } - } - - protected static final class DoubleDataElementBase extends DataElementBase { - - private final TextFieldWidgetExtension textFieldWidgetExtension; - - DoubleDataElementBase(String title, DoubleSupplier getData, DoubleConsumer setData) { - super(title, getData::getAsDouble, setData::accept); - textFieldWidgetExtension = new TextFieldWidgetExtension(OFFSET_X + TEXT_FIELD_PADDING / 2, 0, PANEL_WIDTH - TEXT_FIELD_PADDING, SQUARE_SIZE, title, 16, TextCase.DEFAULT, "[^\\d.-]", title); - } - - @Override - void init(ScreenExtension screen, int offsetY) { - textFieldWidgetExtension.setText2(getData.get().toString()); - textFieldWidgetExtension.setY2(TEXT_FIELD_PADDING / 2 + offsetY); - screen.addChild(new ClickableWidget(textFieldWidgetExtension)); - } - - @Override - int getWidgetHeight() { - return SQUARE_SIZE + TEXT_FIELD_PADDING; - } - } - - protected static final class ChildDataElementBase extends DataElementBase { - - private final ButtonWidgetExtension buttonWidgetExtension; - - ChildDataElementBase(String title, GenericScreenBase newScreen, Supplier getData, Consumer setData) { - super(title, getData, setData); - buttonWidgetExtension = new ButtonWidgetExtension(OFFSET_X, 0, PANEL_WIDTH, SQUARE_SIZE, title, button -> MinecraftClient.getInstance().openScreen(new Screen(newScreen))); - } - - @Override - void init(ScreenExtension screen, int offsetY) { - buttonWidgetExtension.setY2(offsetY); - screen.addChild(new ClickableWidget(buttonWidgetExtension)); - } - - @Override - int getWidgetHeight() { - return SQUARE_SIZE; - } - } -} diff --git a/fabric/src/main/java/org/mtr/mod/screen/LiftCustomizationScreen.java b/fabric/src/main/java/org/mtr/mod/screen/LiftCustomizationScreen.java index 622f9497a..076eba641 100644 --- a/fabric/src/main/java/org/mtr/mod/screen/LiftCustomizationScreen.java +++ b/fabric/src/main/java/org/mtr/mod/screen/LiftCustomizationScreen.java @@ -18,7 +18,7 @@ import java.util.Locale; -public class LiftCustomizationScreen extends ScreenExtension implements IGui { +public class LiftCustomizationScreen extends MTRScreenBase implements IGui { private LiftStyle liftStyle; private Direction liftDirection; diff --git a/fabric/src/main/java/org/mtr/mod/screen/LiftSelectionScreen.java b/fabric/src/main/java/org/mtr/mod/screen/LiftSelectionScreen.java index cca18d2b8..a2c31df0e 100644 --- a/fabric/src/main/java/org/mtr/mod/screen/LiftSelectionScreen.java +++ b/fabric/src/main/java/org/mtr/mod/screen/LiftSelectionScreen.java @@ -10,7 +10,6 @@ import org.mtr.mapping.holder.MinecraftClient; import org.mtr.mapping.holder.World; import org.mtr.mapping.mapper.GraphicsHolder; -import org.mtr.mapping.mapper.ScreenExtension; import org.mtr.mod.Init; import org.mtr.mod.InitClient; import org.mtr.mod.client.MinecraftClientData; @@ -18,7 +17,7 @@ import org.mtr.mod.packet.PacketPressLiftButton; import org.mtr.mod.render.RenderLifts; -public class LiftSelectionScreen extends ScreenExtension implements IGui { +public class LiftSelectionScreen extends MTRScreenBase implements IGui { private final DashboardList selectionList; private final ObjectArrayList floorLevels = new ObjectArrayList<>(); diff --git a/fabric/src/main/java/org/mtr/mod/screen/LiftTrackFloorScreen.java b/fabric/src/main/java/org/mtr/mod/screen/LiftTrackFloorScreen.java index ddfb19cca..8ec065364 100644 --- a/fabric/src/main/java/org/mtr/mod/screen/LiftTrackFloorScreen.java +++ b/fabric/src/main/java/org/mtr/mod/screen/LiftTrackFloorScreen.java @@ -3,7 +3,6 @@ import org.mtr.mapping.holder.*; import org.mtr.mapping.mapper.CheckboxWidgetExtension; import org.mtr.mapping.mapper.GraphicsHolder; -import org.mtr.mapping.mapper.ScreenExtension; import org.mtr.mapping.mapper.TextFieldWidgetExtension; import org.mtr.mapping.tool.TextCase; import org.mtr.mod.InitClient; @@ -13,7 +12,7 @@ import org.mtr.mod.generated.lang.TranslationProvider; import org.mtr.mod.packet.PacketUpdateLiftTrackFloorConfig; -public class LiftTrackFloorScreen extends ScreenExtension implements IGui { +public class LiftTrackFloorScreen extends MTRScreenBase implements IGui { private final TextFieldWidgetExtension textFieldFloorNumber; private final TextFieldWidgetExtension textFieldFloorDescription; diff --git a/fabric/src/main/java/org/mtr/mod/screen/MTRScreenBase.java b/fabric/src/main/java/org/mtr/mod/screen/MTRScreenBase.java new file mode 100644 index 000000000..1475dacbd --- /dev/null +++ b/fabric/src/main/java/org/mtr/mod/screen/MTRScreenBase.java @@ -0,0 +1,33 @@ +package org.mtr.mod.screen; + +import org.mtr.mapping.holder.MinecraftClient; +import org.mtr.mapping.holder.Screen; +import org.mtr.mapping.mapper.ScreenExtension; + +import javax.annotation.Nullable; + +public class MTRScreenBase extends ScreenExtension { + + @Nullable + private final Screen previousScreen; + + public MTRScreenBase(@Nullable ScreenExtension previousScreenExtension) { + super(); + this.previousScreen = previousScreenExtension == null ? null : new Screen(previousScreenExtension); + } + + public MTRScreenBase(@Nullable Screen previousScreen) { + super(); + this.previousScreen = previousScreen; + } + + public MTRScreenBase() { + this((ScreenExtension) null); + } + + @Override + public void onClose2() { + super.onClose2(); + MinecraftClient.getInstance().openScreen(previousScreen); + } +} diff --git a/fabric/src/main/java/org/mtr/mod/screen/PIDSConfigScreen.java b/fabric/src/main/java/org/mtr/mod/screen/PIDSConfigScreen.java index ad30eef5b..ce524c587 100644 --- a/fabric/src/main/java/org/mtr/mod/screen/PIDSConfigScreen.java +++ b/fabric/src/main/java/org/mtr/mod/screen/PIDSConfigScreen.java @@ -143,6 +143,9 @@ private void setPage(int newPage) { for (int i = 0; i < textFieldMessages.length; i++) { textFieldMessages[i].visible = i / maxArrivalsPerPage == page; } + for (int i = 0; i < buttonsHideArrival.length; i++) { + buttonsHideArrival[i].visible = i / maxArrivalsPerPage == page; + } buttonPrevPage.visible = page > 0; buttonNextPage.visible = page < maxPages; } @@ -207,10 +210,7 @@ public static ButtonWidgetExtension getPlatformFilterButton(BlockPos blockPos, C if (selectAllCheckbox.isChecked2()) { filterPlatformIds.clear(); } - MinecraftClient.getInstance().openScreen(new Screen(new DashboardListSelectorScreen(() -> { - MinecraftClient.getInstance().openScreen(new Screen(thisScreen)); - selectAllCheckbox.setChecked(filterPlatformIds.isEmpty()); - }, new ObjectImmutableList<>(platformsForList), filterPlatformIds, false, false))); + MinecraftClient.getInstance().openScreen(new Screen(new DashboardListSelectorScreen(() -> selectAllCheckbox.setChecked(filterPlatformIds.isEmpty()), new ObjectImmutableList<>(platformsForList), filterPlatformIds, false, false, thisScreen))); } }); } diff --git a/fabric/src/main/java/org/mtr/mod/screen/PlatformScreen.java b/fabric/src/main/java/org/mtr/mod/screen/PlatformScreen.java index f2b384cb3..c893a0f8f 100644 --- a/fabric/src/main/java/org/mtr/mod/screen/PlatformScreen.java +++ b/fabric/src/main/java/org/mtr/mod/screen/PlatformScreen.java @@ -1,22 +1,33 @@ package org.mtr.mod.screen; -import org.mtr.core.data.Platform; -import org.mtr.core.data.Station; -import org.mtr.core.data.TransportMode; +import org.mtr.core.data.*; import org.mtr.core.operation.UpdateDataRequest; +import org.mtr.libraries.it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; import org.mtr.mapping.holder.MutableText; import org.mtr.mapping.mapper.GraphicsHolder; +import org.mtr.mapping.mapper.ScreenExtension; import org.mtr.mod.InitClient; import org.mtr.mod.client.MinecraftClientData; +import org.mtr.mod.data.IGui; import org.mtr.mod.generated.lang.TranslationProvider; import org.mtr.mod.packet.PacketUpdateData; public class PlatformScreen extends SavedRailScreenBase { private static final MutableText DWELL_TIME_TEXT = TranslationProvider.GUI_MTR_DWELL_TIME.getMutableText(); + private static final MutableText ROUTES_AT_PLATFORM_TEXT = TranslationProvider.GUI_MTR_ROUTES_AT_PLATFORM.getMutableText(); + private final ObjectOpenHashSet routes = new ObjectOpenHashSet<>(); - public PlatformScreen(Platform savedRailBase, TransportMode transportMode, DashboardScreen dashboardScreen) { - super(savedRailBase, transportMode, dashboardScreen, DWELL_TIME_TEXT); + public PlatformScreen(Platform savedRailBase, TransportMode transportMode, ScreenExtension previousScreenExtension) { + super(savedRailBase, transportMode, previousScreenExtension, DWELL_TIME_TEXT); + + for (Route route : MinecraftClientData.getDashboardInstance().routes) { + for (RoutePlatformData routePlat : route.getRoutePlatforms()) { + if (routePlat.getPlatform().getId() == savedRailBase.getId()) { + routes.add(route); + } + } + } } @Override @@ -34,6 +45,14 @@ public void render(GraphicsHolder graphicsHolder, int mouseX, int mouseY, float if (showScheduleControls) { graphicsHolder.drawText(DWELL_TIME_TEXT, SQUARE_SIZE, SQUARE_SIZE * 2 + TEXT_FIELD_PADDING + TEXT_PADDING, ARGB_WHITE, false, GraphicsHolder.getDefaultLight()); } + + // Draw route lists + graphicsHolder.drawText(ROUTES_AT_PLATFORM_TEXT, SQUARE_SIZE, SQUARE_SIZE * 4 + TEXT_FIELD_PADDING + TEXT_PADDING, ARGB_WHITE, false, GraphicsHolder.getDefaultLight()); + int i = 0; + for (Route rts : routes) { + graphicsHolder.drawText(IGui.formatStationName(rts.getName()), SQUARE_SIZE + textWidth, (SQUARE_SIZE * 4) + (10 * i) + TEXT_FIELD_PADDING + TEXT_PADDING, ARGB_BLACK + rts.getColor(), false, GraphicsHolder.getDefaultLight()); + i++; + } } @Override diff --git a/fabric/src/main/java/org/mtr/mod/screen/RailActionsScreen.java b/fabric/src/main/java/org/mtr/mod/screen/RailActionsScreen.java index 9e2fe42ed..a698f1073 100644 --- a/fabric/src/main/java/org/mtr/mod/screen/RailActionsScreen.java +++ b/fabric/src/main/java/org/mtr/mod/screen/RailActionsScreen.java @@ -8,12 +8,12 @@ import org.mtr.mod.generated.lang.TranslationProvider; import org.mtr.mod.packet.PacketDeleteRailAction; -public class RailActionsScreen extends ScreenExtension implements IGui { +public class RailActionsScreen extends MTRScreenBase implements IGui { private final DashboardList railActionsList; - public RailActionsScreen() { - super(); + public RailActionsScreen(ScreenExtension previousScreenExtension) { + super(previousScreenExtension); railActionsList = new DashboardList(null, null, null, null, null, this::onDelete, null, () -> "", text -> { }); } diff --git a/fabric/src/main/java/org/mtr/mod/screen/RailModifierScreen.java b/fabric/src/main/java/org/mtr/mod/screen/RailModifierScreen.java index 5b2740cdc..35323b8de 100644 --- a/fabric/src/main/java/org/mtr/mod/screen/RailModifierScreen.java +++ b/fabric/src/main/java/org/mtr/mod/screen/RailModifierScreen.java @@ -17,7 +17,7 @@ import java.util.stream.Collectors; -public class RailModifierScreen extends ScreenExtension implements IGui { +public class RailModifierScreen extends MTRScreenBase implements IGui { private Rail.Shape shape; private double radius; diff --git a/fabric/src/main/java/org/mtr/mod/screen/RailStyleSelectorScreen.java b/fabric/src/main/java/org/mtr/mod/screen/RailStyleSelectorScreen.java index 31f0931c7..d3cc52fb5 100644 --- a/fabric/src/main/java/org/mtr/mod/screen/RailStyleSelectorScreen.java +++ b/fabric/src/main/java/org/mtr/mod/screen/RailStyleSelectorScreen.java @@ -23,8 +23,7 @@ public class RailStyleSelectorScreen extends DashboardListSelectorScreen { private final ObjectImmutableList allRails = CustomResourceLoader.getRails(); private RailStyleSelectorScreen(Rail rail, ObjectImmutableList rails, LongArrayList selectedRailIndices) { - super(() -> { - }, rails, selectedRailIndices, false, false); + super(rails, selectedRailIndices, false, false, null); this.rail = rail; } diff --git a/fabric/src/main/java/org/mtr/mod/screen/RailwaySignScreen.java b/fabric/src/main/java/org/mtr/mod/screen/RailwaySignScreen.java index 46210cfe7..fda497b47 100644 --- a/fabric/src/main/java/org/mtr/mod/screen/RailwaySignScreen.java +++ b/fabric/src/main/java/org/mtr/mod/screen/RailwaySignScreen.java @@ -166,7 +166,7 @@ protected void init2() { addChild(new ClickableWidget(buttonNextPage)); if (!isRailwaySign) { - MinecraftClient.getInstance().openScreen(new Screen(new DashboardListSelectorScreen(this::onClose2, platformsForList, selectedIds, true, false))); + MinecraftClient.getInstance().openScreen(new Screen(new DashboardListSelectorScreen(this::onClose2, platformsForList, selectedIds, true, false, null))); } } @@ -308,7 +308,7 @@ private void setNewSignId(@Nullable String newSignId) { final boolean isLine = newSignId != null && (newSignId.equals("line") || newSignId.equals("line_flipped")); final boolean isStation = newSignId != null && (newSignId.equals("station") || newSignId.equals("station_flipped")); if ((isExitLetter || isPlatform || isLine || isStation)) { - MinecraftClient.getInstance().openScreen(new Screen(new DashboardListSelectorScreen(this, new ObjectImmutableList<>(isExitLetter ? exitsForList : isPlatform ? platformsForList : isLine ? routesForList : stationsForList), selectedIds, false, false))); + MinecraftClient.getInstance().openScreen(new Screen(new DashboardListSelectorScreen(new ObjectImmutableList<>(isExitLetter ? exitsForList : isPlatform ? platformsForList : isLine ? routesForList : stationsForList), selectedIds, false, false, this))); } } } diff --git a/fabric/src/main/java/org/mtr/mod/screen/SavedRailScreenBase.java b/fabric/src/main/java/org/mtr/mod/screen/SavedRailScreenBase.java index ae62fde0d..ed6f3c4a2 100644 --- a/fabric/src/main/java/org/mtr/mod/screen/SavedRailScreenBase.java +++ b/fabric/src/main/java/org/mtr/mod/screen/SavedRailScreenBase.java @@ -4,9 +4,7 @@ import org.mtr.core.data.SavedRailBase; import org.mtr.core.data.TransportMode; import org.mtr.mapping.holder.ClickableWidget; -import org.mtr.mapping.holder.MinecraftClient; import org.mtr.mapping.holder.MutableText; -import org.mtr.mapping.holder.Screen; import org.mtr.mapping.mapper.GraphicsHolder; import org.mtr.mapping.mapper.ScreenExtension; import org.mtr.mapping.mapper.TextFieldWidgetExtension; @@ -16,7 +14,7 @@ import org.mtr.mod.data.IGui; import org.mtr.mod.generated.lang.TranslationProvider; -public abstract class SavedRailScreenBase, U extends AreaBase> extends ScreenExtension implements IGui { +public abstract class SavedRailScreenBase, U extends AreaBase> extends MTRScreenBase implements IGui { protected final T savedRailBase; protected final int textWidth; @@ -24,7 +22,6 @@ public abstract class SavedRailScreenBase, U exten protected final WidgetShorterSlider sliderDwellTimeMin; protected final WidgetShorterSlider sliderDwellTimeSec; - private final DashboardScreen dashboardScreen; private final TextFieldWidgetExtension textFieldSavedRailNumber; private final MutableText savedRailNumberText; @@ -33,11 +30,10 @@ public abstract class SavedRailScreenBase, U exten private static final int MAX_DWELL_TIME = 1200; private static final int MAX_SAVED_RAIL_NUMBER_LENGTH = 10; - public SavedRailScreenBase(T savedRailBase, TransportMode transportMode, DashboardScreen dashboardScreen, MutableText... additionalTexts) { + public SavedRailScreenBase(T savedRailBase, TransportMode transportMode, ScreenExtension previousScreenExtension, MutableText... additionalTexts) { super(); this.savedRailBase = savedRailBase; showScheduleControls = !transportMode.continuousMovement; - this.dashboardScreen = dashboardScreen; savedRailNumberText = getNumberStringKey().getMutableText(); textFieldSavedRailNumber = new TextFieldWidgetExtension(0, 0, 0, SQUARE_SIZE, MAX_SAVED_RAIL_NUMBER_LENGTH, TextCase.DEFAULT, null, "1"); @@ -101,12 +97,6 @@ public void render(GraphicsHolder graphicsHolder, int mouseX, int mouseY, float } } - @Override - public void onClose2() { - super.onClose2(); - MinecraftClient.getInstance().openScreen(new Screen(dashboardScreen)); - } - @Override public boolean isPauseScreen2() { return false; diff --git a/fabric/src/main/java/org/mtr/mod/screen/SidingScreen.java b/fabric/src/main/java/org/mtr/mod/screen/SidingScreen.java index 9011417c6..e709422b0 100644 --- a/fabric/src/main/java/org/mtr/mod/screen/SidingScreen.java +++ b/fabric/src/main/java/org/mtr/mod/screen/SidingScreen.java @@ -42,9 +42,9 @@ public class SidingScreen extends SavedRailScreenBase implements private static final float ACCELERATION_UNIT_CONVERSION_1 = 1000 * 1000; // m/ms^2 to m/s^2 private static final float ACCELERATION_UNIT_CONVERSION_2 = ACCELERATION_UNIT_CONVERSION_1 * 3.6F; // m/ms^2 to km/h/s - public SidingScreen(Siding siding, TransportMode transportMode, DashboardScreen dashboardScreen) { - super(siding, transportMode, dashboardScreen, SELECTED_TRAIN_TEXT, MAX_TRAINS_TEXT, ACCELERATION_CONSTANT_TEXT, DECELERATION_CONSTANT_TEXT, DELAYED_VEHICLE_SPEED_INCREASE_PERCENTAGE_TEXT, DELAYED_VEHICLE_REDUCE_DWELL_TIME_PERCENTAGE_TEXT, MANUAL_TO_AUTOMATIC_TIME, MAX_MANUAL_SPEED); - buttonSelectTrain = new ButtonWidgetExtension(0, 0, 0, SQUARE_SIZE, button -> MinecraftClient.getInstance().openScreen(new Screen(new VehicleSelectorScreen(this, savedRailBase)))); + public SidingScreen(Siding siding, TransportMode transportMode, ScreenExtension previousScreenExtension) { + super(siding, transportMode, previousScreenExtension, SELECTED_TRAIN_TEXT, MAX_TRAINS_TEXT, ACCELERATION_CONSTANT_TEXT, DECELERATION_CONSTANT_TEXT, DELAYED_VEHICLE_SPEED_INCREASE_PERCENTAGE_TEXT, DELAYED_VEHICLE_REDUCE_DWELL_TIME_PERCENTAGE_TEXT, MANUAL_TO_AUTOMATIC_TIME, MAX_MANUAL_SPEED); + buttonSelectTrain = new ButtonWidgetExtension(0, 0, 0, SQUARE_SIZE, button -> MinecraftClient.getInstance().openScreen(new Screen(new VehicleSelectorScreen(savedRailBase, this)))); buttonSelectTrain.setMessage2(new Text(TextHelper.translatable("selectWorld.edit").data)); textFieldMaxTrains = new TextFieldWidgetExtension(0, 0, 0, SQUARE_SIZE, MAX_TRAINS_TEXT_LENGTH, TextCase.DEFAULT, "\\D", null); sliderAccelerationConstant = new WidgetShorterSlider(0, MAX_TRAINS_WIDTH, (int) Math.round((Siding.MAX_ACCELERATION - Siding.MIN_ACCELERATION) * SLIDER_SCALE), SidingScreen::accelerationSliderFormatter, null); diff --git a/fabric/src/main/java/org/mtr/mod/screen/SignalColorScreen.java b/fabric/src/main/java/org/mtr/mod/screen/SignalColorScreen.java index 4534f0984..999d8843a 100644 --- a/fabric/src/main/java/org/mtr/mod/screen/SignalColorScreen.java +++ b/fabric/src/main/java/org/mtr/mod/screen/SignalColorScreen.java @@ -3,7 +3,10 @@ import org.mtr.core.tool.Utilities; import org.mtr.libraries.it.unimi.dsi.fastutil.ints.IntAVLTreeSet; import org.mtr.mapping.holder.*; -import org.mtr.mapping.mapper.*; +import org.mtr.mapping.mapper.CheckboxWidgetExtension; +import org.mtr.mapping.mapper.EntityHelper; +import org.mtr.mapping.mapper.GraphicsHolder; +import org.mtr.mapping.mapper.GuiDrawing; import org.mtr.mod.InitClient; import org.mtr.mod.block.BlockSignalBase; import org.mtr.mod.client.IDrawing; @@ -13,7 +16,7 @@ import org.mtr.mod.packet.PacketUpdateSignalConfig; import org.mtr.mod.render.RenderSignalBase; -public class SignalColorScreen extends ScreenExtension implements IGui { +public class SignalColorScreen extends MTRScreenBase implements IGui { private final CheckboxWidgetExtension checkBoxSelectAll; private final CheckboxWidgetExtension[] checkBoxes = new CheckboxWidgetExtension[ItemSignalModifier.COLORS.length]; diff --git a/fabric/src/main/java/org/mtr/mod/screen/TicketMachineScreen.java b/fabric/src/main/java/org/mtr/mod/screen/TicketMachineScreen.java index bbcd63e7b..9f63053c8 100644 --- a/fabric/src/main/java/org/mtr/mod/screen/TicketMachineScreen.java +++ b/fabric/src/main/java/org/mtr/mod/screen/TicketMachineScreen.java @@ -4,14 +4,13 @@ import org.mtr.mapping.mapper.ButtonWidgetExtension; import org.mtr.mapping.mapper.GraphicsHolder; import org.mtr.mapping.mapper.PlayerHelper; -import org.mtr.mapping.mapper.ScreenExtension; import org.mtr.mod.InitClient; import org.mtr.mod.client.IDrawing; import org.mtr.mod.data.IGui; import org.mtr.mod.generated.lang.TranslationProvider; import org.mtr.mod.packet.PacketAddBalance; -public class TicketMachineScreen extends ScreenExtension implements IGui { +public class TicketMachineScreen extends MTRScreenBase implements IGui { private final ButtonWidgetExtension[] buttons = new ButtonWidgetExtension[BUTTON_COUNT]; private final MutableText balanceText; diff --git a/fabric/src/main/java/org/mtr/mod/screen/TrainSensorScreenBase.java b/fabric/src/main/java/org/mtr/mod/screen/TrainSensorScreenBase.java index d8981c4d1..d74ba4a9a 100644 --- a/fabric/src/main/java/org/mtr/mod/screen/TrainSensorScreenBase.java +++ b/fabric/src/main/java/org/mtr/mod/screen/TrainSensorScreenBase.java @@ -18,7 +18,7 @@ import java.util.stream.Collectors; -public abstract class TrainSensorScreenBase extends ScreenExtension implements IGui { +public abstract class TrainSensorScreenBase extends MTRScreenBase implements IGui { private boolean stoppedOnly; private boolean movingOnly; @@ -70,7 +70,7 @@ public TrainSensorScreenBase(BlockPos blockPos, boolean hasSpeedCheckboxes, Obje filterButton = new ButtonWidgetExtension(0, 0, 0, SQUARE_SIZE, button -> { final ObjectArrayList routes = MinecraftClientData.getInstance().simplifiedRoutes.stream().map(simplifiedRoute -> new DashboardListItem(simplifiedRoute.getId(), simplifiedRoute.getName(), simplifiedRoute.getColor())).sorted().collect(Collectors.toCollection(ObjectArrayList::new)); - MinecraftClient.getInstance().openScreen(new Screen(new DashboardListSelectorScreen(this, new ObjectImmutableList<>(routes), filterRouteIds, false, false))); + MinecraftClient.getInstance().openScreen(new Screen(new DashboardListSelectorScreen(new ObjectImmutableList<>(routes), filterRouteIds, false, false, this))); }); this.hasSpeedCheckboxes = hasSpeedCheckboxes; diff --git a/fabric/src/main/java/org/mtr/mod/screen/VehicleSelectorScreen.java b/fabric/src/main/java/org/mtr/mod/screen/VehicleSelectorScreen.java index 562f078ec..01c77c8ef 100644 --- a/fabric/src/main/java/org/mtr/mod/screen/VehicleSelectorScreen.java +++ b/fabric/src/main/java/org/mtr/mod/screen/VehicleSelectorScreen.java @@ -26,7 +26,6 @@ import org.mtr.mod.packet.PacketUpdateData; import org.mtr.mod.resource.VehicleResource; -import javax.annotation.Nullable; import java.util.List; import java.util.concurrent.CompletableFuture; @@ -37,8 +36,8 @@ public class VehicleSelectorScreen extends DashboardListSelectorScreen implement private static final Object2ObjectAVLTreeMap WIKIPEDIA_ARTICLES = new Object2ObjectAVLTreeMap<>(); - public VehicleSelectorScreen(@Nullable ScreenExtension previousScreen, Siding siding) { - super(previousScreen, getVehicleList(siding.getTransportMode()), getSelectedIds(siding), false, true); + public VehicleSelectorScreen(Siding siding, ScreenExtension previousScreenExtension) { + super(getVehicleList(siding.getTransportMode()), getSelectedIds(siding), false, true, previousScreenExtension); buttonDuplicateVehicleCars = new ButtonWidgetExtension(0, 0, 0, SQUARE_SIZE, TranslationProvider.GUI_MTR_DUPLICATE_VEHICLE_CARS.getMutableText(), button -> { final ObjectArrayList existingCars = new ObjectArrayList<>(siding.getVehicleCars()); while (true) { diff --git a/fabric/src/main/java/org/mtr/mod/screen/WidgetMap.java b/fabric/src/main/java/org/mtr/mod/screen/WidgetMap.java index a01fa5f39..d1ea3f90d 100644 --- a/fabric/src/main/java/org/mtr/mod/screen/WidgetMap.java +++ b/fabric/src/main/java/org/mtr/mod/screen/WidgetMap.java @@ -231,7 +231,12 @@ private , U extends AreaBase> void drawAreas } else { additionalString = null; } - drawFromWorldCoords(position.getX(), position.getZ(), (x1, y1) -> IDrawing.drawStringWithFont(graphicsHolder, additionalString == null ? area.getName() : String.format("%s|(%s)", area.getName(), additionalString), getX2() + x1.floatValue(), getY2() + y1.floatValue(), GraphicsHolder.getDefaultLight())); + drawFromWorldCoords(position.getX(), position.getZ(), (x1, y1) -> { + graphicsHolder.push(); + graphicsHolder.translate(getX2() + x1.floatValue(), getY2() + y1.floatValue(), 0); + IDrawing.drawStringWithFont(graphicsHolder, additionalString == null ? area.getName() : String.format("%s|(%s)", area.getName(), additionalString), 0, 0, GraphicsHolder.getDefaultLight()); + graphicsHolder.pop(); + }); } } } diff --git a/fabric/src/main/resources/assets/mtr/lang/en_us.json b/fabric/src/main/resources/assets/mtr/lang/en_us.json index 7d837e259..04ca646a8 100644 --- a/fabric/src/main/resources/assets/mtr/lang/en_us.json +++ b/fabric/src/main/resources/assets/mtr/lang/en_us.json @@ -149,6 +149,8 @@ "command.mtr.clear_filter": "Cleared vehicles for depots matching \"%s\"", "command.mtr.generate_all": "Path generation for all depots started", "command.mtr.generate_filter": "Path generation for depots matching \"%s\" started", + "command.mtr.instant_deploy_all": "Instant-deploy for all depots started", + "command.mtr.instant_deploy_filter": "Instant-deploy for depots matching \"%s\" started", "entity.mtr.rendering": "", "gui.mtr.acceleration": "Vehicle Acceleration", "gui.mtr.add_balance_for_emeralds": "Add $%s for %s emerald(s)", @@ -172,11 +174,9 @@ "gui.mtr.arrival_sec_cjk": "%s 秒", "gui.mtr.automatically_detect_nearby_platform": "Automatically detect nearby platform", "gui.mtr.available": "Available", - "gui.mtr.available_model_parts": "Available Model Parts", "gui.mtr.balance": "Balance: $%s", "gui.mtr.calling_at": "Stops at: (%s/%s)", "gui.mtr.calling_at_cjk": "停靠站:(%s/%s)", - "gui.mtr.cars_to_spawn": "Cars to Spawn: %s", "gui.mtr.clear_vehicles": "Clear Vehicles", "gui.mtr.clockwise_via": "Clockwise via %s", "gui.mtr.clockwise_via_cjk": "順時針經%s", @@ -193,12 +193,6 @@ "gui.mtr.connecting_station_part_cjk": "乘客可在該站%s。", "gui.mtr.cruising_altitude": "Cruising Altitude", "gui.mtr.custom_destination_suggestion": "Destination (\\r to Reset)", - "gui.mtr.custom_resources_export_resource_pack": "Export Resource Pack", - "gui.mtr.custom_resources_gangway_connection_id": "Gangway Connection ID", - "gui.mtr.custom_resources_id": "ID", - "gui.mtr.custom_resources_name": "Name", - "gui.mtr.custom_resources_rider_offset": "Rider Offset: %s", - "gui.mtr.custom_resources_train_barrier_id": "Train Barrier ID", "gui.mtr.days": "%s day(s)", "gui.mtr.deceleration": "Vehicle Deceleration", "gui.mtr.delayed_vehicle_reduce_dwell_time_percentage": "Reduce Dwell Time When Delayed", @@ -211,49 +205,31 @@ "gui.mtr.dismiss_pause_screen": "Press ESC or click anywhere to resume Minecraft", "gui.mtr.dismount_hold": "Hold %s to force dismount: %s", "gui.mtr.display_page": "Page Number", - "gui.mtr.door_animation_type_bouncy_1": "Doors: Bouncy (1)", - "gui.mtr.door_animation_type_bouncy_2": "Doors: Bouncy (2)", - "gui.mtr.door_animation_type_constant": "Doors: Constant", - "gui.mtr.door_animation_type_mlr": "Doors: MLR", - "gui.mtr.door_animation_type_plug_fast": "Doors: Fast Plug", - "gui.mtr.door_animation_type_plug_slow": "Doors: Slow Plug", - "gui.mtr.door_animation_type_r179": "Doors: R179", - "gui.mtr.door_animation_type_r211": "Doors: R211", - "gui.mtr.door_animation_type_standard": "Doors: Standard", - "gui.mtr.door_animation_type_standard_slow": "Doors: Slow", - "gui.mtr.drag_file_to_upload": "Drag File to Upload", "gui.mtr.duplicate_vehicle_cars": "Duplicate Cars", "gui.mtr.dwell_time": "Vehicle Dwell Time", "gui.mtr.edit_area": "Click and drag to draw area.", "gui.mtr.edit_instructions": "Edit Instructions", "gui.mtr.edit_route": "Click on a platform to add it to the route.", - "gui.mtr.editing_part": "Editing: %s", "gui.mtr.emeralds": "Emeralds: %s", "gui.mtr.enter_barrier": "Entered %s - Balance: $%s", "gui.mtr.exit_barrier": "Exited %s - Fare: $%s - Balance: $%s", "gui.mtr.exit_destinations": "Exit Destinations", "gui.mtr.exit_parents": "Station Exits", - "gui.mtr.file_model": "Blockbench File", - "gui.mtr.file_properties": "Properties File (Optional)", - "gui.mtr.file_texture": "Texture File", - "gui.mtr.file_upload": "Upload...", "gui.mtr.filtered_platforms": "Filtered Platforms (%s)", "gui.mtr.filtered_routes": "Filtered Routes (%s)", "gui.mtr.filtered_routes_condition": "Only vehicles running on the following routes will activate this block", "gui.mtr.filtered_routes_empty": "All vehicles will activate this block", "gui.mtr.flip_styles": "Flip", "gui.mtr.game_time": "Game Time", - "gui.mtr.generate_map": "Generate route map", - "gui.mtr.generating_path": "Generating Path", "gui.mtr.hide_arrival": "Hide Arrival", "gui.mtr.hours": "%s hour(s)", + "gui.mtr.instant_deploy": "Instant-deploy", "gui.mtr.insufficient_balance": "Insufficient balance ($%s)", "gui.mtr.interchange_announcement": "Interchange station for the %s.", "gui.mtr.interchange_announcement_cjk": "乘客可以轉乘%s。", "gui.mtr.invalid_orientation": "Could not connect rail; invalid orientation", "gui.mtr.is_anticlockwise_route": "Is Anticlockwise Circular Route", "gui.mtr.is_clockwise_route": "Is Clockwise Circular Route", - "gui.mtr.is_light_rail_route": "Has Route Number", "gui.mtr.is_manual": "Drivable Vehicle", "gui.mtr.is_route_hidden": "Hide Route", "gui.mtr.last_airplane_station": "This flight is going to %s", @@ -264,7 +240,6 @@ "gui.mtr.last_cable_car_station_cjk": "本纜車往%s", "gui.mtr.last_train_station": "This train is going to %s", "gui.mtr.last_train_station_cjk": "本列車往%s", - "gui.mtr.left": "Left", "gui.mtr.lift_buttons_locked": "Buttons Locked", "gui.mtr.lift_buttons_unlocked": "Buttons Unlocked", "gui.mtr.lift_floor_description": "Description", @@ -272,8 +247,6 @@ "gui.mtr.lift_is_double_sided": "Double-sided", "gui.mtr.lift_should_ding": "Play \"Ding\" Sound", "gui.mtr.lift_style": "Style: %s", - "gui.mtr.lift_style_opaque": "Opaque", - "gui.mtr.lift_style_transparent": "Transparent", "gui.mtr.lift_track_required": "Lift / Elevator Tracks Required", "gui.mtr.light_rail_route_announcement": "This is route %s to %s.", "gui.mtr.light_rail_route_announcement_cjk": "本班為%s綫列車前往%s。", @@ -325,46 +298,8 @@ "gui.mtr.offset_x": "Offset X: %s", "gui.mtr.offset_y": "Offset Y: %s", "gui.mtr.offset_z": "Offset Z: %s", - "gui.mtr.part_blacklisted_cars": "Blacklisted Cars", - "gui.mtr.part_display_cjk_size_ratio": "CJK Size: %s", - "gui.mtr.part_display_force_single_line": "Force Single Line", - "gui.mtr.part_display_force_upper_case": "Force Upper Case", - "gui.mtr.part_display_should_scroll": "Scrolling Text", - "gui.mtr.part_display_text_color": "Colour", - "gui.mtr.part_display_text_color_cjk": "CJK/Non-CJK Colour", - "gui.mtr.part_display_type_destination": "Type: Destination", - "gui.mtr.part_display_type_next_station_kcr": "Type: Next Station (KCR)", - "gui.mtr.part_display_type_next_station_mtr": "Type: Next Station (MTR)", - "gui.mtr.part_display_type_next_station_plain": "Type: Next Station", - "gui.mtr.part_display_type_next_station_uk": "Type: Next Station (UK)", - "gui.mtr.part_display_type_route_number": "Type: Route Number", - "gui.mtr.part_display_x_padding": "X Padding: %s", - "gui.mtr.part_display_y_padding": "Y Padding: %s", - "gui.mtr.part_door_offset_left_negative": "Door Offset: -Left", - "gui.mtr.part_door_offset_left_positive": "Door Offset: +Left", - "gui.mtr.part_door_offset_none": "Door Offset: None", - "gui.mtr.part_door_offset_right_negative": "Door Offset: -Right", - "gui.mtr.part_door_offset_right_positive": "Door Offset: +Right", - "gui.mtr.part_is_display": "Is Display", - "gui.mtr.part_mirror": "Mirrored", - "gui.mtr.part_positions": "Positions", - "gui.mtr.part_render_condition_all": "Render: Always", - "gui.mtr.part_render_condition_door_left_closed": "Render: Left Doors Closed", - "gui.mtr.part_render_condition_door_left_open": "Render: Left Doors Open", - "gui.mtr.part_render_condition_door_right_closed": "Render: Right Doors Closed", - "gui.mtr.part_render_condition_door_right_open": "Render: Right Doors Open", - "gui.mtr.part_render_condition_doors_closed": "Render: Doors Closed", - "gui.mtr.part_render_condition_doors_open": "Render: Doors Open", - "gui.mtr.part_render_condition_moving_backwards": "Render: Moving Backwards", - "gui.mtr.part_render_condition_moving_forwards": "Render: Moving Forwards", - "gui.mtr.part_skip_rendering_if_too_far": "Hide If Far", - "gui.mtr.part_stage_always_on_lights": "Lights (Always On)", - "gui.mtr.part_stage_exterior": "Exterior", - "gui.mtr.part_stage_interior": "Interior", - "gui.mtr.part_stage_interior_translucent": "Interior (Translucent)", - "gui.mtr.part_stage_lights": "Lights", - "gui.mtr.part_whitelisted_cars": "Whitelisted Cars", "gui.mtr.path_found": "Main path generated successfully", + "gui.mtr.path_generating": "Started path generation %s ago...", "gui.mtr.path_not_found_between": "Path not found on|> %s|between|> %s|and|> %s|", "gui.mtr.path_not_found_sidings": "%s siding(s) cannot connect to main path", "gui.mtr.path_not_generated_no_sidings": "Path not generated|No sidings in depot!", @@ -378,7 +313,6 @@ "gui.mtr.platform_abbreviated": "Plat. %s", "gui.mtr.platform_abbreviated_cjk": "%s號月台", "gui.mtr.platform_number": "Platform Number", - "gui.mtr.platform_or_siding_exists": "Each rail node can only be connected to one platform or siding", "gui.mtr.press_to_select_floor": "Press %s to select floor", "gui.mtr.psd_apg_door_locked": "Door Locked", "gui.mtr.psd_apg_door_unlocked": "Door Unlocked", @@ -404,7 +338,6 @@ "gui.mtr.repeat_indefinitely": "Repeat Instructions Forever", "gui.mtr.reset_sign": "Reset", "gui.mtr.resource_pack_creator": "Resource Pack Creator", - "gui.mtr.right": "Right", "gui.mtr.rotate_anticlockwise": "Rotate Anticlockwise", "gui.mtr.rotate_clockwise": "Rotate Clockwise", "gui.mtr.route_color": "Route Colour", @@ -416,19 +349,18 @@ "gui.mtr.route_type_train_light_rail": "Type: Light Rail", "gui.mtr.route_type_train_normal": "Type: Normal", "gui.mtr.routes": "Routes", + "gui.mtr.routes_at_platform": "Route(s) at Platform", "gui.mtr.s": "s", "gui.mtr.schedule_mode_real_time_off": "Schedule: Minecraft Time", "gui.mtr.schedule_mode_real_time_on": "Schedule: Real Time", "gui.mtr.search": "Search", "gui.mtr.seconds": "%s second(s)", "gui.mtr.select_all": "Select All", - "gui.mtr.select_all_platforms": "Show arrivals from all platforms", "gui.mtr.select_model": "Select Model", "gui.mtr.selected": "Selected", "gui.mtr.selected_vehicle": "Selected Vehicle", "gui.mtr.separator": "/", "gui.mtr.separator_cjk": "/", - "gui.mtr.settings": "Settings", "gui.mtr.siding_number": "Siding Number", "gui.mtr.sidings_in_depot": "Sidings in this depot: %s", "gui.mtr.sound_file": "Sound File", @@ -439,9 +371,7 @@ "gui.mtr.stations": "Stations", "gui.mtr.stopped_only": "Stopped Vehicles Only", "gui.mtr.support": "Support", - "gui.mtr.terminates_here_1": "This train", - "gui.mtr.terminates_here_2": "terminates", - "gui.mtr.terminates_here_3": "here.", + "gui.mtr.terminates_here": "This train terminates here.", "gui.mtr.terminates_here_cjk": "本班列車終止服務。", "gui.mtr.this_station": "This station is %s", "gui.mtr.this_station_cjk": "本站是%s", @@ -449,23 +379,12 @@ "gui.mtr.to_cjk": "往%s", "gui.mtr.tph": "/hr", "gui.mtr.train_schedule_sensor": "Arrival Offset (Seconds)", - "gui.mtr.transport_mode_airplane": "Type: Airplane", - "gui.mtr.transport_mode_boat": "Type: Boat", - "gui.mtr.transport_mode_cable_car": "Type: Cable Car", - "gui.mtr.transport_mode_train": "Type: Train", "gui.mtr.transport_system_map": "Transport System Map", "gui.mtr.unlimited": "Unlimited", "gui.mtr.unlimited_vehicles": "Unlimited Vehicles", "gui.mtr.untitled": "Untitled", - "gui.mtr.used_model_parts": "Used Model Parts", - "gui.mtr.vehicle_brightness": "Brightness: %s%%", - "gui.mtr.vehicle_cars": "Cars: %s", - "gui.mtr.vehicle_direction_backwards": "Direction: Backwards", - "gui.mtr.vehicle_direction_forwards": "Direction: Forwards", - "gui.mtr.vehicle_door_max": "Door: %s", "gui.mtr.vehicle_length": "Length: %s", "gui.mtr.vehicle_speed": "Speed: %s m/s (%s km/h)", - "gui.mtr.vehicle_width": "Width: %s", "gui.mtr.vehicles_per_hour": "Vehicles Per Hour", "gui.mtr.welcome_station": "Welcome to %s Station.", "gui.mtr.welcome_station_cjk": "歡迎光臨%s站。", @@ -606,11 +525,8 @@ "options.mtr.shift_to_toggle_sitting": "Use %s to toggle sitting inside vehicles", "options.mtr.show_announcement_messages": "Show \"next station\" messages in chat", "options.mtr.support_patreon": "Support the mod on Patreon!", - "options.mtr.track_texture_offset": "Track Texture Offset", - "options.mtr.use_dynamic_fps": "Dynamically boost FPS", "options.mtr.use_mtr_font": "Use custom MTR fonts (might not work on some computers)", "options.mtr.use_tts_announcements": "Enable \"next station\" text-to-speech announcements", - "options.mtr.vehicle_render_distance_ratio": "Vehicle rendering to Minecraft render distance ratio", "sign.mtr.airport": "機場|Airport", "sign.mtr.airport_arrivals": "抵港|Arrivals", "sign.mtr.airport_departures": "離港|Departures", diff --git a/fabric/src/main/resources/assets/mtr/properties/definition/urban_line_base.json b/fabric/src/main/resources/assets/mtr/properties/definition/urban_line_base.json index 3e262062a..1f8f0f38c 100644 --- a/fabric/src/main/resources/assets/mtr/properties/definition/urban_line_base.json +++ b/fabric/src/main/resources/assets/mtr/properties/definition/urban_line_base.json @@ -54,6 +54,13 @@ } ] }, + { + "name": "windowMini", + "positions": [ + ], + "positionsFlipped": [ + ] + }, { "name": "windowMiniEnd1", "positions": [ diff --git a/fabric/src/main/resources/assets/mtr/properties/definition/urban_line_mini_base.json b/fabric/src/main/resources/assets/mtr/properties/definition/urban_line_mini_base.json index b6997fa6a..c4edbba5d 100644 --- a/fabric/src/main/resources/assets/mtr/properties/definition/urban_line_mini_base.json +++ b/fabric/src/main/resources/assets/mtr/properties/definition/urban_line_mini_base.json @@ -42,6 +42,19 @@ } ] }, + { + "name": "windowMini", + "positions": [ + { + "z": 0 + } + ], + "positionsFlipped": [ + { + "z": 0 + } + ] + }, { "name": "windowMiniEnd1", "positions": [ diff --git a/fabric/src/main/resources/assets/mtr/properties/definition/urban_line_small_base.json b/fabric/src/main/resources/assets/mtr/properties/definition/urban_line_small_base.json index 798837e9e..e78cbd42a 100644 --- a/fabric/src/main/resources/assets/mtr/properties/definition/urban_line_small_base.json +++ b/fabric/src/main/resources/assets/mtr/properties/definition/urban_line_small_base.json @@ -48,6 +48,13 @@ } ] }, + { + "name": "windowMini", + "positions": [ + ], + "positionsFlipped": [ + ] + }, { "name": "windowMiniEnd1", "positions": [ diff --git a/fabric/src/main/resources/assets/mtr/properties/vehicle/k_train_tcl_ael_common.json b/fabric/src/main/resources/assets/mtr/properties/vehicle/k_train_tcl_ael_common.json index 7b7c91111..3912bfd72 100644 --- a/fabric/src/main/resources/assets/mtr/properties/vehicle/k_train_tcl_ael_common.json +++ b/fabric/src/main/resources/assets/mtr/properties/vehicle/k_train_tcl_ael_common.json @@ -90,7 +90,8 @@ ], "positionDefinitions": [ "window", - "windowFlipped" + "windowFlipped", + "windowMini" ], "renderStage": "EXTERIOR" }, diff --git a/fabric/src/main/resources/assets/mtr/properties/vehicle/light_rail_5_door_left_overlay.json b/fabric/src/main/resources/assets/mtr/properties/vehicle/light_rail_5_door_left_overlay.json new file mode 100644 index 000000000..c072201ee --- /dev/null +++ b/fabric/src/main/resources/assets/mtr/properties/vehicle/light_rail_5_door_left_overlay.json @@ -0,0 +1,58 @@ +{ + "parts": [ + { + "names": [ + "door_right_overlay_interior" + ], + "positionDefinitions": [ + "doorMovement" + ], + "renderStage": "INTERIOR", + "doorZMultiplier": -14, + "doorAnimationType": "STANDARD" + }, + { + "names": [ + "door_left_overlay_exterior" + ], + "positionDefinitions": [ + "doorMovement" + ], + "renderStage": "EXTERIOR", + "doorZMultiplier": 14, + "doorAnimationType": "STANDARD" + }, + { + "names": [ + "door_right_overlay_interior" + ], + "positionDefinitions": [ + "doorMovementFlipped" + ], + "renderStage": "INTERIOR", + "doorZMultiplier": -14, + "doorAnimationType": "STANDARD" + }, + { + "names": [ + "door_left_overlay_exterior" + ], + "positionDefinitions": [ + "doorMovementFlipped" + ], + "renderStage": "EXTERIOR", + "doorZMultiplier": 14, + "doorAnimationType": "STANDARD" + }, + { + "names": [ + "wall_1" + ], + "positionDefinitions": [ + "doorOverlayWall1" + ], + "renderStage": "INTERIOR" + } + ], + "modelYOffset": 1 +} diff --git a/fabric/src/main/resources/assets/mtr/properties/vehicle/light_rail_5_door_right_overlay.json b/fabric/src/main/resources/assets/mtr/properties/vehicle/light_rail_5_door_right_overlay.json new file mode 100644 index 000000000..ff8628471 --- /dev/null +++ b/fabric/src/main/resources/assets/mtr/properties/vehicle/light_rail_5_door_right_overlay.json @@ -0,0 +1,58 @@ +{ + "parts": [ + { + "names": [ + "door_left_overlay_interior" + ], + "positionDefinitions": [ + "doorMovement" + ], + "renderStage": "INTERIOR", + "doorZMultiplier": 14, + "doorAnimationType": "STANDARD" + }, + { + "names": [ + "door_right_overlay_exterior" + ], + "positionDefinitions": [ + "doorMovement" + ], + "renderStage": "EXTERIOR", + "doorZMultiplier": -14, + "doorAnimationType": "STANDARD" + }, + { + "names": [ + "door_left_overlay_interior" + ], + "positionDefinitions": [ + "doorMovementFlipped" + ], + "renderStage": "INTERIOR", + "doorZMultiplier": 14, + "doorAnimationType": "STANDARD" + }, + { + "names": [ + "door_right_overlay_exterior" + ], + "positionDefinitions": [ + "doorMovementFlipped" + ], + "renderStage": "EXTERIOR", + "doorZMultiplier": -14, + "doorAnimationType": "STANDARD" + }, + { + "names": [ + "wall_2" + ], + "positionDefinitions": [ + "doorOverlayWall2" + ], + "renderStage": "INTERIOR" + } + ], + "modelYOffset": 1 +} diff --git a/fabric/src/main/resources/assets/mtr/properties/vehicle/s_train_door_left_overlay.json b/fabric/src/main/resources/assets/mtr/properties/vehicle/s_train_door_left_overlay.json index 9d7e393c6..d1234b0b6 100644 --- a/fabric/src/main/resources/assets/mtr/properties/vehicle/s_train_door_left_overlay.json +++ b/fabric/src/main/resources/assets/mtr/properties/vehicle/s_train_door_left_overlay.json @@ -10,7 +10,7 @@ "doorEnd2Flipped" ], "renderStage": "INTERIOR", - "doorZMultiplier": -14, + "doorZMultiplier": -13, "doorAnimationType": "STANDARD" }, { @@ -23,7 +23,7 @@ "doorEnd2Flipped" ], "renderStage": "EXTERIOR", - "doorZMultiplier": 14, + "doorZMultiplier": 13, "doorAnimationType": "STANDARD" }, { @@ -36,7 +36,7 @@ "doorEnd2" ], "renderStage": "INTERIOR", - "doorZMultiplier": -14, + "doorZMultiplier": -13, "doorAnimationType": "STANDARD" }, { @@ -49,7 +49,7 @@ "doorEnd2" ], "renderStage": "EXTERIOR", - "doorZMultiplier": 14, + "doorZMultiplier": 13, "doorAnimationType": "STANDARD" }, { diff --git a/fabric/src/main/resources/assets/mtr/properties/vehicle/s_train_door_right_overlay.json b/fabric/src/main/resources/assets/mtr/properties/vehicle/s_train_door_right_overlay.json index d50db52ce..5c6a7cb4a 100644 --- a/fabric/src/main/resources/assets/mtr/properties/vehicle/s_train_door_right_overlay.json +++ b/fabric/src/main/resources/assets/mtr/properties/vehicle/s_train_door_right_overlay.json @@ -10,7 +10,7 @@ "doorEnd2Flipped" ], "renderStage": "INTERIOR", - "doorZMultiplier": 14, + "doorZMultiplier": 13, "doorAnimationType": "STANDARD" }, { @@ -23,7 +23,7 @@ "doorEnd2Flipped" ], "renderStage": "EXTERIOR", - "doorZMultiplier": -14, + "doorZMultiplier": -13, "doorAnimationType": "STANDARD" }, { @@ -36,7 +36,7 @@ "doorEnd2" ], "renderStage": "INTERIOR", - "doorZMultiplier": 14, + "doorZMultiplier": 13, "doorAnimationType": "STANDARD" }, { @@ -49,7 +49,7 @@ "doorEnd2" ], "renderStage": "EXTERIOR", - "doorZMultiplier": -14, + "doorZMultiplier": -13, "doorAnimationType": "STANDARD" }, { diff --git a/fabric/src/main/resources/assets/mtr/sounds.json b/fabric/src/main/resources/assets/mtr/sounds.json index 455fa29b0..975d92999 100644 --- a/fabric/src/main/resources/assets/mtr/sounds.json +++ b/fabric/src/main/resources/assets/mtr/sounds.json @@ -15735,6 +15735,22 @@ } ] }, + "light_rail_5_door_open": { + "sounds": [ + { + "name": "mtr:light_rail/door_open_4", + "pitch": 0.5 + } + ] + }, + "light_rail_5_door_close": { + "sounds": [ + { + "name": "mtr:light_rail/door_close_4", + "pitch": 0.5 + } + ] + }, "light_rail_aeg_acceleration_0a": { "sounds": [ { diff --git a/fabric/src/main/resources/assets/mtr/textures/block/apg_door_light_off.png b/fabric/src/main/resources/assets/mtr/textures/block/apg_door_light_off.png index 6074e8694..ec5ccf54c 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/apg_door_light_off.png and b/fabric/src/main/resources/assets/mtr/textures/block/apg_door_light_off.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/apg_door_light_on.png b/fabric/src/main/resources/assets/mtr/textures/block/apg_door_light_on.png index 2dadd1295..04133d32e 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/apg_door_light_on.png and b/fabric/src/main/resources/assets/mtr/textures/block/apg_door_light_on.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/lift_button.png b/fabric/src/main/resources/assets/mtr/textures/block/lift_button.png index 3ceacd41d..ab77de2f0 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/lift_button.png and b/fabric/src/main/resources/assets/mtr/textures/block/lift_button.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/airplane.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/airplane.png index 3d7bb6831..73fe17cd0 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/airplane.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/airplane.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/airplane_down_left.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/airplane_down_left.png index 4cbfbb149..ca4e746ae 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/airplane_down_left.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/airplane_down_left.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/airplane_left.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/airplane_left.png index 145715edf..17fe96215 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/airplane_left.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/airplane_left.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/airplane_up_left.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/airplane_up_left.png index 87ee86acb..c749bc80c 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/airplane_up_left.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/airplane_up_left.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/airport_express.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/airport_express.png index d8d89c54d..f78025ae1 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/airport_express.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/airport_express.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/airport_transfer.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/airport_transfer.png index d7a23920f..e9938238b 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/airport_transfer.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/airport_transfer.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/arrow.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/arrow.png index 9155faf03..141808809 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/arrow.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/arrow.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/arrow_down.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/arrow_down.png index 7ea1eab0b..fc2c5c405 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/arrow_down.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/arrow_down.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/arrow_down_left.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/arrow_down_left.png index a598398ea..cb9c5a246 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/arrow_down_left.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/arrow_down_left.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/arrow_turn_back.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/arrow_turn_back.png index cc6eddb5f..e01c0e13c 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/arrow_turn_back.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/arrow_turn_back.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/arrow_up.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/arrow_up.png index 550822bc1..31af5d7df 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/arrow_up.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/arrow_up.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/arrow_up_left.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/arrow_up_left.png index bc50fc7c5..d9e1b0174 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/arrow_up_left.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/arrow_up_left.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/baggage_claim.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/baggage_claim.png index 21600283e..582ee7179 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/baggage_claim.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/baggage_claim.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/boat.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/boat.png index 76ee5e54f..0bd767794 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/boat.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/boat.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/cable_car.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/cable_car.png index 52dacc230..fe125146f 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/cable_car.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/cable_car.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/check_in.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/check_in.png index 894ac68c0..af698dcb7 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/check_in.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/check_in.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/circle.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/circle.png index f7d407fc5..7d2b79f70 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/circle.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/circle.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/cross.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/cross.png index 972436b00..8de96e26f 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/cross.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/cross.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/customer_service_centre.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/customer_service_centre.png index a9d96a1ce..fd6e6cc71 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/customer_service_centre.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/customer_service_centre.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/door_not_in_use.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/door_not_in_use.png index c50e402c5..8bcdeaf23 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/door_not_in_use.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/door_not_in_use.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/emergency_exit.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/emergency_exit.png index cca296445..f3937ed66 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/emergency_exit.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/emergency_exit.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/escalator.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/escalator.png index ac794d816..3c100e684 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/escalator.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/escalator.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/exit_2.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/exit_2.png index eb3fe9bfb..631f1e02c 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/exit_2.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/exit_2.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/exit_3.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/exit_3.png index 116ca95f2..4ca626271 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/exit_3.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/exit_3.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/exit_letter.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/exit_letter.png index c56728257..0ae8b10ff 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/exit_letter.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/exit_letter.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/exit_letter_blank.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/exit_letter_blank.png index ca5b83bf7..54fd62708 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/exit_letter_blank.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/exit_letter_blank.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/female.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/female.png index 041eb291c..a06c9e3af 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/female.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/female.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/gap_small.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/gap_small.png index 6e9a16a8c..0f77997a2 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/gap_small.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/gap_small.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/lift_1.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/lift_1.png index 80d947b6e..c0c2701bb 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/lift_1.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/lift_1.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/lift_2.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/lift_2.png index 2bace427c..71012f990 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/lift_2.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/lift_2.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/lift_arrow.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/lift_arrow.png index 07a39dd07..b9b5d11fc 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/lift_arrow.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/lift_arrow.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/light_rail_1.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/light_rail_1.png index 5bfc246c7..737057795 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/light_rail_1.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/light_rail_1.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/light_rail_3.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/light_rail_3.png index 3bc160ffc..827bf6d97 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/light_rail_3.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/light_rail_3.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/line.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/line.png index a88cad221..752903a88 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/line.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/line.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/logo.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/logo.png index 76105aef5..e8e172e31 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/logo.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/logo.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/logo_grayscale.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/logo_grayscale.png index 5e13c62e7..b2f7d6f04 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/logo_grayscale.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/logo_grayscale.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/male.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/male.png index 7d9e97863..a3b5a685b 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/male.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/male.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/platform.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/platform.png index ae57eddee..52671fd04 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/platform.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/platform.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/rubbish.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/rubbish.png index 40485316c..5cdd10eeb 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/rubbish.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/rubbish.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/seven_segment.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/seven_segment.png index 796db9736..375ea02a2 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/seven_segment.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/seven_segment.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/sp1900.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/sp1900.png index b76a4afe4..781c42bd2 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/sp1900.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/sp1900.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/spit.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/spit.png index 129284abd..e0db18f35 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/spit.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/spit.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/stairs_down.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/stairs_down.png index 3e1578e71..26d879a2c 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/stairs_down.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/stairs_down.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/stairs_up.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/stairs_up.png index 3157d25b3..360f458f2 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/stairs_up.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/stairs_up.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/station.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/station.png index 76105aef5..e8e172e31 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/station.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/station.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/tickets.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/tickets.png index ee9d777c0..c1eb30c08 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/tickets.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/tickets.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/toilets.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/toilets.png index 80f60abbf..e7fce48d3 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/toilets.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/toilets.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/train.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/train.png index 8c32be3ed..30fe2b333 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/train.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/train.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/train_old.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/train_old.png index 4615f8d8e..d967cb98b 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/train_old.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/train_old.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/wheelchair.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/wheelchair.png index 110e3f97f..2f279a705 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/wheelchair.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/wheelchair.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/wifi.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/wifi.png index fcdfe8dd0..8329582b7 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/wifi.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/wifi.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/xrl_1.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/xrl_1.png index 5893d99f3..5b7b20172 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/xrl_1.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/xrl_1.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/xrl_2.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/xrl_2.png index 0034cfaa6..cea74da73 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/xrl_2.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/xrl_2.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/block/sign/yellow_head_1.png b/fabric/src/main/resources/assets/mtr/textures/block/sign/yellow_head_1.png index c8c006844..83797b3ff 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/block/sign/yellow_head_1.png and b/fabric/src/main/resources/assets/mtr/textures/block/sign/yellow_head_1.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/a320.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/a320.png index 07cabc8c2..10dfff054 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/a320.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/a320.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/a320_lufthansa.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/a320_lufthansa.png index 4aa8e437b..1762cbb3a 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/a320_lufthansa.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/a320_lufthansa.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/a_train_ael.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/a_train_ael.png index 364d07daa..bc0ef141a 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/a_train_ael.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/a_train_ael.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/a_train_tcl.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/a_train_tcl.png index e5d6dfc1d..57099abbb 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/a_train_tcl.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/a_train_tcl.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/bogie_1.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/bogie_1.png index 6c26313b7..112746996 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/bogie_1.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/bogie_1.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/br_423.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/br_423.png index f21e2d922..e67d26c6d 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/br_423.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/br_423.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/c1141a.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/c1141a.png index 480e5b742..439c40a04 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/c1141a.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/c1141a.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/c_train.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/c_train.png index eefcdc960..efe579141 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/c_train.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/c_train.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/cable_car_grip.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/cable_car_grip.png index 6be613924..b9f8ea2d8 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/cable_car_grip.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/cable_car_grip.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/class_377_southern.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/class_377_southern.png index 62576d49c..850852c81 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/class_377_southern.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/class_377_southern.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/class_802_gwr.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/class_802_gwr.png index 920136c70..7cacfb649 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/class_802_gwr.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/class_802_gwr.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/class_802_tpe.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/class_802_tpe.png index 96ec3cdcc..ed361bea7 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/class_802_tpe.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/class_802_tpe.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/cm_stock.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/cm_stock.png index 6aafb49dc..477a51d21 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/cm_stock.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/cm_stock.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/drl.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/drl.png index 547cedfce..2f124a444 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/drl.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/drl.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/e44.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/e44.png index e83b35a24..2f7db2b9e 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/e44.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/e44.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/eidan_9000.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/eidan_9000.png index f1ed4f9f6..877082ea3 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/eidan_9000.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/eidan_9000.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/k_train.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/k_train.png index 48bfcff3d..3c953a4d2 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/k_train.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/k_train.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/k_train_ael.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/k_train_ael.png index 2140d58f6..35da575f8 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/k_train_ael.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/k_train_ael.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/k_train_tcl.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/k_train_tcl.png index c3babdf81..7bfc23019 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/k_train_tcl.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/k_train_tcl.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/kcr_christmas.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/kcr_christmas.png index 01609abd5..42acf7fe3 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/kcr_christmas.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/kcr_christmas.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/lift_1.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/lift_1.png index d3effbca2..268e55b9a 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/lift_1.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/lift_1.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_1.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_1.png index df4e8f1eb..6c9638c10 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_1.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_1.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_1_orange.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_1_orange.png index eb1629595..e3da55c37 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_1_orange.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_1_orange.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_1r.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_1r.png index 5a9d9dea9..d4ff356e3 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_1r.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_1r.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_1r_old.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_1r_old.png index a775cb2a0..90113df58 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_1r_old.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_1r_old.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_1r_orange.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_1r_orange.png index bee3d87ce..a208f59e1 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_1r_orange.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_1r_orange.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_2.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_2.png index dc2149c87..1c38e0804 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_2.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_2.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_2_orange.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_2_orange.png index 4f29166ec..de2cac116 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_2_orange.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_2_orange.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_2r.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_2r.png index 83bdb4551..62d61e49e 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_2r.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_2r.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_3.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_3.png index 9f1e37d94..5eda2e947 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_3.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_3.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_3_orange.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_3_orange.png index 247d9fb64..0f045cbba 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_3_orange.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_3_orange.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_3r.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_3r.png index 49c6f46d2..1c0e06be1 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_3r.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_3r.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_4.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_4.png index 15343e97a..b0f309a6d 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_4.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_4.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_4_old.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_4_old.png index 68feabb04..65f3a02be 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_4_old.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_4_old.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_4_orange.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_4_orange.png index d8bd33269..464c8261f 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_4_orange.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_4_orange.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_5.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_5.png index c370a0c89..f783791f0 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_5.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_5.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_5_old.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_5_old.png index 271969079..d0f650108 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_5_old.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_5_old.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_5_orange.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_5_orange.png index a99fc1afb..cdc2583af 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_5_orange.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/light_rail_5_orange.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/london_underground_1995.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/london_underground_1995.png index 490e76a50..1c0fb3a4e 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/london_underground_1995.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/london_underground_1995.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/london_underground_1996.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/london_underground_1996.png index a1c3bd181..762ba59c2 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/london_underground_1996.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/london_underground_1996.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/london_underground_d78.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/london_underground_d78.png index 66368bbb1..f2cc57b51 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/london_underground_d78.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/london_underground_d78.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/london_underground_s7.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/london_underground_s7.png index 5235e97bd..2159563bb 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/london_underground_s7.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/london_underground_s7.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/m_train.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/m_train.png index 7a4d67978..cc3ed5a18 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/m_train.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/m_train.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/mlr.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/mlr.png index dfd90208d..cb7d8b066 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/mlr.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/mlr.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/mpl_85.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/mpl_85.png index ca4380367..aedf8f367 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/mpl_85.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/mpl_85.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/ngong_ping_360_crystal.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/ngong_ping_360_crystal.png index 22d7de882..3ee87e8d5 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/ngong_ping_360_crystal.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/ngong_ping_360_crystal.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/ngong_ping_360_crystal_plus.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/ngong_ping_360_crystal_plus.png index 1b57dd528..5b5e8305b 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/ngong_ping_360_crystal_plus.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/ngong_ping_360_crystal_plus.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/ngong_ping_360_normal_light_blue.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/ngong_ping_360_normal_light_blue.png index 50c6c29be..40525706c 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/ngong_ping_360_normal_light_blue.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/ngong_ping_360_normal_light_blue.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/ngong_ping_360_normal_orange.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/ngong_ping_360_normal_orange.png index dcfc8b50f..ab76d9df5 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/ngong_ping_360_normal_orange.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/ngong_ping_360_normal_orange.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/ngong_ping_360_normal_red.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/ngong_ping_360_normal_red.png index 853291b96..8173c56d6 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/ngong_ping_360_normal_red.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/ngong_ping_360_normal_red.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/r179.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/r179.png index 8feb12b36..69505a6f0 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/r179.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/r179.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/r211.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/r211.png index d87fe4958..03c774da1 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/r211.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/r211.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/r_train.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/r_train.png index 5d50eeaa3..5f48d7646 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/r_train.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/r_train.png differ diff --git a/fabric/src/main/resources/assets/mtr/textures/vehicle/s_train.png b/fabric/src/main/resources/assets/mtr/textures/vehicle/s_train.png index 90732b342..abef31a03 100644 Binary files a/fabric/src/main/resources/assets/mtr/textures/vehicle/s_train.png and b/fabric/src/main/resources/assets/mtr/textures/vehicle/s_train.png differ diff --git a/fabric/src/main/vehicle_templates/5_light_rail.json b/fabric/src/main/vehicle_templates/5_light_rail.json index bdf8a171e..cad834502 100644 --- a/fabric/src/main/vehicle_templates/5_light_rail.json +++ b/fabric/src/main/vehicle_templates/5_light_rail.json @@ -267,14 +267,14 @@ "3", "4", "4", - "4", - "4", + "5", + "5", "1", "1", "4", "4", - "4", - "4", + "5", + "5", "1", "1", "1", @@ -285,8 +285,8 @@ "3", "4", "4", - "4", - "4" + "5", + "5" ], "door_overlay": [ "1", diff --git a/gradle.properties b/gradle.properties index f8844ecd8..c8a065e6c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,8 +2,9 @@ org.gradle.jvmargs=-Xmx6G org.gradle.parallel=true org.gradle.daemon=false minecraftVersion=1.20.4 -version=4.0.0-beta.12 +version=4.0.0-beta.13 excludeAssets=false +crowdinApiKey= patreonApiKey= testServer=false debug=false diff --git a/libs/Transport-Simulation-Core-0.0.1.jar b/libs/Transport-Simulation-Core-0.0.1.jar index 544b31ea7..89c355fd3 100644 Binary files a/libs/Transport-Simulation-Core-0.0.1.jar and b/libs/Transport-Simulation-Core-0.0.1.jar differ diff --git a/libs/Transport-Simulation-Core-Build-Tools.jar b/libs/Transport-Simulation-Core-Build-Tools.jar index 1702c9b72..629230f79 100644 Binary files a/libs/Transport-Simulation-Core-Build-Tools.jar and b/libs/Transport-Simulation-Core-Build-Tools.jar differ