mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-22 20:47:59 +01:00
Fixed levitating item placement in third person and fixed crowssbow positioning
This commit is contained in:
parent
0881cf6e5b
commit
77584ea2fa
1 changed files with 3 additions and 2 deletions
|
@ -14,6 +14,7 @@ import net.minecraft.client.render.model.json.ModelTransformationMode;
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
import net.minecraft.entity.LivingEntity;
|
import net.minecraft.entity.LivingEntity;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
|
import net.minecraft.item.CrossbowItem;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.screen.PlayerScreenHandler;
|
import net.minecraft.screen.PlayerScreenHandler;
|
||||||
import net.minecraft.util.Arm;
|
import net.minecraft.util.Arm;
|
||||||
|
@ -62,7 +63,7 @@ public class LevitatingItemRenderer {
|
||||||
|
|
||||||
boolean doMagic = MineLittlePony.getInstance().getConfig().fpsmagic.get() && pony.hasMagic();
|
boolean doMagic = MineLittlePony.getInstance().getConfig().fpsmagic.get() && pony.hasMagic();
|
||||||
|
|
||||||
if (doMagic) {
|
if (doMagic && mode.isFirstPerson()) {
|
||||||
setupPerspective(itemRenderer, entity, stack, left, matrix);
|
setupPerspective(itemRenderer, entity, stack, left, matrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,7 +92,7 @@ public class LevitatingItemRenderer {
|
||||||
private void setupPerspective(ItemRenderer renderer, LivingEntity entity, ItemStack item, boolean left, MatrixStack stack) {
|
private void setupPerspective(ItemRenderer renderer, LivingEntity entity, ItemStack item, boolean left, MatrixStack stack) {
|
||||||
UseAction action = item.getUseAction();
|
UseAction action = item.getUseAction();
|
||||||
|
|
||||||
boolean doNormal = entity.getItemUseTime() <= 0 || action == UseAction.NONE || action == UseAction.CROSSBOW;
|
boolean doNormal = entity.getItemUseTime() <= 0 || action == UseAction.NONE || (action == UseAction.CROSSBOW && CrossbowItem.isCharged(item));
|
||||||
|
|
||||||
if (doNormal) { // eating, blocking, and drinking are not transformed. Only held items.
|
if (doNormal) { // eating, blocking, and drinking are not transformed. Only held items.
|
||||||
int sign = left ? 1 : -1;
|
int sign = left ? 1 : -1;
|
||||||
|
|
Loading…
Reference in a new issue