Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package io.github.itzispyder.clickcrystals.mixins;

import io.github.itzispyder.clickcrystals.gui.misc.brushes.MobHeadBrush;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.EntityTypes;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(EntityTypes.class)
public abstract class MixinEntityTypes {

@Inject(method = "register(Lnet/minecraft/resources/ResourceKey;Lnet/minecraft/world/entity/EntityType$Builder;)Lnet/minecraft/world/entity/EntityType;", at = @At("RETURN"))
private static <T extends Entity> void register(ResourceKey<EntityType<?>> key, EntityType.Builder<T> builder, CallbackInfoReturnable<EntityType<T>> cir) {
MobHeadBrush.init(cir.getReturnValue(), key.identifier().getPath());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import net.minecraft.client.renderer.Lightmap;
import net.minecraft.client.renderer.state.LightmapRenderState;
import net.minecraft.util.profiling.ProfilerFiller;
import org.joml.Vector4f;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
Expand All @@ -24,7 +25,7 @@ public abstract class MixinLightmap implements Global {
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/profiling/ProfilerFiller;push(Ljava/lang/String;)V", shift = At.Shift.AFTER), cancellable = true)
private void onUpdate(LightmapRenderState renderState, CallbackInfo ci, @Local ProfilerFiller profiler) {
if (Module.isEnabled(FullBright.class)) {
RenderSystem.getDevice().createCommandEncoder().clearColorTexture(this.texture, 0xFFFFFFFF);
RenderSystem.getDevice().createCommandEncoder().clearColorTexture(this.texture, new Vector4f(1.0F, 1.0F, 1.0F, 1.0F));
profiler.pop();
ci.cancel();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityEvent;
import net.minecraft.world.entity.LightningBolt;
import net.minecraft.world.entity.EntityTypes;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.component.FireworkExplosion;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import io.github.itzispyder.clickcrystals.scripting.components.Conditional;
import io.github.itzispyder.clickcrystals.util.minecraft.EntityUtils;
import io.github.itzispyder.clickcrystals.util.minecraft.PlayerUtils;
import io.github.itzispyder.clickcrystals.util.minecraft.VectorParser;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.block.state.BlockState;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import io.github.itzispyder.clickcrystals.scripting.components.Conditional;
import io.github.itzispyder.clickcrystals.util.minecraft.EntityUtils;
import io.github.itzispyder.clickcrystals.util.minecraft.PlayerUtils;
import io.github.itzispyder.clickcrystals.util.minecraft.VectorParser;
import net.minecraft.world.level.block.state.BlockState;

import java.util.concurrent.atomic.AtomicBoolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import com.mojang.blaze3d.pipeline.RenderPipeline;
import com.mojang.blaze3d.platform.CompareOp;
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
import com.mojang.blaze3d.vertex.VertexFormat;
import com.mojang.blaze3d.PrimitiveTopology;

public class RenderPipelines {

Expand All @@ -16,95 +16,107 @@ public class RenderPipelines {

public static final RenderPipeline PIPELINE_LINES = RenderPipeline.builder(net.minecraft.client.renderer.RenderPipelines.DEBUG_FILLED_SNIPPET)
.withLocation("pipeline/global_lines_pipeline")
.withVertexFormat(DefaultVertexFormat.POSITION_COLOR, VertexFormat.Mode.DEBUG_LINES)
.withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR)
.withPrimitiveTopology(PrimitiveTopology.DEBUG_LINES)
.withColorTargetState(WITH_BLEND)
.withCull(false)
.withDepthStencilState(DEPTH_NONE)
.build();

public static final RenderPipeline PIPELINE_LINES_STRIP = RenderPipeline.builder(net.minecraft.client.renderer.RenderPipelines.DEBUG_FILLED_SNIPPET)
.withLocation("pipeline/global_lines_pipeline")
.withVertexFormat(DefaultVertexFormat.POSITION_COLOR, VertexFormat.Mode.DEBUG_LINE_STRIP)
.withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR)
.withPrimitiveTopology(PrimitiveTopology.DEBUG_LINE_STRIP)
.withColorTargetState(WITH_BLEND)
.withCull(false)
.withDepthStencilState(DEPTH_NONE)
.build();

public static final RenderPipeline PIPELINE_QUADS = RenderPipeline.builder(net.minecraft.client.renderer.RenderPipelines.DEBUG_FILLED_SNIPPET)
.withLocation("pipeline/global_fill_pipeline")
.withVertexFormat(DefaultVertexFormat.POSITION_COLOR, VertexFormat.Mode.QUADS)
.withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR)
.withPrimitiveTopology(PrimitiveTopology.QUADS)
.withColorTargetState(WITH_BLEND)
.withCull(false)
.withDepthStencilState(DEPTH_NONE)
.build();

public static final RenderPipeline PIPELINE_TRI_FAN = RenderPipeline.builder(net.minecraft.client.renderer.RenderPipelines.DEBUG_FILLED_SNIPPET)
.withLocation("pipeline/global_fill_pipeline")
.withVertexFormat(DefaultVertexFormat.POSITION_COLOR, VertexFormat.Mode.TRIANGLE_FAN)
.withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR)
.withPrimitiveTopology(PrimitiveTopology.TRIANGLE_FAN)
.withColorTargetState(WITH_BLEND)
.withCull(false)
.withDepthStencilState(DEPTH_NONE)
.build();

public static final RenderPipeline PIPELINE_TRI_STRIP = RenderPipeline.builder(net.minecraft.client.renderer.RenderPipelines.DEBUG_FILLED_SNIPPET)
.withLocation("pipeline/global_fill_pipeline")
.withVertexFormat(DefaultVertexFormat.POSITION_COLOR, VertexFormat.Mode.TRIANGLE_STRIP)
.withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR)
.withPrimitiveTopology(PrimitiveTopology.TRIANGLE_STRIP)
.withColorTargetState(WITH_BLEND)
.withCull(false)
.withDepthStencilState(DEPTH_NONE)
.build();

public static final RenderPipeline PIPELINE_TRI = RenderPipeline.builder(net.minecraft.client.renderer.RenderPipelines.DEBUG_FILLED_SNIPPET)
.withLocation("pipeline/global_fill_pipeline")
.withVertexFormat(DefaultVertexFormat.POSITION_COLOR, VertexFormat.Mode.TRIANGLES)
.withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR)
.withPrimitiveTopology(PrimitiveTopology.TRIANGLES)
.withColorTargetState(WITH_BLEND)
.withCull(false)
.withDepthStencilState(DEPTH_NONE)
.build();

public static final RenderPipeline PIPELINE_TEX_QUADS = RenderPipeline.builder(net.minecraft.client.renderer.RenderPipelines.GUI_TEXTURED_SNIPPET)
.withLocation("pipeline/gui_textured")
.withVertexFormat(DefaultVertexFormat.POSITION_TEX_COLOR, VertexFormat.Mode.QUADS)
.withVertexBinding(0, DefaultVertexFormat.POSITION_TEX_COLOR)
.withPrimitiveTopology(PrimitiveTopology.QUADS)
.withColorTargetState(WITH_BLEND)
.withCull(false)
.withDepthStencilState(DEPTH_NONE)
.build();

public static final RenderPipeline PIPELINE_TEX_TRI_FAN = RenderPipeline.builder(net.minecraft.client.renderer.RenderPipelines.GUI_TEXTURED_SNIPPET)
.withLocation("pipeline/gui_textured")
.withVertexFormat(DefaultVertexFormat.POSITION_TEX_COLOR, VertexFormat.Mode.TRIANGLE_FAN)
.withVertexBinding(0, DefaultVertexFormat.POSITION_TEX_COLOR)
.withPrimitiveTopology(PrimitiveTopology.TRIANGLE_FAN)
.withColorTargetState(WITH_BLEND)
.withCull(false)
.withDepthStencilState(DEPTH_NONE)
.build();

public static final RenderPipeline PIPELINE_TRI_STRIP_CULL = RenderPipeline.builder(net.minecraft.client.renderer.RenderPipelines.DEBUG_FILLED_SNIPPET)
.withLocation("pipeline/global_fill_pipeline")
.withVertexFormat(DefaultVertexFormat.POSITION_COLOR, VertexFormat.Mode.TRIANGLE_STRIP)
.withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR)
.withPrimitiveTopology(PrimitiveTopology.TRIANGLE_STRIP)
.withColorTargetState(WITH_BLEND)
.withCull(true)
.withDepthStencilState(DEPTH_LEQUAL)
.build();

