Modernize and 1.19.4ify
This commit is contained in:
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
> This is still very much more of a tech demo, than an actual usable project. Please do not confuse it for one.
|
> This is still very much more of a tech demo, than an actual usable project. Please do not confuse it for one.
|
||||||
|
|
||||||
|
This project is subject to renaming. This is not NEU, but 1.19, even tho the goal is to have some of NEUs features.
|
||||||
|
|
||||||
### Building your own
|
### Building your own
|
||||||
|
|
||||||
Use Java 17.
|
Use Java 17.
|
||||||
|
|||||||
1
TODO.txt
1
TODO.txt
@@ -1,4 +1,5 @@
|
|||||||
- recipes
|
- recipes
|
||||||
|
- replace REI with custom renderer (if needed)
|
||||||
- easy config gui builder
|
- easy config gui builder
|
||||||
- Storage Overlay
|
- Storage Overlay
|
||||||
- PV
|
- PV
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ plugins {
|
|||||||
`maven-publish`
|
`maven-publish`
|
||||||
kotlin("jvm") version "1.7.10"
|
kotlin("jvm") version "1.7.10"
|
||||||
kotlin("plugin.serialization") version "1.7.10"
|
kotlin("plugin.serialization") version "1.7.10"
|
||||||
id("dev.architectury.loom") version "0.12.0.+"
|
id("dev.architectury.loom") version "1.1.336"
|
||||||
id("com.github.johnrengelman.shadow") version "7.1.2"
|
id("com.github.johnrengelman.shadow") version "7.1.2"
|
||||||
id("moe.nea.licenseextractificator") version "fffc76c"
|
id("moe.nea.licenseextractificator") version "fffc76c"
|
||||||
id("io.github.juuxel.loom-quiltflower") version "1.7.3"
|
id("io.github.juuxel.loom-quiltflower") version "1.7.3"
|
||||||
@@ -13,22 +13,15 @@ plugins {
|
|||||||
|
|
||||||
loom {
|
loom {
|
||||||
accessWidenerPath.set(project.file("src/main/resources/notenoughupdates.accesswidener"))
|
accessWidenerPath.set(project.file("src/main/resources/notenoughupdates.accesswidener"))
|
||||||
runConfigs {
|
runs {
|
||||||
removeIf { it.name != "client" }
|
removeIf { it.name != "client" }
|
||||||
}
|
|
||||||
launches {
|
|
||||||
named("client") {
|
named("client") {
|
||||||
property("devauth.enabled", "true")
|
property("devauth.enabled", "true")
|
||||||
property("fabric.log.level", "info")
|
property("fabric.log.level", "info")
|
||||||
property("notenoughupdates.debug", "true")
|
property("notenoughupdates.debug", "true")
|
||||||
}
|
|
||||||
}
|
|
||||||
runs {
|
|
||||||
named("client") {
|
|
||||||
/*
|
/*
|
||||||
vmArg("-XX:+AllowEnhancedClassRedefinition")
|
vmArg("-XX:+AllowEnhancedClassRedefinition")
|
||||||
vmArg("-XX:HotswapAgent=fatjar")
|
vmArg("-XX:HotswapAgent=fatjar")
|
||||||
|
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -68,7 +61,7 @@ dependencies {
|
|||||||
modImplementation("net.fabricmc:fabric-loader:${project.property("fabric_loader_version")}")
|
modImplementation("net.fabricmc:fabric-loader:${project.property("fabric_loader_version")}")
|
||||||
modApi("net.fabricmc.fabric-api:fabric-api:${project.property("fabric_api_version")}")
|
modApi("net.fabricmc.fabric-api:fabric-api:${project.property("fabric_api_version")}")
|
||||||
modImplementation("net.fabricmc:fabric-language-kotlin:${project.property("fabric_kotlin_version")}")
|
modImplementation("net.fabricmc:fabric-language-kotlin:${project.property("fabric_kotlin_version")}")
|
||||||
modApi("dev.architectury:architectury:6.2.46")
|
modApi("dev.architectury:architectury:8.1.79")
|
||||||
|
|
||||||
// Actual dependencies
|
// Actual dependencies
|
||||||
modCompileOnly("me.shedaniel:RoughlyEnoughItems-api:${rootProject.property("rei_version")}") {
|
modCompileOnly("me.shedaniel:RoughlyEnoughItems-api:${rootProject.property("rei_version")}") {
|
||||||
@@ -88,7 +81,7 @@ dependencies {
|
|||||||
modImplementation(include("io.github.cottonmc:LibGui:${project.property("libgui_version")}")!!)
|
modImplementation(include("io.github.cottonmc:LibGui:${project.property("libgui_version")}")!!)
|
||||||
|
|
||||||
// Dev environment preinstalled mods
|
// Dev environment preinstalled mods
|
||||||
modRuntimeOnly("dev.architectury:architectury-fabric:6.2.46")
|
modRuntimeOnly("dev.architectury:architectury-fabric:8.1.79")
|
||||||
modRuntimeOnly("me.shedaniel:RoughlyEnoughItems-fabric:${project.property("rei_version")}") {
|
modRuntimeOnly("me.shedaniel:RoughlyEnoughItems-fabric:${project.property("rei_version")}") {
|
||||||
exclude(module = "architectury")
|
exclude(module = "architectury")
|
||||||
exclude(module = "architectury-fabric")
|
exclude(module = "architectury-fabric")
|
||||||
@@ -138,10 +131,14 @@ tasks.remapJar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tasks.processResources {
|
tasks.processResources {
|
||||||
|
val replacements = listOf(
|
||||||
|
"version" to project.version,
|
||||||
|
"minecraft_version" to project.property("minecraft_version"),
|
||||||
|
"fabric_kotlin_version" to project.property("fabric_kotlin_version")
|
||||||
|
).map { (k, v) -> k to v.toString() }
|
||||||
|
replacements.forEach { (key, value) -> inputs.property(key, value) }
|
||||||
filesMatching("**/fabric.mod.json") {
|
filesMatching("**/fabric.mod.json") {
|
||||||
expand(
|
expand(*replacements.toTypedArray())
|
||||||
"version" to project.version
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
filesMatching("**/lang/*.json") {
|
filesMatching("**/lang/*.json") {
|
||||||
// flattenJson(this)
|
// flattenJson(this)
|
||||||
|
|||||||
@@ -1,22 +1,22 @@
|
|||||||
# suppress inspection "UnusedProperty" for whole file
|
# suppress inspection "UnusedProperty" for whole file
|
||||||
org.gradle.jvmargs=-Xmx4096M
|
org.gradle.jvmargs=-Xmx4096M
|
||||||
|
|
||||||
minecraft_version=1.19.2
|
minecraft_version=1.19.4
|
||||||
loom.platform=fabric
|
loom.platform=fabric
|
||||||
|
|
||||||
archives_base_name=notenoughupdates
|
archives_base_name=notenoughupdates
|
||||||
mod_version=1.0.0
|
mod_version=1.0.0
|
||||||
maven_group=moe.nea.notenoughupdates
|
maven_group=moe.nea.notenoughupdates
|
||||||
|
|
||||||
fabric_loader_version=0.14.9
|
fabric_loader_version=0.14.19
|
||||||
fabric_api_version=0.60.0+1.19.2
|
fabric_api_version=0.80.0+1.19.4
|
||||||
fabric_kotlin_version=1.8.2+kotlin.1.7.10
|
fabric_kotlin_version=1.9.4+kotlin.1.8.21
|
||||||
yarn_version=1.19.2+build.9
|
yarn_version=1.19.4+build.2
|
||||||
|
|
||||||
libgui_version=6.1.0+1.19
|
libgui_version=7.0.0-rc.1+1.19.4
|
||||||
rei_version=9.1.537
|
rei_version=11.0.597
|
||||||
devauth_version=1.0.0
|
devauth_version=1.0.0
|
||||||
modmenu_version=4.0.6
|
modmenu_version=6.2.1
|
||||||
ktor_version=2.0.3
|
ktor_version=2.3.0
|
||||||
|
|
||||||
dbus_java_version=4.2.1
|
dbus_java_version=4.2.1
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package moe.nea.notenoughupdates.mixins;
|
||||||
|
|
||||||
|
import moe.nea.notenoughupdates.events.WorldReadyEvent;
|
||||||
|
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
||||||
|
import net.minecraft.network.packet.s2c.play.PlayerSpawnPositionS2CPacket;
|
||||||
|
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;
|
||||||
|
|
||||||
|
@Mixin(ClientPlayNetworkHandler.class)
|
||||||
|
public class MixinClientPlayNetworkHandler {
|
||||||
|
@Inject(method = "onPlayerSpawnPosition", at = @At("RETURN"))
|
||||||
|
public void onOnPlayerSpawnPosition(PlayerSpawnPositionS2CPacket packet, CallbackInfo ci) {
|
||||||
|
WorldReadyEvent.Companion.publish(new WorldReadyEvent());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package moe.nea.notenoughupdates.mixins;
|
||||||
|
|
||||||
|
import com.mojang.authlib.GameProfile;
|
||||||
|
import moe.nea.notenoughupdates.events.ServerChatLineReceivedEvent;
|
||||||
|
import net.minecraft.client.network.message.MessageHandler;
|
||||||
|
import net.minecraft.network.message.MessageType;
|
||||||
|
import net.minecraft.network.message.SignedMessage;
|
||||||
|
import net.minecraft.text.Text;
|
||||||
|
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;
|
||||||
|
|
||||||
|
@Mixin(MessageHandler.class)
|
||||||
|
public class MixinMessageHandler {
|
||||||
|
@Inject(method = "onChatMessage", cancellable = true, at = @At("HEAD"))
|
||||||
|
public void onOnChatMessage(SignedMessage message, GameProfile sender, MessageType.Parameters params, CallbackInfo ci) {
|
||||||
|
var decoratedText = params.applyChatDecoration(message.unsignedContent() != null ? message.unsignedContent() : message.getContent());
|
||||||
|
var event = new ServerChatLineReceivedEvent(decoratedText);
|
||||||
|
if (ServerChatLineReceivedEvent.Companion.publish(event).getCancelled()) {
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "onGameMessage", at = @At("HEAD"), cancellable = true)
|
||||||
|
public void onOnGameMessage(Text message, boolean overlay, CallbackInfo ci) {
|
||||||
|
if (!overlay) {
|
||||||
|
var event = new ServerChatLineReceivedEvent(message);
|
||||||
|
if (ServerChatLineReceivedEvent.Companion.publish(event).getCancelled()) {
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package moe.nea.notenoughupdates.mixins;
|
||||||
|
|
||||||
|
import moe.nea.notenoughupdates.events.ScreenOpenEvent;
|
||||||
|
import net.minecraft.client.MinecraftClient;
|
||||||
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(MinecraftClient.class)
|
||||||
|
public abstract class MixinMinecraft {
|
||||||
|
@Shadow
|
||||||
|
@Nullable
|
||||||
|
public Screen currentScreen;
|
||||||
|
|
||||||
|
@Inject(method = "setScreen", at = @At("HEAD"), cancellable = true)
|
||||||
|
public void onScreenChange(Screen screen, CallbackInfo ci) {
|
||||||
|
var event = new ScreenOpenEvent(currentScreen, screen);
|
||||||
|
if (ScreenOpenEvent.Companion.publish(event).getCancelled()) {
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package moe.nea.notenoughupdates.mixins;
|
||||||
|
|
||||||
|
import moe.nea.notenoughupdates.events.WorldRenderLastEvent;
|
||||||
|
import net.minecraft.client.render.Camera;
|
||||||
|
import net.minecraft.client.render.GameRenderer;
|
||||||
|
import net.minecraft.client.render.LightmapTextureManager;
|
||||||
|
import net.minecraft.client.render.WorldRenderer;
|
||||||
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
|
import org.joml.Matrix4f;
|
||||||
|
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;
|
||||||
|
|
||||||
|
@Mixin(WorldRenderer.class)
|
||||||
|
public class MixinWorldRenderer {
|
||||||
|
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/WorldRenderer;renderChunkDebugInfo(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;Lnet/minecraft/client/render/Camera;)V", shift = At.Shift.AFTER))
|
||||||
|
public void onWorldRenderLast(MatrixStack matrices, float tickDelta, long limitTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightmapTextureManager lightmapTextureManager, Matrix4f positionMatrix, CallbackInfo ci) {
|
||||||
|
var event = new WorldRenderLastEvent(
|
||||||
|
matrices, tickDelta, renderBlockOutline,
|
||||||
|
camera, gameRenderer, lightmapTextureManager,
|
||||||
|
positionMatrix
|
||||||
|
);
|
||||||
|
WorldRenderLastEvent.Companion.publish(event);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
package moe.nea.notenoughupdates.events
|
package moe.nea.notenoughupdates.events
|
||||||
|
|
||||||
|
import org.joml.Matrix4f
|
||||||
import net.minecraft.client.render.Camera
|
import net.minecraft.client.render.Camera
|
||||||
import net.minecraft.client.render.GameRenderer
|
import net.minecraft.client.render.GameRenderer
|
||||||
import net.minecraft.client.render.LightmapTextureManager
|
import net.minecraft.client.render.LightmapTextureManager
|
||||||
import net.minecraft.client.util.math.MatrixStack
|
import net.minecraft.client.util.math.MatrixStack
|
||||||
import net.minecraft.util.math.Matrix4f
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event is called after all world rendering is done, but before any GUI rendering (including hand) has been done.
|
* This event is called after all world rendering is done, but before any GUI rendering (including hand) has been done.
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
package moe.nea.notenoughupdates.mixins
|
|
||||||
|
|
||||||
import org.spongepowered.asm.mixin.Mixin
|
|
||||||
import org.spongepowered.asm.mixin.Overwrite
|
|
||||||
import net.minecraft.client.ClientBrandRetriever
|
|
||||||
|
|
||||||
@Mixin(ClientBrandRetriever::class)
|
|
||||||
class MixinClientBrandRetriever {
|
|
||||||
|
|
||||||
private companion object {
|
|
||||||
@JvmStatic
|
|
||||||
@Overwrite
|
|
||||||
fun getClientModName(): String {
|
|
||||||
return "penis"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
package moe.nea.notenoughupdates.mixins
|
|
||||||
|
|
||||||
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 net.minecraft.client.network.ClientPlayNetworkHandler
|
|
||||||
import net.minecraft.network.packet.s2c.play.PlayerSpawnPositionS2CPacket
|
|
||||||
import moe.nea.notenoughupdates.events.WorldReadyEvent
|
|
||||||
|
|
||||||
@Mixin(ClientPlayNetworkHandler::class)
|
|
||||||
class MixinClientPlayNetworkHandler {
|
|
||||||
@Inject(method = ["onPlayerSpawnPosition"], at = [At("RETURN")])
|
|
||||||
fun onOnPlayerSpawnPosition(packet: PlayerSpawnPositionS2CPacket, ci: CallbackInfo) {
|
|
||||||
WorldReadyEvent.publish(WorldReadyEvent())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
package moe.nea.notenoughupdates.mixins
|
|
||||||
|
|
||||||
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 net.minecraft.client.network.message.MessageHandler
|
|
||||||
import net.minecraft.network.message.MessageType
|
|
||||||
import net.minecraft.network.message.SignedMessage
|
|
||||||
import net.minecraft.text.Text
|
|
||||||
import moe.nea.notenoughupdates.events.ServerChatLineReceivedEvent
|
|
||||||
|
|
||||||
@Mixin(MessageHandler::class)
|
|
||||||
class MixinMessageHandler {
|
|
||||||
@Inject(method = ["onChatMessage"], at = [At("HEAD")], cancellable = true)
|
|
||||||
fun onOnChatMessage(message: SignedMessage, params: MessageType.Parameters, ci: CallbackInfo) {
|
|
||||||
val decoratedText = params.applyChatDecoration(message.unsignedContent.orElse(message.content))
|
|
||||||
val event = ServerChatLineReceivedEvent(decoratedText)
|
|
||||||
if (ServerChatLineReceivedEvent.publish(event).cancelled) {
|
|
||||||
ci.cancel()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Inject(method = ["onGameMessage"], at = [At("HEAD")], cancellable = true)
|
|
||||||
fun onOnGameMessage(message: Text, overlay: Boolean, ci: CallbackInfo) {
|
|
||||||
if (!overlay) {
|
|
||||||
val event = ServerChatLineReceivedEvent(message)
|
|
||||||
if (ServerChatLineReceivedEvent.publish(event).cancelled) {
|
|
||||||
ci.cancel()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
package moe.nea.notenoughupdates.mixins
|
|
||||||
|
|
||||||
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 net.minecraft.client.MinecraftClient
|
|
||||||
import net.minecraft.client.gui.screen.Screen
|
|
||||||
import moe.nea.notenoughupdates.events.ScreenOpenEvent
|
|
||||||
|
|
||||||
@Suppress("CAST_NEVER_SUCCEEDS")
|
|
||||||
@Mixin(MinecraftClient::class)
|
|
||||||
class MixinMinecraft {
|
|
||||||
@Inject(method = ["setScreen"], at = [At("HEAD")], cancellable = true)
|
|
||||||
fun onScreenChange(screen: Screen?, ci: CallbackInfo) {
|
|
||||||
val event = ScreenOpenEvent((this as MinecraftClient).currentScreen, screen)
|
|
||||||
if (ScreenOpenEvent.publish(event).cancelled)
|
|
||||||
ci.cancel()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
package moe.nea.notenoughupdates.mixins
|
|
||||||
|
|
||||||
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 net.minecraft.client.render.Camera
|
|
||||||
import net.minecraft.client.render.GameRenderer
|
|
||||||
import net.minecraft.client.render.LightmapTextureManager
|
|
||||||
import net.minecraft.client.render.WorldRenderer
|
|
||||||
import net.minecraft.client.util.math.MatrixStack
|
|
||||||
import net.minecraft.util.math.Matrix4f
|
|
||||||
import moe.nea.notenoughupdates.events.WorldRenderLastEvent
|
|
||||||
|
|
||||||
@Mixin(WorldRenderer::class)
|
|
||||||
class MixinWorldRenderer {
|
|
||||||
|
|
||||||
@Inject(
|
|
||||||
method = ["render"],
|
|
||||||
at = [At("INVOKE", target = "renderChunkDebugInfo", shift = At.Shift.AFTER)],
|
|
||||||
)
|
|
||||||
fun onWorldRenderLast(
|
|
||||||
matrices: MatrixStack,
|
|
||||||
tickDelta: Float,
|
|
||||||
arg2: Long,
|
|
||||||
renderBlockOutline: Boolean,
|
|
||||||
camera: Camera,
|
|
||||||
gameRenderer: GameRenderer,
|
|
||||||
lightmapTextureManager: LightmapTextureManager,
|
|
||||||
positionMatrix: Matrix4f,
|
|
||||||
ci: CallbackInfo
|
|
||||||
) {
|
|
||||||
val event = WorldRenderLastEvent(
|
|
||||||
matrices, tickDelta, renderBlockOutline,
|
|
||||||
camera, gameRenderer, lightmapTextureManager,
|
|
||||||
positionMatrix
|
|
||||||
)
|
|
||||||
WorldRenderLastEvent.publish(event)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -16,10 +16,10 @@ import moe.nea.notenoughupdates.repo.ItemCache.asItemStack
|
|||||||
import moe.nea.notenoughupdates.repo.ItemCache.getIdentifier
|
import moe.nea.notenoughupdates.repo.ItemCache.getIdentifier
|
||||||
import net.minecraft.client.util.math.MatrixStack
|
import net.minecraft.client.util.math.MatrixStack
|
||||||
import net.minecraft.item.ItemStack
|
import net.minecraft.item.ItemStack
|
||||||
import net.minecraft.tag.TagKey
|
|
||||||
import net.minecraft.text.Text
|
import net.minecraft.text.Text
|
||||||
import net.minecraft.util.Identifier
|
import net.minecraft.util.Identifier
|
||||||
import java.util.stream.Stream
|
import java.util.stream.Stream
|
||||||
|
import net.minecraft.registry.tag.TagKey
|
||||||
|
|
||||||
object SBItemEntryDefinition : EntryDefinition<NEUItem> {
|
object SBItemEntryDefinition : EntryDefinition<NEUItem> {
|
||||||
override fun equals(o1: NEUItem?, o2: NEUItem?, context: ComparisonContext?): Boolean {
|
override fun equals(o1: NEUItem?, o2: NEUItem?, context: ComparisonContext?): Boolean {
|
||||||
@@ -61,7 +61,7 @@ object SBItemEntryDefinition : EntryDefinition<NEUItem> {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getTagsFor(entry: EntryStack<NEUItem>?, value: NEUItem?): Stream<out TagKey<*>> {
|
override fun getTagsFor(entry: EntryStack<NEUItem>?, value: NEUItem?): Stream<out TagKey<*>>? {
|
||||||
return Stream.empty()
|
return Stream.empty()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,11 @@
|
|||||||
package moe.nea.notenoughupdates.util
|
package moe.nea.notenoughupdates.util
|
||||||
|
|
||||||
import java.time.Instant
|
|
||||||
import kotlinx.serialization.SerializationException
|
import kotlinx.serialization.SerializationException
|
||||||
import kotlinx.serialization.decodeFromString
|
import kotlinx.serialization.decodeFromString
|
||||||
import kotlin.time.Duration
|
import kotlin.time.Duration
|
||||||
import kotlin.time.Duration.Companion.seconds
|
import kotlin.time.Duration.Companion.seconds
|
||||||
import kotlin.time.ExperimentalTime
|
import kotlin.time.ExperimentalTime
|
||||||
import kotlin.time.TimeSource
|
import kotlin.time.TimeSource
|
||||||
import net.minecraft.network.message.ArgumentSignatureDataMap
|
|
||||||
import net.minecraft.network.packet.c2s.play.CommandExecutionC2SPacket
|
|
||||||
import moe.nea.notenoughupdates.NotEnoughUpdates
|
import moe.nea.notenoughupdates.NotEnoughUpdates
|
||||||
import moe.nea.notenoughupdates.events.ServerChatLineReceivedEvent
|
import moe.nea.notenoughupdates.events.ServerChatLineReceivedEvent
|
||||||
import moe.nea.notenoughupdates.events.SkyblockServerUpdateEvent
|
import moe.nea.notenoughupdates.events.SkyblockServerUpdateEvent
|
||||||
@@ -62,17 +59,7 @@ object SBData {
|
|||||||
fun sendLocraw() {
|
fun sendLocraw() {
|
||||||
lastLocrawSent = TimeSource.Monotonic.markNow()
|
lastLocrawSent = TimeSource.Monotonic.markNow()
|
||||||
val nh = MC.player?.networkHandler ?: return
|
val nh = MC.player?.networkHandler ?: return
|
||||||
val ack = nh.consumeAcknowledgment()
|
nh.sendChatCommand("locraw")
|
||||||
nh.sendPacket(
|
|
||||||
CommandExecutionC2SPacket(
|
|
||||||
"locraw",
|
|
||||||
Instant.now(),
|
|
||||||
0L,
|
|
||||||
ArgumentSignatureDataMap.EMPTY,
|
|
||||||
false,
|
|
||||||
ack
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class RenderBlockContext(val tesselator: Tessellator, val camPos: Vec3d) {
|
|||||||
matrixStack.push()
|
matrixStack.push()
|
||||||
matrixStack.translate(blockPos.x - camPos.x, blockPos.y - camPos.y, blockPos.z - camPos.z)
|
matrixStack.translate(blockPos.x - camPos.x, blockPos.y - camPos.y, blockPos.z - camPos.z)
|
||||||
RenderSystem.applyModelViewMatrix()
|
RenderSystem.applyModelViewMatrix()
|
||||||
RenderSystem.setShader(GameRenderer::getPositionColorShader)
|
RenderSystem.setShader(GameRenderer::getPositionColorProgram)
|
||||||
buildCube(buffer)
|
buildCube(buffer)
|
||||||
tesselator.draw()
|
tesselator.draw()
|
||||||
matrixStack.pop()
|
matrixStack.pop()
|
||||||
@@ -73,7 +73,6 @@ class RenderBlockContext(val tesselator: Tessellator, val camPos: Vec3d) {
|
|||||||
|
|
||||||
fun renderBlocks(camera: Camera, block: RenderBlockContext. () -> Unit) {
|
fun renderBlocks(camera: Camera, block: RenderBlockContext. () -> Unit) {
|
||||||
RenderSystem.disableDepthTest()
|
RenderSystem.disableDepthTest()
|
||||||
RenderSystem.disableTexture()
|
|
||||||
RenderSystem.enableBlend()
|
RenderSystem.enableBlend()
|
||||||
RenderSystem.defaultBlendFunc()
|
RenderSystem.defaultBlendFunc()
|
||||||
|
|
||||||
@@ -82,7 +81,6 @@ class RenderBlockContext(val tesselator: Tessellator, val camPos: Vec3d) {
|
|||||||
|
|
||||||
VertexBuffer.unbind()
|
VertexBuffer.unbind()
|
||||||
RenderSystem.enableDepthTest()
|
RenderSystem.enableDepthTest()
|
||||||
RenderSystem.enableTexture()
|
|
||||||
RenderSystem.disableBlend()
|
RenderSystem.disableBlend()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
],
|
],
|
||||||
"depends": {
|
"depends": {
|
||||||
"fabric": "*",
|
"fabric": "*",
|
||||||
"fabric-language-kotlin": ">=1.8.2+kotlin.1.7.10",
|
"fabric-language-kotlin": ">=${fabric_kotlin_version}",
|
||||||
"minecraft": ">=1.18.2"
|
"minecraft": ">=${minecraft_version}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,7 @@
|
|||||||
"MixinClientPlayNetworkHandler",
|
"MixinClientPlayNetworkHandler",
|
||||||
"MixinMessageHandler",
|
"MixinMessageHandler",
|
||||||
"MixinMinecraft",
|
"MixinMinecraft",
|
||||||
"MixinWorldRenderer",
|
"MixinWorldRenderer"
|
||||||
"MixinClientBrandRetriever"
|
|
||||||
],
|
],
|
||||||
"mixins": [
|
"mixins": [
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user