Skip to content

Commit 6a7d818

Browse files
tring some stuff
1 parent d6291dc commit 6a7d818

File tree

5 files changed

+20
-25
lines changed

5 files changed

+20
-25
lines changed

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
plugins {
2-
id 'fabric-loom' version '1.4-SNAPSHOT'
2+
id 'fabric-loom' version '1.9-SNAPSHOT'
33
id 'maven-publish'
44
id 'signing'
5-
id 'io.github.gradle-nexus.publish-plugin' version '1.3.0'
5+
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
66
}
77

88
version = project.mod_version
@@ -35,7 +35,7 @@ processResources {
3535
}
3636
}
3737

38-
def targetJavaVersion = 17
38+
def targetJavaVersion = 21
3939
tasks.withType(JavaCompile).configureEach {
4040
// ensure that the encoding is set to UTF-8, no matter what the system default is
4141
// this fixes some edge cases with special characters not displaying correctly

gradle.properties

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ org.gradle.daemon=false
44
# Fabric Properties
55
# check these on https://fabricmc.net/develop/
66
# Mod Properties
7-
mod_version=1.20.2-1.0.0
7+
mod_version=1.21.1-1.0.0
88
maven_group=io.github.codecraftplugin
99
archives_base_name=registry-lib
1010
#Minecraft
11-
minecraft_version=1.20.2
12-
yarn_mappings=1.20.2+build.4
13-
loader_version=0.14.25
1411

12+
minecraft_version=1.21.1
13+
yarn_mappings=1.21.1+build.3
14+
loader_version=0.16.9
1515
#Fabric api
16-
fabric_version=0.91.1+1.20.2
16+
fabric_version=0.114.0+1.21.1

gradle/wrapper/gradle-wrapper.jar

-58.1 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/main/java/io/github/codecraftplugin/registrylib/utils/Registry.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package io.github.codecraftplugin.registrylib.utils;
22

3-
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
3+
//import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
44
import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup;
55
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
66
import net.fabricmc.loader.api.FabricLoader;
@@ -34,7 +34,7 @@ public class Registry {
3434
* @return the item will be created and returned
3535
*/
3636
public static Item registerItems(String name, String MOD_ID, Item item, RegistryKey<ItemGroup> itemGroup){
37-
Item createditem = net.minecraft.registry.Registry.register(Registries.ITEM,new Identifier(MOD_ID,name),item);
37+
Item createditem = net.minecraft.registry.Registry.register(Registries.ITEM,Identifier.of(MOD_ID,name),item);
3838
addToItemGroup(itemGroup,createditem);
3939
return createditem;
4040
}
@@ -48,7 +48,7 @@ public static Item registerItems(String name, String MOD_ID, Item item, Registry
4848
*/
4949
public static Block registerBlocks(String name, String MOD_ID, Block block, RegistryKey<ItemGroup> itemGroup){
5050
registerBlockItem(name,MOD_ID,block,itemGroup);
51-
return net.minecraft.registry.Registry.register(Registries.BLOCK,new Identifier(MOD_ID,name),block);
51+
return net.minecraft.registry.Registry.register(Registries.BLOCK,Identifier.of(MOD_ID,name),block);
5252
}
5353

5454
/**
@@ -60,8 +60,8 @@ public static Block registerBlocks(String name, String MOD_ID, Block block, Regi
6060
* @return the block item without creating the block (for crops)
6161
*/
6262
public static Item registerBlockItem(String name, String MOD_ID, Block block, RegistryKey<ItemGroup> itemGroup) {
63-
Item blockItem = net.minecraft.registry.Registry.register(Registries.ITEM,new Identifier(MOD_ID,name),
64-
new BlockItem(block,new FabricItemSettings()));
63+
Item blockItem = net.minecraft.registry.Registry.register(Registries.ITEM,Identifier.of(MOD_ID,name),
64+
new BlockItem(block,new Item.Settings()));
6565
addToItemGroup(itemGroup,blockItem);
6666
return blockItem;
6767
}
@@ -75,7 +75,7 @@ public static Item registerBlockItem(String name, String MOD_ID, Block block, Re
7575
*/
7676
public static RegistryKey<ItemGroup> registerItemGroup(String name, String MOD_ID, Supplier<ItemStack> itemStack){
7777
String displayName = formatString(name);
78-
RegistryKey<ItemGroup> customItemGroup = RegistryKey.of(RegistryKeys.ITEM_GROUP,new Identifier(MOD_ID,name));
78+
RegistryKey<ItemGroup> customItemGroup = RegistryKey.of(RegistryKeys.ITEM_GROUP,Identifier.of(MOD_ID,name));
7979
net.minecraft.registry.Registry.register(Registries.ITEM_GROUP, customItemGroup, FabricItemGroup.builder()
8080
.icon(itemStack).displayName(Text.literal(displayName)).build());
8181

@@ -101,7 +101,7 @@ public static void addToItemGroup(RegistryKey<ItemGroup> group, Item item) {
101101
*/
102102
public static Block registerBlocksWithoutBlockItem(String name, String MOD_ID, Block block){
103103
//register the block without block items, so you have to register it manually using registerItems
104-
return net.minecraft.registry.Registry.register(Registries.BLOCK,new Identifier(MOD_ID,name),block);
104+
return net.minecraft.registry.Registry.register(Registries.BLOCK,Identifier.of(MOD_ID,name),block);
105105
}
106106

107107
/**
@@ -113,7 +113,7 @@ public static Block registerBlocksWithoutBlockItem(String name, String MOD_ID, B
113113
* @return the enchantment
114114
*/
115115
public static Enchantment registerEnchantments(String name, Enchantment enchantment, String MOD_ID){
116-
return net.minecraft.registry.Registry.register(Registries.ENCHANTMENT, new Identifier(MOD_ID, name),enchantment);
116+
return net.minecraft.registry.Registry.register(Registries., Identifier.of(MOD_ID, name),enchantment);
117117

118118
}
119119

@@ -125,7 +125,7 @@ public static Enchantment registerEnchantments(String name, Enchantment enchantm
125125
* @return
126126
*/
127127
private static FlowableFluid registerFluids(String name, String MOD_ID,FlowableFluid flowableFluid) {
128-
return net.minecraft.registry.Registry.register(Registries.FLUID, new Identifier(MOD_ID, name), flowableFluid);
128+
return net.minecraft.registry.Registry.register(Registries.FLUID, Identifier.of(MOD_ID, name), flowableFluid);
129129
}
130130
public static void registerRegistry(Logger logger){
131131
logger.info("registered all the registry");
@@ -140,7 +140,7 @@ public static void registerRegistry(Logger logger){
140140
* @return The Entity
141141
*/
142142
public static EntityType registerEntity(String name,String MOD_ID, EntityType entity){
143-
return net.minecraft.registry.Registry.register(Registries.ENTITY_TYPE, new Identifier(MOD_ID,name),entity);
143+
return net.minecraft.registry.Registry.register(Registries.ENTITY_TYPE, Identifier.of(MOD_ID,name),entity);
144144
}
145145
//register status effects
146146

@@ -153,15 +153,15 @@ public static EntityType registerEntity(String name,String MOD_ID, EntityType en
153153
* @return the status effect
154154
*/
155155
public static StatusEffect registerStatusEffects(String name,String MOD_ID, StatusEffect statusEffect){
156-
return net.minecraft.registry.Registry.register(Registries.STATUS_EFFECT, new Identifier(MOD_ID, name), statusEffect);
156+
return net.minecraft.registry.Registry.register(Registries.STATUS_EFFECT, Identifier.of(MOD_ID, name), statusEffect);
157157
}
158158
//register entities with spawn egg
159159

160160
public static <T extends Entity> EntityType<T> buildEntity(EntityType.EntityFactory<T> entity, Class<T> entityClass,
161161
float width, float height, SpawnGroup group, String MOD_ID) {
162162
if (FabricLoader.getInstance().isDevelopmentEnvironment()) {
163163
String name = entityClass.getSimpleName().toLowerCase();
164-
return EntityRegistryBuilder.<T>createBuilder(new Identifier(MOD_ID, name)).entity(entity)
164+
return EntityRegistryBuilder.<T>createBuilder(Identifier.of(MOD_ID, name)).entity(entity)
165165
.category(group).dimensions(EntityDimensions.changing(width, height)).build();
166166
}
167167
return null;

0 commit comments

Comments
 (0)