Skip to content

Commit

Permalink
add: full EntityPos variants of methods with coordinates from vanilla…
Browse files Browse the repository at this point in the history
… Entities and IProjectile;
  • Loading branch information
MJaroslav committed May 3, 2024
1 parent 3eb5ce4 commit d681f06
Show file tree
Hide file tree
Showing 16 changed files with 1,003 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package io.github.mjaroslav.mjutils.asm.mixin.accessors;

import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import org.jetbrains.annotations.NotNull;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;

@Mixin(Entity.class)
public interface AccessorEntity {
@Invoker("func_145780_a")
void playStepSound(int x, int y, int z, @NotNull Block block);

@Invoker("func_145771_j")
boolean tryCorrectMotionOnBlockCollision(double x, double y, double z);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package io.github.mjaroslav.mjutils.asm.mixin.accessors;

import net.minecraft.entity.projectile.EntityArrow;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(EntityArrow.class)
public interface AccessorEntityArrow {
@Accessor("field_145791_d")
int getTileX();

@Accessor("field_145792_e")
int getTileY();

@Accessor("field_145789_f")
int getTileZ();

@Accessor("field_145791_d")
void setTileX(int tileX);

@Accessor("field_145792_e")
void setTileY(int tileY);

@Accessor("field_145789_f")
void setTileZ(int tileZ);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package io.github.mjaroslav.mjutils.asm.mixin.accessors;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.item.EntityBoat;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(EntityBoat.class)
public interface AccessorEntityBoat {
@Accessor
double getBoatX();

@Accessor
double getBoatY();

@Accessor
double getBoatZ();

@Accessor
void setBoatX(double boatX);

@Accessor
void setBoatY(double boatY);

@Accessor
void setBoatZ(double boatZ);

@SideOnly(Side.CLIENT)
@Accessor
double getVelocityX();

@SideOnly(Side.CLIENT)
@Accessor
double getVelocityY();

@SideOnly(Side.CLIENT)
@Accessor
double getVelocityZ();

@SideOnly(Side.CLIENT)
@Accessor
void setVelocityX(double velocityX);

@SideOnly(Side.CLIENT)
@Accessor
void setVelocityY(double velocityY);

@SideOnly(Side.CLIENT)
@Accessor
void setVelocityZ(double velocityZ);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package io.github.mjaroslav.mjutils.asm.mixin.accessors;

import net.minecraft.entity.item.EntityEnderEye;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(EntityEnderEye.class)
public interface AccessorEntityEnderEye {
@Accessor
double getTargetX();

@Accessor
double getTargetY();

@Accessor
double getTargetZ();

@Accessor
void setTargetX(double targetX);

@Accessor
void setTargetY(double targetY);

@Accessor
void setTargetZ(double targetZ);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package io.github.mjaroslav.mjutils.asm.mixin.accessors;

import net.minecraft.entity.monster.EntityEnderman;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;

@Mixin(EntityEnderman.class)
public interface AccessorEntityEnderman {
@Invoker
boolean callTeleportTo(double x, double y, double z);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package io.github.mjaroslav.mjutils.asm.mixin.accessors;

import net.minecraft.entity.projectile.EntityFireball;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(EntityFireball.class)
public interface AccessorEntityFireball {
@Accessor("field_145795_e")
int getTileX();

@Accessor("field_145793_f")
int getTileY();

@Accessor("field_145794_g")
int getTileZ();

@Accessor("field_145795_e")
void setTileX(int tileX);

@Accessor("field_145793_f")
void setTileY(int tileY);

@Accessor("field_145794_g")
void setTileZ(int tileZ);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package io.github.mjaroslav.mjutils.asm.mixin.accessors;

import net.minecraft.entity.projectile.EntityFishHook;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(EntityFishHook.class)
public interface AccessorEntityFishHook {
@Accessor("field_146037_g")
int getTileX();

@Accessor("field_146048_h")
int getTileY();

@Accessor("field_146050_i")
int getTileZ();

@Accessor("field_146037_g")
void setTileX(int tileX);

@Accessor("field_146048_h")
void setTileY(int tileY);

@Accessor("field_146050_i")
void setTileZ(int tileZ);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package io.github.mjaroslav.mjutils.asm.mixin.accessors;

import net.minecraft.entity.monster.EntityGhast;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;

@Mixin(EntityGhast.class)
public interface AccessorEntityGhast {
@Invoker
boolean callIsCourseTraversable(double x, double y, double z, double distance);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package io.github.mjaroslav.mjutils.asm.mixin.accessors;

import net.minecraft.entity.EntityLivingBase;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(EntityLivingBase.class)
public interface AccessorEntityLivingBase {
@Accessor
double getNewPosX();

@Accessor
double getNewPosY();

@Accessor
double getNewPosZ();

@Accessor
void setNewPosX(double newPosX);

@Accessor
void setNewPosY(double newPosY);

@Accessor
void setNewPosZ(double newPosZ);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package io.github.mjaroslav.mjutils.asm.mixin.accessors;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.entity.item.EntityMinecart;
import org.jetbrains.annotations.NotNull;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
import org.spongepowered.asm.mixin.gen.Invoker;

@Mixin(EntityMinecart.class)
public interface AccessorEntityMinecart {
@Accessor
double getMinecartX();

@Accessor
double getMinecartY();

@Accessor
double getMinecartZ();

@Accessor
void setMinecartX(double minecartX);

@Accessor
void setMinecartY(double minecartY);

@Accessor
void setMinecartZ(double minecartZ);

@SideOnly(Side.CLIENT)
@Accessor
double getVelocityX();

@SideOnly(Side.CLIENT)
@Accessor
double getVelocityY();

@SideOnly(Side.CLIENT)
@Accessor
double getVelocityZ();

@SideOnly(Side.CLIENT)
@Accessor
void setVelocityX(double velocityX);

@SideOnly(Side.CLIENT)
@Accessor
void setVelocityY(double velocityY);

@SideOnly(Side.CLIENT)
@Accessor
void setVelocityZ(double velocityZ);

@Invoker("func_145821_a")
void updateMovementOnRail(int x, int y, int z, double speed, double slopeAdjustment, @NotNull Block rail,
int railMeta);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package io.github.mjaroslav.mjutils.asm.mixin.accessors;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ChunkCoordinates;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
import org.spongepowered.asm.mixin.gen.Invoker;

@Mixin(EntityPlayer.class)
public interface AccessorEntityPlayer {
@Invoker
void callAddMountedMovementStat(double deltaX, double deltaY, double deltaZ);

@Accessor
@NotNull
ChunkCoordinates getPlayerLocation();

@Accessor
void setPlayerLocation(@NotNull ChunkCoordinates playerLocation);

@Accessor
@Nullable
ChunkCoordinates getStartMinecartRidingCoordinate();

@Accessor
void setStartMinecartRidingCoordinate(@Nullable ChunkCoordinates startMinecartRidingCoordinate);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package io.github.mjaroslav.mjutils.asm.mixin.accessors;

import net.minecraft.entity.passive.EntitySquid;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(EntitySquid.class)
public interface AccessorEntitySquid {
@Accessor
float getRandomMotionVecX();

@Accessor
float getRandomMotionVecY();

@Accessor
float getRandomMotionVecZ();

@Accessor
void setRandomMotionVecX(float randomMotionVecX);

@Accessor
void setRandomMotionVecY(float randomMotionVecY);

@Accessor
void setRandomMotionVecZ(float randomMotionVecZ);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package io.github.mjaroslav.mjutils.asm.mixin.accessors;

import net.minecraft.entity.projectile.EntityThrowable;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(EntityThrowable.class)
public interface AccessorEntityThrowable {
@Accessor("field_145788_c")
int getTileX();

@Accessor("field_145786_d")
int getTileY();

@Accessor("field_145787_e")
int getTileZ();

@Accessor("field_145788_c")
void setTileX(int tileX);

@Accessor("field_145786_d")
void setTileY(int tileY);

@Accessor("field_145787_e")
void setTileZ(int tileZ);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package io.github.mjaroslav.mjutils.asm.mixin.accessors;

import net.minecraft.entity.boss.EntityWither;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;

@Mixin(EntityWither.class)
public interface AccessorEntityWither {
@Invoker("func_82209_a")
void throwSkull(int head, double x, double y, double z, boolean invulnerable);
}
Loading

0 comments on commit d681f06

Please sign in to comment.