Skip to content

Commit 34c86f2

Browse files
authored
Update mod to Minecraft 1.21.5 (#321)
1 parent 0a2c0be commit 34c86f2

File tree

18 files changed

+113
-44
lines changed

18 files changed

+113
-44
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'fabric-loom' version '1.8.+'
2+
id 'fabric-loom' version '1.10.+'
33
id 'maven-publish'
44
id "com.modrinth.minotaur" version "2.+"
55
}

gradle.properties

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@
22
org.gradle.jvmargs=-Xmx2G
33

44
# Fabric Properties
5-
minecraft_version=1.21.4
6-
yarn_mappings=1.21.4+build.1
7-
loader_version=0.16.9
5+
minecraft_version=1.21.5
6+
yarn_mappings=1.21.5+build.1
7+
loader_version=0.16.13
88

99
# Dependencies
10-
fabric_version=0.118.5+1.21.4
11-
polymer_version=0.11.8+1.21.4
12-
server_translations_version=2.4.0+1.21.2-rc1
10+
fabric_version=0.120.0+1.21.5
11+
polymer_version=0.12.3+1.21.5
12+
server_translations_version=2.5.0+1.21.5-rc1
1313
packet_tweaker_version=0.6.0-pre.1+1.21.2-pre3
1414
fantasy_version=0.6.5+1.21.2
1515
more_codecs_version=0.3.5+1.21.2
16-
stimuli_version=0.5.0+1.21.3
17-
map_templates_version=0.2.2+1.21.4
16+
stimuli_version=0.5.0+1.21.5
17+
map_templates_version=0.2.2+1.21.5
1818
substrate_version=0.2.2+1.20.1
19-
sgui_version=1.8.2+1.21.4
19+
sgui_version=1.9.0+1.21.5
2020
sidebar_api_version=0.5.1+1.21.1
21-
placeholder_api_version=2.5.2+1.21.3
21+
placeholder_api_version=2.6.2+1.21.5
2222
map_canvas_api_version=0.5.0+1.21.3
23-
player_data_api_version=0.7.0+1.21.3
23+
player_data_api_version=0.7.0+1.21.5
2424
predicate_api_version=0.6.0+1.21.2
2525
permission_api_version=0.3.3
2626

gradle/wrapper/gradle-wrapper.jar

122 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.10.2-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

gradlew

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/java/xyz/nucleoid/plasmid/api/game/GameTexts.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ public static Style commandLinkStyle(String command) {
2626

2727
public static Style commandLinkStyle(String command, Text hoverText) {
2828
return Style.EMPTY
29-
.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, command))
30-
.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, hoverText))
29+
.withClickEvent(new ClickEvent.RunCommand(command))
30+
.withHoverEvent(new HoverEvent.ShowText(hoverText))
3131
.withFormatting(Formatting.BLUE, Formatting.UNDERLINE);
3232
}
3333

src/main/java/xyz/nucleoid/plasmid/api/game/common/OldCombat.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import net.minecraft.entity.attribute.EntityAttributes;
88
import net.minecraft.item.*;
99
import net.minecraft.registry.entry.RegistryEntry;
10+
import net.minecraft.registry.tag.ItemTags;
1011
import net.minecraft.util.Identifier;
1112

