Skip to content

Commit

Permalink
reorganize mixins
Browse files Browse the repository at this point in the history
  • Loading branch information
parzivail committed Oct 24, 2024
1 parent 0f4dee2 commit 048a943
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package dev.pswg.interaction;

import dev.pswg.item.ILeftClickUsable;
import dev.pswg.mixin.client.ClientPlayerInteractionManagerAccessor;
import dev.pswg.mixin.client.Accessor$ClientPlayerInteractionManager;
import dev.pswg.networking.GalaxiesPlayerActionC2SPacket;
import dev.pswg.networking.PlayerInteractItemLeftC2SPacket;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
Expand Down Expand Up @@ -89,7 +89,7 @@ public static void handleInputEvents(MinecraftClient client)
*/
private static void stopUsingItemLeft(ClientPlayerInteractionManager interactionManager, ClientPlayerEntity player)
{
((ClientPlayerInteractionManagerAccessor)interactionManager).invokeSyncSelectedSlot();
((Accessor$ClientPlayerInteractionManager)interactionManager).invokeSyncSelectedSlot();

ClientPlayNetworking.send(new GalaxiesPlayerActionC2SPacket(PlayerAction.RELEASE_USE_LEFT_ITEM));

Expand Down Expand Up @@ -147,7 +147,7 @@ private static ActionResult interactItemLeft(MinecraftClient client, ClientPlaye
}
else
{
((ClientPlayerInteractionManagerAccessor)interactionManager).invokeSyncSelectedSlot();
((Accessor$ClientPlayerInteractionManager)interactionManager).invokeSyncSelectedSlot();

var packet = new PlayerInteractItemLeftC2SPacket(hand, player.getYaw(), player.getPitch());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.spongepowered.asm.mixin.gen.Invoker;

@Mixin(ClientPlayerInteractionManager.class)
public interface ClientPlayerInteractionManagerAccessor
public interface Accessor$ClientPlayerInteractionManager
{
@Invoker
void invokeSyncSelectedSlot();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(DrawContext.class)
public interface DrawContextAccessor
public interface Accessor$DrawContext
{
@Accessor("vertexConsumers")
VertexConsumerProvider.Immediate getVertexConsumers();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.spongepowered.asm.mixin.injection.ModifyArg;

@Mixin(AbstractClientPlayerEntity.class)
public abstract class AbstractClientPlayerEntityMixin
public abstract class Mixin$AbstractClientPlayerEntity$GalaxiesAttributes
{
/**
* Append our field of view changes to the client player's field of view calculations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import java.util.function.Consumer;

@Mixin(ItemStack.class)
public abstract class ItemStackMixin
public abstract class Mixin$ItemStack$GalaxiesAttributes
{
@Inject(method = "appendAttributeModifierTooltip(Ljava/util/function/Consumer;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/registry/entry/RegistryEntry;Lnet/minecraft/entity/attribute/EntityAttributeModifier;)V", at = @At("HEAD"), cancellable = true)
public void appendAttributeModifierTooltip(Consumer<Text> textConsumer, PlayerEntity player, RegistryEntry<EntityAttribute> attribute, EntityAttributeModifier modifier, CallbackInfo ci)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(MinecraftClient.class)
public abstract class MinecraftClientMixin
public abstract class Mixin$MinecraftClient$LeftClickInputSupport
{
@Inject(method = "handleInputEvents()V", at = @At("HEAD"))
public void handleInputEvents(CallbackInfo ci)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package dev.pswg.rendering;

import dev.pswg.mixin.client.DrawContextAccessor;
import dev.pswg.mixin.client.Accessor$DrawContext;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.render.VertexConsumer;
Expand All @@ -24,7 +24,7 @@ public final class Drawables
*/
public static VertexConsumerProvider.Immediate getVertexConsumers(DrawContext context)
{
return ((DrawContextAccessor)context).getVertexConsumers();
return ((Accessor$DrawContext)context).getVertexConsumers();
}

/**
Expand Down
10 changes: 5 additions & 5 deletions projects/pswg_core/src/client/resources/pswg.client.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"package": "dev.pswg.mixin.client",
"compatibilityLevel": "JAVA_21",
"client": [
"AbstractClientPlayerEntityMixin",
"ClientPlayerInteractionManagerAccessor",
"DrawContextAccessor",
"ItemStackMixin",
"MinecraftClientMixin"
"Accessor$ClientPlayerInteractionManager",
"Accessor$DrawContext",
"Mixin$AbstractClientPlayerEntity$GalaxiesAttributes",
"Mixin$ItemStack$GalaxiesAttributes",
"Mixin$MinecraftClient$LeftClickInputSupport"
],
"injectors": {
"defaultRequire": 1
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(LivingEntity.class)
public abstract class LivingEntityMixin implements ILeftClickingEntity
public abstract class Mixin$LivingEntity$LeftClickSupport implements ILeftClickingEntity
{
@Unique
private int itemLeftUseTimeLeft;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(PlayerEntity.class)
public class PlayerEntityMixin
public class Mixin$PlayerEntity$GalaxiesAttributes
{
/**
* Appends our custom attributes to the player's attribute builder
Expand Down
4 changes: 2 additions & 2 deletions projects/pswg_core/src/main/resources/pswg.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"package": "dev.pswg.mixin",
"compatibilityLevel": "JAVA_21",
"mixins": [
"LivingEntityMixin",
"PlayerEntityMixin"
"Mixin$LivingEntity$LeftClickSupport",
"Mixin$PlayerEntity$GalaxiesAttributes"
],
"injectors": {
"defaultRequire": 1
Expand Down

0 comments on commit 048a943

Please sign in to comment.