Skip to content

Commit

Permalink
spotlessApply (#316)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Jan 29, 2024
1 parent 795392b commit bdfd0b6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@
import net.minecraft.client.multiplayer.WorldClient;

import org.spongepowered.asm.mixin.Mixin;

import com.mitchej123.hodgepodge.hax.LongChunkCoordIntPairSet;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

import com.mitchej123.hodgepodge.hax.LongChunkCoordIntPairSet;

@Mixin(WorldClient.class)
public abstract class MixinWorldClient_FixAllocations {

private final Set previousActiveChunkSet = new LongChunkCoordIntPairSet();

@Redirect(method="func_147456_g", at = @At(value = "INVOKE", target = "Ljava/util/Set;iterator()Ljava/util/Iterator;"))
@Redirect(
method = "func_147456_g",
at = @At(value = "INVOKE", target = "Ljava/util/Set;iterator()Ljava/util/Iterator;"))
private Iterator<?> fixAllocations(Set instance) {
return ((LongChunkCoordIntPairSet) instance).unsafeIterator();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
package com.mitchej123.hodgepodge.mixins.early.minecraft;

import com.mitchej123.hodgepodge.hax.LongChunkCoordIntPairSet;
import net.minecraft.client.multiplayer.WorldClient;
import java.util.Iterator;
import java.util.Set;

import net.minecraft.world.WorldServer;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

import java.util.Iterator;
import java.util.Set;
import com.mitchej123.hodgepodge.hax.LongChunkCoordIntPairSet;

@Mixin(WorldServer.class)
public abstract class MixinWorldServer_FixAllocations {


@Redirect(method="func_147456_g", at = @At(value = "INVOKE", target = "Ljava/util/Set;iterator()Ljava/util/Iterator;"))
@Redirect(
method = "func_147456_g",
at = @At(value = "INVOKE", target = "Ljava/util/Set;iterator()Ljava/util/Iterator;"))
private Iterator<?> fixAllocations(Set instance) {
return ((LongChunkCoordIntPairSet) instance).unsafeIterator();
}
Expand Down

0 comments on commit bdfd0b6

Please sign in to comment.