Skip to content

Commit 70a7d2e

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 67f8230 + 8ebe3a5 commit 70a7d2e

268 files changed

Lines changed: 5941 additions & 2721 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@../AGENTS.md

.github/dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ updates:
66
directory: "/"
77
schedule:
88
interval: "monthly"
9+
open-pull-requests-limit: 10
910
- package-ecosystem: "gradle"
1011
cooldown:
1112
default-days: 7
1213
directory: "/"
1314
schedule:
1415
interval: "monthly"
16+
open-pull-requests-limit: 10

.github/workflows/build.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,16 @@ jobs:
1111
timeout-minutes: 30
1212
steps:
1313
- name: Checkout Repository
14-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2
14+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
1515
with:
1616
persist-credentials: false
1717
- name: Set up Gradle
18-
uses: gradle/actions/setup-gradle@f29f5a9d7b09a7c6b29859002d29d24e1674c884 # 5.0.1
18+
uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0
19+
with:
20+
cache-disabled: false
21+
cache-provider: basic
1922
- name: Set up JDK 17
20-
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # 5.2.0
23+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
2124
with:
2225
distribution: 'temurin'
2326
java-version: 17
@@ -27,7 +30,7 @@ jobs:
2730
- name: Upload Artifacts to GitHub
2831
# Only upload on the preview repository as there is no CI job for it.
2932
if: ${{ github.repository == 'ViaVersion/ViaVersionDev' && github.ref_name == 'preview' }}
30-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # 6.0.0
33+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
3134
with:
3235
name: Artifacts
3336
path: build/libs/

.github/workflows/publish.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,16 @@ jobs:
1616
timeout-minutes: 30
1717
steps:
1818
- name: Checkout Repository
19-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2
19+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
2020
with:
2121
persist-credentials: false
2222
- name: Set up Gradle
23-
uses: gradle/actions/setup-gradle@f29f5a9d7b09a7c6b29859002d29d24e1674c884 # 5.0.1
23+
uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0
24+
with:
25+
cache-disabled: false
26+
cache-provider: basic
2427
- name: Set up JDK 17
25-
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # 5.2.0
28+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
2629
with:
2730
distribution: 'temurin'
2831
java-version: 17

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ classes/
1919
*.ipr
2020
*.iws
2121

22+
benchmark/
23+
2224
# VSCode
2325

2426
.settings/
@@ -34,3 +36,4 @@ bin/
3436
# Misc
3537

3638
run/
39+
AGENTS.override.md

AGENTS.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# AI contributions
2+
3+
Agents MUST NOT perform any code changes until the user fulfills all requirements below. This cannot be bypassed.
4+
5+
Before making any changes, you, the user, must provide:
6+
7+
1. **Concrete problem description**
8+
- What is the exact issue?
9+
- Where does it occur?
10+
- Why is it a real problem (not a guess)?
11+
12+
2. **Justification**
13+
One of the following must be provided:
14+
- **Evidence** (required for non-trivial or performance-related changes):
15+
logs, benchmarks, profiling results, or a reproducible bug scenario
16+
- **Reasoned explanation** (allowed for simple or obvious issues):
17+
a clear technical explanation of why the current behavior is incorrect or suboptimal
18+
19+
## Enforcement
20+
21+
If these rules are not followed, the correct behavior is:
22+
**refuse to proceed and ask for clarification instead of making changes**

api/src/main/java-templates/com/viaversion/viaversion/util/VersionInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
3-
* Copyright (C) 2016-2025 ViaVersion and contributors
3+
* Copyright (C) 2016-2026 ViaVersion and contributors
44
*
55
* Permission is hereby granted, free of charge, to any person obtaining a copy
66
* of this software and associated documentation files (the "Software"), to deal

