Skip to content

Commit

Permalink
move mixin related hooks and interfaces under mixin package (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexdoru authored Sep 25, 2023
1 parent a3e7898 commit 6f10d18
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 21 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ usesMixins = true
# Adds some debug arguments like verbose output and export
usesMixinDebug = true
# Specify the location of your implementation of IMixinPlugin. Leave it empty otherwise.
mixinPlugin =
mixinPlugin =
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
mixinsPackage = mixins
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;

import com.mitchej123.hodgepodge.common.BlockInvoker_FixXray;
import com.mitchej123.hodgepodge.mixins.interfaces.BlockExt_FixXray;

@Mixin(Block.class)
public abstract class MixinBlock_FixXray implements BlockInvoker_FixXray {
public abstract class MixinBlock_FixXray implements BlockExt_FixXray {

@Shadow
public abstract AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;
import com.mitchej123.hodgepodge.common.KeyBindingDuck;
import com.mitchej123.hodgepodge.mixins.interfaces.KeyBindingExt;

@Mixin(KeyBinding.class)
public class MixinKeyBinding implements KeyBindingDuck {
public class MixinKeyBinding implements KeyBindingExt {

@Shadow
@Final
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import com.mitchej123.hodgepodge.common.KeyBindingDuck;
import com.mitchej123.hodgepodge.mixins.interfaces.KeyBindingExt;

@Mixin(Minecraft.class)
public class MixinMinecraft_UpdateKeys {
Expand All @@ -19,7 +19,7 @@ public class MixinMinecraft_UpdateKeys {
method = "setIngameFocus",
at = @At(value = "INVOKE", target = "Lnet/minecraft/util/MouseHelper;grabMouseCursor()V"))
private void hodgepodge$updateKeysStates(CallbackInfo ci) {
((KeyBindingDuck) Minecraft.getMinecraft().gameSettings.keyBindAttack).hodgepodge$updateKeyStates();
((KeyBindingExt) Minecraft.getMinecraft().gameSettings.keyBindAttack).hodgepodge$updateKeyStates();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

import com.mitchej123.hodgepodge.common.BlockInvoker_FixXray;
import com.mitchej123.hodgepodge.mixins.interfaces.BlockExt_FixXray;

@Mixin(World.class)
public class MixinWorld_FixXray {
Expand All @@ -23,7 +23,7 @@ public class MixinWorld_FixXray {
value = "INVOKE",
target = "Lnet/minecraft/block/Block;getCollisionBoundingBoxFromPool(Lnet/minecraft/world/World;III)Lnet/minecraft/util/AxisAlignedBB;"))
private AxisAlignedBB hodgepodge$fixXray(Block block, World world, int x, int y, int z) {
if (((BlockInvoker_FixXray) block).hodgepodge$shouldRayTraceStopOnBlock(world, x, y, z)) {
if (((BlockExt_FixXray) block).hodgepodge$shouldRayTraceStopOnBlock(world, x, y, z)) {
return hodgepodge$DUMMY_AABB;
}
return null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.mitchej123.hodgepodge.common;
package com.mitchej123.hodgepodge.mixins.hooks;

import java.util.ArrayList;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.mitchej123.hodgepodge.common;
package com.mitchej123.hodgepodge.mixins.interfaces;

import net.minecraft.world.World;

public interface BlockInvoker_FixXray {
public interface BlockExt_FixXray {

boolean hodgepodge$shouldRayTraceStopOnBlock(World worldIn, int x, int y, int z);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.mitchej123.hodgepodge.mixins.interfaces;

public interface KeyBindingExt {

void hodgepodge$updateKeyStates();
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import com.mitchej123.hodgepodge.common.ThaumcraftMixinMethods;
import com.mitchej123.hodgepodge.mixins.hooks.ThaumcraftMixinMethods;

import thaumcraft.common.entities.golems.EntityGolemBase;
import thaumcraft.common.entities.golems.Marker;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

import com.mitchej123.hodgepodge.common.ThaumcraftMixinMethods;
import com.mitchej123.hodgepodge.mixins.hooks.ThaumcraftMixinMethods;

import thaumcraft.common.entities.golems.ItemGolemBell;
import thaumcraft.common.entities.golems.Marker;
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/mixins.hodgepodge.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"required": true,
"minVersion": "0.8.3-GTNH",
"package": "com.mitchej123.hodgepodge.mixins",
"refmap": "mixins.hodgepodge.refmap.json",
"target": "@env(DEFAULT)",
"compatibilityLevel": "JAVA_8"
Expand Down

0 comments on commit 6f10d18

Please sign in to comment.