temp remove ids, broken

This commit is contained in:
Sen 2025-06-20 00:13:42 +02:00
parent bc74b3a29d
commit 1713ca7f96
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
114 changed files with 589 additions and 1731 deletions

View file

@ -1497,8 +1497,6 @@ public class Client implements IThreadListener {
return;
}
int meta = 0;
boolean flag1 = false;
Item item = null;
if (this.pointed.type == HitPosition.ObjectType.BLOCK)
@ -1519,8 +1517,7 @@ public class Client implements IThreadListener {
}
Block block1 = item instanceof ItemBlock && !block.isPickStrict() ? item.getBlock() : block;
meta = block1.getDamageValue(this.world, blockpos);
flag1 = item.getHasSubtypes();
// meta = block1.getDamageValue(this.world, blockpos); TODO: data
}
else
{
@ -1535,9 +1532,9 @@ public class Client implements IThreadListener {
InventoryPlayer inventoryplayer = this.player.inventory;
inventoryplayer.setCurrentItem(item, meta, flag1);
inventoryplayer.setCurrentItem(item);
if(this.itemCheat) {
this.player.client.addToSendQueue(new CPacketCheat(new ItemStack(item, 1, meta), inventoryplayer.currentItem, this.ctrl()));
this.player.client.addToSendQueue(new CPacketCheat(new ItemStack(item), inventoryplayer.currentItem, this.ctrl()));
}
}
}
@ -1957,7 +1954,7 @@ public class Client implements IThreadListener {
(((EntityLiving)entity).deathTime != 0 ? "Tod: " + ((EntityLiving)entity).deathTime + "t, " : "") + "Rüstung: " + ((EntityLiving)entity).getTotalArmorValue() + ", Pfeile: " + ((EntityLiving)entity).getArrowCountInEntity()
: "Rüstung: n/a, Pfeile: n/a") + "\n" +
(held != null ?
"Gegens.: " + ItemRegistry.getNameFromItem(held.getItem()) + " x" + held.size + " (" + held.getMetadata() + ")" : "Gegens.: n/a") + "\n" +
"Gegens.: " + ItemRegistry.getNameFromItem(held.getItem()) + " x" + held.size : "Gegens.: n/a") + "\n" +
"Eigens.: " + (entity.dead ? "D" : "") + (entity.noClip ? "N" : "") + (entity.onGround ? "G" : "")
+ (entity.canBeCollidedWith() ? "C" : "") + (entity.canBePushed() ? "P" : "")
+ (entity.isBurning() ? "B" : "") + (entity.isPlayer() ? "S" : "")

View file

@ -150,7 +150,7 @@ public abstract class RenderRegistry {
map.put(EntityBoat.class, new RenderBoat(mgr));
map.put(EntityHook.class, new RenderFish(mgr));
map.put(EntityHorse.class, new RenderHorse(mgr, new ModelHorse()));
map.put(EntityDynamite.class, new RenderDynamite(mgr, Items.dynamite, ritem));
map.put(EntityDynamite.class, new RenderDynamite(mgr, ritem));
map.put(EntityNuke.class, new RenderBlockEntity(mgr, Blocks.nuke.getState()));
map.put(EntityMouse.class, new RenderMouse(mgr, new ModelMouse()));
map.put(EntityDie.class, new RenderDie(mgr));

View file

@ -517,7 +517,7 @@ public class ClientPlayer implements IClientPlayer
}
else
{
player.inventory.mainInventory[player.inventory.currentItem] = new ItemStack(ItemRegistry.getItemById(i), 1, 0);
player.inventory.mainInventory[player.inventory.currentItem] = new ItemStack(ItemRegistry.getItemById(i));
}
player.setPositionAndRotation(x, y, z, yaw, pitch);

View file

@ -32,19 +32,13 @@ public class ItemModelMesher
public TextureAtlasSprite getParticleIcon(Item item)
{
return this.getParticleIcon(item, 0);
}
public TextureAtlasSprite getParticleIcon(Item item, int meta)
{
return this.getItemModel(new ItemStack(item, 1, meta)).getBaseTexture();
return this.getItemModel(new ItemStack(item)).getBaseTexture();
}
public IBakedModel getItemModel(ItemStack stack)
{
Item item = stack.getItem();
IBakedModel ibakedmodel = this.simpleShapesCache.get(Integer.valueOf(this.getIndex(item,
stack.isItemStackDamageable() ? 0 : stack.getMetadata())));
IBakedModel ibakedmodel = this.simpleShapesCache.get(this.getIndex(item));
if (ibakedmodel == null)
{
@ -64,9 +58,9 @@ public class ItemModelMesher
return ibakedmodel;
}
private int getIndex(Item item, int meta)
private int getIndex(Item item)
{
return ItemRegistry.getIdFromItem(item) << 16 | meta;
return ItemRegistry.getIdFromItem(item);
}
// public void register(Item item, int meta, ResourceLocation location)
@ -122,9 +116,9 @@ public class ItemModelMesher
continue;
item.getRenderItems(item, stacks);
for(ItemStack stack : stacks) {
this.simpleShapesCache.put(this.getIndex(item, stack.getMetadata()),
this.simpleShapesCache.put(this.getIndex(item),
this.modelManager.getModel("item/" +
ItemRegistry.getNameFromItem(item).toString() + "#" + stack.getMetadata() + '#' + "inventory"));
ItemRegistry.getNameFromItem(item).toString() + '#' + "inventory"));
}
stacks.clear();
}

View file

