Fixed leg armor not updating its rotation correctly while in vechicles
parent
1add9bbf9d
commit
69c104a994
17
README.md
17
README.md
|
@ -100,6 +100,23 @@ After:<br>
|
||||||
|
|
||||||
**Note: The mod doesn't add any sounds by itself, all of these sounds are already present in your "resources" folder, they are automatically downloaded by Minecraft itself**
|
**Note: The mod doesn't add any sounds by itself, all of these sounds are already present in your "resources" folder, they are automatically downloaded by Minecraft itself**
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details><summary>Fixed leg armor not being updated while riding</summary>
|
||||||
|
|
||||||
|
Before:<br>
|
||||||
|
<video controls src="https://i.imgur.com/UX9nfs8.mp4" />
|
||||||
|
|
||||||
|
After:<br>
|
||||||
|
<video controls src="https://i.imgur.com/khlHpop.mp4" />
|
||||||
|
|
||||||
|
Before:
|
||||||
|
![player's leg armor not updating its rotation according to the player's legs](https://i.imgur.com/Vx8GAtV.png)
|
||||||
|
|
||||||
|
After:
|
||||||
|
![player's leg armor correctly updating its rotation according to the player's legs](https://i.imgur.com/eHppgk9.png)
|
||||||
|
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
|
@ -4,6 +4,8 @@ import java.lang.management.ManagementFactory;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import net.minecraft.entity.player.Player;
|
import net.minecraft.entity.player.Player;
|
||||||
|
import net.minecraft.item.ItemInstance;
|
||||||
|
import net.minecraft.item.ItemType;
|
||||||
|
|
||||||
public class WyHelper {
|
public class WyHelper {
|
||||||
|
|
||||||
|
@ -22,47 +24,14 @@ public class WyHelper {
|
||||||
|
|
||||||
public static void cheatCommand(Player player) {
|
public static void cheatCommand(Player player) {
|
||||||
Random rand = new Random();
|
Random rand = new Random();
|
||||||
player.level.playSound(player, "random.break", 1, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);
|
// player.level.playSound(player, "random.break", 1, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);
|
||||||
|
|
||||||
// player.dropItem(new ItemInstance(ItemType.pickaxeGold, 1, 100), false);
|
// player.dropItem(new ItemInstance(ItemType.pickaxeGold, 1, 100), false);
|
||||||
// player.dropItem(new ItemInstance(Tile.STONE, 64), false);
|
// player.dropItem(new ItemInstance(Tile.STONE, 64), false);
|
||||||
|
|
||||||
// player.level.playLevelEvent((Player)null, 1005, (int)player.x, (int)player.y, (int)player.z, 0);
|
// player.level.playLevelEvent((Player)null, 1005, (int)player.x, (int)player.y, (int)player.z, 0);
|
||||||
|
|
||||||
// player.dropItem(new ItemInstance(Tile.DOOR_WOOD, 1), false);
|
player.dropItem(new ItemInstance(ItemType.boat, 1), false);
|
||||||
|
|
||||||
// player.dropItem(new ItemInstance(Tile.JUKEBOX, 1), false);
|
|
||||||
// player.dropItem(new ItemInstance(ItemType.record_cat, 1), false);
|
|
||||||
|
|
||||||
// player.dropItem(new ItemInstance(Tile.STONE_SLAB, 2), false);
|
|
||||||
// player.dropItem(new ItemInstance(Tile.CHEST, 2), false);
|
|
||||||
// player.dropItem(new ItemInstance(Tile.FURNACE, 1), false);
|
|
||||||
// player.dropItem(new ItemInstance(Tile.DISPENSER, 1), false);
|
|
||||||
// player.dropItem(new ItemInstance(Tile.DIRT, 64), false);
|
|
||||||
// player.dropItem(new ItemInstance(Tile.DOOR_WOOD, 1), false);
|
|
||||||
// player.dropItem(new ItemInstance(Tile.STILL_LAVA, 1), false);
|
|
||||||
// player.dropItem(new ItemInstance(ItemType.pickaxeDiamond, 1), false);
|
|
||||||
// player.dropItem(new ItemInstance(ItemType.hatchetDiamond, 1), false);
|
|
||||||
// player.dropItem(new ItemInstance(ItemType.bow, 1), false);
|
|
||||||
// player.dropItem(new ItemInstance(Tile.COBBLESTONE, 1), false);
|
|
||||||
// player.dropItem(new ItemInstance(Tile.STAIRS_STONE, 64), false);
|
|
||||||
// player.dropItem(new ItemInstance(Tile.STAIRS_WOOD, 64), false);
|
|
||||||
// player.dropItem(new ItemInstance(ItemType.boat, 1), false);
|
|
||||||
// player.dropItem(new ItemInstance(ItemType.minecart, 1), false);
|
|
||||||
// player.dropItem(new ItemInstance(ItemType.minecartChest, 1), false);
|
|
||||||
// player.dropItem(new ItemInstance(ItemType.minecartFurnace, 1), false);
|
|
||||||
// player.dropItem(new ItemInstance(Tile.RAIL, 64), false);
|
|
||||||
// player.dropItem(new ItemInstance(Tile.GOLDEN_RAIL, 64), false);
|
|
||||||
// player.dropItem(new ItemInstance(Tile.REDSTONE_TORCH, 64), false);
|
|
||||||
// player.dropItem(new ItemInstance(Tile.BUTTON, 1), false);
|
|
||||||
// player.dropItem(new ItemInstance(Tile.REDSTONE_DUST, 64), false);
|
|
||||||
|
|
||||||
// player.dropItem(new ItemInstance(ItemType.bootsDiamond, 1), false);
|
|
||||||
// player.dropItem(new ItemInstance(ItemType.chestplateDiamond, 1), false);
|
|
||||||
// player.dropItem(new ItemInstance(ItemType.helmetDiamond, 1), false);
|
|
||||||
// player.dropItem(new ItemInstance(ItemType.leggingsDiamond, 1), false);
|
|
||||||
|
|
||||||
// player.dropItem(new ItemInstance(Tile.FENCE, 1), false);
|
|
||||||
|
|
||||||
// Skeleton enemy = new Skeleton(player.level);
|
// Skeleton enemy = new Skeleton(player.level);
|
||||||
// enemy.setPositionAndAngles(player.x + 2, player.y, player.z, 0.0f, 0.0f);
|
// enemy.setPositionAndAngles(player.x + 2, player.y, player.z, 0.0f, 0.0f);
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
package xyz.pixelatedw.betterbeta.mixin;
|
||||||
|
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
|
||||||
|
import net.minecraft.client.render.entity.LivingEntityRenderer;
|
||||||
|
import net.minecraft.client.render.entity.model.EntityModel;
|
||||||
|
|
||||||
|
@Mixin(LivingEntityRenderer.class)
|
||||||
|
public class LivingEntityRendererMixin {
|
||||||
|
@Shadow
|
||||||
|
protected EntityModel field_909;
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
protected EntityModel model;
|
||||||
|
}
|
|
@ -2,18 +2,27 @@ package xyz.pixelatedw.betterbeta.mixin;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.At.Shift;
|
import org.spongepowered.asm.mixin.injection.At.Shift;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
import net.minecraft.client.render.entity.PlayerRenderer;
|
import net.minecraft.client.render.entity.PlayerRenderer;
|
||||||
|
import net.minecraft.client.render.entity.model.BipedModel;
|
||||||
import net.minecraft.entity.player.Player;
|
import net.minecraft.entity.player.Player;
|
||||||
import net.minecraft.item.ItemInstance;
|
import net.minecraft.item.ItemInstance;
|
||||||
import net.minecraft.item.ItemType;
|
import net.minecraft.item.ItemType;
|
||||||
|
import net.minecraft.item.armour.ArmourItem;
|
||||||
|
|
||||||
@Mixin(PlayerRenderer.class)
|
@Mixin(PlayerRenderer.class)
|
||||||
public class PlayerRendererMixin {
|
public class PlayerRendererMixin extends LivingEntityRendererMixin{
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
private BipedModel field_295; // Armor
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
private BipedModel field_296; // Legs
|
||||||
|
|
||||||
@Inject(method = "method_827", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/HandItemRenderer;method_1862(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/item/ItemInstance;)V", shift = Shift.BEFORE))
|
@Inject(method = "method_827", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/HandItemRenderer;method_1862(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/item/ItemInstance;)V", shift = Shift.BEFORE))
|
||||||
public void playerRendering(Player player, float f, CallbackInfo ci) {
|
public void playerRendering(Player player, float f, CallbackInfo ci) {
|
||||||
|
@ -22,4 +31,15 @@ public class PlayerRendererMixin {
|
||||||
GL11.glTranslatef(0.0F, -0.5F, 0.0F);
|
GL11.glTranslatef(0.0F, -0.5F, 0.0F);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Inject(method = "render(Lnet/minecraft/entity/player/Player;DDDFF)V", at = @At("HEAD"))
|
||||||
|
public void render(Player arg, double d, double d1, double d2, float f, float f1, CallbackInfo ci) {
|
||||||
|
ItemInstance stack = arg.inventory.getArmourItem(1);
|
||||||
|
if (stack != null) {
|
||||||
|
ItemType item = stack.getType();
|
||||||
|
if (item instanceof ArmourItem) {
|
||||||
|
this.field_296.isRiding = this.field_909.isRiding;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,8 @@
|
||||||
"MinecraftAppletMixin",
|
"MinecraftAppletMixin",
|
||||||
"ItemInstanceMixin",
|
"ItemInstanceMixin",
|
||||||
"MinecraftMixin",
|
"MinecraftMixin",
|
||||||
"MinecartMixin"
|
"MinecartMixin",
|
||||||
|
"LivingEntityRendererMixin"
|
||||||
],
|
],
|
||||||
"injectors": {
|
"injectors": {
|
||||||
"defaultRequire": 1
|
"defaultRequire": 1
|
||||||
|
|
Loading…
Reference in New Issue