Skip to content

Commit

Permalink
fix: dumb mistake with PriorityQueue #27
Browse files Browse the repository at this point in the history
---

Would you believe this was actually in an old stashed change... whoops

Signed-off-by: AterAnimAvis <AterAnimAvis@gmail.com>
  • Loading branch information
AterAnimAvis committed May 1, 2021
1 parent 0610901 commit 616b5e4
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ public interface IRequest {

boolean render();

default int priority() {
return 0;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.minecraft.util.text.TextFormatting;
import org.jetbrains.annotations.Nullable;

import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.function.Function;
Expand All @@ -23,7 +24,7 @@ public class RenderManager extends BaseRenderManager<ITextComponent> {
public static final BaseRenderManager<ITextComponent> INSTANCE = new RenderManager();

public static boolean isRendering = false;
public static Queue<IRequest> requests = new PriorityQueue<>();
public static Queue<IRequest> requests = new PriorityQueue<>(Comparator.comparingInt(IRequest::priority));
@Nullable
private static IRequest request = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.minecraft.util.text.TextFormatting;
import org.jetbrains.annotations.Nullable;

import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.function.Function;
Expand All @@ -23,7 +24,7 @@ public class RenderManager extends BaseRenderManager<ITextComponent> {
public static final BaseRenderManager<ITextComponent> INSTANCE = new RenderManager();

public static boolean isRendering = false;
public static Queue<IRequest> requests = new PriorityQueue<>();
public static Queue<IRequest> requests = new PriorityQueue<>(Comparator.comparingInt(IRequest::priority));
@Nullable
private static IRequest request = null;

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ yarnBuild =9.mcp.snapshot.20201028.1.16.3

##################################### Mod #####################################
modId =block_renderer
modVersion =1.5.2
modVersion =1.5.3
modGroup =com.unascribed
vendor =AterAnimAvis

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import com.unascribed.blockrenderer.render.IRequest;
import com.unascribed.blockrenderer.render.manager.BaseRenderManager;
import net.minecraft.util.text.ITextComponent;
@@ -11,7 +11,7 @@
@@ -12,7 +12,7 @@
import java.util.Queue;
import java.util.function.Function;

Expand Down

0 comments on commit 616b5e4

Please sign in to comment.