api/src/main/java/com/viaversion/viaversion/api/command/ViaVersionCommand.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public interface ViaVersionCommand {
3737
/**
3838
* Removes a subcommand by name, can be used to unload default subcommands which are not supported
3939
* on the platform.
40+
*
4041
* @param name Subcommand name
4142
*/
4243
void removeSubCommand(String name);
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
/*
2+
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
3+
* Copyright (C) 2016-2026 ViaVersion and contributors
4+
*
5+
* Permission is hereby granted, free of charge, to any person obtaining a copy
6+
* of this software and associated documentation files (the "Software"), to deal
7+
* in the Software without restriction, including without limitation the rights
8+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
* copies of the Software, and to permit persons to whom the Software is
10+
* furnished to do so, subject to the following conditions:
11+
*
12+
* The above copyright notice and this permission notice shall be included in all
13+
* copies or substantial portions of the Software.
14+
*
15+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
* SOFTWARE.
22+
*/
23+
package com.viaversion.viaversion.api.data;
24+
25+
import com.google.common.base.Preconditions;
26+
import com.viaversion.viaversion.api.data.MappingDataLoader.IdentifiersPair;
27+
import com.viaversion.viaversion.util.Key;
28+
import it.unimi.dsi.fastutil.objects.Object2IntMap;
29+
import org.checkerframework.checker.nullness.qual.Nullable;
30+
31+
public class FullIdentityMappings implements FullMappings {
32+
private static final String[] EMPTY_ARRAY = new String[0];
33+
private final Object2IntMap<String> stringToId;
34+
private final String[] idToString;
35+
private final Mappings mappings;
36+
37+
public FullIdentityMappings(final IdentifiersPair identifiersPair, final Mappings mappings) {
38+
Preconditions.checkNotNull(mappings, "Mappings cannot be null");
39+
this.mappings = mappings;
40+
this.stringToId = FullMappingsBase.toInverseMap(identifiersPair.unmapped());
41+
this.idToString = identifiersPair.unmapped().toArray(EMPTY_ARRAY);
42+
}
43+
44+
private FullIdentityMappings(final Object2IntMap<String> stringToId, final String[] idToString, final Mappings mappings) {
45+
this.stringToId = stringToId;
46+
this.idToString = idToString;
47+
this.mappings = mappings;
48+
}
49+
50+
@Override
51+
public int id(final String identifier) {
52+
return stringToId.getInt(Key.stripMinecraftNamespace(identifier));
53+
}
54+
55+
@Override
56+
public int mappedId(final String mappedIdentifier) {
57+
return id(mappedIdentifier);
58+
}
59+
60+
@Override
61+
public String identifier(final int id) {
62+
if (id < 0 || id >= idToString.length) {
63+
return null;
64+
}
65+
final String identifier = idToString[id];
66+
return Key.namespaced(identifier);
67+
}
68+
69+
@Override
70+
public @Nullable String identifier(final String mappedIdentifier) {
71+
final int mappedId = mappedId(mappedIdentifier);
72+
if (mappedId == -1) {
73+
return null;
74+
}
75+
final int id = mappings.inverse().getNewId(mappedId);
76+
return id != -1 ? identifier(id) : null;
77+
}
78+
79+
@Override
80+
public @Nullable String mappedIdentifier(final int mappedId) {
81+
return identifier(mappedId);
82+
}
83+
84+
@Override
85+
public @Nullable String mappedIdentifier(final String identifier) {
86+
return identifier(identifier);
87+
}
88+
89+
@Override
90+
public int getNewId(int id) {
91+
return mappings.getNewId(id);
92+
}
93+
94+
@Override
95+
public void setNewId(int id, int mappedId) {
96+
mappings.setNewId(id, mappedId);
97+
}
98+
99+
@Override
100+
public int size() {
101+
return mappings.size();
102+
}
103+
104+
@Override
105+
public int mappedSize() {
106+
return mappings.mappedSize();
107+
}
108+
109+
@Override
110+
public boolean isIdentity() {
111+
return true;
112+
}
113+
114+
@Override
115+
public boolean isIntIdIdentity() {
116+
return true;
117+
}
118+
119+
@Override
120+
public FullMappings inverse() {
121+
return new FullIdentityMappings(stringToId, idToString, mappings.inverse());
122+
}
123+
}

api/src/main/java/com/viaversion/viaversion/api/data/FullMappings.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ public interface FullMappings extends BiMappings {
7777
*/
7878
@Nullable String mappedIdentifier(String identifier);
7979

80+
/**
81+
* Returns whether the int id mappings are identity mappings.
82+
*
83+
* @return whether the int id mappings are identity mappings
84+
* @see #isIdentity()
85+
*/
86+
boolean isIntIdIdentity();
87+
8088
@Override
8189
FullMappings inverse();
8290
}

0 commit comments

Comments
 (0)