diff --git a/patches/net/minecraft/block/BlockConcretePowder.java.patch b/patches/net/minecraft/block/BlockConcretePowder.java.patch index c4715df0..5fc0688e 100644 --- a/patches/net/minecraft/block/BlockConcretePowder.java.patch +++ b/patches/net/minecraft/block/BlockConcretePowder.java.patch @@ -5,7 +5,7 @@ BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(p_196441_1_); - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { IBlockState iblockstate = p_196441_0_.getBlockState(blockpos$mutableblockpos); diff --git a/patches/net/minecraft/block/BlockCoral.java.patch b/patches/net/minecraft/block/BlockCoral.java.patch index a276c5d4..88a58bf5 100644 --- a/patches/net/minecraft/block/BlockCoral.java.patch +++ b/patches/net/minecraft/block/BlockCoral.java.patch @@ -5,7 +5,7 @@ protected boolean canLive(IBlockReader p_203943_1_, BlockPos p_203943_2_) { - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { IFluidState ifluidstate = p_203943_1_.getFluidState(p_203943_2_.offset(enumfacing)); diff --git a/patches/net/minecraft/block/BlockCoralPlantBase.java.patch b/patches/net/minecraft/block/BlockCoralPlantBase.java.patch index 93d853b2..ce2ccdca 100644 --- a/patches/net/minecraft/block/BlockCoralPlantBase.java.patch +++ b/patches/net/minecraft/block/BlockCoralPlantBase.java.patch @@ -5,7 +5,7 @@ else { - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { if (worldIn.getFluidState(pos.offset(enumfacing)).isTagged(FluidTags.WATER)) { diff --git a/patches/net/minecraft/block/BlockFire.java.patch b/patches/net/minecraft/block/BlockFire.java.patch index 8187501b..1532a653 100644 --- a/patches/net/minecraft/block/BlockFire.java.patch +++ b/patches/net/minecraft/block/BlockFire.java.patch @@ -5,7 +5,7 @@ IBlockState iblockstate1 = this.getDefaultState(); - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { BooleanProperty booleanproperty = FACING_TO_PROPERTY_MAP.get(enumfacing); @@ -14,7 +14,7 @@ private boolean areNeighborsFlammable(IBlockReader worldIn, BlockPos pos) { - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { if (this.canBurn(worldIn.getBlockState(pos.offset(enumfacing)))) { @@ -23,7 +23,7 @@ int i = 0; - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { i = Math.max(this.getEncouragement(worldIn.getBlockState(pos.offset(enumfacing)).getBlock()), i); } diff --git a/patches/net/minecraft/block/BlockFlowingFluid.java.patch b/patches/net/minecraft/block/BlockFlowingFluid.java.patch index a30d2eaf..8fc39cd2 100644 --- a/patches/net/minecraft/block/BlockFlowingFluid.java.patch +++ b/patches/net/minecraft/block/BlockFlowingFluid.java.patch @@ -5,7 +5,7 @@ boolean flag = false; - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { if (enumfacing != EnumFacing.DOWN && worldIn.getFluidState(pos.offset(enumfacing)).isTagged(FluidTags.WATER)) { diff --git a/patches/net/minecraft/block/BlockFrostedIce.java.patch b/patches/net/minecraft/block/BlockFrostedIce.java.patch index 1e6d0f0f..1651c1d3 100644 --- a/patches/net/minecraft/block/BlockFrostedIce.java.patch +++ b/patches/net/minecraft/block/BlockFrostedIce.java.patch @@ -5,7 +5,7 @@ try (BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.retain()) { - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { blockpos$pooledmutableblockpos.setPos(pos).move(enumfacing); IBlockState iblockstate = worldIn.getBlockState(blockpos$pooledmutableblockpos); @@ -14,7 +14,7 @@ try (BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.retain()) { - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { blockpos$pooledmutableblockpos.setPos(pos).move(enumfacing); diff --git a/patches/net/minecraft/block/BlockLeaves.java.patch b/patches/net/minecraft/block/BlockLeaves.java.patch index 1d26c825..1ec3ba9b 100644 --- a/patches/net/minecraft/block/BlockLeaves.java.patch +++ b/patches/net/minecraft/block/BlockLeaves.java.patch @@ -17,7 +17,7 @@ try (BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.retain()) { - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { blockpos$pooledmutableblockpos.setPos(p_208493_2_).move(enumfacing); i = Math.min(i, getDistance(p_208493_1_.getBlockState(blockpos$pooledmutableblockpos)) + 1); diff --git a/patches/net/minecraft/block/BlockRedstoneDiode.java.patch b/patches/net/minecraft/block/BlockRedstoneDiode.java.patch index c262d56c..314895e6 100644 --- a/patches/net/minecraft/block/BlockRedstoneDiode.java.patch +++ b/patches/net/minecraft/block/BlockRedstoneDiode.java.patch @@ -57,7 +57,7 @@ worldIn.removeBlock(pos); - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { worldIn.notifyNeighborsOfStateChange(pos.offset(enumfacing), this); } diff --git a/patches/net/minecraft/block/BlockRedstoneOre.java.patch b/patches/net/minecraft/block/BlockRedstoneOre.java.patch index 84e51923..c263c208 100644 --- a/patches/net/minecraft/block/BlockRedstoneOre.java.patch +++ b/patches/net/minecraft/block/BlockRedstoneOre.java.patch @@ -5,7 +5,7 @@ Random random = p_180691_0_.rand; - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { BlockPos blockpos = worldIn.offset(enumfacing); diff --git a/patches/net/minecraft/block/BlockRedstoneWire.java.patch b/patches/net/minecraft/block/BlockRedstoneWire.java.patch index 80c192f5..bad57bd5 100644 --- a/patches/net/minecraft/block/BlockRedstoneWire.java.patch +++ b/patches/net/minecraft/block/BlockRedstoneWire.java.patch @@ -163,7 +163,7 @@ - this.blocksNeedingUpdate.add(p_212568_2_.offset(enumfacing1)); + this.blocksNeedingUpdate.add(p_212568_2_); + -+ for (EnumFacing enumfacing1 : EnumFacing.ENUM_FACING_VALUES) { ++ for (EnumFacing enumfacing1 : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { + this.blocksNeedingUpdate.add(p_212568_2_.offset(enumfacing1)); + } } @@ -174,7 +174,7 @@ worldIn.notifyNeighborsOfStateChange(pos, this); - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { worldIn.notifyNeighborsOfStateChange(pos.offset(enumfacing), this); } @@ -193,7 +193,7 @@ if (!worldIn.isRemote) { - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { worldIn.notifyNeighborsOfStateChange(pos.offset(enumfacing), this); } diff --git a/patches/net/minecraft/block/BlockSponge.java.patch b/patches/net/minecraft/block/BlockSponge.java.patch index c0a63c81..934c3ad6 100644 --- a/patches/net/minecraft/block/BlockSponge.java.patch +++ b/patches/net/minecraft/block/BlockSponge.java.patch @@ -5,7 +5,7 @@ int j = tuple.getB(); - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { BlockPos blockpos1 = blockpos.offset(enumfacing); IBlockState iblockstate = worldIn.getBlockState(blockpos1); diff --git a/patches/net/minecraft/block/state/pattern/BlockPattern.java.patch b/patches/net/minecraft/block/state/pattern/BlockPattern.java.patch index 92dde43c..589b66db 100644 --- a/patches/net/minecraft/block/state/pattern/BlockPattern.java.patch +++ b/patches/net/minecraft/block/state/pattern/BlockPattern.java.patch @@ -5,10 +5,10 @@ for (BlockPos blockpos : BlockPos.getAllInBox(pos, pos.add(i - 1, i - 1, i - 1))) { - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { - for (EnumFacing enumfacing1 : EnumFacing.values()) -+ for (EnumFacing enumfacing1 : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing1 : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { if (enumfacing1 != enumfacing && enumfacing1 != enumfacing.getOpposite()) { diff --git a/patches/net/minecraft/client/renderer/BlockModelRenderer.java.patch b/patches/net/minecraft/client/renderer/BlockModelRenderer.java.patch index 0678741f..f4cfc88d 100644 --- a/patches/net/minecraft/client/renderer/BlockModelRenderer.java.patch +++ b/patches/net/minecraft/client/renderer/BlockModelRenderer.java.patch @@ -5,12 +5,12 @@ { boolean flag = false; - float[] afloat = new float[EnumFacing.values().length * 2]; -+ float[] afloat = new float[EnumFacing.ENUM_FACING_VALUES.length * 2]; ++ float[] afloat = new float[(me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values()).length * 2]; BitSet bitset = new BitSet(3); BlockModelRenderer.AmbientOcclusionFace blockmodelrenderer$ambientocclusionface = new BlockModelRenderer.AmbientOcclusionFace(); - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { randomIn.setSeed(rand); List list = modelIn.getQuads(stateIn, enumfacing, randomIn); @@ -19,7 +19,7 @@ BitSet bitset = new BitSet(3); - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { randomIn.setSeed(rand); List list = modelIn.getQuads(stateIn, enumfacing, randomIn); @@ -28,7 +28,7 @@ quadBounds[EnumFacing.NORTH.getIndex()] = f2; quadBounds[EnumFacing.SOUTH.getIndex()] = f5; - int j = EnumFacing.values().length; -+ int j = EnumFacing.ENUM_FACING_VALUES.length; ++ int j = (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values()).length; quadBounds[EnumFacing.WEST.getIndex() + j] = 1.0F - f; quadBounds[EnumFacing.EAST.getIndex() + j] = 1.0F - f3; quadBounds[EnumFacing.DOWN.getIndex() + j] = 1.0F - f1; @@ -37,7 +37,7 @@ long i = 42L; - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { random.setSeed(42L); this.renderModelBrightnessColorQuads(brightness, red, green, blue, modelIn.getQuads(state, enumfacing, random)); @@ -46,7 +46,7 @@ private Orientation(EnumFacing facingIn, boolean flip) { - this.shape = facingIn.getIndex() + (flip ? EnumFacing.values().length : 0); -+ this.shape = facingIn.getIndex() + (flip ? EnumFacing.ENUM_FACING_VALUES.length : 0); ++ this.shape = facingIn.getIndex() + (flip ? (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values()).length : 0); } } diff --git a/patches/net/minecraft/client/renderer/ItemRenderer.java.patch b/patches/net/minecraft/client/renderer/ItemRenderer.java.patch index 112d04c8..05cd2af6 100644 --- a/patches/net/minecraft/client/renderer/ItemRenderer.java.patch +++ b/patches/net/minecraft/client/renderer/ItemRenderer.java.patch @@ -5,7 +5,7 @@ long i = 42L; - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { random.setSeed(42L); this.renderQuads(bufferbuilder, model.getQuads((IBlockState)null, enumfacing, random), color, stack); diff --git a/patches/net/minecraft/client/renderer/chunk/RenderChunk.java.patch b/patches/net/minecraft/client/renderer/chunk/RenderChunk.java.patch index bb0bd979..bf29d8aa 100644 --- a/patches/net/minecraft/client/renderer/chunk/RenderChunk.java.patch +++ b/patches/net/minecraft/client/renderer/chunk/RenderChunk.java.patch @@ -5,7 +5,7 @@ this.boundingBox = new AxisAlignedBB((double)x, (double)y, (double)z, (double)(x + 16), (double)(y + 16), (double)(z + 16)); - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { this.mapEnumFacing[enumfacing.ordinal()].setPos(this.position).move(enumfacing, 16); } diff --git a/patches/net/minecraft/client/renderer/chunk/RenderChunkCache.java.patch b/patches/net/minecraft/client/renderer/chunk/RenderChunkCache.java.patch index 0c161b10..7491d937 100644 --- a/patches/net/minecraft/client/renderer/chunk/RenderChunkCache.java.patch +++ b/patches/net/minecraft/client/renderer/chunk/RenderChunkCache.java.patch @@ -5,7 +5,7 @@ int i = 0; - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { int j = this.getLightSubtracted(pos.offset(enumfacing), amount); @@ -14,7 +14,7 @@ int l = 0; - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { int k = RenderChunkCache.this.getLightFor(lightType, pos.offset(enumfacing)); diff --git a/patches/net/minecraft/client/renderer/chunk/SetVisibility.java.patch b/patches/net/minecraft/client/renderer/chunk/SetVisibility.java.patch index de272f4e..0201f496 100644 --- a/patches/net/minecraft/client/renderer/chunk/SetVisibility.java.patch +++ b/patches/net/minecraft/client/renderer/chunk/SetVisibility.java.patch @@ -5,7 +5,7 @@ stringbuilder.append(' '); - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { stringbuilder.append(' ').append(enumfacing.toString().toUpperCase().charAt(0)); } @@ -13,12 +13,12 @@ stringbuilder.append('\n'); - for (EnumFacing enumfacing2 : EnumFacing.values()) -+ for (EnumFacing enumfacing2 : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing2 : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { stringbuilder.append(enumfacing2.toString().toUpperCase().charAt(0)); - for (EnumFacing enumfacing1 : EnumFacing.values()) -+ for (EnumFacing enumfacing1 : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing1 : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { if (enumfacing2 == enumfacing1) { diff --git a/patches/net/minecraft/client/renderer/model/FaceBakery.java.patch b/patches/net/minecraft/client/renderer/model/FaceBakery.java.patch index d27e04c9..18bf9d96 100644 --- a/patches/net/minecraft/client/renderer/model/FaceBakery.java.patch +++ b/patches/net/minecraft/client/renderer/model/FaceBakery.java.patch @@ -5,7 +5,7 @@ private static final float SCALE_ROTATION_22_5 = 1.0F / (float)Math.cos((double)((float)Math.PI / 8F)) - 1.0F; private static final float SCALE_ROTATION_GENERAL = 1.0F / (float)Math.cos((double)((float)Math.PI / 4F)) - 1.0F; - private static final FaceBakery.Rotation[] UV_ROTATIONS = new FaceBakery.Rotation[ModelRotation.values().length * EnumFacing.values().length]; -+ private static final FaceBakery.Rotation[] UV_ROTATIONS = new FaceBakery.Rotation[ModelRotation.values().length * EnumFacing.ENUM_FACING_VALUES.length]; ++ private static final FaceBakery.Rotation[] UV_ROTATIONS = new FaceBakery.Rotation[ModelRotation.values().length * (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values()).length]; private static final FaceBakery.Rotation UV_ROTATION_0 = new FaceBakery.Rotation() { BlockFaceUV makeRotatedUV(float u1, float v1, float u2, float v2) @@ -14,7 +14,7 @@ private float[] getPositionsDiv16(Vector3f pos1, Vector3f pos2) { - float[] afloat = new float[EnumFacing.values().length]; -+ float[] afloat = new float[EnumFacing.ENUM_FACING_VALUES.length]; ++ float[] afloat = new float[(me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values()).length]; afloat[EnumFaceDirection.Constants.WEST_INDEX] = pos1.getX() / 16.0F; afloat[EnumFaceDirection.Constants.DOWN_INDEX] = pos1.getY() / 16.0F; afloat[EnumFaceDirection.Constants.NORTH_INDEX] = pos1.getZ() / 16.0F; @@ -23,7 +23,7 @@ float f = 0.0F; - for (EnumFacing enumfacing1 : EnumFacing.values()) -+ for (EnumFacing enumfacing1 : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing1 : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { Vec3i vec3i = enumfacing1.getDirectionVec(); Vector3f vector3f6 = new Vector3f((float)vec3i.getX(), (float)vec3i.getY(), (float)vec3i.getZ()); @@ -32,7 +32,7 @@ int[] aint = new int[p_178408_1_.length]; System.arraycopy(p_178408_1_, 0, aint, 0, p_178408_1_.length); - float[] afloat = new float[EnumFacing.values().length]; -+ float[] afloat = new float[EnumFacing.ENUM_FACING_VALUES.length]; ++ float[] afloat = new float[(me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values()).length]; afloat[EnumFaceDirection.Constants.WEST_INDEX] = 999.0F; afloat[EnumFaceDirection.Constants.DOWN_INDEX] = 999.0F; afloat[EnumFaceDirection.Constants.NORTH_INDEX] = 999.0F; diff --git a/patches/net/minecraft/client/renderer/model/SimpleBakedModel.java.patch b/patches/net/minecraft/client/renderer/model/SimpleBakedModel.java.patch index 018d5894..a7db0136 100644 --- a/patches/net/minecraft/client/renderer/model/SimpleBakedModel.java.patch +++ b/patches/net/minecraft/client/renderer/model/SimpleBakedModel.java.patch @@ -5,7 +5,7 @@ this.builderTexture = p_i48189_2_.getParticleTexture(); - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { p_i48189_4_.setSeed(p_i48189_5_); @@ -14,7 +14,7 @@ private Builder(boolean ambientOcclusion, boolean gui3d, ItemCameraTransforms transforms, ItemOverrideList overrides) { - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { this.builderFaceQuads.put(enumfacing, Lists.newArrayList()); } diff --git a/patches/net/minecraft/entity/monster/EntityShulker.java.patch b/patches/net/minecraft/entity/monster/EntityShulker.java.patch index 4f0c84c5..35d14cc0 100644 --- a/patches/net/minecraft/entity/monster/EntityShulker.java.patch +++ b/patches/net/minecraft/entity/monster/EntityShulker.java.patch @@ -5,7 +5,7 @@ boolean flag = false; - for (EnumFacing enumfacing1 : EnumFacing.values()) -+ for (EnumFacing enumfacing1 : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing1 : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { blockpos1 = blockpos.offset(enumfacing1); @@ -14,7 +14,7 @@ boolean flag = false; - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { if (this.world.isTopSolid(blockpos1.offset(enumfacing))) { diff --git a/patches/net/minecraft/fluid/LavaFluid.java.patch b/patches/net/minecraft/fluid/LavaFluid.java.patch index 7c109b78..a4adebdc 100644 --- a/patches/net/minecraft/fluid/LavaFluid.java.patch +++ b/patches/net/minecraft/fluid/LavaFluid.java.patch @@ -5,7 +5,7 @@ private boolean isSurroundingBlockFlammable(IWorldReaderBase worldIn, BlockPos pos) { - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { if (this.getCanBlockBurn(worldIn, pos.offset(enumfacing))) { diff --git a/patches/net/minecraft/pathfinding/SwimNodeProcessor.java.patch b/patches/net/minecraft/pathfinding/SwimNodeProcessor.java.patch index df95347e..85e790ec 100644 --- a/patches/net/minecraft/pathfinding/SwimNodeProcessor.java.patch +++ b/patches/net/minecraft/pathfinding/SwimNodeProcessor.java.patch @@ -5,7 +5,7 @@ int i = 0; - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { PathPoint pathpoint = this.getWaterNode(currentPoint.x + enumfacing.getXOffset(), currentPoint.y + enumfacing.getYOffset(), currentPoint.z + enumfacing.getZOffset()); diff --git a/patches/net/minecraft/pathfinding/WalkAndSwimNodeProcessor.java.patch b/patches/net/minecraft/pathfinding/WalkAndSwimNodeProcessor.java.patch index 5dfce23a..baead6d7 100644 --- a/patches/net/minecraft/pathfinding/WalkAndSwimNodeProcessor.java.patch +++ b/patches/net/minecraft/pathfinding/WalkAndSwimNodeProcessor.java.patch @@ -5,7 +5,7 @@ if (pathnodetype == PathNodeType.WATER) { - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { PathNodeType pathnodetype2 = this.getPathNodeTypeRaw(blockaccessIn, x + enumfacing.getXOffset(), y + enumfacing.getYOffset(), z + enumfacing.getZOffset()); diff --git a/patches/net/minecraft/state/DirectionProperty.java.patch b/patches/net/minecraft/state/DirectionProperty.java.patch index e146c984..5e4c16f4 100644 --- a/patches/net/minecraft/state/DirectionProperty.java.patch +++ b/patches/net/minecraft/state/DirectionProperty.java.patch @@ -5,7 +5,7 @@ public static DirectionProperty create(String name, Predicate filter) { - return create(name, Arrays.stream(EnumFacing.values()).filter(filter).collect(Collectors.toList())); -+ return create(name, Arrays.stream(EnumFacing.ENUM_FACING_VALUES).filter(filter).collect(Collectors.toList())); ++ return create(name, Arrays.stream((me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())).filter(filter).collect(Collectors.toList())); } public static DirectionProperty create(String p_196962_0_, EnumFacing... p_196962_1_) diff --git a/patches/net/minecraft/tileentity/TileEntityEndGateway.java.patch b/patches/net/minecraft/tileentity/TileEntityEndGateway.java.patch index 7bd4ba5b..9c780f40 100644 --- a/patches/net/minecraft/tileentity/TileEntityEndGateway.java.patch +++ b/patches/net/minecraft/tileentity/TileEntityEndGateway.java.patch @@ -5,7 +5,7 @@ int i = 0; - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { i += this.shouldRenderFace(enumfacing) ? 1 : 0; } diff --git a/patches/net/minecraft/world/Region.java.patch b/patches/net/minecraft/world/Region.java.patch index 072a3fc7..e9aa736e 100644 --- a/patches/net/minecraft/world/Region.java.patch +++ b/patches/net/minecraft/world/Region.java.patch @@ -5,7 +5,7 @@ int i = 0; - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { int j = this.getLightSubtracted(pos.offset(enumfacing), amount); @@ -14,7 +14,7 @@ int l = 0; - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { int k = this.getLightFor(type, pos.offset(enumfacing)); diff --git a/patches/net/minecraft/world/chunk/Chunk.java.patch b/patches/net/minecraft/world/chunk/Chunk.java.patch index a3222111..b95a8060 100644 --- a/patches/net/minecraft/world/chunk/Chunk.java.patch +++ b/patches/net/minecraft/world/chunk/Chunk.java.patch @@ -566,7 +566,7 @@ if (this.sections[j] == EMPTY_SECTION && flag || this.sections[j] != EMPTY_SECTION && this.sections[j].get(k, i1, l).isAir()) { - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { BlockPos blockpos2 = blockpos1.offset(enumfacing); diff --git a/patches/net/minecraft/world/chunk/UpgradeData.java.patch b/patches/net/minecraft/world/chunk/UpgradeData.java.patch index b3bc1684..8c4a5960 100644 --- a/patches/net/minecraft/world/chunk/UpgradeData.java.patch +++ b/patches/net/minecraft/world/chunk/UpgradeData.java.patch @@ -5,7 +5,7 @@ int i1 = (p_196991_0_.z << 4) + (!flag4 || !flag && !flag1 ? (flag3 ? 0 : 15) : 1); int j1 = (p_196991_0_.z << 4) + (!flag4 || !flag && !flag1 ? (flag3 ? 0 : 15) : 14); - EnumFacing[] aenumfacing = EnumFacing.values(); -+ EnumFacing[] aenumfacing = EnumFacing.ENUM_FACING_VALUES; ++ EnumFacing[] aenumfacing = (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values()); BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); for (BlockPos.MutableBlockPos blockpos$mutableblockpos1 : BlockPos.getAllInBoxMutable(k, 0, i1, l, world.getHeight() - 1, j1)) @@ -14,7 +14,7 @@ if (chunksection != null && aint != null && aint.length > 0) { - EnumFacing[] aenumfacing = EnumFacing.values(); -+ EnumFacing[] aenumfacing = EnumFacing.ENUM_FACING_VALUES; ++ EnumFacing[] aenumfacing = (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values()); BlockStateContainer blockstatecontainer = chunksection.getData(); for (int j : aint) @@ -23,7 +23,7 @@ }; - public static final EnumFacing[] field_208827_f = EnumFacing.values(); -+ public static final EnumFacing[] field_208827_f = EnumFacing.ENUM_FACING_VALUES; ++ public static final EnumFacing[] field_208827_f = (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values()); private BlockFixers(Block... p_i47847_3_) { diff --git a/patches/net/minecraft/world/gen/feature/AbstractTreeFeature.java.patch b/patches/net/minecraft/world/gen/feature/AbstractTreeFeature.java.patch index 438fd292..403d0722 100644 --- a/patches/net/minecraft/world/gen/feature/AbstractTreeFeature.java.patch +++ b/patches/net/minecraft/world/gen/feature/AbstractTreeFeature.java.patch @@ -5,7 +5,7 @@ for (BlockPos blockpos : Lists.newArrayList(set)) { - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { blockpos$pooledmutableblockpos.setPos(blockpos).move(enumfacing); @@ -14,7 +14,7 @@ for (BlockPos blockpos1 : set1) { - for (EnumFacing enumfacing1 : EnumFacing.values()) -+ for (EnumFacing enumfacing1 : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing1 : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { blockpos$pooledmutableblockpos.setPos(blockpos1).move(enumfacing1); diff --git a/patches/net/minecraft/world/gen/feature/BlueIceFeature.java.patch b/patches/net/minecraft/world/gen/feature/BlueIceFeature.java.patch index cbfc64f6..ea1ca311 100644 --- a/patches/net/minecraft/world/gen/feature/BlueIceFeature.java.patch +++ b/patches/net/minecraft/world/gen/feature/BlueIceFeature.java.patch @@ -5,7 +5,7 @@ boolean flag = false; - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { if (enumfacing != EnumFacing.DOWN && worldIn.getBlockState(pos.offset(enumfacing)).getBlock() == Blocks.PACKED_ICE) { @@ -14,7 +14,7 @@ if (iblockstate.getMaterial() == Material.AIR || block == Blocks.WATER || block == Blocks.PACKED_ICE || block == Blocks.ICE) { - for (EnumFacing enumfacing1 : EnumFacing.values()) -+ for (EnumFacing enumfacing1 : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing1 : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { Block block1 = worldIn.getBlockState(blockpos.offset(enumfacing1)).getBlock(); diff --git a/patches/net/minecraft/world/gen/feature/GlowstoneFeature.java.patch b/patches/net/minecraft/world/gen/feature/GlowstoneFeature.java.patch index 86e22fa2..85925aa2 100644 --- a/patches/net/minecraft/world/gen/feature/GlowstoneFeature.java.patch +++ b/patches/net/minecraft/world/gen/feature/GlowstoneFeature.java.patch @@ -5,7 +5,7 @@ int j = 0; - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { if (worldIn.getBlockState(blockpos.offset(enumfacing)).getBlock() == Blocks.GLOWSTONE) { diff --git a/patches/net/minecraft/world/gen/feature/structure/BuriedTreasurePieces.java.patch b/patches/net/minecraft/world/gen/feature/structure/BuriedTreasurePieces.java.patch index b76f0559..f322d5e5 100644 --- a/patches/net/minecraft/world/gen/feature/structure/BuriedTreasurePieces.java.patch +++ b/patches/net/minecraft/world/gen/feature/structure/BuriedTreasurePieces.java.patch @@ -23,7 +23,7 @@ IBlockState iblockstate2 = !iblockstate.isAir() && !this.func_204295_a(iblockstate) ? iblockstate : Blocks.SAND.getDefaultState(); - for (EnumFacing enumfacing : EnumFacing.values()) -+ for (EnumFacing enumfacing : EnumFacing.ENUM_FACING_VALUES) ++ for (EnumFacing enumfacing : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())) { BlockPos blockpos = blockpos$mutableblockpos.offset(enumfacing); IBlockState iblockstate3 = worldIn.getBlockState(blockpos); diff --git a/patches/net/minecraft/world/lighting/BaseLightEngine.java.patch b/patches/net/minecraft/world/lighting/BaseLightEngine.java.patch index 2a1f68e1..c64159a1 100644 --- a/patches/net/minecraft/world/lighting/BaseLightEngine.java.patch +++ b/patches/net/minecraft/world/lighting/BaseLightEngine.java.patch @@ -5,7 +5,7 @@ { int i = p_202661_1_ >> 24 & 7; - return i == 7 ? null : EnumFacing.values()[p_202661_1_ >> 24 & 7]; -+ return i == 7 ? null : EnumFacing.ENUM_FACING_VALUES[p_202661_1_ >> 24 & 7]; ++ return i == 7 ? null : (me.jellysquid.mods.lithium.LithiumConfig.ALLOC_ENUM_VALUES ? EnumFacing.ENUM_FACING_VALUES : EnumFacing.values())[p_202661_1_ >> 24 & 7]; } protected void flushQueue(IWorld worldIn, ChunkPos cPos) diff --git a/src/main/java/me/jellysquid/mods/lithium/LithiumConfig.java b/src/main/java/me/jellysquid/mods/lithium/LithiumConfig.java index 1e2c71c4..9672fb57 100644 --- a/src/main/java/me/jellysquid/mods/lithium/LithiumConfig.java +++ b/src/main/java/me/jellysquid/mods/lithium/LithiumConfig.java @@ -13,7 +13,7 @@ public class LithiumConfig private static final boolean LITHIUM_ENABLE = true; public static final boolean ALLOC_ENTITY_TRACKER = LITHIUM_ENABLE && true; -// public static final boolean ALLOC_ENUM_VALUES = LITHIUM_ENABLE && true; // to complicated to be switchable + public static final boolean ALLOC_ENUM_VALUES = LITHIUM_ENABLE && true; public static final boolean BLOCK_MOVING_BLOCK_SHAPES = LITHIUM_ENABLE && true; public static final boolean BLOCK_PISTON_SHAPES = LITHIUM_ENABLE && true; public static final boolean CACHED_HASHCODE = LITHIUM_ENABLE && true;