-
Notifications
You must be signed in to change notification settings - Fork 101
Cheese slime #528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Cheese slime #528
Conversation
Still need to handle spawning.
| } | ||
|
|
||
| @Override | ||
| public void render(CheeseSlimeEntity cheeseSlime, float f, float g, PoseStack poseStack, MultiBufferSource multiBufferSource, int i) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think tickDelta, partialTick and partialTicks are used fairly interchangeably (which I might standardise at some point), but any of these should give people reading the code a better idea of what these numbers represent than just single letters.
Galacticraft/src/main/java/dev/galacticraft/mod/client/render/entity/BubbleEntityRenderer.java
Line 52 in 624d9bd
| public void render(BubbleEntity entity, float yaw, float tickDelta, PoseStack matrices, MultiBufferSource vertexConsumers, int light) { |
Line 48 in 624d9bd
| public void render(RocketEntity entity, float yaw, float partialTick, PoseStack matrices, MultiBufferSource vertexConsumers, int light) { |
| float h = cheeseSlime.getSize(); | ||
| float i = Mth.lerp(f, cheeseSlime.oSquish, cheeseSlime.squish) / (h * 0.5F + 1.0F); | ||
| float j = 1.0F / (i + 1.0F); | ||
| poseStack.scale(j * h, 1.0F / j * h, j * h); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
h divided by j would be much clearer, if indeed that is what you intended.
| poseStack.scale(j * h, 1.0F / j * h, j * h); | |
| poseStack.scale(j * h, h / j, j * h); |
| } | ||
|
|
||
| @Override | ||
| protected void scale(CheeseSlimeEntity cheeseSlime, PoseStack poseStack, float f) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the float f here is also the tickDelta/partialTick/partialTicks.
|
|
||
| import java.util.EnumSet; | ||
|
|
||
| public class CheeseSlimeEntity extends Mob implements Enemy { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason you aren't extending Slime, which would remove the need for so much duplicated code?
| this.model = new SlimeModel<>(set.bakeLayer(ModelLayers.SLIME_OUTER)); | ||
| } | ||
|
|
||
| public void render(PoseStack poseStack, MultiBufferSource multiBufferSource, int i, T livingEntity, float f, float g, float h, float j, float k, float l) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is better to use more descriptive names rather than single characters, but I do appreciate that it can be hard to find what variables represent/should be called sometimes.
Line 92 in 624d9bd
| public void render(PoseStack matrices, MultiBufferSource vertexConsumers, int light, T entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) { |

Adds a Cheese Slime to the game. Basically the same as a normal slime but with a new skin. Can adapt and make changes as code is completely separate to a Slime.
Plan is to use it on the moon in the cheese caves.
Could possibly do with a better texture. Can change the model to suit if necessary.