-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
feat: port to minecraft 1.21
- Loading branch information
Showing
28 changed files
with
144 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
plugins { | ||
id("refinedarchitect.root") | ||
id("refinedarchitect.fabric") | ||
} | ||
|
||
repositories { | ||
maven { | ||
url = uri("https://maven.pkg.github.com/refinedmods/refinedstorage2") | ||
credentials { | ||
username = "anything" | ||
password = "\u0067hp_oGjcDFCn8jeTzIj4Ke9pLoEVtpnZMP4VQgaX" | ||
} | ||
} | ||
maven { | ||
name = "ModMenu" | ||
url = uri("https://maven.terraformersmc.com/") | ||
} | ||
maven { | ||
name = "Cloth Config" | ||
url = uri("https://maven.shedaniel.me/") | ||
} | ||
maven { | ||
name = "Trinkets" | ||
url = uri("https://maven.ladysnake.org/releases") | ||
} | ||
} | ||
|
||
refinedarchitect { | ||
modId = "refinedstorage_trinkets_integration" | ||
fabric() | ||
sonarQube("refinedmods_refinedstorage-trinkets-integration", "refinedmods") | ||
publishing { | ||
maven = true | ||
} | ||
} | ||
|
||
group = "com.refinedmods.refinedstorage" | ||
|
||
base { | ||
archivesName.set("refinedstorage-trinkets-integration") | ||
} | ||
|
||
val refinedstorageVersion: String by project | ||
val trinketsVersion: String by project | ||
val cardinalComponentsVersion: String by project | ||
|
||
dependencies { | ||
modApi("com.refinedmods.refinedstorage:refinedstorage-platform-fabric:${refinedstorageVersion}") | ||
modApi("dev.emi:trinkets:${trinketsVersion}") | ||
modApi("dev.onyxstudios.cardinal-components-api:cardinal-components-base:${cardinalComponentsVersion}") | ||
modApi("dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${cardinalComponentsVersion}") | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
refinedstorageVersion=2.0.0-milestone.3.13 | ||
trinketsVersion=3.8.0 | ||
cardinalComponentsVersion=5.4.0 | ||
refinedarchitectVersion=0.16.7 | ||
refinedstorageVersion=2.0.0-milestone.4.4 | ||
# https://www.curseforge.com/minecraft/mc-mods/trinkets/files | ||
trinketsVersion=3.10.0 | ||
cardinalComponentsVersion=6.1.0 | ||
# Gradle | ||
org.gradle.jvmargs=-Xmx1G |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
pluginManagement { | ||
repositories { | ||
mavenCentral() | ||
gradlePluginPortal() | ||
maven { | ||
url = uri("https://maven.pkg.github.com/refinedmods/refinedarchitect") | ||
credentials { | ||
username = "anything" | ||
password = "\u0067hp_oGjcDFCn8jeTzIj4Ke9pLoEVtpnZMP4VQgaX" | ||
} | ||
} | ||
maven { | ||
name = "Fabric" | ||
url = uri("https://maven.fabricmc.net/") | ||
} | ||
} | ||
val refinedarchitectVersion: String by settings | ||
plugins { | ||
id("refinedarchitect.root").version(refinedarchitectVersion) | ||
id("refinedarchitect.fabric").version(refinedarchitectVersion) | ||
} | ||
} | ||
|
||
rootProject.name = "refinedstorage-trinkets-integration" |
16 changes: 4 additions & 12 deletions
16
src/main/java/com/refinedmods/refinedstorage/trinkets/TrinketsRefinedStoragePlugin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,19 @@ | ||
package com.refinedmods.refinedstorage.trinkets; | ||
|
||
import com.refinedmods.refinedstorage2.platform.api.PlatformApi; | ||
import com.refinedmods.refinedstorage2.platform.api.RefinedStoragePlugin; | ||
import com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil; | ||
import com.refinedmods.refinedstorage.platform.api.PlatformApi; | ||
import com.refinedmods.refinedstorage.platform.api.RefinedStoragePlugin; | ||
|
||
import net.minecraft.resources.ResourceLocation; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class TrinketsRefinedStoragePlugin implements RefinedStoragePlugin { | ||
public static final String ID = "refinedstorage_trinkets_integration"; | ||
|
||
private static final Logger LOGGER = LoggerFactory.getLogger(TrinketsRefinedStoragePlugin.class); | ||
|
||
@Override | ||
public void onPlatformApiAvailable(final PlatformApi platformApi) { | ||
PlatformApi.INSTANCE.getSlotReferenceFactoryRegistry().register( | ||
new ResourceLocation(ID, "trinkets"), | ||
ResourceLocation.fromNamespaceAndPath(ID, "trinkets"), | ||
TrinketsSlotReferenceFactory.INSTANCE | ||
); | ||
PlatformApi.INSTANCE.addSlotReferenceProvider(new TrinketsSlotReferenceProvider()); | ||
LOGGER.info( | ||
"Refined Storage - Trinkets Integration has loaded. RS2 ModId: {}", | ||
IdentifierUtil.MOD_ID | ||
); | ||
} | ||
} |
25 changes: 4 additions & 21 deletions
25
src/main/java/com/refinedmods/refinedstorage/trinkets/TrinketsSlotReference.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 17 additions & 6 deletions
23
src/main/java/com/refinedmods/refinedstorage/trinkets/TrinketsSlotReferenceFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,28 @@ | ||
package com.refinedmods.refinedstorage.trinkets; | ||
|
||
import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; | ||
import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceFactory; | ||
import net.minecraft.network.FriendlyByteBuf; | ||
import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; | ||
import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceFactory; | ||
|
||
import net.minecraft.network.RegistryFriendlyByteBuf; | ||
import net.minecraft.network.codec.ByteBufCodecs; | ||
import net.minecraft.network.codec.StreamCodec; | ||
|
||
class TrinketsSlotReferenceFactory implements SlotReferenceFactory { | ||
public static final SlotReferenceFactory INSTANCE = new TrinketsSlotReferenceFactory(); | ||
static final SlotReferenceFactory INSTANCE = new TrinketsSlotReferenceFactory(); | ||
private static final StreamCodec<RegistryFriendlyByteBuf, TrinketsSlotReference> STREAM_CODEC = | ||
StreamCodec.composite( | ||
ByteBufCodecs.STRING_UTF8, TrinketsSlotReference::groupName, | ||
ByteBufCodecs.STRING_UTF8, TrinketsSlotReference::slotName, | ||
ByteBufCodecs.INT, TrinketsSlotReference::index, | ||
TrinketsSlotReference::new | ||
); | ||
|
||
private TrinketsSlotReferenceFactory() { | ||
} | ||
|
||
@Override | ||
public SlotReference create(final FriendlyByteBuf buf) { | ||
return new TrinketsSlotReference(buf.readUtf(), buf.readUtf(), buf.readInt()); | ||
@SuppressWarnings({"rawtypes", "unchecked"}) | ||
public StreamCodec<RegistryFriendlyByteBuf, SlotReference> getStreamCodec() { | ||
return (StreamCodec) STREAM_CODEC; | ||
} | ||
} |
5 changes: 3 additions & 2 deletions
5
src/main/java/com/refinedmods/refinedstorage/trinkets/TrinketsSlotReferenceProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/resources/assets/refinedstorage_trinkets_integration/lang/en_us.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"trinkets.slot.refinedstorage_trinkets_integration.wireless": "Refined Storage" | ||
"trinkets.slot.refinedstorage_trinkets_integration.refinedstorage": "Refined Storage" | ||
} |
Oops, something went wrong.