Skip to content

Commit

Permalink
port to 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
tristankechlo committed Aug 26, 2024
1 parent 47a4d13 commit f55a940
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 22 deletions.
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

### Version 1.21 - 1.1.2

- port to 1.21

### Version 1.20.6 - 1.1.2

- port to 1.20.6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static <T> T load(Class<T> clazz) {
return loadedService;
}

public static final ResourceLocation ENTITY_KILLED = new ResourceLocation(WhatDidIJustKill.MOD_ID, "entity_killed");
public static final ResourceLocation PLAYER_KILLED = new ResourceLocation(WhatDidIJustKill.MOD_ID, "player_killed");
public static final ResourceLocation ENTITY_KILLED = ResourceLocation.fromNamespaceAndPath(WhatDidIJustKill.MOD_ID, "entity_killed");
public static final ResourceLocation PLAYER_KILLED = ResourceLocation.fromNamespaceAndPath(WhatDidIJustKill.MOD_ID, "player_killed");

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

public class EntityKilledToast extends AbstractEntityToast {

private static final ResourceLocation UNKNOWN_ENTITY = new ResourceLocation(WhatDidIJustKill.MOD_ID, "textures/entity_unknown.png");
private static final ResourceLocation UNKNOWN_ENTITY = ResourceLocation.fromNamespaceAndPath(WhatDidIJustKill.MOD_ID, "textures/entity_unknown.png");
private final ResourceLocation entityTexture;

private EntityKilledToast(Component firstLine, Component secondLine, ResourceLocation entityType) {
Expand Down Expand Up @@ -65,7 +65,7 @@ private static ResourceLocation makeExpectedLocation(ResourceLocation entityType
EntityType<?> type = BuiltInRegistries.ENTITY_TYPE.get(entityType);
String category = type.getCategory().getName().toLowerCase();
String path = String.format("textures/entity_icon/%s/%s.png", category, entityType.getPath());
return new ResourceLocation(entityType.getNamespace(), path);
return ResourceLocation.fromNamespaceAndPath(entityType.getNamespace(), path);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

public class PlayerKilledToast extends AbstractEntityToast {

private static final ResourceLocation UNKNOWN_PLAYER = new ResourceLocation(WhatDidIJustKill.MOD_ID, "textures/player.png");
private static final ResourceLocation UNKNOWN_PLAYER = ResourceLocation.fromNamespaceAndPath(WhatDidIJustKill.MOD_ID, "textures/player.png");
private final ResourceLocation playerTexture;

private PlayerKilledToast(Component firstLine, Component secondLine, ResourceLocation texture) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
public record EntityOptions(ShowToastOption showToast, int timeout, FormatOption firstLine, FormatOption secondLine,
ToastTheme theme, List<Either<ResourceLocation, ModWildcard>> excludes) {

public static final EntityOptions DEFAULT = new EntityOptions(ShowToastOption.NOT_EXCLUDED, 2000, FormatOption.KILLED_DISTANCE, FormatOption.ENTITY_TYPE, ToastTheme.ADVANCEMENT, List.of(Either.left(new ResourceLocation("bat"))));
public static final EntityOptions DEFAULT = new EntityOptions(ShowToastOption.NOT_EXCLUDED, 2000, FormatOption.KILLED_DISTANCE, FormatOption.ENTITY_TYPE, ToastTheme.ADVANCEMENT, List.of(Either.left(ResourceLocation.withDefaultNamespace("bat"))));

public static final Codec<EntityOptions> CODEC = RecordCodecBuilder.<EntityOptions>create(
instance -> instance.group(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

public enum ToastTheme implements StringRepresentable {

ADVANCEMENT("ADVANCEMENT", new ResourceLocation("toast/advancement"), ChatFormatting.GRAY, ChatFormatting.DARK_GRAY, ChatFormatting.WHITE),
RECIPE("RECIPE", new ResourceLocation("toast/recipe"), ChatFormatting.BLACK, ChatFormatting.DARK_GRAY, ChatFormatting.DARK_GRAY),
TUTORIAL("TUTORIAL", new ResourceLocation("toast/tutorial"), ChatFormatting.BLACK, ChatFormatting.DARK_GRAY, ChatFormatting.DARK_GRAY);
ADVANCEMENT("ADVANCEMENT", ResourceLocation.withDefaultNamespace("toast/advancement"), ChatFormatting.GRAY, ChatFormatting.DARK_GRAY, ChatFormatting.WHITE),
RECIPE("RECIPE", ResourceLocation.withDefaultNamespace("toast/recipe"), ChatFormatting.BLACK, ChatFormatting.DARK_GRAY, ChatFormatting.DARK_GRAY),
TUTORIAL("TUTORIAL", ResourceLocation.withDefaultNamespace("toast/tutorial"), ChatFormatting.BLACK, ChatFormatting.DARK_GRAY, ChatFormatting.DARK_GRAY);

public static final Codec<ToastTheme> CODEC = StringRepresentable.fromEnum(ToastTheme::values);
private final String key;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

public class ForgePacketHandler implements IPacketHandler {

private static final SimpleChannel INSTANCE = ChannelBuilder.named(new ResourceLocation(WhatDidIJustKill.MOD_ID, "main"))
private static final SimpleChannel INSTANCE = ChannelBuilder.named(ResourceLocation.fromNamespaceAndPath(WhatDidIJustKill.MOD_ID, "main"))
.networkProtocolVersion(1)
.clientAcceptedVersions((s, i) -> true)
.serverAcceptedVersions((s, i) -> true)
Expand Down
24 changes: 12 additions & 12 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@ group=com.tristankechlo.whatdidijustkill

# Common
java_version=21
minecraft_version=1.20.6
version_range=[1.20.6,1.20.7)
minecraft_version=1.21
version_range=[1.21,1.21.1)

# Forge
forge_version=50.0.22
forge_loader_range=[50,)
forge_version=51.0.33
forge_loader_range=[51,)

# Fabric
fabric_version=0.98.0+1.20.6
fabric_version=0.102.0+1.21
fabric_loader_min=0.15
fabric_loader_version=0.15.11
fabric_range_min_inclusive=1.20.6
fabric_range_max_exclusive=1.20.7
fabric_loader_version=0.16.3
fabric_range_min_inclusive=1.21
fabric_range_max_exclusive=1.21.1

# Neoforge
neoforge_version=20.6.72-beta
neoforge_loader_range=[2,)
neoforge_range=[20.6,)
neoforge_version=21.0.167
neoforge_loader_range=[4,)
neoforge_range=[21,)

# Mod options
mod_name=WhatDidIJustKill
Expand All @@ -30,7 +30,7 @@ mod_id=whatdidijustkill
mod_version=1.1.2

# Other Mods
modmenu_version=10.0.0-beta.1
modmenu_version=11.0.1

# Gradle
org.gradle.jvmargs=-Xmx4G
Expand Down

0 comments on commit f55a940

Please sign in to comment.