data changes

This commit is contained in:
Sen 2025-07-06 21:43:15 +02:00
parent 575015abd6
commit b14a99dc05
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
75 changed files with 449 additions and 1717 deletions

View file

@ -1560,7 +1560,7 @@ public class Client implements IThreadListener {
inventoryplayer.setCurrentItem(item);
if(this.itemCheat) {
this.player.client.addToSendQueue(new CPacketCheat(new ItemStack(item), -2 - inventoryplayer.currentItem, this.ctrl()));
this.player.client.addToSendQueue(new CPacketCheat(item, -2 - inventoryplayer.currentItem, this.ctrl()));
}
}
}
@ -2393,7 +2393,7 @@ public class Client implements IThreadListener {
this.show(GuiMenu.INSTANCE);
}
if(this.world != null && !this.charEditor && Bind.INVENTORY.isPressed()) {
if(this.open instanceof GuiContainer) {
if(this.open instanceof GuiContainer && !(this.open.selected instanceof client.gui.element.Field || this.open.selected instanceof Area)) {
this.show(null);
}
else if(this.open == null) {

View file

@ -507,7 +507,7 @@ public abstract class GuiContainer extends Gui
if(this.cheatStack != null) {
Slot slot = this.getSlotAtPosition(mouseX, mouseY);
if((mouseButton == 0 || mouseButton == 1) && slot != null && this.gm.player != null && slot.canCheatItem())
this.gm.player.client.addToSendQueue(new CPacketCheat(this.cheatStack, slot.slotNumber, mouseButton == 0 && this.cheatStack.size > 1));
this.gm.player.client.addToSendQueue(new CPacketCheat(this.cheatStack.getItem(), slot.slotNumber, mouseButton == 0 && this.cheatStack.size > 1));
if(mouseButton != 1 && !this.gm.ctrl())
this.cheatStack = null;
return;
@ -885,7 +885,7 @@ public abstract class GuiContainer extends Gui
if(idx >= 0 && idx < ITEM_LIST.size()) {
if(slot != -1 || instant) {
this.gm.player.client.addToSendQueue(new CPacketCheat(ITEM_LIST.get(idx), slot < 0 ? slot : -2 - slot, full));
this.gm.player.client.addToSendQueue(new CPacketCheat(ITEM_LIST.get(idx).getItem(), slot < 0 ? slot : -2 - slot, full));
}
else {
this.cheatStack = ITEM_LIST.get(idx).copy();

View file

@ -33,7 +33,7 @@ public class RenderFireball extends Render<EntityProjectile>
GL11.glTranslatef((float)x, (float)y, (float)z);
GlState.enableRescaleNormal();
GL11.glScalef(this.scale, this.scale, this.scale);
TextureAtlasSprite textureatlassprite = Client.CLIENT.getRenderItem().getItemModelMesher().getParticleIcon(Items.fire_charge);
TextureAtlasSprite textureatlassprite = Client.CLIENT.getRenderItem().getItemModelMesher().getParticleIcon(Items.fireball);
// Tessellator tessellator = Tessellator.getInstance();
RenderBuffer worldrenderer = Tessellator.getBuffer();
float f = textureatlassprite.getMinU();

View file

@ -1,31 +0,0 @@
package client.renderer.model;
public class ModelBanner extends ModelBase
{
public ModelRenderer bannerSlate;
public ModelRenderer bannerStand;
public ModelRenderer bannerTop;
public ModelBanner()
{
this.textureWidth = 64;
this.textureHeight = 64;
this.bannerSlate = new ModelRenderer(this, 0, 0);
this.bannerSlate.addBox(-10.0F, 0.0F, -2.0F, 20, 40, 1, 0.0F);
this.bannerStand = new ModelRenderer(this, 44, 0);
this.bannerStand.addBox(-1.0F, -30.0F, -1.0F, 2, 42, 2, 0.0F);
this.bannerTop = new ModelRenderer(this, 0, 42);
this.bannerTop.addBox(-10.0F, -32.0F, -1.0F, 20, 2, 2, 0.0F);
}
/**
* Renders the banner model in.
*/
public void renderBanner()
{
this.bannerSlate.rotationPointY = -32.0F;
this.bannerSlate.render(0.0625F);
this.bannerStand.render(0.0625F);
this.bannerTop.render(0.0625F);
}
}

View file

@ -2,12 +2,7 @@ package client.renderer.particle;
import client.Client;
import client.renderer.RenderBuffer;
import client.world.WorldClient;
import common.color.DyeColor;
import common.entity.Entity;
import common.init.SoundEvent;
import common.tags.TagObject;
import java.util.List;
import common.util.BoundingBox;
import common.util.ExtMath;
import common.world.World;
@ -76,33 +71,6 @@ public class EntityFirework
this.noClip = false;
}
public void setTrail(boolean trailIn)
{
this.trail = trailIn;
}
public void setTwinkle(boolean twinkleIn)
{
this.twinkle = twinkleIn;
}
public void setColour(int colour)
{
float f = (float)((colour & 16711680) >> 16) / 255.0F;
float f1 = (float)((colour & 65280) >> 8) / 255.0F;
float f2 = (float)((colour & 255) >> 0) / 255.0F;
float f3 = 1.0F;
this.setRBGColorF(f * f3, f1 * f3, f2 * f3);
}
public void setFadeColour(int faceColour)
{
this.fadeColourRed = (float)((faceColour & 16711680) >> 16) / 255.0F;
this.fadeColourGreen = (float)((faceColour & 65280) >> 8) / 255.0F;
this.fadeColourBlue = (float)((faceColour & 255) >> 0) / 255.0F;
this.hasFadeColour = true;
}
public BoundingBox getCollisionBoundingBox()
{
return null;
@ -187,257 +155,4 @@ public class EntityFirework
return 1.0F;
}
}
public static class StarterFX extends EntityFX
{
private int fireworkAge;
private final EffectRenderer theEffectRenderer;
private List<TagObject> fireworkExplosions;
boolean twinkle;
public StarterFX(World p_i46464_1_, double p_i46464_2_, double p_i46464_4_, double p_i46464_6_, double p_i46464_8_, double p_i46464_10_, double p_i46464_12_, EffectRenderer p_i46464_14_, TagObject p_i46464_15_)
{
super(p_i46464_1_, p_i46464_2_, p_i46464_4_, p_i46464_6_, 0.0D, 0.0D, 0.0D);
this.motionX = p_i46464_8_;
this.motionY = p_i46464_10_;
this.motionZ = p_i46464_12_;
this.theEffectRenderer = p_i46464_14_;
this.particleMaxAge = 8;
if (p_i46464_15_ != null)
{
this.fireworkExplosions = p_i46464_15_.getList("Explosions");
if (this.fireworkExplosions.size() == 0)
{
this.fireworkExplosions = null;
}
else
{
this.particleMaxAge = this.fireworkExplosions.size() * 2 - 1;
for (int i = 0; i < this.fireworkExplosions.size(); ++i)
{
TagObject tag = this.fireworkExplosions.get(i);
if (tag.getBool("Flicker"))
{
this.twinkle = true;
this.particleMaxAge += 15;
break;
}
}
}
}
}
public void renderParticle(RenderBuffer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ)
{
}
public void onUpdate()
{
if (this.fireworkAge == 0 && this.fireworkExplosions != null)
{
boolean flag = this.isFarAway();
boolean flag1 = false;
if (this.fireworkExplosions.size() >= 3)
{
flag1 = true;
}
else
{
for (int i = 0; i < this.fireworkExplosions.size(); ++i)
{
TagObject tag = this.fireworkExplosions.get(i);
if (tag.getByte("Type") == 1)
{
flag1 = true;
break;
}
}
}
SoundEvent s1 = flag1 ? (flag ? SoundEvent.BLAST_LARGE_FAR : SoundEvent.BLAST_LARGE) :
(flag ? SoundEvent.BLAST_SMALL_FAR : SoundEvent.BLAST_SMALL);
((WorldClient)this.worldObj).playSound(this.posX, this.posY, this.posZ, s1, 20.0F);
}
if (this.fireworkAge % 2 == 0 && this.fireworkExplosions != null && this.fireworkAge / 2 < this.fireworkExplosions.size())
{
int k = this.fireworkAge / 2;
TagObject tag = this.fireworkExplosions.get(k);
int l = tag.getByte("Type");
boolean flag4 = tag.getBool("Trail");
boolean flag2 = tag.getBool("Flicker");
int[] aint = tag.getIntArray("Colors");
int[] aint1 = tag.getIntArray("FadeColors");
if (aint.length == 0)
{
aint = new int[] {DyeColor.WHITE.getColor()};
}
if (l == 1)
{
this.createBall(0.5D, 4, aint, aint1, flag4, flag2);
}
else if (l == 2)
{
this.createShaped(0.5D, new double[][] {
{0.0D, 1.0D}, {0.3455D, 0.309D}, {0.9511D, 0.309D}, {0.3795918367346939D, -0.12653061224489795D},
{0.6122448979591837D, -0.8040816326530612D}, {0.0D, -0.35918367346938773D}
}, aint, aint1, flag4, flag2, false, 4);
}
else if (l == 3)
{
this.createShaped(0.5D, new double[][] {
{0.187 - 0.5, 1.0 - 0.016}, {1.0 - 0.5, 1.0 - 0.625}, {0.0 - 0.5, 1.0 - 0.625},
{0.812 - 0.5, 1.0 - 0.016}, {0.5 - 0.5, 1.0 - 1.0}, {0.187 - 0.5, 1.0 - 0.016}
}, aint, aint1, flag4, flag2, true, 8);
}
else if (l == 4)
{
this.createBurst(aint, aint1, flag4, flag2);
}
else
{
this.createBall(0.25D, 2, aint, aint1, flag4, flag2);
}
int j = aint[0];
float f = (float)((j & 16711680) >> 16) / 255.0F;
float f1 = (float)((j & 65280) >> 8) / 255.0F;
float f2 = (float)((j & 255) >> 0) / 255.0F;
EntityFirework.OverlayFX entityfirework$overlayfx = new EntityFirework.OverlayFX(this.worldObj, this.posX, this.posY, this.posZ);
entityfirework$overlayfx.setRBGColorF(f, f1, f2);
this.theEffectRenderer.addEffect(entityfirework$overlayfx);
}
++this.fireworkAge;
if (this.fireworkAge > this.particleMaxAge)
{
if (this.twinkle)
{
boolean flag3 = this.isFarAway();
SoundEvent s = flag3 ? SoundEvent.TWINKLE_FAR : SoundEvent.TWINKLE;
((WorldClient)this.worldObj).playSound(this.posX, this.posY, this.posZ, s, 20.0F);
}
this.setDead();
}
}
private boolean isFarAway()
{
Client gm = Client.CLIENT;
return gm == null || gm.getRenderViewEntity() == null || gm.getRenderViewEntity().getDistanceSq(this.posX, this.posY, this.posZ) >= 256.0D;
}
private void createParticle(double p_92034_1_, double p_92034_3_, double p_92034_5_, double p_92034_7_, double p_92034_9_, double p_92034_11_, int[] p_92034_13_, int[] p_92034_14_, boolean p_92034_15_, boolean p_92034_16_)
{
EntityFirework.SparkFX entityfirework$sparkfx = new EntityFirework.SparkFX(this.worldObj, p_92034_1_, p_92034_3_, p_92034_5_, p_92034_7_, p_92034_9_, p_92034_11_, this.theEffectRenderer);
entityfirework$sparkfx.setAlphaF(0.99F);
entityfirework$sparkfx.setTrail(p_92034_15_);
entityfirework$sparkfx.setTwinkle(p_92034_16_);
int i = this.rand.zrange(p_92034_13_.length);
entityfirework$sparkfx.setColour(p_92034_13_[i]);
if (p_92034_14_ != null && p_92034_14_.length > 0)
{
entityfirework$sparkfx.setFadeColour(p_92034_14_[this.rand.zrange(p_92034_14_.length)]);
}
this.theEffectRenderer.addEffect(entityfirework$sparkfx);
}
private void createBall(double speed, int size, int[] colours, int[] fadeColours, boolean trail, boolean twinkleIn)
{
double d0 = this.posX;
double d1 = this.posY;
double d2 = this.posZ;
for (int i = -size; i <= size; ++i)
{
for (int j = -size; j <= size; ++j)
{
for (int k = -size; k <= size; ++k)
{
double d3 = (double)j + (this.rand.doublev() - this.rand.doublev()) * 0.5D;
double d4 = (double)i + (this.rand.doublev() - this.rand.doublev()) * 0.5D;
double d5 = (double)k + (this.rand.doublev() - this.rand.doublev()) * 0.5D;
double d6 = (double)ExtMath.sqrtd(d3 * d3 + d4 * d4 + d5 * d5) / speed + this.rand.gaussian() * 0.05D;
this.createParticle(d0, d1, d2, d3 / d6, d4 / d6, d5 / d6, colours, fadeColours, trail, twinkleIn);
if (i != -size && i != size && j != -size && j != size)
{
k += size * 2 - 1;
}
}
}
}
}
private void createShaped(double speed, double[][] shape, int[] colours, int[] fadeColours, boolean trail, boolean twinkleIn,
boolean p_92038_8_, int div)
{
double d0 = shape[0][0];
double d1 = shape[0][1];
this.createParticle(this.posX, this.posY, this.posZ, d0 * speed, d1 * speed, 0.0D, colours, fadeColours, trail, twinkleIn);
float f = this.rand.floatv() * (float)Math.PI;
double d2 = p_92038_8_ ? 0.034D : 0.34D;
double shift = 1.0 / (double)div;
for (int i = 0; i < 3; ++i)
{
double d3 = (double)f + (double)((float)i * (float)Math.PI) * d2;
double d4 = d0;
double d5 = d1;
for (int j = 1; j < shape.length; ++j)
{
double d6 = shape[j][0];
double d7 = shape[j][1];
for (double d8 = shift; d8 <= 1.0D; d8 += shift)
{
double d9 = (d4 + (d6 - d4) * d8) * speed;
double d10 = (d5 + (d7 - d5) * d8) * speed;
double d11 = d9 * Math.sin(d3);
d9 = d9 * Math.cos(d3);
for (double d12 = -1.0D; d12 <= 1.0D; d12 += 2.0D)
{
this.createParticle(this.posX, this.posY, this.posZ, d9 * d12, d10, d11 * d12, colours, fadeColours, trail, twinkleIn);
}
}
d4 = d6;
d5 = d7;
}
}
}
private void createBurst(int[] colours, int[] fadeColours, boolean trail, boolean twinkleIn)
{
double d0 = this.rand.gaussian() * 0.05D;
double d1 = this.rand.gaussian() * 0.05D;
for (int i = 0; i < 70; ++i)
{
double d2 = this.motionX * 0.5D + this.rand.gaussian() * 0.15D + d0;
double d3 = this.motionZ * 0.5D + this.rand.gaussian() * 0.15D + d1;
double d4 = this.motionY * 0.5D + this.rand.doublev() * 0.5D;
this.createParticle(this.posX, this.posY, this.posZ, d2, d4, d3, colours, fadeColours, trail, twinkleIn);
}
}
public int getFXLayer()
{
return 0;
}
}
}

View file

@ -5,7 +5,6 @@ import java.util.Set;
import client.Client;
import client.renderer.particle.EntityFX;
import client.renderer.particle.EntityFirework;
import common.biome.Biome;
import common.collect.Lists;
import common.collect.Sets;
@ -25,7 +24,6 @@ import common.model.ParticleType;
import common.rng.Random;
import common.sound.MovingSoundMinecart;
import common.sound.PositionedSound;
import common.tags.TagObject;
import common.tileentity.TileEntity;
import common.util.BlockPos;
import common.util.ChunkPos;
@ -381,11 +379,6 @@ public class WorldClient extends AWorldClient
this.gm.getSoundManager().playSound(positionedsoundrecord);
// }
}
public void makeFireworks(double x, double y, double z, double motionX, double motionY, double motionZ, TagObject compund)
{
this.gm.effectRenderer.addEffect(new EntityFirework.StarterFX(this.gm.world, x, y, z, motionX, motionY, motionZ, this.gm.effectRenderer, compund));
}
public ChunkClient getChunk(int x, int z)
{

View file

Before

Width:  |  Height:  |  Size: 239 B

After

Width:  |  Height:  |  Size: 239 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 B