1213
/**
@@ -55,7 +56,7 @@ public static ItemStack applyTo(ItemStack stack) {
5556
}
5657

5758
{
58-
float attackDamageBonus = stack.getItem() instanceof HoeItem ? 0 : getToolMaterial(stack).attackDamageBonus();
59+
float attackDamageBonus = stack.isIn(ItemTags.HOES) ? 0 : getToolMaterial(stack).attackDamageBonus();
5960
int baseDamage = getBaseDamage(stack);
6061

6162
EntityAttributeModifier modifier = createDamageModifier(attackDamageBonus + baseDamage);
@@ -91,16 +92,15 @@ private static ToolMaterial getToolMaterial(ItemStack item) {
9192
}
9293

9394
private static int getBaseDamage(ItemStack stack) {
94-
var item = stack.getItem();
95-
if (item instanceof SwordItem) {
95+
if (stack.isIn(ItemTags.SWORDS)) {
9696
return SWORD_BASE_DAMAGE;
97-
} else if (item instanceof AxeItem) {
97+
} else if (stack.isIn(ItemTags.AXES)) {
9898
return AXE_BASE_DAMAGE;
99-
} else if (item instanceof PickaxeItem) {
99+
} else if (stack.isIn(ItemTags.PICKAXES)) {
100100
return PICKAXE_BASE_DAMAGE;
101-
} else if (item instanceof ShovelItem) {
101+
} else if (stack.isIn(ItemTags.SHOVELS)) {
102102
return SHOVEL_BASE_DAMAGE;
103-
} else if (item instanceof HoeItem) {
103+
} else if (stack.isIn(ItemTags.HOES)) {
104104
return HOE_BASE_DAMAGE;
105105
}
106106
return 0;

src/main/java/xyz/nucleoid/plasmid/api/game/common/team/GameTeamConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ private static Text getNameWithColorFallback(Optional<Text> name, Colors colors)
117117
if (colors == Colors.NONE) {
118118
return Text.literal("Team");
119119
} else {
120-
return Text.translatable("color.minecraft." + colors.blockDyeColor().getName());
120+
return Text.translatable("color.minecraft." + colors.blockDyeColor().getId());
121121
}
122122
});
123123
}

src/main/java/xyz/nucleoid/plasmid/api/util/Guis.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import net.minecraft.block.entity.BannerPatterns;
1010
import net.minecraft.component.DataComponentTypes;
1111
import net.minecraft.component.type.BannerPatternsComponent;
12+
import net.minecraft.component.type.TooltipDisplayComponent;
1213
import net.minecraft.item.ItemStack;
1314
import net.minecraft.item.Items;
1415
import net.minecraft.registry.*;
@@ -18,7 +19,6 @@
1819
import net.minecraft.server.network.ServerPlayerEntity;
1920
import net.minecraft.text.MutableText;
2021
import net.minecraft.util.DyeColor;
21-
import net.minecraft.util.Unit;
2222
import net.minecraft.util.math.MathHelper;
2323
import org.jetbrains.annotations.Range;
2424

@@ -173,7 +173,7 @@ private static ScreenHandlerType<?> selectScreenType(int rowCount) {
173173
private static ItemStack createBanner(BannerPatternsComponent.Builder patterns) {
174174
ItemStack stack = Items.GRAY_BANNER.getDefaultStack();
175175
stack.set(DataComponentTypes.CUSTOM_NAME, ScreenTexts.EMPTY);
176-
stack.set(DataComponentTypes.HIDE_ADDITIONAL_TOOLTIP, Unit.INSTANCE);
176+
stack.apply(DataComponentTypes.TOOLTIP_DISPLAY, TooltipDisplayComponent.DEFAULT, tooltipDisplay -> tooltipDisplay.with(DataComponentTypes.BANNER_PATTERNS, true));
177177
stack.set(DataComponentTypes.BANNER_PATTERNS, patterns.build());
178178
return stack;
179179
}

src/main/java/xyz/nucleoid/plasmid/api/util/ItemStackBuilder.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import net.minecraft.registry.entry.RegistryEntry;
1717
import net.minecraft.server.MinecraftServer;
1818
import net.minecraft.text.Text;
19+
import net.minecraft.util.Unit;
1920
import net.minecraft.world.World;
2021
import org.jetbrains.annotations.Nullable;
2122

@@ -74,12 +75,16 @@ public <T> ItemStackBuilder set(ComponentType<T> type, @Nullable T value) {
7475
}
7576

7677
public ItemStackBuilder setUnbreakable() {
77-
this.stack.set(DataComponentTypes.UNBREAKABLE, new UnbreakableComponent(true));
78+
this.stack.set(DataComponentTypes.UNBREAKABLE, Unit.INSTANCE);
79+
this.stack.apply(DataComponentTypes.TOOLTIP_DISPLAY, TooltipDisplayComponent.DEFAULT, tooltipDisplay -> tooltipDisplay.with(DataComponentTypes.UNBREAKABLE, true));
80+
7881
return this;
7982
}
8083

8184
public ItemStackBuilder setDyeColor(int color) {
82-
this.stack.set(DataComponentTypes.DYED_COLOR, new DyedColorComponent(color, true));
85+
this.stack.set(DataComponentTypes.DYED_COLOR, new DyedColorComponent(color));
86+
this.stack.apply(DataComponentTypes.TOOLTIP_DISPLAY, TooltipDisplayComponent.DEFAULT, tooltipDisplay -> tooltipDisplay.with(DataComponentTypes.DYED_COLOR, true));
87+
8388
return this;
8489
}
8590

0 commit comments

Comments
 (0)