Skip to content

Commit fe893e7

Browse files
authored
Merge pull request #4 from litetex-oss/dev
Release
2 parents 1213876 + e2e521a commit fe893e7

File tree

10 files changed

+538
-528
lines changed

10 files changed

+538
-528
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
# 1.0.0
1+
# 1.0.1
2+
* Improved compatibility information
23

4+
# 1.0.0
35
Improvements and changes in comparison to Capes mod:
46
* Improved provider configuration screen
57
* Can now be ordered

LICENSE

Lines changed: 504 additions & 3 deletions
Large diffs are not rendered by default.

LICENSE.LGPL-2.1-or-later

Lines changed: 0 additions & 504 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
Provides you with capes!
1414

15-
You can choose from various providers.
15+
You can choose from various providers or add your own.
1616

1717
Improved/Reworked version of the ["Capes" mod](https://github.com/CaelTheColher/Capes):
1818
* Improved and easier cape provider integration

build.gradle

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'fabric-loom' version '1.10.2'
2+
id 'fabric-loom' version '1.10.4'
33
id 'maven-publish'
44
id 'checkstyle'
55
id 'org.sonarqube' version '6.0.1.5171'
@@ -21,7 +21,7 @@ base {
2121

2222
loom {
2323
accessWidenerPath = file("src/main/resources/cape-provider.accesswidener")
24-
log4jConfigs.from(file("log4j2-dev.xml"))
24+
log4jConfigs.from(file("src/dev/log4j2.xml"))
2525
}
2626

2727
// https://github.com/gradle/gradle/issues/27035
@@ -128,4 +128,7 @@ modrinth {
128128
uploadFile = remapJar
129129
syncBodyFrom = rootProject.file("README.md").text
130130
changelog = System.getenv("MODRINTH_CHANGELOG_TEXT")
131+
dependencies {
132+
optional.project 'modmenu'
133+
}
131134
}
File renamed without changes.

src/main/java/net/litetex/capes/handler/PlayerHandler.java renamed to src/main/java/net/litetex/capes/handler/PlayerCapeHandler.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@
3838

3939

4040
@SuppressWarnings("checkstyle:MagicNumber")
41-
public class PlayerHandler
41+
public class PlayerCapeHandler
4242
{
43-
private static final Logger LOG = LoggerFactory.getLogger(PlayerHandler.class);
43+
private static final Logger LOG = LoggerFactory.getLogger(PlayerCapeHandler.class);
4444

45-
private static final Map<UUID, PlayerHandler> INSTANCES = Collections.synchronizedMap(new HashMap<>());
45+
private static final Map<UUID, PlayerCapeHandler> INSTANCES = Collections.synchronizedMap(new HashMap<>());
4646

4747
private static final ExecutorService EXECUTORS = Executors.newFixedThreadPool(
4848
2,
@@ -68,7 +68,7 @@ public Thread newThread(@NotNull final Runnable r)
6868
private boolean hasElytraTexture = true;
6969
private boolean hasAnimatedCape;
7070

71-
public PlayerHandler(final GameProfile profile)
71+
public PlayerCapeHandler(final GameProfile profile)
7272
{
7373
this.profile = profile;
7474
}
@@ -225,15 +225,15 @@ private Map<Integer, NativeImage> toAnimatedCapeTextureFrames(final NativeImage
225225
return frames;
226226
}
227227

228-
public static PlayerHandler getProfile(final GameProfile profile)
228+
public static PlayerCapeHandler getProfile(final GameProfile profile)
229229
{
230230
return INSTANCES.get(profile.getId());
231231
}
232232

233233
// Only use this when required to keep RAM consumption low!
234-
public static PlayerHandler getOrCreateProfile(final GameProfile profile)
234+
public static PlayerCapeHandler getOrCreateProfile(final GameProfile profile)
235235
{
236-
return INSTANCES.computeIfAbsent(profile.getId(), ignored -> new PlayerHandler(profile));
236+
return INSTANCES.computeIfAbsent(profile.getId(), ignored -> new PlayerCapeHandler(profile));
237237
}
238238

239239
public static void onLoadTexture(final GameProfile profile)
@@ -282,11 +282,11 @@ public static void onLoadTexture(
282282
}
283283
}
284284

285-
final PlayerHandler playerHandler = getOrCreateProfile(profile);
286-
playerHandler.resetCape();
285+
final PlayerCapeHandler handler = getOrCreateProfile(profile);
286+
handler.resetCape();
287287

288288
final Optional<CapeProvider> optFoundCapeProvider = capeProviders.stream()
289-
.filter(playerHandler::trySetCape)
289+
.filter(handler::trySetCape)
290290
.findFirst();
291291

292292
if(LOG.isDebugEnabled())

src/main/java/net/litetex/capes/menu/preview/render/PlayerPlaceholderEntity.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import com.mojang.authlib.GameProfile;
66

77
import net.litetex.capes.Capes;
8-
import net.litetex.capes.handler.PlayerHandler;
8+
import net.litetex.capes.handler.PlayerCapeHandler;
99
import net.litetex.capes.provider.CapeProvider;
1010
import net.minecraft.client.MinecraftClient;
1111
import net.minecraft.client.util.DefaultSkinHelper;
@@ -62,19 +62,19 @@ public void loadCapeTextureIfRequired()
6262
if(!this.capeLoading)
6363
{
6464
this.capeLoading = true;
65-
PlayerHandler.onLoadTexture(this.gameProfile, false, this.capeProviders, () -> this.capeLoaded = true);
65+
PlayerCapeHandler.onLoadTexture(this.gameProfile, false, this.capeProviders, () -> this.capeLoaded = true);
6666
}
6767
}
6868

6969
public Identifier getCapeTexture()
7070
{
71-
final PlayerHandler handler = PlayerHandler.getProfile(this.gameProfile);
71+
final PlayerCapeHandler handler = PlayerCapeHandler.getProfile(this.gameProfile);
7272
return handler != null && handler.hasCape() ? handler.getCape() : this.skin.capeTexture();
7373
}
7474

7575
public Identifier getElytraTexture()
7676
{
77-
final PlayerHandler handler = PlayerHandler.getProfile(this.gameProfile);
77+
final PlayerCapeHandler handler = PlayerCapeHandler.getProfile(this.gameProfile);
7878
final Identifier capeTexture = this.getCapeTexture();
7979
return handler == null
8080
|| (handler.hasElytraTexture()

src/main/java/net/litetex/capes/mixins/PlayerListEntryMixin.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import com.mojang.authlib.GameProfile;
1919

2020
import net.litetex.capes.Capes;
21-
import net.litetex.capes.handler.PlayerHandler;
21+
import net.litetex.capes.handler.PlayerCapeHandler;
2222
import net.minecraft.client.network.PlayerListEntry;
2323
import net.minecraft.client.util.SkinTextures;
2424
import net.minecraft.util.Identifier;
@@ -42,14 +42,14 @@ private static void loadTextures(
4242
if(lastLoadTime == null || lastLoadTime.isBefore(now.minus(Capes.instance().loadThrottleSuppressDuration())))
4343
{
4444
LOAD_THROTTLE.put(id, now);
45-
PlayerHandler.onLoadTexture(profile);
45+
PlayerCapeHandler.onLoadTexture(profile);
4646
}
4747
}
4848

4949
@Inject(method = "getSkinTextures", at = @At("TAIL"), cancellable = true)
5050
private void getCapeTexture(final CallbackInfoReturnable<SkinTextures> cir)
5151
{
52-
final PlayerHandler handler = PlayerHandler.getProfile(this.profile);
52+
final PlayerCapeHandler handler = PlayerCapeHandler.getProfile(this.profile);
5353
if(handler != null && handler.hasCape())
5454
{
5555
final SkinTextures oldTextures = cir.getReturnValue();

src/main/resources/fabric.mod.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@
4040
"minecraft": "~${minecraft_version}",
4141
"modmenu": "~${modmenu_version}"
4242
},
43+
"breaks": {
44+
"capes": "*"
45+
},
46+
"conflicts": {
47+
"minecraftcapes": "*",
48+
"wynntils": "*",
49+
"capemod": "*"
50+
},
4351
"custom": {
4452
"modmenu": {
4553
"links": {

0 commit comments

Comments
 (0)