mirror of
https://github.com/Wurst-Imperium/Wurst7.git
synced 2024-09-19 17:02:13 +02:00
Merge tag 'v7.15.2' into 1.16.3
Conflicts: gradle.properties src/main/java/net/wurstclient/WurstClient.java
This commit is contained in:
commit
ab2af7ebd9
@ -12,7 +12,7 @@ loader_version=0.10.1+build.209
|
||||
fabric_version=0.23.0+build.410-1.16
|
||||
|
||||
# Mod Properties
|
||||
mod_version = v7.15.1-MC1.16.3
|
||||
mod_version = v7.15.2-MC1.16.3
|
||||
maven_group = net.wurstclient
|
||||
archives_base_name = Wurst-Client
|
||||
|
||||
|
@ -56,7 +56,7 @@ public enum WurstClient
|
||||
public static final MinecraftClient MC = MinecraftClient.getInstance();
|
||||
public static final IMinecraftClient IMC = (IMinecraftClient)MC;
|
||||
|
||||
public static final String VERSION = "7.15.1";
|
||||
public static final String VERSION = "7.15.2";
|
||||
public static final String MC_VERSION = "1.16.3";
|
||||
|
||||
private WurstAnalytics analytics;
|
||||
|
@ -508,6 +508,9 @@ public final class AutoFarmHack extends Hack
|
||||
private void updateDisplayList(List<BlockPos> blocksToHarvest,
|
||||
List<BlockPos> blocksToReplant)
|
||||
{
|
||||
if(BlockEntityRenderDispatcher.INSTANCE.camera == null)
|
||||
return;
|
||||
|
||||
BlockPos camPos = RenderUtils.getCameraBlockPos();
|
||||
int regionX = (camPos.getX() >> 9) * 512;
|
||||
int regionZ = (camPos.getZ() >> 9) * 512;
|
||||
|
@ -65,10 +65,14 @@ public final class BaseFinderHack extends Hack
|
||||
|
||||
private final HashSet<BlockPos> matchingBlocks = new HashSet<>();
|
||||
private final ArrayList<int[]> vertices = new ArrayList<>();
|
||||
private int displayList;
|
||||
|
||||
private int messageTimer = 0;
|
||||
private int counter;
|
||||
|
||||
private Integer oldRegionX;
|
||||
private Integer oldRegionZ;
|
||||
|
||||
public BaseFinderHack()
|
||||
{
|
||||
super("BaseFinder",
|
||||
@ -104,6 +108,7 @@ public final class BaseFinderHack extends Hack
|
||||
// reset timer
|
||||
messageTimer = 0;
|
||||
blockNames = new ArrayList<>(naturalBlocks.getBlockNames());
|
||||
displayList = GL11.glGenLists(1);
|
||||
|
||||
EVENTS.add(UpdateListener.class, this);
|
||||
EVENTS.add(RenderListener.class, this);
|
||||
@ -114,8 +119,13 @@ public final class BaseFinderHack extends Hack
|
||||
{
|
||||
EVENTS.remove(UpdateListener.class, this);
|
||||
EVENTS.remove(RenderListener.class, this);
|
||||
|
||||
matchingBlocks.clear();
|
||||
vertices.clear();
|
||||
oldRegionX = null;
|
||||
oldRegionZ = null;
|
||||
|
||||
GL11.glDeleteLists(displayList, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -128,18 +138,12 @@ public final class BaseFinderHack extends Hack
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glColor4f(1F, 0F, 0F, 0.15F);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
RenderUtils.applyRenderOffset();
|
||||
RenderUtils.applyRegionalRenderOffset();
|
||||
|
||||
// vertices
|
||||
GL11.glBegin(GL11.GL_QUADS);
|
||||
{
|
||||
for(int[] vertex : vertices)
|
||||
GL11.glVertex3d(vertex[0], vertex[1], vertex[2]);
|
||||
}
|
||||
GL11.glEnd();
|
||||
GL11.glColor4f(1, 0, 0, 0.15F);
|
||||
GL11.glCallList(displayList);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
@ -155,6 +159,28 @@ public final class BaseFinderHack extends Hack
|
||||
{
|
||||
int modulo = MC.player.age % 64;
|
||||
|
||||
BlockPos camPos = RenderUtils.getCameraBlockPos();
|
||||
Integer regionX = (camPos.getX() >> 9) * 512;
|
||||
Integer regionZ = (camPos.getZ() >> 9) * 512;
|
||||
|
||||
if(modulo == 0 || !regionX.equals(oldRegionX)
|
||||
|| !regionZ.equals(oldRegionZ))
|
||||
{
|
||||
GL11.glNewList(displayList, GL11.GL_COMPILE);
|
||||
|
||||
GL11.glBegin(GL11.GL_QUADS);
|
||||
|
||||
for(int[] vertex : vertices)
|
||||
GL11.glVertex3d(vertex[0] - regionX, vertex[1],
|
||||
vertex[2] - regionZ);
|
||||
|
||||
GL11.glEnd();
|
||||
GL11.glEndList();
|
||||
|
||||
oldRegionX = regionX;
|
||||
oldRegionZ = regionZ;
|
||||
}
|
||||
|
||||
// reset matching blocks
|
||||
if(modulo == 0)
|
||||
matchingBlocks.clear();
|
||||
|
@ -211,9 +211,9 @@ public final class CaveFinderHack extends Hack
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
RenderUtils.applyRenderOffset();
|
||||
RenderUtils.applyRegionalRenderOffset();
|
||||
|
||||
// generate rainbow color
|
||||
// generate color
|
||||
float x = System.currentTimeMillis() % 2000 / 1000F;
|
||||
float alpha = 0.25F + 0.25F * MathHelper.sin(x * (float)Math.PI);
|
||||
|
||||
@ -421,24 +421,19 @@ public final class CaveFinderHack extends Hack
|
||||
{
|
||||
HashSet<BlockPos> matchingBlocks = getMatchingBlocksFromTask();
|
||||
|
||||
BlockPos camPos = RenderUtils.getCameraBlockPos();
|
||||
int regionX = (camPos.getX() >> 9) * 512;
|
||||
int regionZ = (camPos.getZ() >> 9) * 512;
|
||||
|
||||
Callable<ArrayList<int[]>> task =
|
||||
BlockVertexCompiler.createTask(matchingBlocks);
|
||||
BlockVertexCompiler.createTask(matchingBlocks, regionX, regionZ);
|
||||
|
||||
compileVerticesTask = pool2.submit(task);
|
||||
}
|
||||
|
||||
private void setDisplayListFromTask()
|
||||
{
|
||||
ArrayList<int[]> vertices;
|
||||
|
||||
try
|
||||
{
|
||||
vertices = compileVerticesTask.get();
|
||||
|
||||
}catch(InterruptedException | ExecutionException e)
|
||||
{
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
ArrayList<int[]> vertices = getVerticesFromTask();
|
||||
|
||||
GL11.glNewList(displayList, GL11.GL_COMPILE);
|
||||
for(int[] vertex : vertices)
|
||||
@ -448,6 +443,18 @@ public final class CaveFinderHack extends Hack
|
||||
displayListUpToDate = true;
|
||||
}
|
||||
|
||||
public ArrayList<int[]> getVerticesFromTask()
|
||||
{
|
||||
try
|
||||
{
|
||||
return compileVerticesTask.get();
|
||||
|
||||
}catch(InterruptedException | ExecutionException e)
|
||||
{
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private enum Area
|
||||
{
|
||||
D3("3x3 chunks", 1),
|
||||
|
@ -33,7 +33,7 @@ public abstract class CactusBlockMixin extends Block
|
||||
|
||||
@Inject(at = {@At("HEAD")},
|
||||
method = {
|
||||
"getOutlineShape(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/ShapeContext;)Lnet/minecraft/util/shape/VoxelShape;"},
|
||||
"getCollisionShape(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/ShapeContext;)Lnet/minecraft/util/shape/VoxelShape;"},
|
||||
cancellable = true)
|
||||
private void onGetCollisionShape(BlockState blockState_1,
|
||||
BlockView blockView_1, BlockPos blockPos_1,
|
||||
|
@ -33,6 +33,23 @@ public enum BlockVertexCompiler
|
||||
.collect(Collectors.toCollection(() -> new ArrayList<>()));
|
||||
}
|
||||
|
||||
public static Callable<ArrayList<int[]>> createTask(
|
||||
HashSet<BlockPos> blocks, int regionX, int regionZ)
|
||||
{
|
||||
return () -> blocks.parallelStream()
|
||||
.flatMap(pos -> getVertices(pos, blocks).stream())
|
||||
.map(v -> applyRegionOffset(v, regionX, regionZ))
|
||||
.collect(Collectors.toCollection(ArrayList::new));
|
||||
}
|
||||
|
||||
private static int[] applyRegionOffset(int[] vertex, int regionX,
|
||||
int regionZ)
|
||||
{
|
||||
vertex[0] -= regionX;
|
||||
vertex[2] -= regionZ;
|
||||
return vertex;
|
||||
}
|
||||
|
||||
private static ArrayList<int[]> getVertices(BlockPos pos,
|
||||
HashSet<BlockPos> matchingBlocks)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user