[CHORE] Port to 1.20.3/4
This commit is contained in:
@@ -9,7 +9,7 @@ pipeline {
|
||||
stage("Notify Discord") {
|
||||
steps {
|
||||
discordSend webhookURL: env.FDD_WH_ADMIN,
|
||||
title: "Deploy Started: CraterLib 1.20.2 Deploy #${BUILD_NUMBER}",
|
||||
title: "Deploy Started: CraterLib 1.20.3 Deploy #${BUILD_NUMBER}",
|
||||
link: env.BUILD_URL,
|
||||
result: 'SUCCESS',
|
||||
description: "Build: [${BUILD_NUMBER}](${env.BUILD_URL})"
|
||||
@@ -38,7 +38,7 @@ pipeline {
|
||||
deleteDir()
|
||||
|
||||
discordSend webhookURL: env.FDD_WH_ADMIN,
|
||||
title: "CraterLib 1.20.2 Deploy #${BUILD_NUMBER}",
|
||||
title: "CraterLib 1.20.3 Deploy #${BUILD_NUMBER}",
|
||||
link: env.BUILD_URL,
|
||||
result: currentBuild.currentResult,
|
||||
description: "Build: [${BUILD_NUMBER}](${env.BUILD_URL})\nStatus: ${currentBuild.currentResult}"
|
||||
|
@@ -13,7 +13,7 @@ pipeline {
|
||||
stage("Notify Discord") {
|
||||
steps {
|
||||
discordSend webhookURL: env.SSS_WEBHOOK,
|
||||
title: "Deploy Started: ${projectName} 1.20.2 Deploy #${BUILD_NUMBER}",
|
||||
title: "Deploy Started: ${projectName} 1.20.3 Deploy #${BUILD_NUMBER}",
|
||||
link: env.BUILD_URL,
|
||||
result: 'SUCCESS',
|
||||
description: "Build: [${BUILD_NUMBER}](${env.BUILD_URL})"
|
||||
@@ -54,7 +54,7 @@ pipeline {
|
||||
versionName: "Snapshot 1.0.${BUILD_NUMBER}",
|
||||
version: "1.0.${BUILD_NUMBER}",
|
||||
modLoaders: "forge|neoforge|fabric|quilt",
|
||||
minecraftVersions: "1.20.2",
|
||||
minecraftVersions: "1.20.3",
|
||||
failWebhook: env.SSS_WEBHOOK,
|
||||
publishWebhooks: "${env.SSS_WEBHOOK}|${env.FDD_WH}"
|
||||
|
||||
|
@@ -23,7 +23,7 @@ public class InternalConfigButton extends AbstractButton {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(@NotNull GuiGraphics poseStack, int i, int j, float f) {
|
||||
protected void renderWidget(GuiGraphics arg, int i, int j, float f) {
|
||||
if (cancel) {
|
||||
setMessage(Component.translatable(screen.isEdited() ? "t.clc.cancel_discard" : "gui.cancel"));
|
||||
} else {
|
||||
@@ -31,7 +31,7 @@ public class InternalConfigButton extends AbstractButton {
|
||||
active = screen.isEdited() && !hasErrors;
|
||||
setMessage(Component.translatable(hasErrors ? "t.clc.error" : "t.clc.save"));
|
||||
}
|
||||
super.render(poseStack, i, j, f);
|
||||
super.renderWidget(arg, i, j, f);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -9,6 +9,7 @@ import net.minecraft.commands.Commands;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(Commands.class)
|
||||
@@ -16,21 +17,21 @@ public class CommandMixin {
|
||||
|
||||
@Inject(method = "performCommand",
|
||||
at = @At(value = "INVOKE",
|
||||
target = "Lcom/mojang/brigadier/CommandDispatcher;execute(Lcom/mojang/brigadier/ParseResults;)I",
|
||||
target = "Lnet/minecraft/commands/Commands;finishParsing(Lcom/mojang/brigadier/ParseResults;Ljava/lang/String;Lnet/minecraft/commands/CommandSourceStack;)Lcom/mojang/brigadier/context/ContextChain;",
|
||||
shift = At.Shift.BEFORE
|
||||
), cancellable = true
|
||||
)
|
||||
private void injectCommandEvent(ParseResults<CommandSourceStack> stackParseResults, String command, CallbackInfoReturnable<Integer> cir) {
|
||||
private void injectCommandEvent(ParseResults<CommandSourceStack> stackParseResults, String command, CallbackInfo ci) {
|
||||
CraterCommandEvent commandEvent = new CraterCommandEvent(stackParseResults, command);
|
||||
CraterEventBus.INSTANCE.postEvent(commandEvent);
|
||||
if (commandEvent.wasCancelled()) {
|
||||
cir.setReturnValue(1);
|
||||
ci.cancel();
|
||||
return;
|
||||
}
|
||||
|
||||
if (commandEvent.getException() != null) {
|
||||
Throwables.throwIfUnchecked(commandEvent.getException());
|
||||
cir.setReturnValue(1);
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -34,7 +34,7 @@
|
||||
"depends": {
|
||||
"fabricloader": ">=0.14.21",
|
||||
"fabric-api": "*",
|
||||
"minecraft": ">=1.20.2",
|
||||
"minecraft": ">=1.20.3",
|
||||
"java": ">=17"
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
modLoader = "javafml"
|
||||
loaderVersion = "[46,)"
|
||||
loaderVersion = "[49,)"
|
||||
license = "MIT"
|
||||
issueTrackerURL="https://github.com/firstdarkdev/craterLib/issues"
|
||||
|
||||
@@ -19,13 +19,13 @@ displayTest = "MATCH_VERSION"
|
||||
[[dependencies.${mod_id}]]
|
||||
modId = "forge"
|
||||
mandatory = true
|
||||
versionRange = "[46,)"
|
||||
versionRange = "[49,)"
|
||||
ordering = "NONE"
|
||||
side = "BOTH"
|
||||
|
||||
[[dependencies.${mod_id}]]
|
||||
modId = "minecraft"
|
||||
mandatory = true
|
||||
versionRange = "[1.20.2,1.21)"
|
||||
versionRange = "[1.20.3,1.21)"
|
||||
ordering = "NONE"
|
||||
side = "BOTH"
|
||||
|
@@ -1 +1 @@
|
||||
com.hypherionmc.craterlib.client.NeoForgeClientHelper
|
||||
com.hypherionmc.craterlib.client.ForgeClientHelper
|
@@ -1 +1 @@
|
||||
com.hypherionmc.craterlib.common.NeoForgeCommonHelper
|
||||
com.hypherionmc.craterlib.common.ForgeCommonHelper
|
@@ -1 +1 @@
|
||||
com.hypherionmc.craterlib.common.NeoForgeFluidHelper
|
||||
com.hypherionmc.craterlib.common.ForgeFluidHelper
|
@@ -1 +1 @@
|
||||
com.hypherionmc.craterlib.common.NeoForgeLoaderHelper
|
||||
com.hypherionmc.craterlib.common.ForgeLoaderHelper
|
@@ -1,13 +1,9 @@
|
||||
package com.hypherionmc.craterlib.common;
|
||||
|
||||
import com.hypherionmc.craterlib.api.blockentity.caps.CraterCapabilityHandler;
|
||||
import com.hypherionmc.craterlib.api.blockentity.caps.ICraterCapProvider;
|
||||
import com.hypherionmc.craterlib.core.network.CraterNetworkHandler;
|
||||
import com.hypherionmc.craterlib.core.platform.CommonPlatform;
|
||||
import com.hypherionmc.craterlib.core.systems.fluid.ICraterFluidHandler;
|
||||
import com.hypherionmc.craterlib.network.NeoForgeNetworkHandler;
|
||||
import com.hypherionmc.craterlib.systems.energy.NeoForgeEnergyReader;
|
||||
import com.hypherionmc.craterlib.systems.fluid.NeoForgeFluidReader;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
@@ -19,7 +15,6 @@ import net.minecraft.world.inventory.AbstractContainerMenu;
|
||||
import net.minecraft.world.inventory.MenuType;
|
||||
import net.minecraft.world.item.CreativeModeTab;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.neoforged.neoforge.common.capabilities.Capabilities;
|
||||
import net.neoforged.neoforge.common.extensions.IMenuTypeExtension;
|
||||
import net.neoforged.neoforge.server.ServerLifecycleHooks;
|
||||
import org.apache.commons.lang3.function.TriFunction;
|
||||
@@ -28,7 +23,6 @@ import org.jetbrains.annotations.Nullable;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
@@ -67,7 +61,8 @@ public class NeoForgeCommonHelper implements CommonPlatform {
|
||||
|
||||
@Override
|
||||
public <T> Optional<T> getCapabilityHandler(BlockEntity entity, Direction side, CraterCapabilityHandler capability) {
|
||||
if (capability == CraterCapabilityHandler.ENERGY) {
|
||||
// TODO Fix This
|
||||
/*if (capability == CraterCapabilityHandler.ENERGY) {
|
||||
AtomicReference<NeoForgeEnergyReader> energyReference = new AtomicReference<>();
|
||||
entity.getCapability(Capabilities.ENERGY, side).ifPresent(storage -> energyReference.set(new NeoForgeEnergyReader(storage)));
|
||||
|
||||
@@ -83,7 +78,7 @@ public class NeoForgeCommonHelper implements CommonPlatform {
|
||||
|
||||
if (entity instanceof ICraterCapProvider capProvider) {
|
||||
return capProvider.getCapability(capability, side);
|
||||
}
|
||||
}*/
|
||||
|
||||
return Optional.empty();
|
||||
}
|
||||
|
@@ -1,33 +1,16 @@
|
||||
package com.hypherionmc.craterlib.mixin;
|
||||
|
||||
import com.hypherionmc.craterlib.api.blockentity.caps.CraterCapabilityHandler;
|
||||
import com.hypherionmc.craterlib.api.blockentity.caps.ICraterCapProvider;
|
||||
import com.hypherionmc.craterlib.common.blockentity.CraterBlockEntity;
|
||||
import com.hypherionmc.craterlib.core.systems.energy.CustomEnergyStorage;
|
||||
import com.hypherionmc.craterlib.core.systems.fluid.ICraterFluidHandler;
|
||||
import com.hypherionmc.craterlib.core.systems.inventory.SimpleInventory;
|
||||
import com.hypherionmc.craterlib.systems.energy.NeoForgeEnergyWrapper;
|
||||
import com.hypherionmc.craterlib.systems.fluid.NeoForgeWrappedFluidTank;
|
||||
import com.hypherionmc.craterlib.systems.inventory.NeoForgeInventoryWrapper;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.neoforged.neoforge.common.capabilities.Capabilities;
|
||||
import net.neoforged.neoforge.common.capabilities.Capability;
|
||||
import net.neoforged.neoforge.common.capabilities.ICapabilityProvider;
|
||||
import net.neoforged.neoforge.common.util.LazyOptional;
|
||||
import net.neoforged.neoforge.items.wrapper.SidedInvWrapper;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @author HypherionSA
|
||||
*/
|
||||
// TODO Fix This
|
||||
@Mixin(CraterBlockEntity.class)
|
||||
public class BlockEntityMixin implements ICapabilityProvider {
|
||||
public class BlockEntityMixin /*implements ICapabilityProvider*/ {
|
||||
|
||||
@Override
|
||||
/*@Override
|
||||
public @NotNull <T> LazyOptional<T> getCapability(@NotNull Capability<T> cap, @Nullable Direction side) {
|
||||
ICraterCapProvider capProvider = (ICraterCapProvider) this;
|
||||
|
||||
@@ -53,5 +36,5 @@ public class BlockEntityMixin implements ICapabilityProvider {
|
||||
}
|
||||
|
||||
return LazyOptional.empty();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
@@ -19,13 +19,13 @@ displayTest = "MATCH_VERSION"
|
||||
[[dependencies.${mod_id}]]
|
||||
modId = "neoforge"
|
||||
mandatory = true
|
||||
versionRange = "[20.2,)"
|
||||
versionRange = "[20.3,)"
|
||||
ordering = "NONE"
|
||||
side = "BOTH"
|
||||
|
||||
[[dependencies.${mod_id}]]
|
||||
modId = "minecraft"
|
||||
mandatory = true
|
||||
versionRange = "[1.20.2,1.21)"
|
||||
versionRange = "[1.20.3,1.21)"
|
||||
ordering = "NONE"
|
||||
side = "BOTH"
|
||||
|
@@ -10,17 +10,17 @@ mod_id=craterlib
|
||||
mod_name=CraterLib
|
||||
|
||||
# Shared
|
||||
minecraft_version=1.20.2
|
||||
minecraft_version=1.20.3
|
||||
|
||||
# Fabric
|
||||
fabric_loader=0.14.22
|
||||
fabric_api=0.89.0+1.20.2
|
||||
fabric_loader=0.15.0
|
||||
fabric_api=0.91.1+1.20.3
|
||||
|
||||
# Forge
|
||||
forge_version=48.0.6
|
||||
forge_version=49.0.2
|
||||
|
||||
# NeoForged
|
||||
neoforge_version=64-beta
|
||||
neoforge_version=8-beta
|
||||
|
||||
# Dependencies
|
||||
mod_menu_version=8.0.0-beta.2
|
||||
|
Reference in New Issue
Block a user