Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 65 additions & 39 deletions src/main/java/tconstruct/armor/ArmorProxyClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -341,50 +341,76 @@ void renderArmorExtras(RenderPlayerEvent.SetArmorModel event) {
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 (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 (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 (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 (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);
}
}
}
} 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);
}
}
}

Expand Down