Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
7ff6718
Update bug report template to include Java 22
Rongmario Jun 10, 2024
e2bb54d
Align resize behavior to lwjgl2 (#163)
vfyjxf Jun 15, 2024
9e93b66
Update gradle
kappa-maintainer Jun 16, 2024
b1ac239
Add zh_CN and zh_TW (#170)
ChAoSUnItY Jul 8, 2024
2ab52fa
Improve the "Duped mods" error message (#181)
strubium Aug 8, 2024
1543ad6
Javadoc for ProgressManager (#185)
strubium Aug 14, 2024
3adae0e
Javadoc for DungeonHooks (#186)
strubium Aug 19, 2024
b958531
Javadoc for BiomeDictionary (#187)
strubium Aug 19, 2024
a245727
Using NeoForge Installer instead of Forge, update correct icon (#121)
Ecdcaeb Oct 27, 2024
6629255
Revert "Using NeoForge Installer instead of Forge, update correct ico…
KorewaLidesu Oct 27, 2024
48b17d4
Update bug report template to include Java 23 (#231)
Ecdcaeb Oct 28, 2024
f5cd2de
Java Doc for some Client events and helpful api (#242)
Ecdcaeb Nov 9, 2024
27f74c2
Add manually publish action
kappa-maintainer Nov 18, 2024
e7f0a41
Cleanup patch hunks (#253)
HaHaWTH Dec 8, 2024
aabb1c9
Sync changes & Fix build
HaHaWTH Dec 16, 2024
a35a2a7
Revert name change
HaHaWTH Dec 16, 2024
4e66f14
Rename method
HaHaWTH Dec 16, 2024
4509e20
Remove repository dispatch
HaHaWTH Dec 16, 2024
51e593a
Merge remote-tracking branch 'pure-cleanroom/main' into bouncedpad
HaHaWTH Dec 16, 2024
a150f54
Cleanup hunks
HaHaWTH Dec 16, 2024
868bf97
All upstream changes merged
HaHaWTH Dec 16, 2024
96a4ed5
Fix version command output
HaHaWTH Dec 17, 2024
f81dd1e
Add Java 24 EA to issue template
Rongmario Dec 17, 2024
e7c8055
Permission bridge
HaHaWTH Dec 17, 2024
3a222e2
[ci skip] Update README
HaHaWTH Dec 17, 2024
afe17ec
[ci skip] Added logo
HaHaWTH Dec 17, 2024
a5689eb
Updated upstream (Cleanroom)
HaHaWTH Dec 17, 2024
76f7c3c
Fix typo
HaHaWTH Dec 17, 2024
5c94464
[ci skip] Better handling dumpitem command
HaHaWTH Dec 17, 2024
3c491b7
Fix some mod compatibility
HaHaWTH Dec 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/ISSUE_TEMPLATE/000-report-bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ body:
- Java 19
- Java 20
- Java 21
- Java 22
- Java 23
- Java 24 (Early-Access)
- Other (Please Specify)
validations:
required: true
Expand Down Expand Up @@ -87,4 +90,4 @@ body:
- label: "I am using experimental branch and have installed [Scalar](https://github.com/CleanroomMC/Scalar/releases/tag/2.11.1) and it does not fix this issue."
required: true
- label: "I am running a test build from Cleanroom Github Actions. (Or, if I've compiled it myself I plan to fix the issue)"
required: true
required: true
16 changes: 8 additions & 8 deletions .github/workflows/BuildTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ jobs:
path: projects/cleanroom/build/libs/*-installer.jar
if-no-files-found: error

- name: Repository Dispatch
if: ${{ success() && github.event_name != 'pull_request' }}
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.CLEANROOMMC_DISPATCH_TOKEN }} # require PAT :shrug:
repository: CleanroomMC/CleanroomMMC
event-type: cleanroom_upload_artifact
client-payload: '{"commit_hash": "${{ github.sha }}", "run_job_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}", "branch": "${{ steps.branch-names.outputs.current_branch }}", "build_type": "${{ inputs.environment || steps.vars.outputs.BUILD_TYPE }}", "actor": "${{ github.actor }}", "version": "${{ env.CLEANROOM_VERSION }}"}'
# - name: Repository Dispatch
# if: ${{ success() && github.event_name != 'pull_request' }}
# uses: peter-evans/repository-dispatch@v3
# with:
# token: ${{ secrets.CLEANROOMMC_DISPATCH_TOKEN }} # require PAT :shrug:
# repository: CleanroomMC/CleanroomMMC
# event-type: cleanroom_upload_artifact
# client-payload: '{"commit_hash": "${{ github.sha }}", "run_job_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}", "branch": "${{ steps.branch-names.outputs.current_branch }}", "build_type": "${{ inputs.environment || steps.vars.outputs.BUILD_TYPE }}", "actor": "${{ github.actor }}", "version": "${{ env.CLEANROOM_VERSION }}"}'
43 changes: 43 additions & 0 deletions .github/workflows/Publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Manually Publish

on:
workflow_dispatch:

jobs:

build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/[email protected]
with:
fetch-tags: true
fetch-depth: 0

- name: Set up JDK 21
uses: actions/[email protected]
with:
java-version: '21'
distribution: 'temurin'

- name: Fix Gradle permission
run: chmod +x ./gradlew

- name: Setup Forge env
run: ./gradlew setup -Prun_number=${{ github.run_number }}

- name: Get version
run: echo "CLEANROOM_VERSION=$(cat version.txt)" >> $GITHUB_ENV

- name: Stop Gradle daemon
run: ./gradlew --stop

- name: Build Jars
run: ./gradlew installerJar -Prun_number=${{ github.run_number }}

- name: Stop Gradle daemon again
run: ./gradlew --stop

- name: Publish to maven for mod development
run: ./gradlew publish -PoutlandUsername=${{ secrets.MAVEN_USERNAME }} -PoutlandPassword="${{ secrets.MAVEN_PASSWORD }}" -Prun_number=${{ github.run_number }}
8 changes: 4 additions & 4 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v4.1.4
- uses: actions/checkout@v4.2.2
with:
fetch-tags: true
fetch-depth: 0

- name: Set up JDK 21
uses: actions/setup-java@v4.2.1
uses: actions/setup-java@v4.5.0
with:
java-version: '21'
distribution: 'temurin'
Expand All @@ -45,13 +45,13 @@ jobs:
run: ./gradlew publish -PoutlandUsername=${{ secrets.MAVEN_USERNAME }} -PoutlandPassword="${{ secrets.MAVEN_PASSWORD }}" -Prun_number=${{ github.run_number }} -Prelease=true

- name: Checkout CleanroomMMC
uses: actions/checkout@v4.1.4
uses: actions/checkout@v4.2.2
with:
repository: CleanroomMC/CleanroomMMC
path: mmc

- name: setup python
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.3.0
with:
python-version: '3.12'

Expand Down
31 changes: 9 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
# Cleanroom Minecraft
<img src="./images/catroom.png" height="160" alt="CatRoom" align="right">

## Features
### Implemented
# CatRoom

- 1.12.2 on Java 21
- LWJGL3
- A working *mod development template/kit*
- Patches for loading incompatible mods
- Built-in Mixin w/ handy bootstrapping
- Develop using Scala 3 + Kotlin 2
- Compatibility to 99% of Forge mods
CatRoom is a Cleanroom+Bukkit+Spigot server software forked from [CatServer](https://github.com/Luohuayu/CatServer).

### Planning
## Features:

- CleanroomGradle to replace ForgeGradle
- Classfile API
- Actually useful APIs (See [here](https://github.com/orgs/CleanroomMC/projects/4/))
- Optimized
- Replaced Forge with Cleanroom
- Enhanced mod compatibility
- Built-in Forge-Bukkit permission bridge
- Make use of modern Java features
- Optimized plugin performance

## Components:

Expand All @@ -29,13 +23,6 @@
- Javassist
- [Scalar](https://github.com/CleanroomMC/Scalar/releases/tag/2.11.1), a Scala provider. We made Scala libraries become a standalone mod so it can be updated.

## Download & Installation:

- For MultiMC-based launchers (PolyMC, PrismLauncher), download the MMC instance from [release](https://github.com/CleanroomMC/Cleanroom/releases), import it in your launcher(alternatively unzip patches and json inside to your 1.12 instance).
- For regular launcher (official launcher, AT launcher, FTB, HMCL), download the installer jar from release. You could use the installer like the Forge one.
- **Remember to install Fugue!**
- **And Scalar!**

## Build Instructions:

1. Clone this repository
Expand Down
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ buildscript {
}
}
dependencies {
classpath "net.minecraftforge.gradle:ForgeGradle:6.10.+"
classpath "net.minecraftforge.gradle:ForgeGradle:6.0.+"
}
}

Expand Down Expand Up @@ -1003,7 +1003,8 @@ project(':cleanroom') {
'Timestamp' : new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'Main-Class' : 'net.minecraftforge.fml.relauncher.ServerLaunchWrapper',
'Class-Path' : classpath.toString(),
'Tweak-Class': 'net.minecraftforge.fml.common.launcher.FMLTweaker'
'Tweak-Class': 'net.minecraftforge.fml.common.launcher.FMLTweaker',
'Implementation-Version' : "git-CatRoom-${props.minecraft_version}"
])
manifest.attributes([
'Specification-Title' : props.title,
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Binary file added images/catroom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,91 +1,25 @@
--- before/net/minecraft/advancements/AdvancementManager.java
+++ after/net/minecraft/advancements/AdvancementManager.java
@@ -9,6 +9,7 @@
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import java.io.BufferedReader;
+import java.io.Closeable;
import java.io.File;
import java.io.IOException;
import java.io.Reader;
@@ -41,25 +42,16 @@
public class AdvancementManager
{
private static final Logger field_192782_a = LogManager.getLogger();
- public static final Gson field_192783_b = new GsonBuilder()
- .registerTypeHierarchyAdapter(
- Advancement.Builder.class,
- new JsonDeserializer<Advancement.Builder>()
+ public static final Gson field_192783_b = (new GsonBuilder()).registerTypeHierarchyAdapter(Advancement.Builder.class, new JsonDeserializer<Advancement.Builder>()
{
public Advancement.Builder deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException
{
JsonObject jsonobject = JsonUtils.func_151210_l(p_deserialize_1_, "advancement");
return Advancement.Builder.func_192059_a(jsonobject, p_deserialize_3_);
}
- }
- )
- .registerTypeAdapter(AdvancementRewards.class, new AdvancementRewards.Deserializer())
- .registerTypeHierarchyAdapter(ITextComponent.class, new ITextComponent.Serializer())
- .registerTypeHierarchyAdapter(Style.class, new Style.Serializer())
- .registerTypeAdapterFactory(new EnumTypeAdapterFactory())
- .create();
@@ -58,8 +58,8 @@
.registerTypeHierarchyAdapter(Style.class, new Style.Serializer())
.registerTypeAdapterFactory(new EnumTypeAdapterFactory())
.create();
- private static final AdvancementList field_192784_c = new AdvancementList();
- private final File field_192785_d;
+ }).registerTypeAdapter(AdvancementRewards.class, new AdvancementRewards.Deserializer()).registerTypeHierarchyAdapter(ITextComponent.class, new ITextComponent.Serializer()).registerTypeHierarchyAdapter(Style.class, new Style.Serializer()).registerTypeAdapterFactory(new EnumTypeAdapterFactory()).create();
+ public static final AdvancementList field_192784_c = new AdvancementList();
+ public final File field_192785_d;
private boolean field_193768_e;

public AdvancementManager(@Nullable File p_i47421_1_)
@@ -74,6 +66,7 @@
@@ -74,6 +74,7 @@
field_192784_c.func_192087_a();
Map<ResourceLocation, Advancement.Builder> map = this.func_192781_c();
this.func_192777_a(map);
+ this.field_193768_e |= net.minecraftforge.common.ForgeHooks.loadAdvancements(map);
field_192784_c.func_192083_a(map);

for (Advancement advancement : field_192784_c.func_192088_b())
@@ -94,11 +87,11 @@
{
if (this.field_192785_d == null)
{
- return Maps.newHashMap();
+ return Maps.<ResourceLocation, Advancement.Builder>newHashMap();
}
else
{
- Map<ResourceLocation, Advancement.Builder> map = Maps.newHashMap();
+ Map<ResourceLocation, Advancement.Builder> map = Maps.<ResourceLocation, Advancement.Builder>newHashMap();
this.field_192785_d.mkdirs();

for (File file1 : FileUtils.listFiles(this.field_192785_d, new String[] {"json"}, true))
@@ -112,9 +105,7 @@

try
{
- Advancement.Builder advancement$builder = JsonUtils.func_188178_a(
- field_192783_b, FileUtils.readFileToString(file1, StandardCharsets.UTF_8), Advancement.Builder.class
- );
+ Advancement.Builder advancement$builder = (Advancement.Builder)JsonUtils.func_188178_a(field_192783_b, FileUtils.readFileToString(file1, StandardCharsets.UTF_8), Advancement.Builder.class);

if (advancement$builder == null)
{
@@ -149,12 +140,7 @@
{
URL url = AdvancementManager.class.getResource("/assets/.mcassetsroot");

- if (url == null)
- {
- field_192782_a.error("Couldn't find .mcassetsroot");
- this.field_193768_e = true;
- }
- else
+ if (url != null)
{
URI uri = url.toURI();
Path path;
@@ -187,6 +173,11 @@
@@ -187,6 +188,11 @@
Path path2 = path.relativize(path1);
String s = FilenameUtils.removeExtension(path2.toString()).replaceAll("\\\\", "/");
ResourceLocation resourcelocation = new ResourceLocation("minecraft", s);
Expand All @@ -97,36 +31,3 @@

if (!p_192777_1_.containsKey(resourcelocation))
{
@@ -195,7 +186,7 @@
try
{
bufferedreader = Files.newBufferedReader(path1);
- Advancement.Builder advancement$builder = JsonUtils.func_193839_a(field_192783_b, bufferedreader, Advancement.Builder.class);
+ Advancement.Builder advancement$builder = (Advancement.Builder)JsonUtils.func_193839_a(field_192783_b, bufferedreader, Advancement.Builder.class);
p_192777_1_.put(resourcelocation, advancement$builder);
}
catch (JsonParseException jsonparseexception)
@@ -215,16 +206,22 @@
}
}
}
+
+ return;
}
+
+ field_192782_a.error("Couldn't find .mcassetsroot");
+ this.field_193768_e = true;
}
catch (IOException | URISyntaxException urisyntaxexception)
{
field_192782_a.error("Couldn't get a list of all built-in advancement files", (Throwable)urisyntaxexception);
this.field_193768_e = true;
+ return;
}
finally
{
- IOUtils.closeQuietly(filesystem);
+ IOUtils.closeQuietly((Closeable)filesystem);
}
}

Original file line number Diff line number Diff line change
@@ -1,39 +1,5 @@
--- before/net/minecraft/advancements/critereon/ItemPredicate.java
+++ after/net/minecraft/advancements/critereon/ItemPredicate.java
@@ -37,15 +37,7 @@
this.field_193445_h = NBTPredicate.field_193479_a;
}

- public ItemPredicate(
- @Nullable Item p_i47540_1_,
- @Nullable Integer p_i47540_2_,
- MinMaxBounds p_i47540_3_,
- MinMaxBounds p_i47540_4_,
- EnchantmentPredicate[] p_i47540_5_,
- @Nullable PotionType p_i47540_6_,
- NBTPredicate p_i47540_7_
- )
+ public ItemPredicate(@Nullable Item p_i47540_1_, @Nullable Integer p_i47540_2_, MinMaxBounds p_i47540_3_, MinMaxBounds p_i47540_4_, EnchantmentPredicate[] p_i47540_5_, @Nullable PotionType p_i47540_6_, NBTPredicate p_i47540_7_)
{
this.field_192496_b = p_i47540_1_;
this.field_192497_c = p_i47540_2_;
@@ -95,7 +87,15 @@
}

PotionType potiontype = PotionUtils.func_185191_c(p_192493_1_);
- return this.field_192500_f == null || this.field_192500_f == potiontype;
+
+ if (this.field_192500_f != null && this.field_192500_f != potiontype)
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
}
}

@@ -104,6 +104,13 @@
if (p_192492_0_ != null && !p_192492_0_.isJsonNull())
{
Expand Down
Loading
Loading