Skip to content

Commit fe919e6

Browse files
committed
⬆️ Update mod to Minecraft 1.21.11
1 parent db45935 commit fe919e6

29 files changed

Lines changed: 143 additions & 141 deletions

Common/src/main/java/com/autovw/advancednetherite/api/TooltipBuilder.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import com.mojang.logging.LogUtils;
66
import net.minecraft.network.chat.Component;
77
import net.minecraft.network.chat.MutableComponent;
8-
import net.minecraft.resources.ResourceLocation;
8+
import net.minecraft.resources.Identifier;
99
import org.jetbrains.annotations.Nullable;
1010
import org.slf4j.Logger;
1111

@@ -27,28 +27,28 @@ private TooltipBuilder()
2727
/**
2828
* Used to create a translatable tooltip.
2929
* Not setting the mod id will result in the tooltip being registered under the default <i>minecraft</i> namespace.
30-
* If the tooltip name is empty, {@link #build(ResourceLocation, Object...)} will throw a {@link IllegalStateException}.
30+
* If the tooltip name is empty, {@link #build(Identifier, Object...)} will throw a {@link IllegalStateException}.
3131
*
32-
* Use {@link #create(ResourceLocation, Object...)} if the tooltip should contain other sub-elements.
32+
* Use {@link #create(Identifier, Object...)} if the tooltip should contain other sub-elements.
3333
*
3434
* @param key name of the tooltip
3535
* @return a MutableComponent
3636
*/
37-
public static MutableComponent create(ResourceLocation key)
37+
public static MutableComponent create(Identifier key)
3838
{
3939
return build(key, (Object) null);
4040
}
4141

4242
/**
4343
* Used to create a translatable tooltip.
4444
* Not setting the mod id will result in the tooltip being registered under the default <i>minecraft</i> namespace.
45-
* If the tooltip name is empty, {@link #build(ResourceLocation, Object...)} will throw a {@link IllegalStateException}.
45+
* If the tooltip name is empty, {@link #build(Identifier, Object...)} will throw a {@link IllegalStateException}.
4646
*
4747
* @param key name of the tooltip
4848
* @param args sub-elements
4949
* @return a MutableComponent
5050
*/
51-
public static MutableComponent create(ResourceLocation key, Object... args)
51+
public static MutableComponent create(Identifier key, Object... args)
5252
{
5353
return build(key, args);
5454
}
@@ -57,7 +57,7 @@ public static MutableComponent create(ResourceLocation key, Object... args)
5757
* Builder used for internal purposes only.
5858
*/
5959
@Internal
60-
private static MutableComponent build(ResourceLocation key, @Nullable Object... args)
60+
private static MutableComponent build(Identifier key, @Nullable Object... args)
6161
{
6262
String content = "tooltip." + key.getNamespace() + "." + key.getPath();
6363
if (!content.endsWith("."))

Common/src/main/java/com/autovw/advancednetherite/client/screen/ConfigScreen.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,16 @@ protected void init()
3737
{
3838
// Configured button
3939
addRenderableWidget(Button.builder(Component.translatable("config.advancednetherite.screen.button.install_configured", this.configured), onPress -> {
40-
this.handleComponentClicked(Style.EMPTY.withClickEvent(new ClickEvent.OpenUrl(URI.create("https://www.curseforge.com/minecraft/mc-mods/configured"))));
40+
// 1.21.11: Moved to ChatScreen, now private
41+
//this.handleComponentClicked(Style.EMPTY.withClickEvent(new ClickEvent.OpenUrl(URI.create("https://www.curseforge.com/minecraft/mc-mods/configured"))));
4142
}).pos(width / 2 - 155, height / 2 + 12).size(150, 20).build());
4243

4344
// Instructions button
4445
Button instructionsButton = Button.builder(Component.translatable("config.advancednetherite.screen.button.instructions"), onPress -> {
4546
if (getInstructionsUrl() != null)
4647
{
47-
this.handleComponentClicked(Style.EMPTY.withClickEvent(new ClickEvent.OpenUrl(getInstructionsUrl())));
48+
// 1.21.11: Moved to ChatScreen, now private
49+
//this.handleComponentClicked(Style.EMPTY.withClickEvent(new ClickEvent.OpenUrl(getInstructionsUrl())));
4850
}
4951
}).pos(width / 2 + 5, height / 2 + 12).size(150, 20).build();
5052

Common/src/main/java/com/autovw/advancednetherite/core/ModBlocks.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import com.autovw.advancednetherite.AdvancedNetherite;
44
import net.minecraft.core.registries.Registries;
55
import net.minecraft.resources.ResourceKey;
6-
import net.minecraft.resources.ResourceLocation;
6+
import net.minecraft.resources.Identifier;
77
import net.minecraft.world.level.block.Block;
88
import net.minecraft.world.level.block.Blocks;
99
import net.minecraft.world.level.block.state.BlockBehaviour;
@@ -20,6 +20,6 @@ public final class ModBlocks
2020

2121
private static ResourceKey<Block> key(String name)
2222
{
23-
return ResourceKey.create(Registries.BLOCK, ResourceLocation.fromNamespaceAndPath(AdvancedNetherite.MOD_ID, name));
23+
return ResourceKey.create(Registries.BLOCK, Identifier.fromNamespaceAndPath(AdvancedNetherite.MOD_ID, name));
2424
}
2525
}

Common/src/main/java/com/autovw/advancednetherite/core/ModItems.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import com.autovw.advancednetherite.core.util.ModToolMaterials;
77
import net.minecraft.core.registries.Registries;
88
import net.minecraft.resources.ResourceKey;
9-
import net.minecraft.resources.ResourceLocation;
9+
import net.minecraft.resources.Identifier;
1010
import net.minecraft.world.item.Item;
1111
import net.minecraft.world.item.equipment.ArmorType;
1212

@@ -85,6 +85,6 @@ public final class ModItems
8585

8686
private static ResourceKey<Item> key(String name)
8787
{
88-
return ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(AdvancedNetherite.MOD_ID, name));
88+
return ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(AdvancedNetherite.MOD_ID, name));
8989
}
9090
}