@ -144,8 +144,8 @@ public abstract class ModelBakery
// {
item.getRenderItems(item, stacks);
for(ItemStack stack : stacks) {
String resourcelocation = "item/" + ItemRegistry.getNameFromItem(item).toString() + "#" + stack.getMetadata() + '#' + "inventory";
models.put(resourcelocation, (ModelBlock)item.getModel(ModelBlock.PROVIDER, ItemRegistry.getNameFromItem(item).toString(), stack.getMetadata()));
String resourcelocation = "item/" + ItemRegistry.getNameFromItem(item).toString() + '#' + "inventory";
models.put(resourcelocation, (ModelBlock)item.getModel(ModelBlock.PROVIDER, ItemRegistry.getNameFromItem(item).toString()));
itemLocations.add(resourcelocation);
}
stacks.clear();

View file

@ -1,16 +1,16 @@
package client.renderer.entity;
import common.entity.projectile.EntityDynamite;
import common.item.Item;
import common.init.ItemRegistry;
import common.item.ItemStack;
public class RenderDynamite extends RenderItemEntity<EntityDynamite> {
public RenderDynamite(RenderManager renderManagerIn, Item itemIn, RenderItem renderItemIn) {
super(renderManagerIn, itemIn, renderItemIn);
public RenderDynamite(RenderManager renderManagerIn, RenderItem renderItemIn) {
super(renderManagerIn, null, renderItemIn);
}
public ItemStack getStack(EntityDynamite entityIn)
{
return new ItemStack(this.item, 1, entityIn.explosionSize);
return new ItemStack(ItemRegistry.getRegisteredItem("dynamite" + (entityIn.explosionSize <= 0 || entityIn.explosionSize >= 8 ? "" : "_" + entityIn.explosionSize)));
}
}

View file

@ -39,7 +39,7 @@ public class RenderItemEntity<T extends Entity> extends Render<T>
public ItemStack getStack(T entityIn)
{
return new ItemStack(this.item, 1, 0);
return new ItemStack(this.item);
}
protected String getEntityTexture(Entity entity)

View file

@ -10,14 +10,9 @@ import common.world.World;
public class EntityBreakingFX extends EntityFX
{
protected EntityBreakingFX(World worldIn, double posXIn, double posYIn, double posZIn, Item p_i1195_8_)
protected EntityBreakingFX(World worldIn, double posXIn, double posYIn, double posZIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, Item p_i1197_14_)
{
this(worldIn, posXIn, posYIn, posZIn, p_i1195_8_, 0);
}
protected EntityBreakingFX(World worldIn, double posXIn, double posYIn, double posZIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, Item p_i1197_14_, int p_i1197_15_)
{
this(worldIn, posXIn, posYIn, posZIn, p_i1197_14_, p_i1197_15_);
this(worldIn, posXIn, posYIn, posZIn, p_i1197_14_);
this.motionX *= 0.10000000149011612D;
this.motionY *= 0.10000000149011612D;
this.motionZ *= 0.10000000149011612D;
@ -26,10 +21,10 @@ public class EntityBreakingFX extends EntityFX
this.motionZ += zSpeedIn;
}
protected EntityBreakingFX(World worldIn, double posXIn, double posYIn, double posZIn, Item p_i1196_8_, int p_i1196_9_)
protected EntityBreakingFX(World worldIn, double posXIn, double posYIn, double posZIn, Item p_i1196_8_)
{
super(worldIn, posXIn, posYIn, posZIn, 0.0D, 0.0D, 0.0D);
this.setParticleIcon(Client.CLIENT.getRenderItem().getItemModelMesher().getParticleIcon(p_i1196_8_, p_i1196_9_));
this.setParticleIcon(Client.CLIENT.getRenderItem().getItemModelMesher().getParticleIcon(p_i1196_8_));
this.particleRed = this.particleGreen = this.particleBlue = 1.0F;
this.particleGravity = 1.0F; // Blocks.snow.particleGravity;
this.particleScale /= 2.0F;
@ -75,8 +70,7 @@ public class EntityBreakingFX extends EntityFX
{
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
int i = p_178902_15_.length > 1 ? p_178902_15_[1] : 0;
return new EntityBreakingFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, ItemRegistry.getItemById(p_178902_15_[0]), i);
return new EntityBreakingFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, ItemRegistry.getItemById(p_178902_15_[0]));
}
}

View file

@ -189,8 +189,7 @@ public class PlayerController {
if(this.stack != null && stack != null) {
flag = stack.getItem() == this.stack.getItem()
&& ItemStack.areItemStackTagsEqual(stack, this.stack)
&& (stack.isItemStackDamageable() || stack.getMetadata() == this.stack.getMetadata());
&& ItemStack.areItemStackTagsEqual(stack, this.stack);
}
return pos.equals(this.position) && flag;

View file

@ -653,7 +653,7 @@ public class WorldClient extends AWorldClient
for (int i1 = 0; i1 < 8; ++i1)
{
this.spawnEntityFX(ParticleType.ITEM_CRACK, ParticleType.ITEM_CRACK.getShouldIgnoreRange(), d13, d14, d16, this.rand.gaussian() * 0.15D, this.rand.doublev() * 0.2D, this.rand.gaussian() * 0.15D, new int[] {ItemRegistry.getIdFromItem(Items.potion), data});
this.spawnEntityFX(ParticleType.ITEM_CRACK, ParticleType.ITEM_CRACK.getShouldIgnoreRange(), d13, d14, d16, this.rand.gaussian() * 0.15D, this.rand.doublev() * 0.2D, this.rand.gaussian() * 0.15D, new int[] {ItemRegistry.getIdFromItem(Items.potion)});
}
ParticleType enumparticletypes = ParticleType.WATER_SPLASH;