added placementRotationFix mixins
This commit is contained in:
1 parent
4ec6e0e03e
commit
db091d68d7
5 files changed
+57
-1
No files matched your search
@@ -0,0 +1,26 @@
|
||||
package carpet.mixins;
|
||||
|
||||
import carpet.CarpetSettings;
|
||||
import carpet.utils.IEntity;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
@Mixin(Direction.class)
|
||||
public abstract class DirectionMixin
|
||||
{
|
||||
@Redirect(method = "getEntityFacingOrder", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;getYaw(F)F"))
|
||||
private static float ifGetYaw(Entity entity, float float_1)
|
||||
{
|
||||
if (!CarpetSettings.getBool("placementRotationFix"))
|
||||
{
|
||||
return -entity.getYaw(1.0F) * 0.017453292F;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -((IEntity) entity).getMainYaw(1.0F) * 0.017453292F;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user