Implement a number of small fixes
This commit is contained in:
+1
-1
@@ -48,7 +48,7 @@ mod_name=Fretux's Skill Engine
|
||||
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
||||
mod_license=All Rights Reserved
|
||||
# The mod version. See https://semver.org/
|
||||
mod_version=1.2.4
|
||||
mod_version=1.2.5
|
||||
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
||||
# This should match the base package used for the mod sources.
|
||||
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
|
||||
@@ -20,11 +20,11 @@ public final class SkillEngineAPI {
|
||||
private SkillEngineAPI() {}
|
||||
|
||||
public static ResourceLocation id(String path) {
|
||||
return new ResourceLocation(SkillEngine.MODID, path);
|
||||
return ResourceLocation.fromNamespaceAndPath(SkillEngine.MODID, path);
|
||||
}
|
||||
|
||||
public static ResourceLocation rl(String namespace, String path) {
|
||||
return new ResourceLocation(namespace, path);
|
||||
return ResourceLocation.fromNamespaceAndPath(namespace, path);
|
||||
}
|
||||
|
||||
public static SkillNode getSkillNode(ResourceLocation id) {
|
||||
|
||||
@@ -451,7 +451,16 @@ public class SkilltreeScreen extends Screen {
|
||||
} else if (unlocked) {
|
||||
color = 0xFF44CC44;
|
||||
} else {
|
||||
color = 0xFF444444;
|
||||
int cost = node.getCost();
|
||||
if (cost <= 1) {
|
||||
color = 0xFF444444;
|
||||
} else if (cost == 2) {
|
||||
color = 0xFFFF6633;
|
||||
} else if (cost == 3) {
|
||||
color = 0xFF33CCCC;
|
||||
} else {
|
||||
color = 0xFFFFD700;
|
||||
}
|
||||
}
|
||||
return color;
|
||||
}
|
||||
|
||||
@@ -32,6 +32,17 @@ public class SkillEnginePlayerEvents {
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onClone(PlayerEvent.Clone event) {
|
||||
if (event.getEntity() instanceof ServerPlayer newPlayer && event.getOriginal() instanceof ServerPlayer oldPlayer) {
|
||||
oldPlayer.getCapability(SkillEngineCapabilities.PLAYER_SKILLS).ifPresent(oldData ->
|
||||
newPlayer.getCapability(SkillEngineCapabilities.PLAYER_SKILLS).ifPresent(newData -> {
|
||||
newData.load(oldData.save());
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onRespawn(PlayerEvent.PlayerRespawnEvent event) {
|
||||
if (event.getEntity() instanceof ServerPlayer player) {
|
||||
|
||||
Reference in New Issue
Block a user