[PORT] Sigh.... Dammit Mojang
This commit is contained in:
@@ -38,7 +38,7 @@ shadowJar {
|
||||
|
||||
relocate 'me.hypherionmc.moonconfig', 'shadow.hypherionmc.moonconfig'
|
||||
}
|
||||
classifier ''
|
||||
setArchiveClassifier('')
|
||||
}
|
||||
|
||||
build.dependsOn shadowJar
|
||||
|
@@ -335,12 +335,12 @@ public class CraterConfigScreen extends Screen {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mouseScrolled(double d, double e, double f) {
|
||||
public boolean mouseScrolled(double d, double e, double f, double g) {
|
||||
if (e >= TOP && e <= height - BOTTOM) {
|
||||
scrollerAmount = Mth.clamp(scrollerAmount - f * 16.0D, 0, scrollHeight());
|
||||
return true;
|
||||
}
|
||||
return super.mouseScrolled(d, e, f);
|
||||
return super.mouseScrolled(d, e, f, g);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -3,6 +3,7 @@ package com.hypherionmc.craterlib.mixin.events;
|
||||
import com.hypherionmc.craterlib.api.event.server.CraterAdvancementEvent;
|
||||
import com.hypherionmc.craterlib.core.event.CraterEventBus;
|
||||
import net.minecraft.advancements.Advancement;
|
||||
import net.minecraft.advancements.AdvancementHolder;
|
||||
import net.minecraft.server.PlayerAdvancements;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
@@ -17,10 +18,12 @@ public class PlayerAdvancementsMixin {
|
||||
@Shadow private ServerPlayer player;
|
||||
|
||||
@Inject(method = "award", at = @At(value = "INVOKE", target = "Lnet/minecraft/advancements/AdvancementRewards;grant(Lnet/minecraft/server/level/ServerPlayer;)V", shift = At.Shift.AFTER))
|
||||
private void injectAdvancementEvent(Advancement advancement, String $$1, CallbackInfoReturnable<Boolean> cir) {
|
||||
CraterAdvancementEvent event = new CraterAdvancementEvent(this.player, advancement);
|
||||
private void injectAdvancementEvent(AdvancementHolder advancementHolder, String string, CallbackInfoReturnable<Boolean> cir) {
|
||||
CraterAdvancementEvent event = new CraterAdvancementEvent(this.player, advancementHolder.value());
|
||||
|
||||
if (advancement.getDisplay() != null && advancement.getDisplay().shouldAnnounceChat()) {
|
||||
Advancement advancement = advancementHolder.value();
|
||||
|
||||
if (advancement.display().isPresent() && advancement.display().get().shouldAnnounceChat()) {
|
||||
CraterEventBus.INSTANCE.postEvent(event);
|
||||
}
|
||||
}
|
||||
|
@@ -8,6 +8,7 @@ import com.mojang.authlib.GameProfile;
|
||||
import net.minecraft.network.Connection;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.server.network.CommonListenerCookie;
|
||||
import net.minecraft.server.players.PlayerList;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
@@ -28,7 +29,7 @@ public class PlayerListMixin {
|
||||
}
|
||||
|
||||
@Inject(method = "placeNewPlayer", at = @At("TAIL"))
|
||||
private void injectPlayerLoginEvent(Connection connection, ServerPlayer serverPlayer, CallbackInfo ci) {
|
||||
private void injectPlayerLoginEvent(Connection connection, ServerPlayer serverPlayer, CommonListenerCookie commonListenerCookie, CallbackInfo ci) {
|
||||
CraterPlayerEvent.PlayerLoggedIn loggedIn = new CraterPlayerEvent.PlayerLoggedIn(serverPlayer);
|
||||
CraterEventBus.INSTANCE.postEvent(loggedIn);
|
||||
}
|
||||
|
@@ -4,6 +4,8 @@ import com.hypherionmc.craterlib.api.event.client.CraterSinglePlayerEvent;
|
||||
import com.hypherionmc.craterlib.core.event.CraterEventBus;
|
||||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import net.minecraft.client.player.AbstractClientPlayer;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
@@ -12,10 +14,12 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
@Mixin(ClientLevel.class)
|
||||
public class ClientLevelMixin {
|
||||
|
||||
@Inject(method = "addPlayer", at = @At("HEAD"))
|
||||
private void injectSinglePlayerJoinEvent(int $$0, AbstractClientPlayer player, CallbackInfo ci) {
|
||||
CraterSinglePlayerEvent.PlayerLogin playerLogin = new CraterSinglePlayerEvent.PlayerLogin(player);
|
||||
CraterEventBus.INSTANCE.postEvent(playerLogin);
|
||||
@Inject(method = "addEntity", at = @At("HEAD"))
|
||||
private void injectSinglePlayerJoinEvent(Entity entity, CallbackInfo ci) {
|
||||
if (entity instanceof Player player) {
|
||||
CraterSinglePlayerEvent.PlayerLogin playerLogin = new CraterSinglePlayerEvent.PlayerLogin(player);
|
||||
CraterEventBus.INSTANCE.postEvent(playerLogin);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
public class RealmsMainScreenMixin {
|
||||
|
||||
@Inject(at = @At("HEAD"), method = "play")
|
||||
private void play(RealmsServer serverData, Screen parent, CallbackInfo ci) {
|
||||
private static void play(RealmsServer serverData, Screen parent, CallbackInfo ci) {
|
||||
PlayerJoinRealmEvent playerJoinRealm = new PlayerJoinRealmEvent(serverData);
|
||||
CraterEventBus.INSTANCE.postEvent(playerJoinRealm);
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"pack": {
|
||||
"description": "${mod_name}",
|
||||
"pack_format": 8
|
||||
"pack_format": 18
|
||||
}
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@
|
||||
"depends": {
|
||||
"fabricloader": ">=0.14.21",
|
||||
"fabric-api": "*",
|
||||
"minecraft": ">=1.20",
|
||||
"minecraft": ">=1.20.2",
|
||||
"java": ">=17"
|
||||
}
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@ registrationUtils {
|
||||
projects {
|
||||
Common { type 'common'; project ':Common' }
|
||||
Fabric { type 'fabric'; project ':Fabric' }
|
||||
Forge { type 'forge'; project ':Forge' }
|
||||
//Forge { type 'forge'; project ':Forge' }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ task rpcJar(type: Jar) {
|
||||
includeEmptyDirs = false
|
||||
archivesBaseName = "${mod_name}-modules"
|
||||
version = final_ver;
|
||||
classifier = "rpc"
|
||||
setArchiveClassifier("rpc")
|
||||
|
||||
from project(":Common").sourceSets.main.output
|
||||
}
|
||||
@@ -104,7 +104,7 @@ task configJar(type: Jar) {
|
||||
includeEmptyDirs = false
|
||||
archivesBaseName = "${mod_name}-modules"
|
||||
version = final_ver;
|
||||
classifier = "config"
|
||||
setArchiveClassifier("config")
|
||||
|
||||
from project(":Common").sourceSets.main.output
|
||||
include("**\\core\\config\\**\\*", "**\\**\\CraterConstants.*")
|
||||
@@ -115,7 +115,7 @@ task eventsJar(type: Jar) {
|
||||
includeEmptyDirs = false
|
||||
archivesBaseName = "${mod_name}-modules"
|
||||
version = final_ver;
|
||||
classifier = "events"
|
||||
setArchiveClassifier("events")
|
||||
|
||||
from project(":Common").sourceSets.main.output
|
||||
include("**\\core\\event\\**\\*", "**\\**\\CraterConstants.*")
|
||||
|
@@ -5,7 +5,7 @@ version_patch=2
|
||||
group=com.hypherionmc.craterlib
|
||||
|
||||
# Common
|
||||
minecraft_version=1.20
|
||||
minecraft_version=1.20.2
|
||||
common_runs_enabled=false
|
||||
common_client_run_name=Common Client
|
||||
common_server_run_name=Common Server
|
||||
@@ -15,8 +15,8 @@ forge_version=46.0.1
|
||||
forge_ats_enabled=true
|
||||
|
||||
# Fabric
|
||||
fabric_version=0.83.0+1.20
|
||||
fabric_loader_version=0.14.21
|
||||
fabric_version=0.89.0+1.20.2
|
||||
fabric_loader_version=0.14.22
|
||||
|
||||
# Mod options
|
||||
mod_name=CraterLib
|
||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
@@ -11,4 +11,4 @@ pluginManagement {
|
||||
}
|
||||
|
||||
rootProject.name = 'CraterLib'
|
||||
include("Common", "Fabric", "Forge")
|
||||
include("Common", "Fabric"/*, "Forge"*/)
|
||||
|
Reference in New Issue
Block a user