diff --git a/src/main/java/io/github/itzispyder/clickcrystals/mixins/MixinEntityType.java b/src/main/java/io/github/itzispyder/clickcrystals/mixins/MixinEntityType.java deleted file mode 100644 index 4ef81349..00000000 --- a/src/main/java/io/github/itzispyder/clickcrystals/mixins/MixinEntityType.java +++ /dev/null @@ -1,18 +0,0 @@ -package io.github.itzispyder.clickcrystals.mixins; - -import io.github.itzispyder.clickcrystals.gui.misc.brushes.MobHeadBrush; -import net.minecraft.world.entity.Entity; -import net.minecraft.world.entity.EntityType; -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 MixinEntityType { - - @Inject(method = "Lnet/minecraft/world/entity/EntityType;register(Ljava/lang/String;Lnet/minecraft/world/entity/EntityType$Builder;)Lnet/minecraft/world/entity/EntityType;", at = @At("RETURN")) - private static void register(String vanillaId, EntityTypes.Builder builder, CallbackInfoReturnable> cir) { - MobHeadBrush.init(cir.getReturnValue(), vanillaId); - } -} \ No newline at end of file diff --git a/src/main/java/io/github/itzispyder/clickcrystals/mixins/MixinEntityTypes.java b/src/main/java/io/github/itzispyder/clickcrystals/mixins/MixinEntityTypes.java new file mode 100644 index 00000000..04149fa5 --- /dev/null +++ b/src/main/java/io/github/itzispyder/clickcrystals/mixins/MixinEntityTypes.java @@ -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 void register(ResourceKey> key, EntityType.Builder builder, CallbackInfoReturnable> cir) { + MobHeadBrush.init(cir.getReturnValue(), key.identifier().getPath()); + } +} \ No newline at end of file diff --git a/src/main/java/io/github/itzispyder/clickcrystals/mixins/MixinLightmap.java b/src/main/java/io/github/itzispyder/clickcrystals/mixins/MixinLightmap.java index 9cba0b1e..644290dc 100644 --- a/src/main/java/io/github/itzispyder/clickcrystals/mixins/MixinLightmap.java +++ b/src/main/java/io/github/itzispyder/clickcrystals/mixins/MixinLightmap.java @@ -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; @@ -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(); } diff --git a/src/main/java/io/github/itzispyder/clickcrystals/modules/modules/misc/DeathEffects.java b/src/main/java/io/github/itzispyder/clickcrystals/modules/modules/misc/DeathEffects.java index 16e8a7d0..f7596c04 100644 --- a/src/main/java/io/github/itzispyder/clickcrystals/modules/modules/misc/DeathEffects.java +++ b/src/main/java/io/github/itzispyder/clickcrystals/modules/modules/misc/DeathEffects.java @@ -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; diff --git a/src/main/java/io/github/itzispyder/clickcrystals/scripting/components/conditionalcontexts/ConditionalBlockInFov.java b/src/main/java/io/github/itzispyder/clickcrystals/scripting/components/conditionalcontexts/ConditionalBlockInFov.java index 67a52fc8..ae8a7d0e 100644 --- a/src/main/java/io/github/itzispyder/clickcrystals/scripting/components/conditionalcontexts/ConditionalBlockInFov.java +++ b/src/main/java/io/github/itzispyder/clickcrystals/scripting/components/conditionalcontexts/ConditionalBlockInFov.java @@ -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; diff --git a/src/main/java/io/github/itzispyder/clickcrystals/scripting/components/conditionalcontexts/ConditionalBlockInRange.java b/src/main/java/io/github/itzispyder/clickcrystals/scripting/components/conditionalcontexts/ConditionalBlockInRange.java index 907880d4..09e0491c 100644 --- a/src/main/java/io/github/itzispyder/clickcrystals/scripting/components/conditionalcontexts/ConditionalBlockInRange.java +++ b/src/main/java/io/github/itzispyder/clickcrystals/scripting/components/conditionalcontexts/ConditionalBlockInRange.java @@ -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; diff --git a/src/main/java/io/github/itzispyder/clickcrystals/util/minecraft/render/RenderPipelines.java b/src/main/java/io/github/itzispyder/clickcrystals/util/minecraft/render/RenderPipelines.java index 32b1e10a..b2dc685b 100644 --- a/src/main/java/io/github/itzispyder/clickcrystals/util/minecraft/render/RenderPipelines.java +++ b/src/main/java/io/github/itzispyder/clickcrystals/util/minecraft/render/RenderPipelines.java @@ -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 { @@ -16,7 +16,8 @@ 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) @@ -24,7 +25,8 @@ public class RenderPipelines { 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) @@ -32,7 +34,8 @@ public class RenderPipelines { 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) @@ -40,7 +43,8 @@ public class RenderPipelines { 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) @@ -48,7 +52,8 @@ public class RenderPipelines { 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) @@ -56,7 +61,8 @@ public class RenderPipelines { 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) @@ -64,7 +70,8 @@ public class RenderPipelines { 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) @@ -72,7 +79,8 @@ public class RenderPipelines { 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) @@ -80,7 +88,8 @@ public class RenderPipelines { 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) @@ -88,7 +97,8 @@ public class RenderPipelines { 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) @@ -96,7 +106,8 @@ public class RenderPipelines { 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) @@ -104,7 +115,8 @@ public class RenderPipelines { 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) diff --git a/src/main/resources/clickcrystals.mixins.json b/src/main/resources/clickcrystals.mixins.json index 5aa8cdaa..3ba4afd1 100644 --- a/src/main/resources/clickcrystals.mixins.json +++ b/src/main/resources/clickcrystals.mixins.json @@ -42,7 +42,7 @@ "AccessorLivingEntity", "MixinBlock", "MixinEntity", - "MixinEntityType", + "MixinEntityTypes", "MixinInventory", "MixinItem", "MixinItemStack",