-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
separated out missile (formerly projectile) & lob
- Loading branch information
1 parent
92e8933
commit b41edec
Showing
28 changed files
with
337 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...va/dev/cammiescorner/arcanuscontinuum/client/renderer/entity/magic/LobEntityRenderer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package dev.cammiescorner.arcanuscontinuum.client.renderer.entity.magic; | ||
|
||
import com.mojang.blaze3d.vertex.PoseStack; | ||
import com.mojang.blaze3d.vertex.VertexConsumer; | ||
import dev.cammiescorner.arcanuscontinuum.Arcanus; | ||
import dev.cammiescorner.arcanuscontinuum.client.ArcanusClient; | ||
import dev.cammiescorner.arcanuscontinuum.client.models.entity.magic.MagicLobModel; | ||
import dev.cammiescorner.arcanuscontinuum.common.entities.magic.Lob; | ||
import dev.cammiescorner.arcanuscontinuum.common.util.ArcanusHelper; | ||
import dev.cammiescorner.arcanuscontinuum.common.util.Color; | ||
import net.minecraft.client.renderer.MultiBufferSource; | ||
import net.minecraft.client.renderer.entity.ArrowRenderer; | ||
import net.minecraft.client.renderer.entity.EntityRendererProvider; | ||
import net.minecraft.client.renderer.texture.OverlayTexture; | ||
import net.minecraft.resources.ResourceLocation; | ||
|
||
public class LobEntityRenderer extends ArrowRenderer<Lob> { | ||
private static final ResourceLocation LOB_TEXTURE = Arcanus.id("textures/entity/magic/lob.png"); | ||
private final MagicLobModel lobModel; | ||
|
||
public LobEntityRenderer(EntityRendererProvider.Context context) { | ||
super(context); | ||
lobModel = new MagicLobModel(context.getModelSet().bakeLayer(MagicLobModel.MODEL_LAYER)); | ||
} | ||
|
||
@Override | ||
public void render(Lob entity, float yaw, float tickDelta, PoseStack matrices, MultiBufferSource vertices, int light) { | ||
VertexConsumer consumer = vertices.getBuffer(ArcanusClient.getMagicCircles(getTextureLocation(entity))); | ||
Color color = ArcanusHelper.getMagicColor(entity); | ||
|
||
matrices.pushPose(); | ||
|
||
matrices.translate(0, 0.3, 0); | ||
lobModel.cube1.xRot = (entity.tickCount + tickDelta) * 0.1f; | ||
lobModel.cube1.yRot = (entity.tickCount + tickDelta) * 0.1f; | ||
lobModel.cube2.yRot = -(entity.tickCount + tickDelta) * 0.125f; | ||
lobModel.cube2.zRot = -(entity.tickCount + tickDelta) * 0.125f; | ||
lobModel.cube3.zRot = (entity.tickCount + tickDelta) * 0.15f; | ||
lobModel.cube3.xRot = (entity.tickCount + tickDelta) * 0.15f; | ||
lobModel.renderToBuffer(matrices, consumer, light, OverlayTexture.NO_OVERLAY, color.redF(), color.greenF(), color.blueF(), 1f); | ||
|
||
matrices.popPose(); | ||
} | ||
|
||
@Override | ||
public ResourceLocation getTextureLocation(Lob entity) { | ||
return LOB_TEXTURE; | ||
} | ||
} |
68 changes: 0 additions & 68 deletions
68
...escorner/arcanuscontinuum/client/renderer/entity/magic/MagicProjectileEntityRenderer.java
This file was deleted.
Oops, something went wrong.
50 changes: 50 additions & 0 deletions
50
...ev/cammiescorner/arcanuscontinuum/client/renderer/entity/magic/MissileEntityRenderer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package dev.cammiescorner.arcanuscontinuum.client.renderer.entity.magic; | ||
|
||
import com.mojang.blaze3d.vertex.PoseStack; | ||
import com.mojang.blaze3d.vertex.VertexConsumer; | ||
import com.mojang.math.Axis; | ||
import dev.cammiescorner.arcanuscontinuum.Arcanus; | ||
import dev.cammiescorner.arcanuscontinuum.client.ArcanusClient; | ||
import dev.cammiescorner.arcanuscontinuum.client.models.entity.magic.MagicProjectileModel; | ||
import dev.cammiescorner.arcanuscontinuum.common.entities.magic.Missile; | ||
import dev.cammiescorner.arcanuscontinuum.common.util.ArcanusHelper; | ||
import dev.cammiescorner.arcanuscontinuum.common.util.Color; | ||
import net.minecraft.client.renderer.MultiBufferSource; | ||
import net.minecraft.client.renderer.entity.ArrowRenderer; | ||
import net.minecraft.client.renderer.entity.EntityRendererProvider; | ||
import net.minecraft.client.renderer.texture.OverlayTexture; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.util.Mth; | ||
|
||
public class MissileEntityRenderer extends ArrowRenderer<Missile> { | ||
private static final ResourceLocation PROJECTILE_TEXTURE = Arcanus.id("textures/entity/magic/projectile.png"); | ||
private final MagicProjectileModel projectileModel; | ||
|
||
public MissileEntityRenderer(EntityRendererProvider.Context context) { | ||
super(context); | ||
projectileModel = new MagicProjectileModel(context.getModelSet().bakeLayer(MagicProjectileModel.MODEL_LAYER)); | ||
} | ||
|
||
@Override | ||
public void render(Missile entity, float yaw, float tickDelta, PoseStack matrices, MultiBufferSource vertices, int light) { | ||
VertexConsumer consumer = vertices.getBuffer(ArcanusClient.getMagicCircles(getTextureLocation(entity))); | ||
Color color = ArcanusHelper.getMagicColor(entity); | ||
|
||
matrices.pushPose(); | ||
|
||
matrices.mulPose(Axis.YP.rotationDegrees(Mth.lerp(tickDelta, entity.yRotO, entity.getYRot()) - 180f)); | ||
matrices.mulPose(Axis.XP.rotationDegrees(Mth.lerp(tickDelta, entity.xRotO, entity.getXRot()))); | ||
matrices.translate(0f, -1f, 0f); | ||
projectileModel.ring1.zRot = (entity.tickCount + tickDelta) * 0.1f; | ||
projectileModel.ring2.zRot = -(entity.tickCount + tickDelta) * 0.125f; | ||
projectileModel.ring3.zRot = (entity.tickCount + tickDelta) * 0.15f; | ||
projectileModel.renderToBuffer(matrices, consumer, light, OverlayTexture.NO_OVERLAY, color.redF(), color.greenF(), color.blueF(), 1f); | ||
|
||
matrices.popPose(); | ||
} | ||
|
||
@Override | ||
public ResourceLocation getTextureLocation(Missile entity) { | ||
return PROJECTILE_TEXTURE; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
src/main/java/dev/cammiescorner/arcanuscontinuum/common/entities/magic/GuidedShot.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package dev.cammiescorner.arcanuscontinuum.common.entities.magic; | ||
|
||
public class GuidedShot { | ||
} |
Oops, something went wrong.