Skip to content

Commit

Permalink
Deprecate everything in compat.mojang
Browse files Browse the repository at this point in the history
* We'll need to replace, remove, or rewrite these
* It's also likely silently hiding something that's preventing the Iris backport from rendering anything useful
  • Loading branch information
mitchej123 committed Dec 6, 2023
1 parent ab7afba commit 2990376
Show file tree
Hide file tree
Showing 90 changed files with 120 additions and 148 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.gtnewhorizons.angelica.compat.mojang;
package com.gtnewhorizons.angelica.compat;

import com.gtnewhorizons.angelica.compat.mojang.BlockPos;
import lombok.Getter;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.EntityLivingBase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.gtnewhorizons.angelica.compat.mojang;
package com.gtnewhorizons.angelica.compat;

// ChunkCoordIntPair
import com.gtnewhorizons.angelica.compat.mojang.BlockPos;

// See if we can merge/mixin/extend ChunkCoordIntPair?
public class ChunkPos {
public static long INT_MASK = (1L << Integer.SIZE) - 1;

Expand Down Expand Up @@ -37,4 +39,21 @@ public long toLong() {
public static long toLong(int x, int z) {
return (long)x & 4294967295L | ((long)z & 4294967295L) << 32;
}

public int hashCode()
{
int i = 1664525 * this.x + 1013904223;
int j = 1664525 * (this.z ^ -559038737) + 1013904223;
return i ^ j;
}

public boolean equals(Object object) {
if (this == object) {
return true;
}
if (object instanceof ChunkPos lv) {
return this.x == lv.x && this.z == lv.z;
}
return false;
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.gtnewhorizons.angelica.compat.mojang;
package com.gtnewhorizons.angelica.compat;

import com.gtnewhorizons.angelica.compat.mojang.BlockPos;
import org.joml.Vector3i;

// ChunkPosition maybe?
// See if we can merge/mixin/extend ChunkPosition maybe?
public class ChunkSectionPos extends Vector3i {

public static int getSectionCoord(int coord) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.gtnewhorizons.angelica.compat.mojang;
package com.gtnewhorizons.angelica.compat;

public class CompatMathHelper {
public static int smallestEncompassingPowerOfTwo(int value) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.gtnewhorizons.angelica.compat.mojang;
package com.gtnewhorizons.angelica.compat;

public class Constants {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.gtnewhorizons.angelica.compat.mojang;
package com.gtnewhorizons.angelica.compat;

import com.gtnewhorizons.angelica.compat.mojang.ByteBufferBackedInputStream;
import lombok.Getter;
import net.coderbot.iris.Iris;
import org.lwjgl.BufferUtils;
Expand All @@ -14,6 +15,7 @@
import java.nio.ByteBuffer;
import java.nio.IntBuffer;

// TBD
public class NativeImage extends BufferedImage {
@Getter
private final Format format;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import java.io.IOException;

@Deprecated
public abstract class AutoClosableAbstractTexture extends AbstractTexture implements AutoCloseable {

public abstract void load(IResourceManager manager) throws IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import net.minecraftforge.common.util.ForgeDirection;

@Deprecated
public enum Axis {
X,
Y,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.util.List;
import java.util.Random;

@Deprecated
public interface BakedModel extends IForgeBakedModel {

List<BakedQuad> getQuads(BlockState state, ForgeDirection face, Random random);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.gtnewhorizons.angelica.compat.forge.VertexLighterFlat;
import net.minecraftforge.common.util.ForgeDirection;

@Deprecated
public class BakedQuad {

public void pipe(VertexLighterFlat lighter) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.jetbrains.annotations.NotNull;

@Deprecated
public class BlockBreakingInfo implements Comparable<BlockBreakingInfo> {

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.gtnewhorizons.angelica.compat.mojang;

@Deprecated
public class BlockModels {

public BakedModel getModel(BlockState blockState) { return null; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import static com.google.common.math.IntMath.log2;

// Should we keep this?
public class BlockPos extends Vector3i {

private static final int SIZE_BITS_X = 1 + log2(MathHelper.roundUpToPowerOfTwo(30000000), RoundingMode.UNNECESSARY);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.gtnewhorizons.angelica.compat.mojang;

@Deprecated
public enum BlockRenderType {
INVISIBLE,
ENTITYBLOCK_ANIMATED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import net.minecraft.world.EnumSkyBlock;
import net.minecraftforge.common.util.ForgeDirection;

@Deprecated
public interface BlockRenderView extends BlockView {

float getBrightness(ForgeDirection face, boolean shade);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
import com.gtnewhorizons.angelica.compat.forge.IForgeBlockState;
import me.jellysquid.mods.sodium.common.util.WorldUtil;
import net.minecraft.block.Block;
import net.minecraft.block.BlockLiquid;
import net.minecraft.block.material.Material;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.BlockFluidBase;
import net.minecraftforge.fluids.FluidRegistry;
import org.joml.Vector3d;

@Deprecated
public class BlockState implements IForgeBlockState {
private final static Vector3d ZERO = new Vector3d(0, 0, 0);
private final Block block;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.gtnewhorizons.angelica.compat.mojang;

@Deprecated
public interface BlockView {

BlockState getBlockState(BlockPos adjPos);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.util.List;

// This is the Tessellator - TODO: Merge/Overwrite
@Deprecated
public class BufferBuilder implements VertexConsumer, BufferBuilderExt {
private ByteBuffer buffer;
private List<DrawState> vertexCounts;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.SortedMap;

@Deprecated
public class BufferBuilderStorage {
private final SortedMap<RenderLayer, BufferBuilder> entityBuilders = null;
private final VertexConsumerProvider.Immediate entityVertexConsumers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.Map;

@Deprecated
public class BufferSource implements MultiBufferSource {

public <V, K> BufferSource(BufferBuilder bufferBuilder, Map<K,V> kvMap) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.io.InputStream;
import java.nio.ByteBuffer;

@Deprecated
public class ByteBufferBackedInputStream extends InputStream {

ByteBuffer buf;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import net.minecraftforge.common.util.ForgeDirection;

import java.util.BitSet;
import java.util.EnumSet;
import java.util.Set;

@Deprecated
public class ChunkOcclusionData {
private static final int DIRECTION_COUNT = ForgeDirection.values().length;
private final BitSet visibility;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import it.unimi.dsi.fastutil.ints.IntArrayFIFOQueue;
import it.unimi.dsi.fastutil.ints.IntPriorityQueue;
import me.jellysquid.mods.sodium.common.util.DirectionUtil;
import net.minecraft.util.Util;
import net.minecraftforge.common.util.ForgeDirection;

import java.util.BitSet;
Expand All @@ -13,6 +12,8 @@
/**
* WARNING: Minecraft 1.16 code rip!!
*/

@Deprecated
public class ChunkOcclusionDataBuilder {
private static final int STEP_X = (int)Math.pow(16.0, 0.0);
private static final int STEP_Z = (int)Math.pow(16.0, 1.0);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.gtnewhorizons.angelica.compat.mojang.VertexFormatElement.Type;
import com.gtnewhorizons.angelica.compat.mojang.VertexFormatElement.Usage;

@Deprecated
public class DefaultVertexFormat {

public static final VertexFormatElement POSITION_ELEMENT = new VertexFormatElement(0, Type.FLOAT, Usage.POSITION, 3);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import lombok.Getter;

@Deprecated
public class DrawState {
@Getter
private final VertexFormat format;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import net.minecraftforge.fluids.Fluid;
import org.joml.Vector3d;

@Deprecated
public class FluidState {

private final Fluid fluid;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.gtnewhorizons.angelica.compat.mojang;

@Deprecated
public class GameRenderer {

public void invokeBobHurt(MatrixStack poseStack, float tickDelta) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.util.Iterator;
import java.util.List;

@Deprecated
public class IdList <T> implements IndexedIterable<T> {
protected int nextId;
protected final IdentityHashMap<T, Integer> idMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import javax.annotation.Nullable;

@Deprecated
public interface IndexedIterable <T> extends Iterable<T> {
int getRawId(T entry);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.gtnewhorizons.angelica.compat.mojang;

@Deprecated
public enum InteractionHand {
MAIN_HAND,
OFF_HAND;
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import java.util.Deque;

@Deprecated
public class MatrixStack {
private final Deque<Entry> matrixStack;

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.Map;

@Deprecated
public interface MultiBufferSource {
static BufferSource immediateWithBuffers(Map<RenderLayer, BufferBuilder> map, BufferBuilder arg) {
return new BufferSource(arg, map);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.gtnewhorizons.angelica.compat.mojang;

@Deprecated
public class OverlayTexture {

// This is definitely wrong
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.joml.Matrix3f;
import org.joml.Matrix4f;

@Deprecated
public class OverlayVertexConsumer implements VertexConsumer {

public OverlayVertexConsumer(VertexConsumer buffer, Matrix4f model, Matrix3f normal) {}
Expand Down
Loading

0 comments on commit 2990376

Please sign in to comment.