Add CNPC+ Api

This commit is contained in:
KAMKEEL committed 2022-11-25 00:57:24 -05:00
1 parent 0c4db676e4
commit 95e2f9df01
109 files changed
+7308

No files matched your search

@@ -0,0 +1,19 @@
package net.minecraft.block.properties;
import java.util.Collection;
/** This code is owned by Minecraft */
public interface IProperty<T extends Comparable<T>>
{
String getName();
Collection<T> getAllowedValues();
Class<T> getValueClass();
/**
* Get the name for the given value.
*/
String getName(T value);
}
@@ -0,0 +1,23 @@
package net.minecraft.block.state;
import com.google.common.collect.ImmutableMap;
import java.util.Collection;
import net.minecraft.block.Block;
import net.minecraft.block.properties.IProperty;
/** This code is owned by Minecraft */
public interface IBlockState
{
Collection<IProperty> getPropertyNames();
<T extends Comparable<T>> T getValue(IProperty<T> property);
<T extends Comparable<T>, V extends T> IBlockState withProperty(IProperty<T> property, V value);
<T extends Comparable<T>> IBlockState cycleProperty(IProperty<T> property);
ImmutableMap<IProperty, Comparable> getProperties();
Block getBlock();
}
+123
View File
@@ -0,0 +1,123 @@
package net.minecraft.util;
import com.google.common.base.Objects;
/** This code is owned by Minecraft */
public class Vec3i implements Comparable<Vec3i>
{
/** The Null vector constant (0, 0, 0) */
public static final Vec3i NULL_VECTOR = new Vec3i(0, 0, 0);
/** X coordinate */
private final int x;
/** Y coordinate */
private final int y;
/** Z coordinate */
private final int z;
public Vec3i(int xIn, int yIn, int zIn)
{
this.x = xIn;
this.y = yIn;
this.z = zIn;
}
public Vec3i(double xIn, double yIn, double zIn)
{
this(MathHelper.floor_double(xIn), MathHelper.floor_double(yIn), MathHelper.floor_double(zIn));
}
public boolean equals(Object p_equals_1_)
{
if (this == p_equals_1_)
{
return true;
}
else if (!(p_equals_1_ instanceof Vec3i))
{
return false;
}
else
{
Vec3i vec3i = (Vec3i)p_equals_1_;
return this.getX() != vec3i.getX() ? false : (this.getY() != vec3i.getY() ? false : this.getZ() == vec3i.getZ());
}
}
public int hashCode()
{
return (this.getY() + this.getZ() * 31) * 31 + this.getX();
}
public int compareTo(Vec3i p_compareTo_1_)
{
return this.getY() == p_compareTo_1_.getY() ? (this.getZ() == p_compareTo_1_.getZ() ? this.getX() - p_compareTo_1_.getX() : this.getZ() - p_compareTo_1_.getZ()) : this.getY() - p_compareTo_1_.getY();
}
/**
* Get the X coordinate
*/
public int getX()
{
return this.x;
}
/**
* Get the Y coordinate
*/
public int getY()
{
return this.y;
}
/**
* Get the Z coordinate
*/
public int getZ()
{
return this.z;
}
/**
* Calculate the cross product of this and the given Vector
*/
public Vec3i crossProduct(Vec3i vec)
{
return new Vec3i(this.getY() * vec.getZ() - this.getZ() * vec.getY(), this.getZ() * vec.getX() - this.getX() * vec.getZ(), this.getX() * vec.getY() - this.getY() * vec.getX());
}
/**
* Calculate squared distance to the given coordinates
*/
public double distanceSq(double toX, double toY, double toZ)
{
double d0 = (double)this.getX() - toX;
double d1 = (double)this.getY() - toY;
double d2 = (double)this.getZ() - toZ;
return d0 * d0 + d1 * d1 + d2 * d2;
}
/**
* Compute square of distance from point x, y, z to center of this Block
*/
public double distanceSqToCenter(double xIn, double yIn, double zIn)
{
double d0 = (double)this.getX() + 0.5D - xIn;
double d1 = (double)this.getY() + 0.5D - yIn;
double d2 = (double)this.getZ() + 0.5D - zIn;
return d0 * d0 + d1 * d1 + d2 * d2;
}
/**
* Calculate squared distance to the given Vector
*/
public double distanceSq(Vec3i to)
{
return this.distanceSq((double)to.getX(), (double)to.getY(), (double)to.getZ());
}
public String toString()
{
return Objects.toStringHelper(this).add("x", this.getX()).add("y", this.getY()).add("z", this.getZ()).toString();
}
}
+557
View File
@@ -0,0 +1,557 @@
package net.minecraft.util.math;
import java.util.Iterator;
import java.util.List;
import javax.annotation.concurrent.Immutable;
import net.minecraft.util.Vec3i;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import com.google.common.collect.AbstractIterator;
import com.google.common.collect.Lists;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.Entity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.MathHelper;
/**
* Pasted in from 1.9, with the Vec3d constructor removed
*/
@Immutable
public class BlockPos extends Vec3i
{
private static final Logger LOGGER = LogManager.getLogger();
/** The BlockPos with all coordinates 0 */
public static final BlockPos ORIGIN = new BlockPos(0, 0, 0);
private static final int NUM_X_BITS = 26; //1 + MathHelper.calculateLogBaseTwo(MathHelper.roundUpToPowerOfTwo(30000000)); //Manually calculated because of crash
private static final int NUM_Z_BITS = NUM_X_BITS;
private static final int NUM_Y_BITS = 64 - NUM_X_BITS - NUM_Z_BITS;
private static final int Y_SHIFT = 0 + NUM_Z_BITS;
private static final int X_SHIFT = Y_SHIFT + NUM_Y_BITS;
private static final long X_MASK = (1L << NUM_X_BITS) - 1L;
private static final long Y_MASK = (1L << NUM_Y_BITS) - 1L;
private static final long Z_MASK = (1L << NUM_Z_BITS) - 1L;
public BlockPos(int x, int y, int z)
{
super(x, y, z);
}
public BlockPos(double x, double y, double z)
{
super(x, y, z);
}
public BlockPos(Entity source)
{
this(source.posX, source.posY, source.posZ);
}
public BlockPos(Vec3i source)
{
this(source.getX(), source.getY(), source.getZ());
}
/**
* Add the given coordinates to the coordinates of this BlockPos
*/
public BlockPos add(double x, double y, double z)
{
return x == 0.0D && y == 0.0D && z == 0.0D ? this : new BlockPos((double)this.getX() + x, (double)this.getY() + y, (double)this.getZ() + z);
}
/**
* Add the given coordinates to the coordinates of this BlockPos
*/
public BlockPos add(int x, int y, int z)
{
return x == 0 && y == 0 && z == 0 ? this : new BlockPos(this.getX() + x, this.getY() + y, this.getZ() + z);
}
/**
* Add the given Vector to this BlockPos
*/
public BlockPos add(Vec3i vec)
{
return vec.getX() == 0 && vec.getY() == 0 && vec.getZ() == 0 ? this : new BlockPos(this.getX() + vec.getX(), this.getY() + vec.getY(), this.getZ() + vec.getZ());
}
/**
* Subtract the given Vector from this BlockPos
*/
public BlockPos subtract(Vec3i vec)
{
return vec.getX() == 0 && vec.getY() == 0 && vec.getZ() == 0 ? this : new BlockPos(this.getX() - vec.getX(), this.getY() - vec.getY(), this.getZ() - vec.getZ());
}
/**
* Offset this BlockPos 1 block up
*/
public BlockPos up()
{
return this.up(1);
}
/**
* Offset this BlockPos n blocks up
*/
public BlockPos up(int n)
{
return this.offset(EnumFacing.UP, n);
}
/**
* Offset this BlockPos 1 block down
*/
public BlockPos down()
{
return this.down(1);
}
/**
* Offset this BlockPos n blocks down
*/
public BlockPos down(int n)
{
return this.offset(EnumFacing.DOWN, n);
}
/**
* Offset this BlockPos 1 block in northern direction
*/
public BlockPos north()
{
return this.north(1);
}
/**
* Offset this BlockPos n blocks in northern direction
*/
public BlockPos north(int n)
{
return this.offset(EnumFacing.NORTH, n);
}
/**
* Offset this BlockPos 1 block in southern direction
*/
public BlockPos south()
{
return this.south(1);
}
/**
* Offset this BlockPos n blocks in southern direction
*/
public BlockPos south(int n)
{
return this.offset(EnumFacing.SOUTH, n);
}
/**
* Offset this BlockPos 1 block in western direction
*/
public BlockPos west()
{
return this.west(1);
}
/**
* Offset this BlockPos n blocks in western direction
*/
public BlockPos west(int n)
{
return this.offset(EnumFacing.WEST, n);
}
/**
* Offset this BlockPos 1 block in eastern direction
*/
public BlockPos east()
{
return this.east(1);
}
/**
* Offset this BlockPos n blocks in eastern direction
*/
public BlockPos east(int n)
{
return this.offset(EnumFacing.EAST, n);
}
/**
* Offset this BlockPos 1 block in the given direction
*/
public BlockPos offset(EnumFacing facing)
{
return this.offset(facing, 1);
}
/**
* Offsets this BlockPos n blocks in the given direction
*/
public BlockPos offset(EnumFacing facing, int n)
{
return n == 0 ? this : new BlockPos(this.getX() + facing.getFrontOffsetX() * n, this.getY() + facing.getFrontOffsetY() * n, this.getZ() + facing.getFrontOffsetZ() * n);
}
/**
* Calculate the cross product of this and the given Vector
*/
public BlockPos crossProduct(Vec3i vec)
{
return new BlockPos(this.getY() * vec.getZ() - this.getZ() * vec.getY(), this.getZ() * vec.getX() - this.getX() * vec.getZ(), this.getX() * vec.getY() - this.getY() * vec.getX());
}
/**
* Serialize this BlockPos into a long value
*/
public long toLong()
{
return ((long)this.getX() & X_MASK) << X_SHIFT | ((long)this.getY() & Y_MASK) << Y_SHIFT | ((long)this.getZ() & Z_MASK) << 0;
}
/**
* Create a BlockPos from a serialized long value (created by toLong)
*/
public static BlockPos fromLong(long serialized)
{
int i = (int)(serialized << 64 - X_SHIFT - NUM_X_BITS >> 64 - NUM_X_BITS);
int j = (int)(serialized << 64 - Y_SHIFT - NUM_Y_BITS >> 64 - NUM_Y_BITS);
int k = (int)(serialized << 64 - NUM_Z_BITS >> 64 - NUM_Z_BITS);
return new BlockPos(i, j, k);
}
/**
* Create an Iterable that returns all positions in the box specified by the given corners
*/
public static Iterable<BlockPos> getAllInBox(BlockPos from, BlockPos to)
{
final BlockPos blockpos = new BlockPos(Math.min(from.getX(), to.getX()), Math.min(from.getY(), to.getY()), Math.min(from.getZ(), to.getZ()));
final BlockPos blockpos1 = new BlockPos(Math.max(from.getX(), to.getX()), Math.max(from.getY(), to.getY()), Math.max(from.getZ(), to.getZ()));
return new Iterable<BlockPos>()
{
public Iterator<BlockPos> iterator()
{
return new AbstractIterator<BlockPos>()
{
private BlockPos lastReturned = null;
protected BlockPos computeNext()
{
if (this.lastReturned == null)
{
this.lastReturned = blockpos;
return this.lastReturned;
}
else if (this.lastReturned.equals(blockpos1))
{
return (BlockPos)this.endOfData();
}
else
{
int i = this.lastReturned.getX();
int j = this.lastReturned.getY();
int k = this.lastReturned.getZ();
if (i < blockpos1.getX())
{
++i;
}
else if (j < blockpos1.getY())
{
i = blockpos.getX();
++j;
}
else if (k < blockpos1.getZ())
{
i = blockpos.getX();
j = blockpos.getY();
++k;
}
this.lastReturned = new BlockPos(i, j, k);
return this.lastReturned;
}
}
};
}
};
}
/**
* Returns a version of this BlockPos that is guaranteed to be immutable.
*
* <p>When storing a BlockPos given to you for an extended period of time, make sure you
* use this in case the value is changed internally.</p>
*/
public BlockPos toImmutable()
{
return this;
}
/**
* Like getAllInBox but reuses a single MutableBlockPos instead. If this method is used, the resulting BlockPos
* instances can only be used inside the iteration loop.
*/
public static Iterable<BlockPos.MutableBlockPos> getAllInBoxMutable(BlockPos from, BlockPos to)
{
final BlockPos blockpos = new BlockPos(Math.min(from.getX(), to.getX()), Math.min(from.getY(), to.getY()), Math.min(from.getZ(), to.getZ()));
final BlockPos blockpos1 = new BlockPos(Math.max(from.getX(), to.getX()), Math.max(from.getY(), to.getY()), Math.max(from.getZ(), to.getZ()));
return new Iterable<BlockPos.MutableBlockPos>()
{
public Iterator<BlockPos.MutableBlockPos> iterator()
{
return new AbstractIterator<BlockPos.MutableBlockPos>()
{
private BlockPos.MutableBlockPos theBlockPos = null;
protected BlockPos.MutableBlockPos computeNext()
{
if (this.theBlockPos == null)
{
this.theBlockPos = new BlockPos.MutableBlockPos(blockpos.getX(), blockpos.getY(), blockpos.getZ());
return this.theBlockPos;
}
else if (this.theBlockPos.equals(blockpos1))
{
return (BlockPos.MutableBlockPos)this.endOfData();
}
else
{
int i = this.theBlockPos.getX();
int j = this.theBlockPos.getY();
int k = this.theBlockPos.getZ();
if (i < blockpos1.getX())
{
++i;
}
else if (j < blockpos1.getY())
{
i = blockpos.getX();
++j;
}
else if (k < blockpos1.getZ())
{
i = blockpos.getX();
j = blockpos.getY();
++k;
}
this.theBlockPos.x = i;
this.theBlockPos.y = j;
this.theBlockPos.z = k;
return this.theBlockPos;
}
}
};
}
};
}
public static class MutableBlockPos extends BlockPos
{
/** Mutable X Coordinate */
protected int x;
/** Mutable Y Coordinate */
protected int y;
/** Mutable Z Coordinate */
protected int z;
public MutableBlockPos()
{
this(0, 0, 0);
}
public MutableBlockPos(BlockPos pos)
{
this(pos.getX(), pos.getY(), pos.getZ());
}
public MutableBlockPos(int x_, int y_, int z_)
{
super(0, 0, 0);
this.x = x_;
this.y = y_;
this.z = z_;
}
/**
* Gets the X coordinate.
*/
public int getX()
{
return this.x;
}
/**
* Gets the Y coordinate.
*/
public int getY()
{
return this.y;
}
/**
* Gets the Z coordinate.
*/
public int getZ()
{
return this.z;
}
/**
* Sets the position, MUST not be name 'set' as that causes obfusication conflicts with func_185343_d
*/
public BlockPos.MutableBlockPos setPos(int xIn, int yIn, int zIn)
{
this.x = xIn;
this.y = yIn;
this.z = zIn;
return this;
}
public BlockPos.MutableBlockPos setPos(double p_189532_1_, double p_189532_3_, double p_189532_5_)
{
return this.setPos(MathHelper.floor_double(p_189532_1_), MathHelper.floor_double(p_189532_3_), MathHelper.floor_double(p_189532_5_));
}
@SideOnly(Side.CLIENT)
public BlockPos.MutableBlockPos setPos(Entity p_189535_1_)
{
return this.setPos(p_189535_1_.posX, p_189535_1_.posY, p_189535_1_.posZ);
}
public BlockPos.MutableBlockPos setPos(Vec3i p_189533_1_)
{
return this.setPos(p_189533_1_.getX(), p_189533_1_.getY(), p_189533_1_.getZ());
}
public BlockPos.MutableBlockPos move(EnumFacing p_189536_1_)
{
return this.move(p_189536_1_, 1);
}
public BlockPos.MutableBlockPos move(EnumFacing p_189534_1_, int p_189534_2_)
{
return this.setPos(this.x + p_189534_1_.getFrontOffsetX() * p_189534_2_, this.y + p_189534_1_.getFrontOffsetY() * p_189534_2_, this.z + p_189534_1_.getFrontOffsetZ() * p_189534_2_);
}
public void setY(int yIn)
{
this.y = yIn;
}
/**
* Returns a version of this BlockPos that is guaranteed to be immutable.
*
* <p>When storing a BlockPos given to you for an extended period of time, make sure you
* use this in case the value is changed internally.</p>
*/
public BlockPos toImmutable()
{
return new BlockPos(this);
}
}
public static final class PooledMutableBlockPos extends BlockPos.MutableBlockPos
{
private boolean released;
private static final List<BlockPos.PooledMutableBlockPos> POOL = Lists.<BlockPos.PooledMutableBlockPos>newArrayList();
private PooledMutableBlockPos(int xIn, int yIn, int zIn)
{
super(xIn, yIn, zIn);
}
public static BlockPos.PooledMutableBlockPos retain()
{
return retain(0, 0, 0);
}
public static BlockPos.PooledMutableBlockPos retain(double xIn, double yIn, double zIn)
{
return retain(MathHelper.floor_double(xIn), MathHelper.floor_double(yIn), MathHelper.floor_double(zIn));
}
@SideOnly(Side.CLIENT)
public static BlockPos.PooledMutableBlockPos retain(Vec3i vec)
{
return retain(vec.getX(), vec.getY(), vec.getZ());
}
public static BlockPos.PooledMutableBlockPos retain(int xIn, int yIn, int zIn)
{
synchronized (POOL)
{
if (!POOL.isEmpty())
{
BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = (BlockPos.PooledMutableBlockPos)POOL.remove(POOL.size() - 1);
if (blockpos$pooledmutableblockpos != null && blockpos$pooledmutableblockpos.released)
{
blockpos$pooledmutableblockpos.released = false;
blockpos$pooledmutableblockpos.set(xIn, yIn, zIn);
return blockpos$pooledmutableblockpos;
}
}
}
return new BlockPos.PooledMutableBlockPos(xIn, yIn, zIn);
}
public void release()
{
synchronized (POOL)
{
if (POOL.size() < 100)
{
POOL.add(this);
}
this.released = true;
}
}
public BlockPos.PooledMutableBlockPos set(int xIn, int yIn, int zIn)
{
if (this.released)
{
BlockPos.LOGGER.error("PooledMutableBlockPosition modified after it was released.", new Throwable());
this.released = false;
}
return (BlockPos.PooledMutableBlockPos)super.setPos(xIn, yIn, zIn);
}
@SideOnly(Side.CLIENT)
public BlockPos.PooledMutableBlockPos set(Entity p_189537_1_)
{
return (BlockPos.PooledMutableBlockPos)super.setPos(p_189537_1_);
}
public BlockPos.PooledMutableBlockPos set(double xIn, double yIn, double zIn)
{
return (BlockPos.PooledMutableBlockPos)super.setPos(xIn, yIn, zIn);
}
public BlockPos.PooledMutableBlockPos set(Vec3i vec)
{
return (BlockPos.PooledMutableBlockPos)super.setPos(vec);
}
public BlockPos.PooledMutableBlockPos offsetMutable(EnumFacing facing)
{
return (BlockPos.PooledMutableBlockPos)super.move(facing);
}
public BlockPos.PooledMutableBlockPos movePos(EnumFacing p_189538_1_, int p_189538_2_)
{
return (BlockPos.PooledMutableBlockPos)super.move(p_189538_1_, p_189538_2_);
}
}
}
@@ -0,0 +1,255 @@
package net.minecraft.util.math;
public class IntHashMap<V> {
private transient IntHashMap.Entry<V>[] slots = new IntHashMap.Entry[16];
/**
* The number of items stored in this map
*/
private transient int count;
/**
* The grow threshold
*/
private int threshold = 12;
/**
* The scale factor used to determine when to grow the table
*/
private final float growFactor = 0.75F;
/**
* Makes the passed in integer suitable for hashing by a number of shifts
*/
private static int computeHash(int integer) {
integer = integer ^ integer >>> 20 ^ integer >>> 12;
return integer ^ integer >>> 7 ^ integer >>> 4;
}
/**
* Computes the index of the slot for the hash and slot count passed in.
*/
private static int getSlotIndex(int hash, int slotCount) {
return hash & slotCount - 1;
}
/**
* Returns the object associated to a key
*/
public V lookup(int p_76041_1_) {
int i = computeHash(p_76041_1_);
for (IntHashMap.Entry<V> entry = this.slots[getSlotIndex(i, this.slots.length)]; entry != null; entry = entry.nextEntry) {
if (entry.hashEntry == p_76041_1_) {
return entry.valueEntry;
}
}
return (V) null;
}
/**
* Returns true if this hash table contains the specified item.
*/
public boolean containsItem(int p_76037_1_) {
return this.lookupEntry(p_76037_1_) != null;
}
final IntHashMap.Entry<V> lookupEntry(int p_76045_1_) {
int i = computeHash(p_76045_1_);
for (IntHashMap.Entry<V> entry = this.slots[getSlotIndex(i, this.slots.length)]; entry != null; entry = entry.nextEntry) {
if (entry.hashEntry == p_76045_1_) {
return entry;
}
}
return null;
}
/**
* Adds a key and associated value to this map
*/
public void addKey(int p_76038_1_, V p_76038_2_) {
int i = computeHash(p_76038_1_);
int j = getSlotIndex(i, this.slots.length);
for (IntHashMap.Entry<V> entry = this.slots[j]; entry != null; entry = entry.nextEntry) {
if (entry.hashEntry == p_76038_1_) {
entry.valueEntry = p_76038_2_;
return;
}
}
this.insert(i, p_76038_1_, p_76038_2_, j);
}
/**
* Increases the number of hash slots
*/
private void grow(int p_76047_1_) {
IntHashMap.Entry<V>[] entry = this.slots;
int i = entry.length;
if (i == 1073741824) {
this.threshold = Integer.MAX_VALUE;
} else {
IntHashMap.Entry<V>[] entry1 = new IntHashMap.Entry[p_76047_1_];
this.copyTo(entry1);
this.slots = entry1;
this.threshold = (int) ((float) p_76047_1_ * this.growFactor);
}
}
/**
* Copies the hash slots to a new array
*/
private void copyTo(IntHashMap.Entry<V>[] p_76048_1_) {
IntHashMap.Entry<V>[] entry = this.slots;
int i = p_76048_1_.length;
for (int j = 0; j < entry.length; ++j) {
IntHashMap.Entry<V> entry1 = entry[j];
if (entry1 != null) {
entry[j] = null;
while (true) {
IntHashMap.Entry<V> entry2 = entry1.nextEntry;
int k = getSlotIndex(entry1.slotHash, i);
entry1.nextEntry = p_76048_1_[k];
p_76048_1_[k] = entry1;
entry1 = entry2;
if (entry2 == null) {
break;
}
}
}
}
}
/**
* Removes the specified object from the map and returns it
*/
public V removeObject(int p_76049_1_) {
IntHashMap.Entry<V> entry = this.removeEntry(p_76049_1_);
return (V) (entry == null ? null : entry.valueEntry);
}
final IntHashMap.Entry<V> removeEntry(int p_76036_1_) {
int i = computeHash(p_76036_1_);
int j = getSlotIndex(i, this.slots.length);
IntHashMap.Entry<V> entry = this.slots[j];
IntHashMap.Entry<V> entry1;
IntHashMap.Entry<V> entry2;
for (entry1 = entry; entry1 != null; entry1 = entry2) {
entry2 = entry1.nextEntry;
if (entry1.hashEntry == p_76036_1_) {
--this.count;
if (entry == entry1) {
this.slots[j] = entry2;
} else {
entry.nextEntry = entry2;
}
return entry1;
}
entry = entry1;
}
return entry1;
}
/**
* Removes all entries from the map
*/
public void clearMap() {
IntHashMap.Entry<V>[] entry = this.slots;
for (int i = 0; i < entry.length; ++i) {
entry[i] = null;
}
this.count = 0;
}
/**
* Adds an object to a slot
*/
private void insert(int p_76040_1_, int p_76040_2_, V p_76040_3_, int p_76040_4_) {
IntHashMap.Entry<V> entry = this.slots[p_76040_4_];
this.slots[p_76040_4_] = new IntHashMap.Entry(p_76040_1_, p_76040_2_, p_76040_3_, entry);
if (this.count++ >= this.threshold) {
this.grow(2 * this.slots.length);
}
}
static class Entry<V> {
/**
* The hash code of this entry
*/
final int hashEntry;
/**
* The object stored in this entry
*/
V valueEntry;
IntHashMap.Entry<V> nextEntry;
/**
* The id of the hash slot computed from the hash
*/
final int slotHash;
Entry(int p_i1552_1_, int p_i1552_2_, V p_i1552_3_, IntHashMap.Entry<V> p_i1552_4_) {
this.valueEntry = p_i1552_3_;
this.nextEntry = p_i1552_4_;
this.hashEntry = p_i1552_2_;
this.slotHash = p_i1552_1_;
}
/**
* Returns the hash code for this entry
*/
public final int getHash() {
return this.hashEntry;
}
/**
* Returns the object stored in this entry
*/
public final V getValue() {
return this.valueEntry;
}
public final boolean equals(Object p_equals_1_) {
if (!(p_equals_1_ instanceof IntHashMap.Entry)) {
return false;
} else {
IntHashMap.Entry<V> entry = (IntHashMap.Entry) p_equals_1_;
Object object = Integer.valueOf(this.getHash());
Object object1 = Integer.valueOf(entry.getHash());
if (object == object1 || object != null && object.equals(object1)) {
Object object2 = this.getValue();
Object object3 = entry.getValue();
if (object2 == object3 || object2 != null && object2.equals(object3)) {
return true;
}
}
return false;
}
}
public final int hashCode() {
return IntHashMap.computeHash(this.hashEntry);
}
public final String toString() {
return this.getHash() + "=" + this.getValue();
}
}
}