Skip to content

Commit

Permalink
Updated classes to 1.21 (music discs temporarily removed)
Browse files Browse the repository at this point in the history
Mixins working
  • Loading branch information
Leronus committed Aug 9, 2024
1 parent 24288f4 commit 3462851
Show file tree
Hide file tree
Showing 21 changed files with 114 additions and 109 deletions.
12 changes: 2 additions & 10 deletions MORES-CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,2 @@
v1.6.0
Updated to Minecraft 1.20.6
- Updated full armor effects to show infinite instead of a countdown timer that keeps refreshing
- Updated item groups to match vanilla Minecraft item groups
- All armor trims are working correctly (bronze was missing before)
- All food items working (velvet, chocolate, carrot pie & 3 metal apples)
- Ruby tools autosmelter working
- Swords working (speeds / dmg still need testing)
- Harvest level (temporarily?) removed from tooltips on tools
- Horse armor and shields currently not present in 1.20 versions
v2.0.0
Updated to Minecraft 1.21
18 changes: 15 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ repositories {
}
}

loom {
splitEnvironmentSourceSets()

mods {
"mores" {
sourceSet sourceSets.main
sourceSet sourceSets.client
}
}

}

fabricApi {
configureDataGeneration()
}
Expand All @@ -58,12 +70,12 @@ dependencies {

//Iris
modImplementation "maven.modrinth:YL57xq9U:${project.iris_version}"
//Indium
modImplementation "maven.modrinth:Orvt0mRa:${project.indium_version}"
// //Indium
// modImplementation "maven.modrinth:Orvt0mRa:${project.indium_version}"
//EntityCulling
modImplementation "maven.modrinth:NNAgCjsB:${project.entity_culling_version}"
//Continuity
modImplementation "maven.modrinth:1IjD5062:${project.continuity_version}"
// modImplementation "maven.modrinth:1IjD5062:${project.continuity_version}"
// //Bobby
// modImplementation "maven.modrinth:M08ruV16:2cuVyTav"
//Nvidium
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ yarn_mappings=1.21+build.9
loader_version=0.15.11

# Mod Properties
mod_version=1.6.0
mod_version=2.0.0
maven_group=mod.leronus.mores
archives_base_name=mores

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/mod/leronus/mores/block/ModBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ private static void addItemsToBuildingBlockItemGroup(FabricItemGroupEntries entr

private static Block registerBlock(String name, Block block) {
registerBlockItem(name, block);
return Registry.register(Registries.BLOCK, new Identifier(Mores.MOD_ID, name), block);
return Registry.register(Registries.BLOCK, Identifier.of(Mores.MOD_ID, name), block);
}

private static Item registerBlockItem(String name, Block block) {
return Registry.register(Registries.ITEM, new Identifier(Mores.MOD_ID, name),
return Registry.register(Registries.ITEM, Identifier.of(Mores.MOD_ID, name),
new BlockItem(block, new Item.Settings()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ protected void configure(RegistryWrapper.WrapperLookup arg) {
ModItems.GRAPHENE_HELMET, ModItems.GRAPHENE_CHESTPLATE, ModItems.GRAPHENE_LEGGINGS, ModItems.GRAPHENE_BOOTS
);

getOrCreateTagBuilder(ItemTags.MUSIC_DISCS)
.add(ModItems.SWEET_CAROLINE_MUSIC_DISC, ModItems.CIPHER_DISC);
// getOrCreateTagBuilder(ItemTags.MUSIC_DISCS)
// .add(ModItems.SWEET_CAROLINE_MUSIC_DISC, ModItems.CIPHER_DISC);

getOrCreateTagBuilder(ItemTags.IRON_ORES)
.add(ModBlocks.SILVER_ORE.asItem());
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/mod/leronus/mores/datagen/ModModelProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,8 @@ public void generateItemModels(ItemModelGenerator itemModelGenerator) {
// itemModelGenerator.register(ModItems.DUCK, Models.GENERATED);
// itemModelGenerator.register(ModItems.COOKED_DUCK, Models.GENERATED);
// itemModelGenerator.register(ModItems.DUCK_EGG, Models.GENERATED);
itemModelGenerator.register(ModItems.SWEET_CAROLINE_MUSIC_DISC, Models.GENERATED);
itemModelGenerator.register(ModItems.CIPHER_DISC, Models.GENERATED);
// itemModelGenerator.register(ModItems.SWEET_CAROLINE_MUSIC_DISC, Models.GENERATED);
// itemModelGenerator.register(ModItems.CIPHER_DISC, Models.GENERATED);

// itemModelGenerator.register(ModItems.DUCK_SPAWN_EGG,
// new Model(Optional.of(new Identifier("item/template_spawn_egg")), Optional.empty()));
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/mod/leronus/mores/item/ModArmorMaterials.java
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ public ModArmorMaterials()
//region HELPER METHODS
private static RegistryEntry<ArmorMaterial> register(String id, EnumMap<ArmorItem.Type, Integer> defense, int enchantability, RegistryEntry<SoundEvent> equipSound, float toughness, float knockbackResistance, Supplier<Ingredient> repairIngredient)
{
List<ArmorMaterial.Layer> list = List.of(new ArmorMaterial.Layer(new Identifier(Mores.MOD_ID, id)));
List<ArmorMaterial.Layer> list = List.of(new ArmorMaterial.Layer(Identifier.of(Mores.MOD_ID, id)));
return register(id, defense, enchantability, equipSound, toughness, knockbackResistance, repairIngredient, list);
}

Expand All @@ -320,7 +320,7 @@ private static RegistryEntry<ArmorMaterial> register(String id, EnumMap<ArmorIte
{
enumMap.put(type, defense.get(type));
}
return Registry.registerReference(Registries.ARMOR_MATERIAL, new Identifier(Mores.MOD_ID, id),
return Registry.registerReference(Registries.ARMOR_MATERIAL, Identifier.of(Mores.MOD_ID, id),
new ArmorMaterial(enumMap, enchantability, equipSound, repairIngredient,
layers, toughness, knockbackResistance));
}
Expand Down
24 changes: 12 additions & 12 deletions src/main/java/mod/leronus/mores/item/ModItemGroups.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

public class ModItemGroups {
public static final ItemGroup MATERIAL_GROUP = Registry.register(Registries.ITEM_GROUP,
new Identifier(Mores.MOD_ID, "materials"),
Identifier.of(Mores.MOD_ID, "materials"),
FabricItemGroup.builder().displayName(Text.translatable("creativemodetab.mores_materials"))
.icon(() -> new ItemStack(ModItems.RUBY_GEM)).entries((displayContext, entries) -> {
entries.add(ModItems.ANTHRACITE);
Expand Down Expand Up @@ -48,7 +48,7 @@ public class ModItemGroups {
entries.add(ModItems.GRAPHENE_GEM);
}).build());
public static final ItemGroup BLOCK_GROUP = Registry.register(Registries.ITEM_GROUP,
new Identifier(Mores.MOD_ID, "blocks"),
Identifier.of(Mores.MOD_ID, "blocks"),
FabricItemGroup.builder().displayName(Text.translatable("creativemodetab.mores_blocks"))
.icon(() -> new ItemStack(ModBlocks.TURQUOISE_BLOCK)).entries((displayContext, entries) -> {
// entries.add(ModBlocks.ALLOY_FURNACE);
Expand All @@ -73,7 +73,7 @@ public class ModItemGroups {
}).build());

public static final ItemGroup ORE_GROUP = Registry.register(Registries.ITEM_GROUP,
new Identifier(Mores.MOD_ID, "ores"),
Identifier.of(Mores.MOD_ID, "ores"),
FabricItemGroup.builder().displayName(Text.translatable("creativemodetab.mores_ores"))
.icon(() -> new ItemStack(ModBlocks.DEEPSLATE_TURQUOISE_ORE)).entries((displayContext, entries) -> {
entries.add(ModBlocks.ANTHRACITE_ORE);
Expand Down Expand Up @@ -105,7 +105,7 @@ public class ModItemGroups {
}).build());

public static final ItemGroup TOOLS_GROUP = Registry.register(Registries.ITEM_GROUP,
new Identifier(Mores.MOD_ID, "tools"),
Identifier.of(Mores.MOD_ID, "tools"),
FabricItemGroup.builder().displayName(Text.translatable("creativemodetab.mores_tools"))
.icon(() -> new ItemStack(ModItems.COBALT_PICKAXE)).entries((displayContext, entries) -> {
entries.add(ModItems.TIN_PICKAXE);
Expand Down Expand Up @@ -184,12 +184,12 @@ public class ModItemGroups {
entries.add(ModItems.GRAPHENE_AXE);
entries.add(ModItems.GRAPHENE_SHOVEL);
entries.add(ModItems.GRAPHENE_HOE);
entries.add(ModItems.SWEET_CAROLINE_MUSIC_DISC);
entries.add(ModItems.CIPHER_DISC);
// entries.add(ModItems.SWEET_CAROLINE_MUSIC_DISC);
// entries.add(ModItems.CIPHER_DISC);
}).build());

public static final ItemGroup WEAPONS_GROUP = Registry.register(Registries.ITEM_GROUP,
new Identifier(Mores.MOD_ID, "weapons"),
Identifier.of(Mores.MOD_ID, "weapons"),
FabricItemGroup.builder().displayName(Text.translatable("creativemodetab.mores_weapons"))
.icon(() -> new ItemStack(ModItems.NETHERITE_BATTLEAXE)).entries((displayContext, entries) -> {
entries.add(ModItems.WOOD_BATTLEAXE);
Expand Down Expand Up @@ -289,7 +289,7 @@ public class ModItemGroups {
}).build());

public static final ItemGroup ARMOR_GROUP = Registry.register(Registries.ITEM_GROUP,
new Identifier(Mores.MOD_ID, "armor"),
Identifier.of(Mores.MOD_ID, "armor"),
FabricItemGroup.builder().displayName(Text.translatable("creativemodetab.mores_armor"))
.icon(() -> new ItemStack(ModItems.GRAPHENE_CHESTPLATE)).entries((displayContext, entries) -> {
entries.add(ModItems.TIN_HELMET);
Expand Down Expand Up @@ -371,7 +371,7 @@ public class ModItemGroups {
}).build());

// public static final ItemGroup SHIELDS_GROUP = Registry.register(Registries.ITEM_GROUP,
// new Identifier(Mores.MOD_ID, "shields"),
// Identifier.of(Mores.MOD_ID, "shields"),
// FabricItemGroup.builder().displayName(Text.translatable("creativemodetab.mores_shields"))
// .icon(() -> new ItemStack(ModItems.BRONZE_SHIELD)).entries((displayContext, entries) -> {
// entries.add(ModItems.TIN_SHIELD);
Expand All @@ -396,7 +396,7 @@ public class ModItemGroups {
// }).build());

// public static final ItemGroup HORSE_ARMOR_GROUP = Registry.register(Registries.ITEM_GROUP,
// new Identifier(Mores.MOD_ID, "horse_armor"),
// Identifier.of(Mores.MOD_ID, "horse_armor"),
// FabricItemGroup.builder().displayName(Text.translatable("creativemodetab.mores_horse_armor"))
// .icon(() -> new ItemStack(ModItems.TOURMALINE_HORSE_ARMOR)).entries((displayContext, entries) -> {
// entries.add(ModItems.TIN_HORSE_ARMOR);
Expand All @@ -422,7 +422,7 @@ public class ModItemGroups {
// }).build());
//
public static final ItemGroup FOOD_GROUP = Registry.register(Registries.ITEM_GROUP,
new Identifier(Mores.MOD_ID, "food"),
Identifier.of(Mores.MOD_ID, "food"),
FabricItemGroup.builder().displayName(Text.translatable("creativemodetab.mores_foods"))
.icon(() -> new ItemStack(ModItems.COBALT_APPLE)).entries((displayContext, entries) -> {
entries.add(ModItems.BRONZE_APPLE);
Expand All @@ -436,7 +436,7 @@ public class ModItemGroups {
}).build());

// public static final ItemGroup ENTITIES_GROUP = Registry.register(Registries.ITEM_GROUP,
// new Identifier(Mores.MOD_ID, "Entities"),
// Identifier.of(Mores.MOD_ID, "Entities"),
// FabricItemGroup.builder().displayName(Text.translatable("creativemodetab.mores_entities"))
// .icon(() -> new ItemStack(ModItems.DUCK_SPAWN_EGG)).entries((displayContext, entries) -> {
// entries.add(ModItems.DUCK_SPAWN_EGG);
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/mod/leronus/mores/item/ModItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ public class ModItems {
/**
* Fills the registry with items
*/
public static final Item SWEET_CAROLINE_MUSIC_DISC = registerItem("sweet_caroline_music_disc", new MusicDiscItem(4, ModSounds.SWEET_CAROLINE_BOOTLEG, new Item.Settings().rarity(Rarity.RARE), 4040));
public static final Item CIPHER_DISC = registerItem("cipher_music_disc", new MusicDiscItem(5, ModSounds.CIPHER, new Item.Settings().rarity(Rarity.RARE), 3820));
// public static final Item SWEET_CAROLINE_MUSIC_DISC = registerItem("sweet_caroline_music_disc", new MusicDiscItem(4, ModSounds.SWEET_CAROLINE_BOOTLEG, new Item.Settings().rarity(Rarity.RARE), 4040));
// public static final Item CIPHER_DISC = registerItem("cipher_music_disc", new MusicDiscItem(5, ModSounds.CIPHER, new Item.Settings().rarity(Rarity.RARE), 3820));

public static final Item OBSIDIAN_UPGRADE_SMITHING_TEMPLATE = registerItem("obsidian_upgrade_smithing_template", ModSmithingTemplateItem.createObsidianUpgradeTemplate());
public static final Item BRONZE_ALLOY_SMITHING_TEMPLATE = registerItem("bronze_alloy_smithing_template", ModSmithingTemplateItem.createBronzeAlloyTemplate());
Expand Down Expand Up @@ -837,13 +837,13 @@ private static void addItemsToToolsItemGroup(FabricItemGroupEntries entries) {
entries.add(GRAPHENE_SHOVEL);
entries.add(GRAPHENE_HOE);

entries.add(SWEET_CAROLINE_MUSIC_DISC);
entries.add(CIPHER_DISC);
// entries.add(SWEET_CAROLINE_MUSIC_DISC);
// entries.add(CIPHER_DISC);
}


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

public static void registerModItems() {
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/mod/leronus/mores/item/custom/ModAxeItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import mod.leronus.mores.item.ModItems;
import mod.leronus.mores.item.ModToolMaterials;
import net.minecraft.client.item.TooltipType;
import net.minecraft.item.tooltip.TooltipType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.effect.StatusEffects;
Expand Down Expand Up @@ -35,6 +35,7 @@ public boolean postHit(ItemStack stack, LivingEntity target, LivingEntity attack
return super.postHit(stack, target, attacker);
}


@Override
public void appendTooltip(ItemStack stack, TooltipContext context, List<Text> tooltip, TooltipType type) {
if (stack.getItem() instanceof MiningToolItem item) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package mod.leronus.mores.item.custom;

import mod.leronus.mores.item.ModItems;
import net.minecraft.client.item.TooltipType;
import net.minecraft.item.tooltip.TooltipType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.effect.StatusEffects;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import mod.leronus.mores.item.ModItems;
import mod.leronus.mores.item.ModToolMaterials;
import net.minecraft.client.item.TooltipType;
import net.minecraft.item.tooltip.TooltipType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.effect.StatusEffects;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import mod.leronus.mores.item.ModItems;
import mod.leronus.mores.item.ModToolMaterials;
import net.minecraft.client.item.TooltipType;
import net.minecraft.item.tooltip.TooltipType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.effect.StatusEffects;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import mod.leronus.mores.item.ModItems;
import mod.leronus.mores.item.ModToolMaterials;
import net.minecraft.client.item.TooltipType;
import net.minecraft.item.tooltip.TooltipType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.effect.StatusEffects;
Expand Down
Loading

0 comments on commit 3462851

Please sign in to comment.