item physics

This commit is contained in:
ThisIsALegitUsername 2023-03-03 17:13:23 +00:00
parent 45590c193b
commit aefde8b574
8 changed files with 55910 additions and 55760 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

1
pp.sh Executable file
View File

@ -0,0 +1 @@
cp javascript/classes.js javascript/badwifi

View File

@ -14,6 +14,7 @@ import dev.resent.module.impl.hud.FPS;
import dev.resent.module.impl.hud.Freelook; import dev.resent.module.impl.hud.Freelook;
import dev.resent.module.impl.hud.Hitboxes; import dev.resent.module.impl.hud.Hitboxes;
import dev.resent.module.impl.hud.Info; import dev.resent.module.impl.hud.Info;
import dev.resent.module.impl.hud.ItemPhysics;
import dev.resent.module.impl.hud.KeyStrokes; import dev.resent.module.impl.hud.KeyStrokes;
import dev.resent.module.impl.hud.PotCounter; import dev.resent.module.impl.hud.PotCounter;
import dev.resent.module.impl.hud.PotionHUD; import dev.resent.module.impl.hud.PotionHUD;
@ -74,9 +75,11 @@ public class ModManager {
public static Cape cape = new Cape(); public static Cape cape = new Cape();
public static BPS bps = new BPS(); public static BPS bps = new BPS();
public static ClickGui clickGui = new ClickGui(); public static ClickGui clickGui = new ClickGui();
public static ItemPhysics itemPhysics = new ItemPhysics();
public ModManager() { public ModManager() {
//Hud //Hud
register(itemPhysics);
register(clickGui); register(clickGui);
register(bps); register(bps);
register(cape); register(cape);

View File

@ -0,0 +1,10 @@
package dev.resent.module.impl.hud;
import dev.resent.annotation.Module;
import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category;
@Module(name = "ItemPhysics", category = Category.MISC)
public class ItemPhysics extends Mod{
}

View File

@ -0,0 +1,116 @@
package dev.resent.util.physics;
import dev.resent.module.base.ModManager;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.resources.model.IBakedModel;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
public class RenderItemPhysics {
public static int func_177077_a(EntityItem itemIn, double p_177077_2_, double p_177077_4_, double p_177077_6_, float p_177077_8_, IBakedModel p_177077_9_, int func_177078_a) {
ItemStack itemstack = itemIn.getEntityItem();
Item item = itemstack.getItem();
Block block = Block.getBlockFromItem(item);
if (item == null)
{
return 0;
}
else
{
boolean flag = p_177077_9_.isGui3d();
int i = func_177078_a;
if(ModManager.itemPhysics.isEnabled()) {
if(block != null) {
GlStateManager.translate((float)p_177077_2_, (float)p_177077_4_ + 0.15F, (float)p_177077_6_);
}else {
GlStateManager.translate((float)p_177077_2_, (float)p_177077_4_ + 0.02F, (float)p_177077_6_);
GlStateManager.rotate(-90F, 1F, 0F, 0F);
}
}else {
float f1 = MathHelper.sin(((float)itemIn.getAge() + p_177077_8_) / 10.0F + itemIn.hoverStart) * 0.1F + 0.1F;
float f2 = p_177077_9_.getItemCameraTransforms().getTransform(ItemCameraTransforms.TransformType.GROUND).scale.y;
GlStateManager.translate((float)p_177077_2_, (float)p_177077_4_ + f1 + 0.25F * f2, (float)p_177077_6_);
}
if(!ModManager.itemPhysics.isEnabled()) {
if (flag || Minecraft.getMinecraft().getRenderManager().options != null)
{
float f3 = (((float)itemIn.getAge() + p_177077_8_) / 20.0F + itemIn.hoverStart) * (180F / (float)Math.PI);
GlStateManager.rotate(f3, 0.0F, 1.0F, 0.0F);
}
}
if (!flag)
{
float f6 = -0.0F * (float)(i - 1) * 0.5F;
float f4 = -0.0F * (float)(i - 1) * 0.5F;
float f5 = -0.046875F * (float)(i - 1) * 0.5F;
GlStateManager.translate(f6, f4, f5);
}
if(ModManager.itemPhysics.isEnabled() && !itemIn.onGround) {
float angle = System.currentTimeMillis() % (360 * 20) / (float) (4.5 - 1 /*0.5-4 */);
GlStateManager.rotate(angle, 1F, 1F, 1F);
}
/*if(Soar.instance.modManager.getModByClass(UHCOverlayMod.class).isEnabled()) {
float ingotScale = 1.5f;
float nuggetScale = 1.5f;
float appleScale = 1.5f;
float oreScale = 1.5f;
float skullScale = 1.5f;
float f6 = -0.0F * (float)(i - 1) * 0.5F;
float f4 = -0.0F * (float)(i - 1) * 0.5F;
float f5 = -0.046875F * (float)(i - 1) * 0.5F;
if(item == Items.gold_ingot) {
if(!ModManager.itemPhysics.isEnabled()) {
GlStateManager.translate(f6, f4 + (ingotScale / 8), f5);
}
GlStateManager.scale(ingotScale, ingotScale, ingotScale);
}
if(item == Items.gold_nugget) {
if(!ModManager.itemPhysics.isEnabled()) {
GlStateManager.translate(f6, f4 + (nuggetScale / 8), f5);
}
GlStateManager.scale(nuggetScale, nuggetScale, nuggetScale);
}
if(item == Items.golden_apple) {
if(!ModManager.itemPhysics.isEnabled()) {
GlStateManager.translate(f6, f4 + (appleScale / 8), f5);
}
GlStateManager.scale(appleScale, appleScale, appleScale);
}
if(block == Blocks.gold_ore) {
if(!ModManager.itemPhysics.isEnabled()) {
GlStateManager.translate(f6, f4 + (oreScale / 8), f5);
}
GlStateManager.scale(oreScale, oreScale, oreScale);
}
if(item == Items.skull) {
if(!ModManager.itemPhysics.isEnabled()) {
GlStateManager.translate(f6, f4 + (skullScale / 8), f5);
}
GlStateManager.scale(skullScale, skullScale, skullScale);
}
}*/
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
return i;
}
}
}

View File

@ -1,6 +1,8 @@
package net.minecraft.client.renderer.entity; package net.minecraft.client.renderer.entity;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_GREATER;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_ONE_MINUS_SRC_ALPHA;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_SRC_ALPHA;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
@ -8,9 +10,7 @@ import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.resources.model.IBakedModel; import net.minecraft.client.resources.model.IBakedModel;
import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
/**+ /**+
@ -43,54 +43,34 @@ public class RenderEntityItem extends Render<EntityItem> {
this.shadowOpaque = 0.75F; this.shadowOpaque = 0.75F;
} }
private int func_177077_a(EntityItem itemIn, double p_177077_2_, double p_177077_4_, double p_177077_6_, float p_177077_8_, IBakedModel p_177077_9_) private int func_177077_a(EntityItem itemIn, double parDouble1, double parDouble2, double parDouble3, float parFloat1, IBakedModel parIBakedModel) {
{ return dev.resent.util.physics.RenderItemPhysics.func_177077_a(itemIn, parDouble1, parDouble2, parDouble3, parFloat1, parIBakedModel, func_177078_a(itemIn.getEntityItem()));
ItemStack itemstack = itemIn.getEntityItem(); /*ItemStack itemstack = itemIn.getEntityItem();
Item item = itemstack.getItem(); Item item = itemstack.getItem();
if (item == null) {
if (item == null)
{
return 0; return 0;
} } else {
else boolean flag = parIBakedModel.isGui3d();
{
boolean flag = p_177077_9_.isGui3d();
int i = this.func_177078_a(itemstack); int i = this.func_177078_a(itemstack);
float f = 0.25F; float f = 0.25F;
float f1 = MathHelper.sin(((float) itemIn.getAge() + parFloat1) / 10.0F + itemIn.hoverStart) * 0.1F + 0.1F;
float f1 = -0.125f; //MathHelper.sin(((float)itemIn.getAge() + p_177077_8_) / 10.0F + itemIn.hoverStart) * 0.1F + 0.1F; float f2 = parIBakedModel.getItemCameraTransforms().getTransform(ItemCameraTransforms.TransformType.GROUND).scale.y;
if(!flag) f1 = -0.175f; GlStateManager.translate((float) parDouble1, (float) parDouble2 + f1 + 0.25F * f2, (float) parDouble3);
if (flag || this.renderManager.options != null) {
float f2 = p_177077_9_.getItemCameraTransforms().getTransform(ItemCameraTransforms.TransformType.GROUND).scale.y; float f3 = (((float) itemIn.getAge() + parFloat1) / 20.0F + itemIn.hoverStart) * 57.295776F;
GlStateManager.translate((float)p_177077_2_, (float)p_177077_4_ + f1 + 0.25F * f2, (float)p_177077_6_); GlStateManager.rotate(f3, 0.0F, 1.0F, 0.0F);
if (flag || this.renderManager.options != null)
{
float f3 = (((float)itemIn.getAge() + p_177077_8_) / 20.0F + itemIn.hoverStart) * (180F / (float)Math.PI);
//GlStateManager.rotate(f3, 0.0F, 1.0F, 0.0F);
} }
if (!flag) if (!flag) {
{ float f6 = 0.0F * (float) (i - 1) * 0.5F;
float f6 = -0.0F * (float)(i - 1) * 0.5F; float f4 = 0.0F * (float) (i - 1) * 0.5F;
float f4 = -0.0F * (float)(i - 1) * 0.5F; float f5 = -0.046875F * (float) (i - 1) * 0.5F;
float f5 = -0.046875F * (float)(i - 1) * 0.5F; GlStateManager.translate(f6, f4, f5);
//GlStateManager.translate(f6, f4, f5);
if(itemIn.onGround) GlStateManager.rotate(180, 0.0f, 1.0f, 1.0f);
}
float speed = 10;
if(!itemIn.onGround) {
float rotAmount = ((float)itemIn.getAge() * speed) % 360;
GlStateManager.rotate(rotAmount, 1f, 0f, 1f);
} }
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
return i; return i;
} }*/
} }
private int func_177078_a(ItemStack stack) { private int func_177078_a(ItemStack stack) {