diff --git a/README.md b/README.md index 2b499f6..31895c6 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ We create a peripheral with two functions: * sendMessage - a function which will send a message to every player ## Supported Versions +- [1.19](https://github.com/Seniorendi/CCTutorial/tree/1.19) - [1.18](https://github.com/Seniorendi/CCTutorial/tree/1.18) - [1.16](https://github.com/Seniorendi/CCTutorial/tree/1.16) diff --git a/build.gradle b/build.gradle index 847b44d..7e3030f 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ archivesBaseName = 'cctutorial' java.toolchain.languageVersion = JavaLanguageVersion.of(17) minecraft { - mappings channel: 'official', version: '1.18.2' + mappings channel: 'official', version: "${mc_version}" runs { client { @@ -88,9 +88,9 @@ dependencies { // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied. // The userdev artifact is a special name and will get all sorts of transformations applied to it. - minecraft 'net.minecraftforge:forge:1.18.2-40.0.40' + minecraft "net.minecraftforge:forge:${mc_version}-${forge_version}" - implementation fg.deobf("org.squiddev:cc-tweaked-1.18.2:${cc_version}") + implementation fg.deobf("org.squiddev:cc-tweaked-1.19.1:${cc_version}") } diff --git a/gradle.properties b/gradle.properties index ca3d81e..0af5ab3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,6 @@ org.gradle.jvmargs=-Xmx3G org.gradle.daemon=false -cc_version=1.100.4 + +cc_version=1.100.9 +mc_version=1.19.2 +forge_version=43.1.3 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b1159fc..8fad3f5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/de/srendi/cctutorial/cctutorial/CCPeripheral.java b/src/main/java/de/srendi/cctutorial/cctutorial/CCPeripheral.java index 8de7c3f..13e73f0 100644 --- a/src/main/java/de/srendi/cctutorial/cctutorial/CCPeripheral.java +++ b/src/main/java/de/srendi/cctutorial/cctutorial/CCPeripheral.java @@ -3,8 +3,7 @@ package de.srendi.cctutorial.cctutorial; import dan200.computercraft.api.lua.LuaFunction; import dan200.computercraft.api.peripheral.IComputerAccess; import dan200.computercraft.api.peripheral.IPeripheral; -import net.minecraft.Util; -import net.minecraft.network.chat.TextComponent; +import net.minecraft.network.chat.Component; import net.minecraftforge.server.ServerLifecycleHooks; import javax.annotation.Nonnull; @@ -82,8 +81,8 @@ public class CCPeripheral implements IPeripheral { // Used to get the current server and all online players. ServerLifecycleHooks.getCurrentServer().getPlayerList().getPlayers().forEach(player -> { // Now, send the message - // To send a message, we need a Component(We use a TextComponent) and a sender UUID. We just pass an empty uuid in here - player.sendMessage(new TextComponent(message), Util.NIL_UUID); + // To send a message, we need a Component(In this case a literal text component). + player.sendSystemMessage(Component.literal(message)); }); } diff --git a/src/main/java/de/srendi/cctutorial/cctutorial/Registration.java b/src/main/java/de/srendi/cctutorial/cctutorial/Registration.java index ff428b3..7029325 100644 --- a/src/main/java/de/srendi/cctutorial/cctutorial/Registration.java +++ b/src/main/java/de/srendi/cctutorial/cctutorial/Registration.java @@ -18,7 +18,7 @@ public class Registration { public static final DeferredRegister BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, CCtutorial.MODID); public static final DeferredRegister ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, CCtutorial.MODID); - public static final DeferredRegister> BLOCK_ENTITIES = DeferredRegister.create(ForgeRegistries.BLOCK_ENTITIES, CCtutorial.MODID); + public static final DeferredRegister> BLOCK_ENTITIES = DeferredRegister.create(ForgeRegistries.BLOCK_ENTITY_TYPES, CCtutorial.MODID); // Blocks public static final RegistryObject CC_BLOCK = register("tutorial_block", CCBlock::new);