Skip to content

Commit

Permalink
projection
Browse files Browse the repository at this point in the history
  • Loading branch information
RadonCoding committed Nov 3, 2023
1 parent 9cccdf5 commit bb144c9
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ private static boolean isGrounded(Level level, BlockPos pos) {
return hit.getType() == HitResult.Type.BLOCK;
}



@Override
public void onRelease(LivingEntity owner) {
ISorcererData cap = owner.getCapability(SorcererDataHandler.INSTANCE).resolve().orElseThrow();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ public void tick(LivingEntity owner) {

if (!owner.level().isClientSide) {
if (this.speedStacks > 0) {
this.applyModifier(owner, Attributes.MOVEMENT_SPEED, PROJECTION_SORCERY_MOVEMENT_SPEED_UUID, "Movement speed", this.speedStacks * 3.0D, AttributeModifier.Operation.MULTIPLY_TOTAL);
this.applyModifier(owner, Attributes.MOVEMENT_SPEED, PROJECTION_SORCERY_MOVEMENT_SPEED_UUID, "Movement speed", this.speedStacks * 2.0D, AttributeModifier.Operation.MULTIPLY_TOTAL);
this.applyModifier(owner, Attributes.ATTACK_SPEED, PROJECTION_ATTACK_SPEED_UUID, "Attack speed", this.speedStacks, AttributeModifier.Operation.MULTIPLY_TOTAL);
this.applyModifier(owner, ForgeMod.STEP_HEIGHT_ADDITION.get(), STEP_HEIGHT_ADDITION_UUID, "Step height addition", 2.0F, AttributeModifier.Operation.ADDITION);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package radon.jujutsu_kaisen.client.particle;

import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.brigadier.StringReader;
Expand All @@ -10,14 +11,12 @@
import net.minecraft.client.particle.*;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.entity.EntityRenderDispatcher;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.core.particles.ParticleOptions;
import net.minecraft.core.particles.ParticleType;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.phys.Vec3;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import radon.jujutsu_kaisen.client.MixinData;
Expand Down Expand Up @@ -124,13 +123,14 @@ public void render(@NotNull VertexConsumer pBuffer, @NotNull Camera pRenderInfo,
this.entity.setYRot(this.yRot);
this.entity.yRotO = this.yRot0;

EntityRenderDispatcher manager = Minecraft.getInstance().getEntityRenderDispatcher();
EntityRenderer<? super Entity> renderer = manager.getRenderer(this.entity);
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, this.alpha);

Vec3 offset = renderer.getRenderOffset(this.entity, pPartialTicks);
stack.translate((this.x - pRenderInfo.getPosition().x()) + offset.x(), (this.y - pRenderInfo.getPosition().y()) + offset.y(), (this.z - pRenderInfo.getPosition().z()) + offset.z());
EntityRenderDispatcher manager = Minecraft.getInstance().getEntityRenderDispatcher();
manager.render(this.entity, this.x - pRenderInfo.getPosition().x(), this.y - pRenderInfo.getPosition().y(), this.z - pRenderInfo.getPosition().z(), 0.0F, pPartialTicks, stack, buffer, manager.getPackedLightCoords(this.entity, pPartialTicks));

renderer.render(this.entity, 0.0F, pPartialTicks, stack, buffer, manager.getPackedLightCoords(this.entity, pPartialTicks));
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);

this.entity.yRotO = yRotO;
this.entity.setYRot(yRot);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package radon.jujutsu_kaisen.client.particle;

import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.brigadier.StringReader;
Expand Down Expand Up @@ -38,6 +39,8 @@ public class ProjectionParticle<T extends ProjectionParticle.ProjectionParticleO
protected ProjectionParticle(ClientLevel pLevel, double pX, double pY, double pZ, T options) {
super(pLevel, pX, pY, pZ);

this.alpha = 0.5F;

this.entityId = options.entityId();
this.yaw = options.yaw();
}
Expand Down Expand Up @@ -94,13 +97,14 @@ public void render(@NotNull VertexConsumer pBuffer, @NotNull Camera pRenderInfo,
this.entity.yBodyRot = this.yaw;
this.entity.yBodyRotO = this.yaw;

EntityRenderDispatcher manager = Minecraft.getInstance().getEntityRenderDispatcher();
EntityRenderer<? super Entity> renderer = manager.getRenderer(this.entity);
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, this.alpha);

Vec3 offset = renderer.getRenderOffset(this.entity, pPartialTicks);
stack.translate((this.x - pRenderInfo.getPosition().x()) + offset.x(), (this.y - pRenderInfo.getPosition().y()) + offset.y(), (this.z - pRenderInfo.getPosition().z()) + offset.z());
EntityRenderDispatcher manager = Minecraft.getInstance().getEntityRenderDispatcher();
manager.render(this.entity, this.x - pRenderInfo.getPosition().x(), this.y - pRenderInfo.getPosition().y(), this.z - pRenderInfo.getPosition().z(), 0.0F, pPartialTicks, stack, buffer, manager.getPackedLightCoords(this.entity, pPartialTicks));

renderer.render(this.entity, 0.0F, pPartialTicks, stack, buffer, manager.getPackedLightCoords(this.entity, pPartialTicks));
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);

this.entity.yBodyRotO = yBodyRotO;
this.entity.yBodyRot = yBodyRot;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bb144c9

Please sign in to comment.