mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-25 14:34:22 +00:00
Fix JABBA-related issues with crafting station slots (#54)
* Fix shift-merging tools voiding items fixes <https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/11392> * Change 0-sized ItemStacks into null stacks in crafting station attached slots Fixes <https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/10425> * Update buildscript * spotlessApply
This commit is contained in:
1 parent
18bfeaff32
commit
39be06c23b
571 files changed
+25959
-28223
No files matched your search
@@ -1,11 +1,5 @@
|
||||
package tconstruct.weaponry.client.item;
|
||||
|
||||
import tconstruct.client.FlexibleToolRenderer;
|
||||
import tconstruct.weaponry.TinkerWeaponry;
|
||||
import tconstruct.weaponry.ammo.ArrowAmmo;
|
||||
import tconstruct.weaponry.entity.ArrowEntity;
|
||||
import tconstruct.library.weaponry.ProjectileWeapon;
|
||||
import tconstruct.library.weaponry.IWindup;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
@@ -13,7 +7,12 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import tconstruct.weaponry.entity.BoltEntity;
|
||||
import tconstruct.client.FlexibleToolRenderer;
|
||||
import tconstruct.library.weaponry.IWindup;
|
||||
import tconstruct.library.weaponry.ProjectileWeapon;
|
||||
import tconstruct.weaponry.TinkerWeaponry;
|
||||
import tconstruct.weaponry.ammo.ArrowAmmo;
|
||||
import tconstruct.weaponry.entity.ArrowEntity;
|
||||
|
||||
public class BowRenderer extends FlexibleToolRenderer {
|
||||
private static final ArrowEntity dummy = new ArrowEntity(null);
|
||||
@@ -25,41 +24,35 @@ public class BowRenderer extends FlexibleToolRenderer {
|
||||
GL11.glTranslatef(0.5f, 0.5f, 0);
|
||||
GL11.glScalef(0.5f, 0.5f, 0.5f);
|
||||
|
||||
if(type == ItemRenderType.EQUIPPED)
|
||||
{
|
||||
//GL11.glTranslatef(0.0F, 0.125F, 0.3125F);
|
||||
if (type == ItemRenderType.EQUIPPED) {
|
||||
// GL11.glTranslatef(0.0F, 0.125F, 0.3125F);
|
||||
GL11.glTranslatef(0.2F, -0.4F, 0.2f);
|
||||
GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F);
|
||||
//GL11.glScalef(f1, -f1, f1);
|
||||
//GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F);
|
||||
// GL11.glScalef(f1, -f1, f1);
|
||||
// GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
|
||||
}
|
||||
|
||||
// windup animation
|
||||
if(type == ItemRenderType.EQUIPPED_FIRST_PERSON && player.isUsingItem())
|
||||
{
|
||||
if (type == ItemRenderType.EQUIPPED_FIRST_PERSON && player.isUsingItem()) {
|
||||
float progress = ((IWindup) item.getItem()).getWindupProgress(item, player);
|
||||
|
||||
//GL11.glScalef(1.2f, 1.2f, 1.2f);
|
||||
//float progress = ((IWindup) item.getItem()).getWindupProgress(item, Minecraft.getMinecraft().thePlayer);;
|
||||
// GL11.glScalef(1.2f, 1.2f, 1.2f);
|
||||
// float progress = ((IWindup) item.getItem()).getWindupProgress(item, Minecraft.getMinecraft().thePlayer);;
|
||||
GL11.glRotatef(-18.0F, 0.0F, 0.0F, 1.0F); // tilts the bow forward a bit
|
||||
GL11.glRotatef(-6.0F, 0.0F, 1.0F, 0.0F); // rotates the bow so it faces more forward
|
||||
GL11.glRotatef(8.0F, 1.0F, 0.0F, 0.0F); // rotates the bow forward
|
||||
GL11.glTranslatef(-0.9F, 0.2F, -1.0F);
|
||||
|
||||
|
||||
// this does the "zoom closer to the bow" thing
|
||||
GL11.glTranslatef(progress * -0.1f, progress * -0.125f, 0.0F);
|
||||
|
||||
|
||||
|
||||
// we're crazy, so.. render the arrow =D
|
||||
ItemStack ammo = ((ProjectileWeapon) item.getItem()).searchForAmmo(player, item); // we know it's a projectile weapon, it's a bow!
|
||||
if(ammo != null) {
|
||||
if(ammo.getItem() == Items.arrow)
|
||||
dummy.returnStack = ArrowAmmo.vanillaArrow;
|
||||
else
|
||||
dummy.returnStack = ammo;
|
||||
ItemStack ammo = ((ProjectileWeapon) item.getItem())
|
||||
.searchForAmmo(player, item); // we know it's a projectile weapon, it's a bow!
|
||||
if (ammo != null) {
|
||||
if (ammo.getItem() == Items.arrow) dummy.returnStack = ArrowAmmo.vanillaArrow;
|
||||
else dummy.returnStack = ammo;
|
||||
Render renderer = RenderManager.instance.getEntityClassRenderObject(ArrowEntity.class);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
@@ -79,16 +72,14 @@ public class BowRenderer extends FlexibleToolRenderer {
|
||||
renderer.doRender(dummy, 0, 0, 0, 0, 0);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
else if(type == ItemRenderType.EQUIPPED && player.isUsingItem())
|
||||
{
|
||||
} else if (type == ItemRenderType.EQUIPPED && player.isUsingItem()) {
|
||||
// we're crazy, so.. render the arrow =D
|
||||
ItemStack ammo = ((ProjectileWeapon) item.getItem()).searchForAmmo(player, item); // we know it's a projectile weapon, it's a bow!
|
||||
if(ammo != null) {
|
||||
if(ammo.getItem() == Items.arrow || !(ammo.getItem() instanceof ArrowAmmo))
|
||||
ItemStack ammo = ((ProjectileWeapon) item.getItem())
|
||||
.searchForAmmo(player, item); // we know it's a projectile weapon, it's a bow!
|
||||
if (ammo != null) {
|
||||
if (ammo.getItem() == Items.arrow || !(ammo.getItem() instanceof ArrowAmmo))
|
||||
dummy.returnStack = ArrowAmmo.vanillaArrow;
|
||||
else
|
||||
dummy.returnStack = ammo;
|
||||
else dummy.returnStack = ammo;
|
||||
Render renderer = RenderManager.instance.getEntityClassRenderObject(ArrowEntity.class);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
@@ -110,11 +101,8 @@ public class BowRenderer extends FlexibleToolRenderer {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(item.getItem() == TinkerWeaponry.longbow)
|
||||
GL11.glScalef(2.3f, 2.3f, 1.0f);
|
||||
else if(item.getItem() == TinkerWeaponry.shortbow)
|
||||
GL11.glScalef(1.7f, 1.7f, 1.0f);
|
||||
if (item.getItem() == TinkerWeaponry.longbow) GL11.glScalef(2.3f, 2.3f, 1.0f);
|
||||
else if (item.getItem() == TinkerWeaponry.shortbow) GL11.glScalef(1.7f, 1.7f, 1.0f);
|
||||
|
||||
GL11.glTranslatef(-0.5f, -0.5f, 0f);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user