Skip to content

Commit

Permalink
Merge branch '1.18+' into dev/1.18+/5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
null2264 authored Dec 3, 2023
2 parents 0c3aa8e + 2bd8a5e commit f16a09a
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 37 deletions.
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ loader_version_1_18_2=0.14.14
fabric_version_1_18_2=0.76.0+1.18.2

# Runtime Properties
recipe_viewer=none
recipe_viewer=emi

# Dependencies
jankson_version=1.2.2
emi_version=1.0.21
emi_version=1.0.26

# Version Specific Dependencies
create_version_1_18_2=0.5.0.i-1002+1.18.2
port_lib_version_1_18_2=1.2.869-beta+1.18.2
port_lib_version_1_18_2=1.2.869-beta+1.18.2
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ private static boolean handleReaction(Level level, BlockPos pos, Fluid fluid1, F
return FLUID_INTERACTION.interactFromPipe(level, pos, fluid1, fluid2);
}

@SuppressWarnings("InvalidInjectorMethodSignature") // False positive
@Inject(
//#if FABRIC
method = "handlePipeFlowCollision(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lio/github/fabricators_of_create/porting_lib/util/FluidStack;Lio/github/fabricators_of_create/porting_lib/util/FluidStack;)V",
//#else
//$$ method = "handlePipeFlowCollision",
method = "handlePipeFlowCollision",
//#if FABRIC<=0
//$$ remap = false,
//#endif
at = @At(value = "HEAD"), cancellable = true
Expand All @@ -49,7 +48,7 @@ private static boolean handleReaction(Level level, BlockPos pos, Fluid fluid1, F
}

@Inject(
method = "handlePipeSpillCollision(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/material/Fluid;Lnet/minecraft/world/level/material/FluidState;)V",
method = "handlePipeSpillCollision",
//#if FABRIC<=0
//$$ remap = false,
//#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@
//$$ import io.github.null2264.cobblegen.network.PacketByteBufPayload;
//$$ import net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket;
//$$ import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
//$$ import net.minecraft.resources.ResourceLocation;
//$$ import org.spongepowered.asm.mixin.injection.At;
//$$ import org.spongepowered.asm.mixin.injection.Inject;
//$$ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
//$$
//$$ import static io.github.null2264.cobblegen.CobbleGen.MOD_ID;
//#endif
import net.minecraft.resources.ResourceLocation;
import org.spongepowered.asm.mixin.Debug;
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.CallbackInfoReturnable;

import static io.github.null2264.cobblegen.CobbleGen.SYNC_CHANNEL;
import static io.github.null2264.cobblegen.CobbleGen.SYNC_PING_CHANNEL;

@Mixin(ClientboundCustomPayloadPacket.class)
@Mixin(value = ClientboundCustomPayloadPacket.class, priority = 999)
public abstract class ClientboundCustomPayloadPacketMixin {
//#if MC>=1.20.2
//$$ @Inject(method = "readPayload", at = @At("HEAD"), cancellable = true)
//$$ private static void read(ResourceLocation id, FriendlyByteBuf buf, CallbackInfoReturnable<CustomPacketPayload> cir) {
//$$ if (!(id.equals(SYNC_CHANNEL)) || (id.equals(SYNC_PING_CHANNEL)))
//$$ if (!id.getNamespace().equals(MOD_ID))
//$$ return;
//$$
//$$ FriendlyByteBuf newBuf = new FriendlyByteBuf(Unpooled.buffer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
public abstract class ConnectionMixin {
//#if MC>=1.20.2
//$$ @Shadow public abstract boolean isConnected();

//$$
//$$ @Inject(method = "disconnect", at = @At("TAIL"))
//$$ private void disconnect(Component component, CallbackInfo ci) {
//$$ if (this.isConnected())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
package io.github.null2264.cobblegen.mixin.network;

import net.minecraft.network.FriendlyByteBuf;
import org.spongepowered.asm.mixin.Debug;
import org.spongepowered.asm.mixin.Mixin;
//#if MC<1.20.2
import net.minecraft.network.protocol.game.ServerboundCustomPayloadPacket;
//#else
//$$ import net.minecraft.network.FriendlyByteBuf;
//$$ import io.netty.buffer.Unpooled;
//$$ import io.github.null2264.cobblegen.network.PacketByteBufPayload;
//$$ import net.minecraft.network.protocol.common.ServerboundCustomPayloadPacket;
//$$ import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
//$$ import net.minecraft.resources.ResourceLocation;
//$$ import org.spongepowered.asm.mixin.injection.At;
//$$ import org.spongepowered.asm.mixin.injection.Inject;
//$$ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
//$$
//$$ import static io.github.null2264.cobblegen.CobbleGen.MOD_ID;
//#endif
import net.minecraft.resources.ResourceLocation;
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.CallbackInfoReturnable;

import static io.github.null2264.cobblegen.CobbleGen.SYNC_CHANNEL;
import static io.github.null2264.cobblegen.CobbleGen.SYNC_PING_CHANNEL;

@Mixin(ServerboundCustomPayloadPacket.class)
@Mixin(value = ServerboundCustomPayloadPacket.class, priority = 999)
public abstract class ServerboundCustomPayloadPacketMixin {
//#if MC>=1.20.2
//$$ @Inject(method = "readPayload", at = @At("HEAD"), cancellable = true)
//$$ private static void read(ResourceLocation id, FriendlyByteBuf buf, CallbackInfoReturnable<CustomPacketPayload> cir) {
//$$ if (!(id.equals(SYNC_CHANNEL)) || (id.equals(SYNC_PING_CHANNEL)))
//$$ if (!id.getNamespace().equals(MOD_ID))
//$$ return;
//$$
//$$ FriendlyByteBuf newBuf = new FriendlyByteBuf(Unpooled.buffer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ public static boolean handlePacket(ClientPacketListener listener, ClientboundCus
//$$ public static boolean handlePacket(ClientCommonPacketListenerImpl listener, CustomPacketPayload packet) {
//#endif
//#if MC>=1.20.2
//#if FABRIC>=1
//$$ if (LoaderCompat.isModLoaded("fabric") && packet instanceof net.fabricmc.fabric.impl.networking.payload.PacketByteBufPayload && packet.id().getNamespace().equals(MOD_ID))
//$$ packet = new PacketByteBufPayload(packet.id(), ((net.fabricmc.fabric.impl.networking.payload.PacketByteBufPayload) packet).data());
//#endif
//$$ if (!(packet instanceof PacketByteBufPayload)) return false;
//$$ ResourceLocation id = ((PacketByteBufPayload) packet).id();
//#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ public static boolean handlePacket(ServerGamePacketListenerImpl listener, Server
//$$ public static boolean handlePacket(ServerCommonPacketListenerImpl listener, CustomPacketPayload packet) {
//#endif
//#if MC>=1.20.2
//#if FABRIC>=1
//$$ if (LoaderCompat.isModLoaded("fabric") && packet instanceof net.fabricmc.fabric.impl.networking.payload.PacketByteBufPayload && packet.id().getNamespace().equals(MOD_ID))
//$$ packet = new PacketByteBufPayload(packet.id(), ((net.fabricmc.fabric.impl.networking.payload.PacketByteBufPayload) packet).data());
//#endif
//$$ if (!(packet instanceof PacketByteBufPayload)) return false;
//$$ ResourceLocation id = ((PacketByteBufPayload) packet).id();
//#else
Expand Down

0 comments on commit f16a09a

Please sign in to comment.