Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.

Commit 594d82c

Browse files
committed
update to forge 1.17
1 parent 2da1f90 commit 594d82c

File tree

5 files changed

+21
-23
lines changed

5 files changed

+21
-23
lines changed

build.gradle

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,20 @@ buildscript {
44
mavenCentral()
55
}
66
dependencies {
7-
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '4.1.+', changing: true
7+
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
88
}
99
}
1010
apply plugin: 'net.minecraftforge.gradle'
1111
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
1212
apply plugin: 'eclipse'
1313
apply plugin: 'maven-publish'
1414

15-
version = '1.0-1.16.5'
15+
version = '1.0-1.17'
1616
group = 'com.github.nearata.optifinecapes' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
1717
archivesBaseName = 'OptifineCapes'
1818

19-
java.toolchain.languageVersion = JavaLanguageVersion.of(8) // Mojang ships Java 8 to end users, so your mod should target Java 8.
19+
// Mojang ships Java 16 to end users in 1.17+ instead of Java 8 in 1.16 or lower, so your mod should target Java 16.
20+
java.toolchain.languageVersion = JavaLanguageVersion.of(16)
2021

2122
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
2223
minecraft {
@@ -25,7 +26,7 @@ minecraft {
2526
// stable_# Stables are built at the discretion of the MCP team.
2627
// Use non-default mappings at your own risk. they may not always work.
2728
// Simply re-run your setup task after changing the mappings to update your workspace.
28-
mappings channel: 'official', version: '1.16.5'
29+
mappings channel: 'official', version: '1.17.1'
2930
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
3031

3132
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
@@ -111,7 +112,7 @@ dependencies {
111112
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
112113
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
113114
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
114-
minecraft 'net.minecraftforge:forge:1.16.5-36.1.32'
115+
minecraft 'net.minecraftforge:forge:1.17.1-37.0.12'
115116

116117
// You may put jars on which you depend on in ./libs or you may define them like so..
117118
// compile "some.group:artifact:version:classifier"
@@ -141,7 +142,7 @@ jar {
141142
"Specification-Vendor": "Nearata",
142143
"Specification-Version": "1", // We are version 1 of ourselves
143144
"Implementation-Title": project.name,
144-
"Implementation-Version": "${version}",
145+
"Implementation-Version": project.jar.archiveVersion,
145146
"Implementation-Vendor" :"Nearata",
146147
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
147148
])
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions-snapshots/gradle-7.2-20210702220150+0000-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

src/main/java/com/github/nearata/optifinecapes/OptifineCapes.java

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
import java.util.List;
77

88
import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
9+
import com.mojang.blaze3d.platform.NativeImage;
910

11+
import net.minecraft.Util;
1012
import net.minecraft.client.Minecraft;
11-
import net.minecraft.client.entity.player.AbstractClientPlayerEntity;
12-
import net.minecraft.client.network.play.NetworkPlayerInfo;
13+
import net.minecraft.client.multiplayer.PlayerInfo;
14+
import net.minecraft.client.player.AbstractClientPlayer;
1315
import net.minecraft.client.renderer.texture.DynamicTexture;
14-
import net.minecraft.client.renderer.texture.NativeImage;
15-
import net.minecraft.entity.player.PlayerEntity;
16-
import net.minecraft.util.ResourceLocation;
17-
import net.minecraft.util.Util;
16+
import net.minecraft.resources.ResourceLocation;
17+
import net.minecraft.world.entity.player.Player;
1818
import net.minecraftforge.client.event.RenderPlayerEvent;
1919
import net.minecraftforge.common.MinecraftForge;
2020
import net.minecraftforge.event.TickEvent.ClientTickEvent;
@@ -35,15 +35,15 @@ public OptifineCapes()
3535
@SubscribeEvent
3636
public final void renderPlayer(final RenderPlayerEvent.Pre event)
3737
{
38-
final PlayerEntity player = event.getPlayer();
39-
final AbstractClientPlayerEntity acp = (AbstractClientPlayerEntity) player;
38+
final Player player = event.getPlayer();
39+
final AbstractClientPlayer acp = (AbstractClientPlayer) player;
4040
final String name = player.getName().getString();
4141

4242
if (acp.isCapeLoaded() && acp.getCloakTextureLocation() == null && !players.contains(name))
4343
{
4444
this.players.add(name);
4545

46-
final NetworkPlayerInfo playerInfo = acp.getPlayerInfo();
46+
final PlayerInfo playerInfo = acp.getPlayerInfo();
4747

4848
Util.backgroundExecutor().execute(() -> {
4949
try
@@ -53,8 +53,6 @@ public final void renderPlayer(final RenderPlayerEvent.Pre event)
5353
final DynamicTexture dynamicTexture = new DynamicTexture(this.parseCape(nativeImage));
5454
final ResourceLocation resourceLocation = mc.getTextureManager().register("optifinecapes/", dynamicTexture);
5555

56-
mc.getTextureManager().loadTexture(resourceLocation, dynamicTexture);
57-
5856
playerInfo.textureLocations.put(Type.CAPE, resourceLocation);
5957
playerInfo.textureLocations.put(Type.ELYTRA, resourceLocation);
6058
}
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
public net.minecraft.client.entity.player.AbstractClientPlayerEntity func_175155_b()Lnet/minecraft/client/network/play/NetworkPlayerInfo; # getPlayerInfo
2-
public net.minecraft.client.network.play.NetworkPlayerInfo field_187107_a # textureLocations
3-
public net.minecraft.client.renderer.texture.TextureManager func_230183_b_(Lnet/minecraft/util/ResourceLocation;Lnet/minecraft/client/renderer/texture/Texture;)Lnet/minecraft/client/renderer/texture/Texture; # loadTexture
1+
public net.minecraft.client.player.AbstractClientPlayer m_108558_()Lnet/minecraft/client/multiplayer/PlayerInfo; # getPlayerInfo
2+
public net.minecraft.client.multiplayer.PlayerInfo f_105299_ # textureLocations

src/main/resources/META-INF/mods.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
modLoader="javafml" #mandatory
2-
loaderVersion="[36,)" #mandatory
2+
loaderVersion="[37,)" #mandatory
33
license="MIT"
44
issueTrackerURL="https://github.com/Nearata/OptifineCapes/issues" #optional
55
[[mods]] #mandatory
@@ -13,6 +13,6 @@ description="For those who are only interested in the optifine capes."
1313
modId="minecraft"
1414
mandatory=true
1515
# This version range declares a minimum of the current minecraft version up to but not including the next major version
16-
versionRange="[1.16.5,1.17)"
16+
versionRange="[1.17.1,1.18)"
1717
ordering="NONE"
1818
side="CLIENT"

0 commit comments

Comments
 (0)