Skip to content

Commit 7269acb

Browse files
committed
1.20.1
1 parent ee42101 commit 7269acb

File tree

5 files changed

+45
-16
lines changed

5 files changed

+45
-16
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ dependencies {
3939
annotationProcessor "org.ow2.asm:asm-tree:9.0"
4040
annotationProcessor "org.ow2.asm:asm-util:9.0"
4141

42-
modImplementation include("io.github.cottonmc:LibGui:6.4.0+1.19")
42+
modImplementation include("io.github.cottonmc:LibGui:8.0.0+1.20")
4343
}
4444

4545
processResources {

gradle.properties

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@ org.gradle.jvmargs=-Xmx1G
33

44
# Fabric Properties
55
# check these on https://fabricmc.net/develop
6-
minecraft_version=1.19.2
7-
yarn_mappings=1.19.2+build.28
8-
loader_version=0.14.17
9-
6+
minecraft_version=1.20.1
7+
yarn_mappings=1.20.1+build.8
8+
loader_version=0.14.21
109

1110
#Fabric api
12-
fabric_version=0.76.0+1.19.2
11+
fabric_version=0.84.0+1.20.1
1312

1413
# Mod Properties
15-
mod_version = 1.0.0
14+
mod_version = 1.0.1
1615
maven_group = atlasengine
1716
archives_base_name = atlasengine-fabric
Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,49 @@
11
package ca.atlasengine;
22

33
import net.fabricmc.api.ModInitializer;
4-
import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder;
4+
import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup;
5+
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
56
import net.minecraft.item.ItemGroup;
67
import net.minecraft.item.ItemStack;
8+
import net.minecraft.registry.Registries;
9+
import net.minecraft.registry.Registry;
10+
import net.minecraft.registry.RegistryKey;
11+
import net.minecraft.registry.RegistryKeys;
12+
import net.minecraft.text.Text;
713
import net.minecraft.util.Identifier;
814

915
public class Mod implements ModInitializer {
10-
public static final ItemGroup ATLASENGINE_LOGO = FabricItemGroupBuilder
11-
.build(new Identifier("atlasengine", "logo"), () -> new ItemStack(ModItems.LOGO));
16+
public static final ItemGroup ATLASENGINE_LOGO = FabricItemGroup.builder()
17+
.displayName(Text.translatable("itemGroup.atlasengine.logo"))
18+
.icon(() -> new ItemStack(ModItems.LOGO))
19+
.build();
1220

13-
public static final ItemGroup ATLASENGINE_MODEL = FabricItemGroupBuilder
14-
.build(new Identifier("atlasengine", "model"), () -> new ItemStack(ModItems.MODEL));
21+
public static final ItemGroup ATLASENGINE_MODEL = FabricItemGroup.builder()
22+
.displayName(Text.translatable("itemGroup.atlasengine.model"))
23+
.icon(() -> new ItemStack(ModItems.MODEL))
24+
.build();
1525

1626
@Override
1727
public void onInitialize() {
1828
ModItems.registerModItems();
29+
30+
var LOGO = RegistryKey.of(RegistryKeys.ITEM_GROUP, new Identifier("atlasengine", "logo"));
31+
var MODEL = RegistryKey.of(RegistryKeys.ITEM_GROUP, new Identifier("atlasengine", "model"));
32+
33+
Registry.register(Registries.ITEM_GROUP,
34+
LOGO,
35+
ATLASENGINE_LOGO);
36+
37+
Registry.register(Registries.ITEM_GROUP,
38+
MODEL,
39+
ATLASENGINE_MODEL);
40+
41+
ItemGroupEvents.modifyEntriesEvent(LOGO).register(content -> {
42+
content.add(ModItems.LOGO);
43+
});
44+
45+
ItemGroupEvents.modifyEntriesEvent(MODEL).register(content -> {
46+
content.add(ModItems.MODEL);
47+
});
1948
}
2049
}

src/main/java/ca/atlasengine/ModItems.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22

33
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
44
import net.minecraft.item.Item;
5+
import net.minecraft.registry.Registries;
6+
import net.minecraft.registry.Registry;
57
import net.minecraft.util.Identifier;
6-
import net.minecraft.util.registry.Registry;
78

89
public class ModItems {
910
public static final Item LOGO = registerItem("logo",
10-
new Item(new FabricItemSettings().group(Mod.ATLASENGINE_LOGO)));
11+
new Item(new FabricItemSettings()));
1112

1213
public static final Item MODEL = registerItem("model",
13-
new Item(new FabricItemSettings().group(Mod.ATLASENGINE_MODEL)));
14+
new Item(new FabricItemSettings()));
1415

1516
private static Item registerItem(String name, Item item) {
16-
return Registry.register(Registry.ITEM, new Identifier("atlasengine", name), item);
17+
return Registry.register(Registries.ITEM, new Identifier("atlasengine", name), item);
1718
}
1819

1920
public static void registerModItems() {
-120 KB
Loading

0 commit comments

Comments
 (0)