Skip to content

Commit

Permalink
feat: update to minecraft 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
SLH335 committed Aug 5, 2024
1 parent 5fe2a8e commit ec983f6
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 12 deletions.
16 changes: 8 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ org.gradle.jvmargs=-Xmx1G
org.gradle.parallel=true

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.20.5
yarn_mappings=1.20.5+build.1
loader_version=0.15.10
# check these on https://fabricmc.net/develop
minecraft_version=1.21
yarn_mappings=1.21+build.9
loader_version=0.15.11

# Mod Properties
mod_version = 0.3.1+mc1.20.5
maven_group = xyz.hafemann
archives_base_name = netheriteextras
mod_version = 0.3.2+mc1.21
maven_group = xyz.hafemann
archives_base_name = netheriteextras

# Dependencies
fabric_version=0.97.5+1.20.5
fabric_version=0.101.1+1.21
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class ModItems {
new Item(new Item.Settings().maxCount(1).maxDamage(4).rarity(Rarity.UNCOMMON).fireproof()));

private static Item registerItem(String name, Item item) {
return Registry.register(Registries.ITEM, new Identifier(NetheriteExtras.MOD_ID, name), item);
return Registry.register(Registries.ITEM, Identifier.of(NetheriteExtras.MOD_ID, name), item);
}

public static void registerModItems() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ public NetheriteHorseArmorItem(Settings settings) {
@Override
public Identifier getEntityTexture() {
String entityTexture = "textures/entity/horse/armor/horse_armor_netherite.png";
return new Identifier(NetheriteExtras.MOD_ID, entityTexture);
return Identifier.of(NetheriteExtras.MOD_ID, entityTexture);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ public NetheriteWolfArmorItem(Settings settings) {
@Override
public Identifier getEntityTexture() {
String entityTexture = "textures/entity/wolf/wolf_armor_netherite.png";
return new Identifier(NetheriteExtras.MOD_ID, entityTexture);
return Identifier.of(NetheriteExtras.MOD_ID, entityTexture);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ArmorMaterials;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.recipe.Ingredient;
import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.sound.SoundEvents;
Expand All @@ -30,6 +31,14 @@ protected NetheriteWolfArmorEquipMixin(EntityType<? extends TameableEntity> enti
super(entityType, world);
}

@Inject(
method = "hasArmor",
at = @At("TAIL"),
cancellable = true)
public void hasArmor(CallbackInfoReturnable<Boolean> cir) {
cir.setReturnValue(this.getBodyArmor().isOf(Items.WOLF_ARMOR) || this.getBodyArmor().isOf(ModItems.NETHERITE_WOLF_ARMOR));
}

@Inject(
method = "interactMob",
at = @At("HEAD"),
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"depends": {
"fabricloader": ">=0.15.10",
"fabric-api": "*",
"minecraft": "~1.20.5",
"minecraft": "~1.21",
"java": ">=21"
},
"suggests": {
Expand Down

0 comments on commit ec983f6

Please sign in to comment.