Common/src/main/java/com/autovw/advancednetherite/core/util/ModArmorMaterials.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.autovw.advancednetherite.core.util;
22

3-
import net.minecraft.Util;
3+
import net.minecraft.util.Util;
44
import net.minecraft.core.Holder;
55
import net.minecraft.resources.ResourceKey;
66
import net.minecraft.sounds.SoundEvent;

Common/src/main/java/com/autovw/advancednetherite/core/util/ModEquipmentAssets.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import net.minecraft.client.resources.model.EquipmentClientInfo;
44
import net.minecraft.core.Registry;
55
import net.minecraft.resources.ResourceKey;
6-
import net.minecraft.resources.ResourceLocation;
6+
import net.minecraft.resources.Identifier;
77
import net.minecraft.world.item.equipment.EquipmentAsset;
88

99
import java.util.function.BiConsumer;
@@ -15,7 +15,7 @@
1515
*/
1616
public final class ModEquipmentAssets
1717
{
18-
private static final ResourceKey<? extends Registry<EquipmentAsset>> ROOT_ID = ResourceKey.createRegistryKey(ResourceLocation.withDefaultNamespace("equipment_asset"));
18+
private static final ResourceKey<? extends Registry<EquipmentAsset>> ROOT_ID = ResourceKey.createRegistryKey(Identifier.withDefaultNamespace("equipment_asset"));
1919

2020
public static final ResourceKey<EquipmentAsset> NETHERITE_IRON = id("netherite_iron");
2121
public static final ResourceKey<EquipmentAsset> NETHERITE_GOLD = id("netherite_gold");
@@ -24,7 +24,7 @@ public final class ModEquipmentAssets
2424

2525
private static ResourceKey<EquipmentAsset> id(String name)
2626
{
27-
return ResourceKey.create(ROOT_ID, ResourceLocation.fromNamespaceAndPath(MOD_ID, name));
27+
return ResourceKey.create(ROOT_ID, Identifier.fromNamespaceAndPath(MOD_ID, name));
2828
}
2929

3030
public static void bootstrap(BiConsumer<ResourceKey<EquipmentAsset>, EquipmentClientInfo> consumer)
@@ -37,6 +37,6 @@ public static void bootstrap(BiConsumer<ResourceKey<EquipmentAsset>, EquipmentCl
3737

3838
private static EquipmentClientInfo onlyHumanoid(String name)
3939
{
40-
return EquipmentClientInfo.builder().addHumanoidLayers(ResourceLocation.fromNamespaceAndPath(MOD_ID, name)).build();
40+
return EquipmentClientInfo.builder().addHumanoidLayers(Identifier.fromNamespaceAndPath(MOD_ID, name)).build();
4141
}
4242
}

Common/src/main/java/com/autovw/advancednetherite/core/util/ModTags.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import com.autovw.advancednetherite.AdvancedNetherite;
44
import net.minecraft.core.registries.Registries;
5-
import net.minecraft.resources.ResourceLocation;
5+
import net.minecraft.resources.Identifier;
66
import net.minecraft.tags.TagKey;
77
import net.minecraft.world.item.Item;
88
import net.minecraft.world.item.enchantment.Enchantment;
@@ -181,7 +181,7 @@ public final class ModTags
181181
* @param tagLoc Resource location of the tag
182182
* @return Block tag
183183
*/
184-
public static TagKey<Block> blockTag(ResourceLocation tagLoc)
184+
public static TagKey<Block> blockTag(Identifier tagLoc)
185185
{
186186
return TagKey.create(Registries.BLOCK, tagLoc);
187187
}
@@ -190,7 +190,7 @@ public static TagKey<Block> blockTag(ResourceLocation tagLoc)
190190
* @param tagLoc Resource location of the tag
191191
* @return Item tag
192192
*/
193-
public static TagKey<Item> itemTag(ResourceLocation tagLoc)
193+
public static TagKey<Item> itemTag(Identifier tagLoc)
194194
{
195195
return TagKey.create(Registries.ITEM, tagLoc);
196196
}
@@ -199,23 +199,23 @@ public static TagKey<Item> itemTag(ResourceLocation tagLoc)
199199
* @param tagLoc Resource location of the tag
200200
* @return Enchantment tag
201201
*/
202-
public static TagKey<Enchantment> enchantmentTag(ResourceLocation tagLoc)
202+
public static TagKey<Enchantment> enchantmentTag(Identifier tagLoc)
203203
{
204204
return TagKey.create(Registries.ENCHANTMENT, tagLoc);
205205
}
206206

207207
private static TagKey<Block> modBlockTag(String tagName)
208208
{
209-
return ModTags.blockTag(ResourceLocation.fromNamespaceAndPath(AdvancedNetherite.MOD_ID, tagName));
209+
return ModTags.blockTag(Identifier.fromNamespaceAndPath(AdvancedNetherite.MOD_ID, tagName));
210210
}
211211

212212
private static TagKey<Item> modItemTag(String tagName)
213213
{
214-
return ModTags.itemTag(ResourceLocation.fromNamespaceAndPath(AdvancedNetherite.MOD_ID, tagName));
214+
return ModTags.itemTag(Identifier.fromNamespaceAndPath(AdvancedNetherite.MOD_ID, tagName));
215215
}
216216

217217
private static TagKey<Enchantment> modEnchantmentTag(String tagName)
218218
{
219-
return ModTags.enchantmentTag(ResourceLocation.fromNamespaceAndPath(AdvancedNetherite.MOD_ID, tagName));
219+
return ModTags.enchantmentTag(Identifier.fromNamespaceAndPath(AdvancedNetherite.MOD_ID, tagName));
220220
}
221221
}

