diff --git a/build.gradle b/build.gradle index 783d07c..d55b489 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ plugins { id 'idea' id 'maven-publish' id 'java-library' - id 'net.minecraftforge.gradle' version '[6.0,6.2)' + id 'net.minecraftforge.gradle' version '5.1.+' id 'org.parchmentmc.librarian.forgegradle' version '1.+' } @@ -53,7 +53,7 @@ minecraft { // This property allows configuring Gradle's ProcessResources task(s) to run on IDE output locations before launching the game. // It is REQUIRED to be set to true for this template to function. // See https://docs.gradle.org/current/dsl/org.gradle.language.jvm.tasks.ProcessResources.html - copyIdeResources = true + //copyIdeResources = true // When true, this property will add the folder name of all declared run configurations to generated IDE run configurations. // The folder name can be set on a run configuration using the "folderName" property. @@ -187,7 +187,7 @@ dependencies { // A missing property will result in an error. Properties are expanded using ${} Groovy notation. // When "copyIdeResources" is enabled, this will also run before the game launches in IDE environments. // See https://docs.gradle.org/current/dsl/org.gradle.language.jvm.tasks.ProcessResources.html -tasks.named('processResources', ProcessResources).configure { +/*tasks.named('processResources', ProcessResources).configure { var replaceProperties = [ minecraft_version : minecraft_version, minecraft_version_range: minecraft_version_range, forge_version : forge_version, forge_version_range: forge_version_range, @@ -200,7 +200,7 @@ tasks.named('processResources', ProcessResources).configure { filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) { expand replaceProperties + [project: project] } -} +}*/ // Example for how to get properties into the manifest for reading at runtime. tasks.named('jar', Jar).configure { diff --git a/gradle.properties b/gradle.properties index 5ff2ff9..84387da 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,25 +4,25 @@ org.gradle.jvmargs=-Xmx3G org.gradle.daemon=false -parchment_version=2023.09.03 +parchment_version=2022.11.06 # luckperms_api_version=5.4 -libac=1.4.46 -eventsbus=1.0.45 +libac=1.4.19 +eventsbus=1.0.31 ## Environment Properties # The Minecraft version must agree with the Forge version to get a valid artifact -minecraft_version=1.20.1 +minecraft_version=1.18.2 # The Minecraft version range can use any release version of Minecraft as bounds. # Snapshots, pre-releases, and release candidates are not guaranteed to sort properly # as they do not follow standard versioning conventions. -minecraft_version_range=[1.20.1,1.21) +minecraft_version_range=[1.18.2,1.19) # The Forge version must agree with the Minecraft version to get a valid artifact -forge_version=47.2.0 +forge_version=40.2.17 # The Forge version range can use any version of Forge as bounds or match the loader version range -forge_version_range=[47,) +forge_version_range=[40,) # The loader version range can only use the major version of Forge/FML as bounds -loader_version_range=[47,) +loader_version_range=[40,) # The mapping channel to use for mappings. # The default set of supported mapping channels are ["official", "snapshot", "snapshot_nodoc", "stable", "stable_nodoc"]. # Additional mapping channels can be registered through the "channelProviders" extension in a Gradle plugin. @@ -40,7 +40,7 @@ loader_version_range=[47,) mapping_channel=parchment # The mapping version to query from the mapping channel. # This must match the format required by the mapping channel. -mapping_version=2023.09.03-1.20.1 +mapping_version=2022.11.06-1.18.2 ## Mod Properties @@ -53,7 +53,7 @@ mod_name=Zontreck Library Mod # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. mod_license=GPLv3 # The mod version. See https://semver.org/ -mod_version=1.10.021324.2257 +mod_version=1.10.012124.1709 # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # This should match the base package used for the mod sources. # See https://maven.apache.org/guides/mini/guide-naming-conventions.html diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index fae0804..ae04661 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-8.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle b/settings.gradle index 8a72e7b..7f4682f 100644 --- a/settings.gradle +++ b/settings.gradle @@ -3,8 +3,4 @@ pluginManagement { gradlePluginPortal() maven { url = "https://maven.zontreck.com/repository/internal" } } -} - -plugins { - id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0' -} +} \ No newline at end of file diff --git a/src/main/java/dev/zontreck/libzontreck/blocks/BlockImitation.java b/src/main/java/dev/zontreck/libzontreck/blocks/BlockImitation.java deleted file mode 100644 index ab23bd1..0000000 --- a/src/main/java/dev/zontreck/libzontreck/blocks/BlockImitation.java +++ /dev/null @@ -1,95 +0,0 @@ -package dev.zontreck.libzontreck.blocks; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.server.level.ServerLevel; -import net.minecraft.util.RandomSource; -import net.minecraft.world.entity.Entity; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.BlockGetter; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.biome.Biome; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.state.BlockState; - -/** - * Code partially taken from HT's TreeChop - *
- * Source Material
- */
-public abstract class BlockImitation extends Block
-{
- public BlockImitation(Properties pProperties) {
- super(pProperties);
- }
-
-
- public abstract BlockState getImitatedBlockState(BlockGetter level, BlockPos pos);
-
- public abstract void updateImitation(BlockState newState, BlockGetter level, BlockPos pos);
-
- @Override
- public void animateTick(BlockState blockState, Level level, BlockPos pos, RandomSource random) {
- BlockState imitatedBlockState = getImitatedBlockState(level, pos);
- imitatedBlockState.getBlock().animateTick(imitatedBlockState, level, pos, random);
- }
-
- @Override
- public void stepOn(Level level, BlockPos pos, BlockState blockState, Entity entity) {
- BlockState imitatedBlockState = getImitatedBlockState(level, pos);
- imitatedBlockState.getBlock().stepOn(level, pos, imitatedBlockState, entity);
- }
-
- @Override
- public void fallOn(Level level, BlockState blockState, BlockPos pos, Entity entity, float speed) {
- BlockState imitatedBlockState = getImitatedBlockState(level, pos);
- imitatedBlockState.getBlock().fallOn(level, imitatedBlockState, pos, entity, speed);
- }
-
- @Override
- public ItemStack getCloneItemStack(BlockGetter level, BlockPos pos, BlockState blockState) {
- BlockState imitatedBlockState = getImitatedBlockState(level, pos);
- return imitatedBlockState.getBlock().getCloneItemStack(level, pos, imitatedBlockState);
- }
-
- @Override
- public void handlePrecipitation(BlockState blockState, Level level, BlockPos pos, Biome.Precipitation precipitation) {
- BlockState imitatedBlockState = getImitatedBlockState(level, pos);
- imitatedBlockState.getBlock().handlePrecipitation(imitatedBlockState, level, pos, precipitation);
- }
-
- @Override
- public int getLightBlock(BlockState blockState, BlockGetter level, BlockPos pos) {
- return super.getLightBlock(blockState, level, pos);
- }
-
- @Override
- public float getShadeBrightness(BlockState blockState, BlockGetter level, BlockPos pos) {
- return super.getShadeBrightness(blockState, level, pos);
- }
-
- @Override
- public int getAnalogOutputSignal(BlockState blockState, Level level, BlockPos pos) {
- return getImitatedBlockState(level, pos).getAnalogOutputSignal(level, pos);
- }
-
- @Override
- public void randomTick(BlockState blockState, ServerLevel level, BlockPos pos, RandomSource random) {
- getImitatedBlockState(level, pos).randomTick(level, pos, random);
- }
-
- @Override
- public void tick(BlockState blockState, ServerLevel level, BlockPos pos, RandomSource random) {
- getImitatedBlockState(level, pos).tick(level, pos, random);
- }
-
- @Override
- public int getSignal(BlockState blockState, BlockGetter level, BlockPos pos, Direction direction) {
- return getImitatedBlockState(level, pos).getSignal(level, pos, direction);
- }
-
- @Override
- public int getDirectSignal(BlockState blockState, BlockGetter level, BlockPos pos, Direction direction) {
- return getImitatedBlockState(level, pos).getDirectSignal(level, pos, direction);
- }
-}
diff --git a/src/main/java/dev/zontreck/libzontreck/chestgui/ChestGUI.java b/src/main/java/dev/zontreck/libzontreck/chestgui/ChestGUI.java
index 8e41c10..445281c 100644
--- a/src/main/java/dev/zontreck/libzontreck/chestgui/ChestGUI.java
+++ b/src/main/java/dev/zontreck/libzontreck/chestgui/ChestGUI.java
@@ -199,7 +199,7 @@ public class ChestGUI
{
updateUtilityButtons();
MinecraftForge.EVENT_BUS.post(new OpenGUIEvent(id, player, this));
- NetworkHooks.openScreen(ServerUtilities.getPlayerByID(player.toString()), new SimpleMenuProvider(ChestGUIMenu.getServerMenu(this), ChatHelpers.macro((MenuTitle != "") ? MenuTitle : "No Title")));
+ NetworkHooks.openGui(ServerUtilities.getPlayerByID(player.toString()), new SimpleMenuProvider(ChestGUIMenu.getServerMenu(this), ChatHelpers.macro(((MenuTitle != "") ? MenuTitle : "No Title"))));
}
}
diff --git a/src/main/java/dev/zontreck/libzontreck/currency/Account.java b/src/main/java/dev/zontreck/libzontreck/currency/Account.java
index e0b81f8..bef02ff 100644
--- a/src/main/java/dev/zontreck/libzontreck/currency/Account.java
+++ b/src/main/java/dev/zontreck/libzontreck/currency/Account.java
@@ -6,7 +6,6 @@ import dev.zontreck.libzontreck.chat.ChatColor;
import dev.zontreck.libzontreck.currency.events.TransactionHistoryFlushEvent;
import dev.zontreck.libzontreck.profiles.Profile;
import dev.zontreck.libzontreck.profiles.UserProfileNotYetExistsException;
-import net.minecraft.core.UUIDUtil;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.ListTag;
import net.minecraft.nbt.NbtUtils;
diff --git a/src/main/java/dev/zontreck/libzontreck/events/ForgeEventHandlers.java b/src/main/java/dev/zontreck/libzontreck/events/ForgeEventHandlers.java
index c2813ec..22895f2 100644
--- a/src/main/java/dev/zontreck/libzontreck/events/ForgeEventHandlers.java
+++ b/src/main/java/dev/zontreck/libzontreck/events/ForgeEventHandlers.java
@@ -23,9 +23,9 @@ import net.minecraftforge.fml.common.Mod;
public class ForgeEventHandlers {
@SubscribeEvent
- public void onPlayerTick(LivingEvent.LivingTickEvent ev)
+ public void onPlayerTick(LivingEvent.LivingUpdateEvent ev)
{
- if(ev.getEntity().level().isClientSide) return;
+ if(ServerUtilities.isClient()) return;
if(ev.getEntity() instanceof ServerPlayer player)
{
@@ -44,11 +44,11 @@ public class ForgeEventHandlers {
@SubscribeEvent
public void onPlayerJoin(final PlayerEvent.PlayerLoggedInEvent ev)
{
- if(ev.getEntity().level().isClientSide)return;
+ if(ServerUtilities.isClient())return;
ServerPlayer player = (ServerPlayer)ev.getEntity();
Profile prof = Profile.factory(player);
- ServerLevel level = player.serverLevel();
+ ServerLevel level = player.getLevel();
MinecraftForge.EVENT_BUS.post(new ProfileLoadedEvent(prof, player, level));
@@ -68,7 +68,7 @@ public class ForgeEventHandlers {
public void onLeave(final PlayerEvent.PlayerLoggedOutEvent ev)
{
LibZontreck.LIBZONTRECK_SERVER_AVAILABLE=false; // Yes do this even on the client!
- if(ev.getEntity().level().isClientSide)return;
+ if(ServerUtilities.isClient()) return;
// Get player profile, send disconnect alert, then commit profile and remove it from memory
try {
diff --git a/src/main/java/dev/zontreck/libzontreck/menus/ChestGUIScreen.java b/src/main/java/dev/zontreck/libzontreck/menus/ChestGUIScreen.java
index 9ae9ee4..c736c76 100644
--- a/src/main/java/dev/zontreck/libzontreck/menus/ChestGUIScreen.java
+++ b/src/main/java/dev/zontreck/libzontreck/menus/ChestGUIScreen.java
@@ -1,9 +1,9 @@
package dev.zontreck.libzontreck.menus;
import com.mojang.blaze3d.systems.RenderSystem;
+import com.mojang.blaze3d.vertex.PoseStack;
import dev.zontreck.libzontreck.LibZontreck;
import dev.zontreck.libzontreck.chestgui.ChestGUI;
-import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.network.chat.Component;
@@ -35,7 +35,7 @@ public class ChestGUIScreen extends AbstractContainerScreen