Skip to content

Commit

Permalink
Fix compile with 1.12
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyvest committed Jul 16, 2024
1 parent 397b146 commit 5ba2f18
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 3 deletions.
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pluginManagement {
maven("https://repo.polyfrost.org/releases") // Adds the Polyfrost maven repository to get Polyfrost Gradle Toolkit
}
plugins {
val pgtVersion = "0.6.3" // Sets the default versions for Polyfrost Gradle Toolkit
val pgtVersion = "0.6.5" // Sets the default versions for Polyfrost Gradle Toolkit
id("org.polyfrost.multi-version.root") version pgtVersion
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package club.sk1er.patcher.hooks;

//#if MC==10809
import java.util.EnumMap;
import java.util.Map;

Expand All @@ -10,8 +11,10 @@
import net.minecraftforge.client.model.TRSRTransformation;

import static net.minecraftforge.client.model.TRSRTransformation.identity;
//#endif

public class TRSRTransformationHook {
//#if MC==10809
@SuppressWarnings("deprecation")
public static TRSRTransformation from(ItemTransformVec3f transform) {
return transform.equals(ItemTransformVec3f.DEFAULT) ? identity() : new TRSRTransformation(transform);
Expand Down Expand Up @@ -48,4 +51,6 @@ static TRSRTransformation get(ModelRotation rotation) {
return rotations.computeIfAbsent(rotation, r -> new TRSRTransformation(ForgeHooksClient.getMatrix(r)));
}
}

//#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import club.sk1er.patcher.ducks.WorldExt;
import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
import net.minecraft.tileentity.TileEntity;
//#if MC==10809
import net.minecraft.world.ChunkCoordIntPair;
//#endif
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
import org.spongepowered.asm.lib.Opcodes;
Expand All @@ -18,7 +20,11 @@
import java.util.List;

@Mixin(World.class)
public class WorldMixin_TileEntityUnload implements WorldExt {
public class WorldMixin_TileEntityUnload
//#if MC==10809
implements WorldExt
//#endif
{
//#if MC==10809
@Shadow
@Final
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package club.sk1er.patcher.mixins.performance.forge;

import club.sk1er.patcher.hooks.TRSRTransformationHook;
//#if MC==10809
import net.minecraft.client.resources.model.ModelRotation;
//#endif
import net.minecraftforge.client.model.ForgeBlockStateV1;
//#if MC==10809
import net.minecraftforge.client.model.TRSRTransformation;
//#endif
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import club.sk1er.patcher.hooks.TRSRTransformationHook;
import net.minecraft.client.renderer.block.model.ItemTransformVec3f;
import net.minecraftforge.client.ForgeHooksClient;
//#if MC==10809
import net.minecraftforge.client.model.TRSRTransformation;
//#endif
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
package club.sk1er.patcher.mixins.performance.forge;

//#if MC==10809
import net.minecraftforge.client.model.TRSRTransformation;
//#endif
import org.spongepowered.asm.mixin.Final;
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.CallbackInfoReturnable;

@Mixin(value = TRSRTransformation.class, remap = false)
@Mixin(
//#if MC==10809
value = TRSRTransformation.class, remap = false
//#else
//$$ value = net.minecraft.client.Minecraft.class
//#endif
)
public class TRSRTransformationMixin_OptimizeTransforms {
//#if MC==10809
@Shadow
Expand Down
1 change: 1 addition & 0 deletions versions/1.12.2-1.8.9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ net.minecraft.network.play.server.SPacketEntityStatus net.minecraft.network.play
net.minecraft.network.play.server.SPacketCloseWindow net.minecraft.network.play.server.S2EPacketCloseWindow
net.minecraft.network.play.server.SPacketCustomPayload net.minecraft.network.play.server.S3FPacketCustomPayload
net.minecraft.network.play.server.SPacketSpawnPlayer net.minecraft.network.play.server.S0CPacketSpawnPlayer
net.minecraft.network.play.server.SPacketUpdateTileEntity net.minecraft.network.play.server.S35PacketUpdateTileEntity
net.minecraft.network.status.client.CPacketServerQuery net.minecraft.network.status.client.C00PacketServerQuery
net.minecraft.network.status.server.SPacketServerInfo net.minecraft.network.status.server.S00PacketServerInfo
net.minecraft.network.status.server.SPacketPong net.minecraft.network.status.server.S01PacketPong
Expand Down

0 comments on commit 5ba2f18

Please sign in to comment.