Common/src/main/java/com/autovw/advancednetherite/core/util/ModTooltips.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import com.autovw.advancednetherite.api.TooltipBuilder;
55
import net.minecraft.ChatFormatting;
66
import net.minecraft.network.chat.MutableComponent;
7-
import net.minecraft.resources.ResourceLocation;
7+
import net.minecraft.resources.Identifier;
88

99
/**
1010
* A class that contains tooltips registered by Advanced Netherite.
@@ -38,8 +38,8 @@ public final class ModTooltips
3838
public static final MutableComponent ZOMBIFIED_PIGLIN_MOB_DROP_TOOLTIP = TooltipBuilder.create(id("sword.additional_zombified_piglin_mob_drop"), PLUS_TOOLTIP).withStyle(ChatFormatting.GOLD);
3939
public static final MutableComponent PHANTOM_MOB_DROP_TOOLTIP = TooltipBuilder.create(id("sword.additional_phantom_mob_drop"), PLUS_TOOLTIP).withStyle(ChatFormatting.GRAY);
4040

41-
private static ResourceLocation id(String key)
41+
private static Identifier id(String key)
4242
{
43-
return ResourceLocation.fromNamespaceAndPath(AdvancedNetherite.MOD_ID, key);
43+
return Identifier.fromNamespaceAndPath(AdvancedNetherite.MOD_ID, key);
4444
}
4545
}

Common/src/main/java/com/autovw/advancednetherite/helper/IRegistryHelper.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.autovw.advancednetherite.helper;
22

3-
import net.minecraft.resources.ResourceLocation;
3+
import net.minecraft.resources.Identifier;
44
import net.minecraft.sounds.SoundEvent;
55
import net.minecraft.world.effect.MobEffect;
66
import net.minecraft.world.entity.EntityType;
@@ -17,33 +17,33 @@ public interface IRegistryHelper
1717
* @return Id of the provided block
1818
* @since 2.0.0
1919
*/
20-
ResourceLocation getBlockById(Block block);
20+
Identifier getBlockById(Block block);
2121

2222
/**
2323
* @param item item to get id from
2424
* @return Id of the provided item
2525
* @since 2.0.0
2626
*/
27-
ResourceLocation getItemById(Item item);
27+
Identifier getItemById(Item item);
2828

2929
/**
3030
* @param mobEffect Mob effect to get id from
3131
* @return Id of the provided mob effect
3232
* @since 2.0.0
3333
*/
34-
ResourceLocation getMobEffectById(MobEffect mobEffect);
34+
Identifier getMobEffectById(MobEffect mobEffect);
3535

3636
/**
3737
* @param soundEvent Sound event to get id from
3838
* @return Id of the provided sound event
3939
* @since 2.0.0
4040
*/
41-
ResourceLocation getSoundEventById(SoundEvent soundEvent);
41+
Identifier getSoundEventById(SoundEvent soundEvent);
4242

4343
/**
4444
* @param entityType Entity type to get id from
4545
* @return Id of the provided entity type
4646
* @since 2.0.0
4747
*/
48-
ResourceLocation getEntityTypeById(EntityType<?> entityType);
48+
Identifier getEntityTypeById(EntityType<?> entityType);
4949
}

Fabric/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
22
id 'java'
33
id 'idea'
4-
id 'fabric-loom' version '1.11-SNAPSHOT'
4+
id 'fabric-loom' version '1.13-SNAPSHOT'
55
}
66

77
group = "com.autovw.advancednetherite"

0 commit comments

Comments
 (0)