public static final RenderPipeline PIPELINE_TRI_FAN_CULL = RenderPipeline.builder(net.minecraft.client.renderer.RenderPipelines.DEBUG_FILLED_SNIPPET)
.withLocation("pipeline/global_fill_pipeline")
.withVertexFormat(DefaultVertexFormat.POSITION_COLOR, VertexFormat.Mode.TRIANGLE_FAN)
.withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR)
.withPrimitiveTopology(PrimitiveTopology.TRIANGLE_FAN)
.withColorTargetState(WITH_BLEND)
.withCull(false)
.withDepthStencilState(DEPTH_LEQUAL)
.build();

public static final RenderPipeline PIPELINE_QUADS_CULL = RenderPipeline.builder(net.minecraft.client.renderer.RenderPipelines.DEBUG_FILLED_SNIPPET)
.withLocation("pipeline/global_fill_pipeline")
.withVertexFormat(DefaultVertexFormat.POSITION_COLOR, VertexFormat.Mode.QUADS)
.withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR)
.withPrimitiveTopology(PrimitiveTopology.QUADS)
.withColorTargetState(WITH_BLEND)
.withCull(false)
.withDepthStencilState(DEPTH_LEQUAL)
.build();

public static final RenderPipeline PIPELINE_LINES_CULL = RenderPipeline.builder(net.minecraft.client.renderer.RenderPipelines.DEBUG_FILLED_SNIPPET)
.withLocation("pipeline/global_lines_pipeline")
.withVertexFormat(DefaultVertexFormat.POSITION_COLOR, VertexFormat.Mode.DEBUG_LINES)
.withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR)
.withPrimitiveTopology(PrimitiveTopology.DEBUG_LINES)
.withColorTargetState(WITH_BLEND)
.withCull(false)
.withDepthStencilState(DEPTH_LEQUAL)
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/clickcrystals.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"AccessorLivingEntity",
"MixinBlock",
"MixinEntity",
"MixinEntityType",
"MixinEntityTypes",
"MixinInventory",
"MixinItem",
"MixinItemStack",
Expand Down