Skip to content

Commit

Permalink
Merge branch 'refs/heads/feature/registry-sync-v2/main' into feature/…
Browse files Browse the repository at this point in the history
…registry-sync-v2/api

# Conflicts:
#	build.gradle
  • Loading branch information
thecatcore committed Jul 6, 2024
2 parents b7a8575 + 20cc331 commit d9996b3
Show file tree
Hide file tree
Showing 296 changed files with 5,612 additions and 2,119 deletions.
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@ Fabric API is the library for essential hooks and interoperability mechanisms fo
For support, consider joining the [Legacy Fabric discord server](https://legacyfabric.net/discord) or opening an issue.

## Modules available and tested by minecraft version
✅ = Working as expected\
✅ = Working as expected.\
⚠ = Working but has some issues.\
? = Not sure if it was tested or working correctly\
❌ = Not working at all, likely crashing
? = Not tested, might not work as intended.\
❌ = Not ported or probably not working.

| | 1.7.10 | 1.8 | 1.8.9 | 1.9.4 | 1.10.2 | 1.11.2 | 1.12.2 | 1.13.2 |
|----------------------|--------|-----|-------|-------|--------|--------|--------|--------|
| api-base |||||||||
| command-api-v1 |||||||||
| command-api-v2 |||||||||
| crash-report-info-v1 |||||||||
| entity-events-v1 |||||||||
| gamerule-api-v1 |||||||| ? |
| item-groups-v1 |||||||||
| keybindings-api-v1 | #132 ||||||||
| lifecycle-events-v1 |||||||||
| logger-api-v1 |||||||||
| networking-api-v1 |||||||||
| permissions-api-v1 |||||||||
| registry-sync-api-v1 |||||||||
| rendering-api-v1 |||||||||
| resource-loader-v1 |||||||||
| | 1.6.4 | 1.7.10 | 1.8 | 1.8.9 | 1.9.4 | 1.10.2 | 1.11.2 | 1.12.2 | 1.13.2 |
|----------------------|-------------------------------|--------|-----|-------|-------|--------|--------|--------|--------|
| api-base | |||||||||
| command-api-v1 | |||||||||
| command-api-v2 | | ||||||||
| crash-report-info-v1 | |||||||||
| entity-events-v1 | |||||||||
| gamerule-api-v1 | ? | ||||||| ? |
| item-groups-v1 | |||||||||
| keybindings-api-v1 | | ||||||||
| lifecycle-events-v1 | |||||||||
| logger-api-v1 | |||||||||
| networking-api-v1 | | ||||||||
| permissions-api-v1 | |||||||||
| registry-sync-api-v1 | ❌ (Depends on networking-api) | ||||||||
| rendering-api-v1 | |||||||||
| resource-loader-v1 | |||||||||
25 changes: 25 additions & 0 deletions SPONGE_HEADER
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* This file is part of SpongeAPI, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

14 changes: 12 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
id "eclipse"
id "idea"
id "maven-publish"
id "fabric-loom" version "1.6.5" apply false
id "fabric-loom" version "1.6.2" apply false
id "legacy-looming" version "1.6.3" apply false
id "com.diffplug.spotless" version "6.20.0"
id "org.ajoberstar.grgit" version "3.1.1"
Expand All @@ -22,7 +22,8 @@ def supportedVersions = [
"1.9.4",
"1.8.9",
"1.8",
"1.7.10"
"1.7.10",
"1.6.4"
]
def supportedRanges = [
// ["1.8", "1.8.9", false] // third parameter is whether or not to include snapshots in the range.
Expand Down Expand Up @@ -354,6 +355,15 @@ allprojects {
importOrder("java", "javax", "", "net.minecraft", "net.fabricmc", "net.legacyfabric")
indentWithTabs()
trimTrailingWhitespace()
targetExclude('**/lib/sponge/*.java', '**/lib/sponge/**/*.java')
}
format("sponge", com.diffplug.gradle.spotless.JavaExtension) {
licenseHeaderFile(rootProject.file("SPONGE_HEADER"))
removeUnusedImports()
importOrder("java", "javax", "", "net.minecraft", "net.fabricmc", "net.legacyfabric")
indentWithTabs()
trimTrailingWhitespace()
target('**/lib/sponge/*.java', '**/lib/sponge/**/*.java')
}
}

Expand Down
18 changes: 9 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.parallel=true

base_version = 1.9.4
base_version = 1.10.2
loader_version = 0.15.7
yarn_mappings_build = 530

## Module versions
legacy-fabric-api-base.version = 1.1.0
legacy-fabric-command-api-v1.version = 1.0.0
legacy-fabric-command-api-v2.version = 1.0.1
legacy-fabric-command-api-v1.version = 1.0.1
legacy-fabric-command-api-v2.version = 1.0.2
legacy-fabric-crash-report-info-v1.version = 1.0.0
legacy-fabric-entity-events-v1.version = 1.0.0
legacy-fabric-gamerule-api-v1.version = 1.0.0
legacy-fabric-item-groups-v1.version = 2.0.0
legacy-fabric-keybindings-api-v1.version = 1.0.1
legacy-fabric-lifecycle-events-v1.version = 1.0.1
legacy-fabric-item-groups-v1.version = 2.1.0
legacy-fabric-keybindings-api-v1.version = 1.1.1
legacy-fabric-lifecycle-events-v1.version = 1.1.0
legacy-fabric-logger-api-v1.version = 1.0.4
legacy-fabric-networking-api-v1.version = 2.0.1
legacy-fabric-permissions-api-v1.version = 1.0.1
legacy-fabric-networking-api-v1.version = 2.0.2
legacy-fabric-permissions-api-v1.version = 1.1.0
legacy-fabric-registry-sync-api-v1.version = 2.2.0
legacy-fabric-registry-sync-api-v2.version = 1.0.0
legacy-fabric-rendering-api-v1.version = 1.0.0
legacy-fabric-resource-loader-v1.version = 2.1.1
legacy-fabric-resource-loader-v1.version = 2.2.1
1 change: 1 addition & 0 deletions legacy-fabric-command-api-v1/common/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
minVersionIncluded=1.3
maxVersionIncluded=1.12.2
artifactSuffix=
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
],
"description": "Adds command-related hooks.",
"depends": {
"minecraft": "${minecraft_version}"
"minecraft": "${minecraft_version}",
"legacy-fabric-lifecycle-events-v1-common": "*"
},
"custom": {
"modmenu": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (c) 2020 - 2024 Legacy Fabric
* Copyright (c) 2016 - 2022 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package net.legacyfabric.fabric.test.command;

import net.fabricmc.api.ModInitializer;

import net.legacyfabric.fabric.api.logger.v1.Logger;
import net.legacyfabric.fabric.api.registry.CommandRegistry;

public class CommandV1Test implements ModInitializer {
public static final Logger LOGGER = Logger.get("LegacyFabricAPI", "Test", "CommandV1Test");

@Override
public void onInitialize() {
CommandRegistry.INSTANCE.register(new ModMetadataCommandV1());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/*
* Copyright (c) 2020 - 2024 Legacy Fabric
* Copyright (c) 2016 - 2022 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package net.legacyfabric.fabric.test.command;

import java.util.Optional;

import net.minecraft.command.AbstractCommand;
import net.minecraft.command.CommandException;
import net.minecraft.command.CommandSource;

import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.loader.api.ModContainer;
import net.fabricmc.loader.api.metadata.ContactInformation;

public class ModMetadataCommandV1 extends AbstractCommand {
@Override
public String getCommandName() {
return "modmetadatav1";
}

@Override
public String getUsageTranslationKey(CommandSource source) {
return "modmetadatav1";
}

@Override
public void execute(CommandSource source, String[] args) throws CommandException {
if (args.length > 0) {
Optional<ModContainer> optionalModContainer = FabricLoader.getInstance().getModContainer(args[0]);

if (optionalModContainer.isPresent()) {
ModContainer container = optionalModContainer.get();

StringBuilder builder = new StringBuilder();
builder.append("Mod Name: ".concat(container.getMetadata().getName()).concat("\n"));
builder.append("Description: ".concat(container.getMetadata().getDescription()).concat("\n"));
ContactInformation contact = container.getMetadata().getContact();

if (contact.get("issues").isPresent()) {
StringBuilder issueText = new StringBuilder("");
issueText.append("Issues: ");
StringBuilder issueUrl = new StringBuilder(contact.get("issues").get());
issueText.append(issueUrl);
issueText.append("\n");
builder.append(issueText);
}

if (contact.get("sources").isPresent()) {
StringBuilder sourcesText = new StringBuilder("");
sourcesText.append("Sources: ");
StringBuilder sourcesUrl = new StringBuilder(contact.get("sources").get());
sourcesText.append(sourcesUrl);
sourcesText.append("\n");
builder.append(sourcesText);
}

builder.append("Metadata Type: ".concat(container.getMetadata().getType()).concat("\n"));
CommandV1Test.LOGGER.info(builder.toString());
} else {
CommandV1Test.LOGGER.error("Couldn't find Mod container for mod id '" + args[0] + "'");
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"schemaVersion": 1,
"id": "legacy-fabric-command-api-v1-testmod",
"description": "Tests for api features",
"version": "1.0.0",
"entrypoints": {
"main": [
"net.legacyfabric.fabric.test.command.CommandV1Test"
]
},
"depends": {
"minecraft": "${minecraft_version}"
}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
/*
* Copyright (c) 2020 - 2024 Legacy Fabric
* Copyright (c) 2016 - 2022 FabricMC
* This file is part of SpongeAPI, licensed under the MIT License (MIT).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* http://www.apache.org/licenses/LICENSE-2.0
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package net.legacyfabric.fabric.api.command.v2.lib.sponge;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
/*
* Copyright (c) 2020 - 2024 Legacy Fabric
* Copyright (c) 2016 - 2022 FabricMC
* This file is part of SpongeAPI, licensed under the MIT License (MIT).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* http://www.apache.org/licenses/LICENSE-2.0
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package net.legacyfabric.fabric.api.command.v2.lib.sponge;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
/*
* Copyright (c) 2020 - 2024 Legacy Fabric
* Copyright (c) 2016 - 2022 FabricMC
* This file is part of SpongeAPI, licensed under the MIT License (MIT).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* http://www.apache.org/licenses/LICENSE-2.0
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package net.legacyfabric.fabric.api.command.v2.lib.sponge;
Expand Down
Loading

0 comments on commit d9996b3

Please sign in to comment.