Skip to content

Commit 2c06ff7

Browse files
committed
1.21.5 support
1 parent da31391 commit 2c06ff7

File tree

8 files changed

+22
-18
lines changed

8 files changed

+22
-18
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Find the latest versions [here](https://maven.fabricmc.net/teamreborn/energy/)
2121
- Version 3.x should be used for Minecraft 1.19.4 -> 1.20.4
2222
- Version 4.0.x should be used for Minecraft 1.20.5 or later
2323
- Version 4.1.x should be used for Minecraft 1.21 or later
24+
- Version 4.2.x should be used for Minecraft 1.21.5 or later
2425

2526
Add the following into your dependencies block in build.gradle
2627

build.gradle

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'fabric-loom' version '1.6-SNAPSHOT'
2+
id 'fabric-loom' version '1.10-SNAPSHOT'
33
id 'java'
44
id 'maven-publish'
55
}
@@ -61,28 +61,28 @@ java {
6161
publishing {
6262
publications {
6363
create("maven", MavenPublication) {
64-
groupId 'teamreborn'
65-
artifactId project.base.archivesName.get()
66-
version project.version
64+
groupId = 'teamreborn'
65+
artifactId = project.base.archivesName.get()
66+
version = project.version
6767

6868
from components.java
6969
}
7070
}
7171
repositories {
7272
if (ENV.MAVEN_URL) {
7373
maven {
74-
url ENV.MAVEN_URL
74+
url = ENV.MAVEN_URL
7575
credentials {
76-
username ENV.MAVEN_USERNAME
77-
password ENV.MAVEN_PASSWORD
76+
username = ENV.MAVEN_USERNAME
77+
password = ENV.MAVEN_PASSWORD
7878
}
7979
}
8080
}
8181
}
8282
}
8383

8484
// A task to ensure that the version being released has not already been released.
85-
task checkVersion {
85+
tasks.register('checkVersion') {
8686
doFirst {
8787
def xml = new URL("https://maven.fabricmc.net/teamreborn/energy/maven-metadata.xml").text
8888
def metadata = new XmlSlurper().parseText(xml)

gradle.properties

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Done to increase the memory available to gradle.
22
org.gradle.jvmargs=-Xmx1G
33

4-
mod_version=4.1.0
4+
mod_version=4.2.0
55

66
# Fabric Properties
77
# check these on https://fabricmc.net/versions.html
8-
minecraft_version=1.21-pre2
9-
yarn_mappings=1.21-pre2+build.2
10-
loader_version=0.15.11
8+
minecraft_version=1.21.5-pre2
9+
yarn_mappings=1.21.5-pre2+build.6
10+
loader_version=0.16.10
1111

1212
# Dependencies
13-
fabric_version=0.99.4+1.21
13+
fabric_version=0.119.0+1.21.5

gradle/wrapper/gradle-wrapper.jar

-9 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

src/main/java/team/reborn/energy/api/base/SimpleSidedEnergyContainer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public abstract class SimpleSidedEnergyContainer extends SnapshotParticipant<Lon
1919

2020
public SimpleSidedEnergyContainer() {
2121
for (int i = 0; i < 7; ++i) {
22-
sideStorages[i] = new SideStorage(i == 6 ? null : Direction.byId(i));
22+
sideStorages[i] = new SideStorage(i == 6 ? null : Direction.byIndex(i));
2323
}
2424
}
2525

@@ -42,7 +42,7 @@ public SimpleSidedEnergyContainer() {
4242
* @return An {@link EnergyStorage} implementation for the passed side.
4343
*/
4444
public EnergyStorage getSideStorage(@Nullable Direction side) {
45-
return sideStorages[side == null ? 6 : side.getId()];
45+
return sideStorages[side == null ? 6 : side.getIndex()];
4646
}
4747

4848
@Override

src/main/resources/fabric.mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
"depends": {
2525
"java": ">=21",
26-
"minecraft": ">=1.21-",
26+
"minecraft": ">=1.21.5-",
2727
"fabric-transfer-api-v1": ">=5.1.0"
2828
}
2929
}

src/test/java/team/reborn/energy/test/TestBatteryItem.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22

33
import net.minecraft.item.Item;
44
import net.minecraft.item.ItemStack;
5+
import net.minecraft.registry.RegistryKey;
6+
import net.minecraft.registry.RegistryKeys;
7+
import net.minecraft.util.Identifier;
58
import team.reborn.energy.api.base.SimpleEnergyItem;
69

710
public class TestBatteryItem extends Item implements SimpleEnergyItem {
811
private final long capacity, maxInput, maxOutput;
912

1013
public TestBatteryItem(long capacity, long maxInput, long maxOutput) {
11-
super(new Item.Settings());
14+
super(new Item.Settings().registryKey(RegistryKey.of(RegistryKeys.ITEM, Identifier.of("energy_test", "battery"))));
1215
this.capacity = capacity;
1316
this.maxInput = maxInput;
1417
this.maxOutput = maxOutput;

0 commit comments

Comments
 (0)