Skip to content

Commit

Permalink
Port to 1.21 Fabric
Browse files Browse the repository at this point in the history
  • Loading branch information
manmaed committed Jun 13, 2024
1 parent d52ca08 commit 4c26d30
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build & Release For Minecraft 1.20.6 - Fabric
name: Build & Release For Minecraft 1.21 - Fabric

on:
push:
Expand Down
13 changes: 9 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,16 @@ processResources {
}

tasks.withType(JavaCompile).configureEach {
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
it.options.release = 17
it.options.release = 21
}

java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
//withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21

}

Expand Down Expand Up @@ -136,6 +135,9 @@ publishMods {
requires {
slug = 'fabric-api'
}
optional {
slug = 'fusion-connected-textures'
}
}
modrinth {
accessToken = providers.environmentVariable("MODRINTH_DEPLOY")
Expand All @@ -144,5 +146,8 @@ publishMods {
requires {
slug = 'fabric-api'
}
optional {
slug = 'fusion-connected-textures'
}
}
}
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ org.gradle.parallel=true

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.20.6
minecraft_version=1.21
yarn_mappings=build.1
loader_version=0.15.11
fabric_version=0.97.8
fabric_version=0.100.1

# Mod Properties
maven_group = net.manmaed
archives_base_name = antiblocksrechiseled

#Mod Stuff
mod_name=AntiBlocksReChiseled
mod_version=0.9
mod_version=0.10

#CurseForge Stuff
curseforge_id=715567
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class AntiBlocksReChiseled implements ModInitializer {
public static final String MOD_ID = "antiblocksrechiseled";


public static final RegistryKey<ItemGroup> itemGroup = RegistryKey.of(RegistryKeys.ITEM_GROUP, new Identifier(MOD_ID, "item_group"));
public static final RegistryKey<ItemGroup> itemGroup = RegistryKey.of(RegistryKeys.ITEM_GROUP, Identifier.of(MOD_ID, "item_group"));


@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,6 @@ private static void registerItem(String name, Item item) {
ItemGroupEvents.modifyEntriesEvent(AntiBlocksReChiseled.itemGroup).register(entries -> entries.add(item));
}
private static Identifier getId(String name) {
return new Identifier(AntiBlocksReChiseled.MOD_ID, name);
return Identifier.of(AntiBlocksReChiseled.MOD_ID, name);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,6 @@ private static void registerItem(String name, Item item) {
}

private static Identifier getId(String name) {
return new Identifier(AntiBlocksReChiseled.MOD_ID, name);
return Identifier.of(AntiBlocksReChiseled.MOD_ID, name);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,6 @@ private static void registerItem(String name, Item item) {
}

private static Identifier getId(String name) {
return new Identifier(AntiBlocksReChiseled.MOD_ID, name);
return Identifier.of(AntiBlocksReChiseled.MOD_ID, name);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,6 @@ private static void registerItem(String name, Item item) {
}

private static Identifier getId(String name) {
return new Identifier(AntiBlocksReChiseled.MOD_ID, name);
return Identifier.of(AntiBlocksReChiseled.MOD_ID, name);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,6 @@ private static void registerItem(String name, Item item) {
}

private static Identifier getId(String name) {
return new Identifier(AntiBlocksReChiseled.MOD_ID, name);
return Identifier.of(AntiBlocksReChiseled.MOD_ID, name);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ private static void registerItem(String name, Item item) {
}

private static Identifier getId(String name) {
return new Identifier(AntiBlocksReChiseled.MOD_ID, name);
return Identifier.of(AntiBlocksReChiseled.MOD_ID, name);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,6 @@ private static void registerItem(String name, Item item) {
}

private static Identifier getId(String name) {
return new Identifier(AntiBlocksReChiseled.MOD_ID, name);
return Identifier.of(AntiBlocksReChiseled.MOD_ID, name);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package net.manmaed.antiblocksrechiseled.blocks.base;

import net.minecraft.block.*;
import net.minecraft.block.enums.Instrument;
import net.minecraft.block.enums.NoteBlockInstrument;
import net.minecraft.block.piston.PistonBehavior;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
Expand All @@ -21,13 +21,13 @@ public AntiPressurePlate() {
super(BlockSetType.STONE ,Settings.create()
.mapColor(MapColor.STONE_GRAY)
.solid()
.instrument(Instrument.BASEDRUM)
.instrument(NoteBlockInstrument.BASEDRUM)
.requiresTool()
.noCollision()
.strength(0.5F)
.pistonBehavior(PistonBehavior.DESTROY)
.luminance(light -> 15));
this.setDefaultState((BlockState)((BlockState)this.stateManager.getDefaultState()).with(POWERED, false));
this.setDefaultState((BlockState) ((BlockState) this.stateManager.getDefaultState()).with(POWERED, false));
this.activationRule = ActivationRule.PLAYERS;
;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import net.minecraft.block.MapColor;
import net.minecraft.block.SlabBlock;
import net.minecraft.block.enums.Instrument;
import net.minecraft.block.enums.NoteBlockInstrument;

public class AntiSlabBlock extends SlabBlock {
public AntiSlabBlock() {
super(Settings.create()
.mapColor(MapColor.STONE_GRAY)
.instrument(Instrument.BASEDRUM)
.instrument(NoteBlockInstrument.BASEDRUM)
.requiresTool()
.strength(2.0F, 6.0F)
.luminance(light -> 15));
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
},

"depends": {
"fabricloader": ">=0.15.0",
"fabricloader": ">=0.15.11",
"fabric-api": "*",
"minecraft": "~1.20.3",
"java": ">=17"
"minecraft": "~1.21",
"java": ">=21"
}
}

0 comments on commit 4c26d30

Please sign in to comment.