mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-10-25 20:32:32 +00:00
render traveller accessories from Baubles slots when Tinker tab is disabled (#291)
Co-authored-by: Ethryan <3237986+Ethryan@users.noreply.github.com>
This commit is contained in:
1 parent
6827757b8e
commit
035c6d69d4
1 file changed
+63
-37
@@ -341,50 +341,76 @@ public class ArmorProxyClient extends ArmorProxyCommon {
|
||||
float limbSwing = player.prevLimbSwingAmount
|
||||
+ (player.limbSwingAmount - player.prevLimbSwingAmount) * partialTick;
|
||||
float limbSwingMod = player.limbSwing - player.limbSwingAmount * (1.0F - partialTick);
|
||||
// TPlayerStats stats = TPlayerStats.get(player);
|
||||
ArmorExtended armor = ArmorProxyClient.armorExtended; // TODO: Do this for every player, not just the client
|
||||
if (armor != null && armor.inventory[1] != null) {
|
||||
if (getTranslucencyLevel(armor.inventory[1]) != 2
|
||||
&& !(player.isInvisible() && getTranslucencyLevel(armor.inventory[1]) > 0)) {
|
||||
Item item = armor.inventory[1].getItem();
|
||||
ModelBiped model = item.getArmorModel(player, armor.inventory[1], 4);
|
||||
if (PHConstruct.enableTinkerInventoryTab) {
|
||||
ArmorExtended armor = ArmorProxyClient.armorExtended;
|
||||
if (armor != null && armor.inventory[1] != null) {
|
||||
if (getTranslucencyLevel(armor.inventory[1]) != 2
|
||||
&& !(player.isInvisible() && getTranslucencyLevel(armor.inventory[1]) > 0)) {
|
||||
Item item = armor.inventory[1].getItem();
|
||||
ModelBiped model = item.getArmorModel(player, armor.inventory[1], 4);
|
||||
|
||||
if (item instanceof IAccessoryModel) {
|
||||
this.mc.getTextureManager()
|
||||
.bindTexture(((IAccessoryModel) item).getWearbleTexture(player, armor.inventory[1], 1));
|
||||
model.setLivingAnimations(player, limbSwingMod, limbSwing, partialTick);
|
||||
model.render(
|
||||
player,
|
||||
limbSwingMod,
|
||||
limbSwing,
|
||||
pitch,
|
||||
yawRotation - yawOffset,
|
||||
bodyRotation,
|
||||
zeropointsixtwofive);
|
||||
if (item instanceof IAccessoryModel) {
|
||||
this.mc.getTextureManager()
|
||||
.bindTexture(((IAccessoryModel) item).getWearbleTexture(player, armor.inventory[1], 1));
|
||||
model.setLivingAnimations(player, limbSwingMod, limbSwing, partialTick);
|
||||
model.render(
|
||||
player,
|
||||
limbSwingMod,
|
||||
limbSwing,
|
||||
pitch,
|
||||
yawRotation - yawOffset,
|
||||
bodyRotation,
|
||||
zeropointsixtwofive);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (armor != null && armor.inventory[3] != null) {
|
||||
if (getTranslucencyLevel(armor.inventory[3]) != 2
|
||||
&& !(player.isInvisible() && getTranslucencyLevel(armor.inventory[3]) > 0)) {
|
||||
Item item = armor.inventory[3].getItem();
|
||||
ModelBiped model = item.getArmorModel(player, armor.inventory[3], 5);
|
||||
if (armor != null && armor.inventory[3] != null) {
|
||||
if (getTranslucencyLevel(armor.inventory[3]) != 2
|
||||
&& !(player.isInvisible() && getTranslucencyLevel(armor.inventory[3]) > 0)) {
|
||||
Item item = armor.inventory[3].getItem();
|
||||
ModelBiped model = item.getArmorModel(player, armor.inventory[3], 5);
|
||||
|
||||
if (item instanceof IAccessoryModel) {
|
||||
this.mc.getTextureManager()
|
||||
.bindTexture(((IAccessoryModel) item).getWearbleTexture(player, armor.inventory[1], 1));
|
||||
model.setLivingAnimations(player, limbSwingMod, limbSwing, partialTick);
|
||||
model.render(
|
||||
player,
|
||||
limbSwingMod,
|
||||
limbSwing,
|
||||
pitch,
|
||||
yawRotation - yawOffset,
|
||||
bodyRotation,
|
||||
zeropointsixtwofive);
|
||||
if (item instanceof IAccessoryModel) {
|
||||
this.mc.getTextureManager()
|
||||
.bindTexture(((IAccessoryModel) item).getWearbleTexture(player, armor.inventory[1], 1));
|
||||
model.setLivingAnimations(player, limbSwingMod, limbSwing, partialTick);
|
||||
model.render(
|
||||
player,
|
||||
limbSwingMod,
|
||||
limbSwing,
|
||||
pitch,
|
||||
yawRotation - yawOffset,
|
||||
bodyRotation,
|
||||
zeropointsixtwofive);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ItemStack[] baubles = tconstruct.compat.BaublesHelper.getBaubleStacks(player);
|
||||
if (baubles == null) return;
|
||||
|
||||
for (int i = 0; i < baubles.length; i++) {
|
||||
ItemStack stack = baubles[i];
|
||||
if (stack == null) continue;
|
||||
Item item = stack.getItem();
|
||||
if (!(item instanceof IAccessoryModel)) continue;
|
||||
if (getTranslucencyLevel(stack) == 2) continue;
|
||||
if (player.isInvisible() && getTranslucencyLevel(stack) > 0) continue;
|
||||
|
||||
ModelBiped model = item.getArmorModel(player, stack, i);
|
||||
if (model == null) continue;
|
||||
this.mc.getTextureManager().bindTexture(((IAccessoryModel) item).getWearbleTexture(player, stack, i));
|
||||
model.setLivingAnimations(player, limbSwingMod, limbSwing, partialTick);
|
||||
model.render(
|
||||
player,
|
||||
limbSwingMod,
|
||||
limbSwing,
|
||||
pitch,
|
||||
yawRotation - yawOffset,
|
||||
bodyRotation,
|
||||
zeropointsixtwofive);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user