Made triffid take reduced projectile damage
Fixed fallen king crown New basilisk texture Overhaul nightmare AI
This commit is contained in:
1 parent
8bb2720a11
commit
bd09c6ec7f
16 files changed
+1798
-2334
No files matched your search
+20
@@ -2,7 +2,12 @@ package com.craisinlord.antarchy.content.client.renderer;
|
||||
|
||||
import com.craisinlord.antarchy.content.client.model.BasiliskModel;
|
||||
import com.craisinlord.antarchy.content.entity.basilisk.BasiliskEntity;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||
import net.minecraft.client.renderer.MultiBufferSource;
|
||||
import net.minecraft.client.renderer.entity.EntityRendererProvider;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import software.bernie.geckolib.cache.object.BakedGeoModel;
|
||||
import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
public class BasiliskRenderer extends GeoEntityRenderer<BasiliskEntity> {
|
||||
@@ -11,4 +16,19 @@ public class BasiliskRenderer extends GeoEntityRenderer<BasiliskEntity> {
|
||||
super(context, new BasiliskModel());
|
||||
this.shadowRadius = 1.0F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preRender(PoseStack poseStack, BasiliskEntity animatable, BakedGeoModel model,
|
||||
@Nullable MultiBufferSource bufferSource, @Nullable VertexConsumer buffer,
|
||||
boolean isReRender, float partialTick, int packedLight, int packedOverlay, int colour) {
|
||||
super.preRender(poseStack, animatable, model, bufferSource, buffer, isReRender, partialTick, packedLight, packedOverlay, colour);
|
||||
if (animatable.isDeadOrDying()) {
|
||||
poseStack.translate(0.0D, -0.35D, 0.0D);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float getDeathMaxRotation(BasiliskEntity animatable) {
|
||||
return 0.0F;
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,7 @@ import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.tags.DamageTypeTags;
|
||||
import net.minecraft.world.damagesource.DamageSource;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
@@ -226,6 +227,9 @@ public class TriffidEntity extends Monster implements GeoEntity {
|
||||
if (this.isInvulnerableTo(source)) {
|
||||
return false;
|
||||
}
|
||||
if (source.is(DamageTypeTags.IS_PROJECTILE)) {
|
||||
amount *= 0.33333334F;
|
||||
}
|
||||
return super.hurt(source, amount);
|
||||
}
|
||||
|
||||
|
||||
+84
-1
@@ -44,17 +44,29 @@ import software.bernie.geckolib.animation.PlayState;
|
||||
import software.bernie.geckolib.animation.RawAnimation;
|
||||
import software.bernie.geckolib.animation.keyframe.event.builtin.AutoPlayingSoundKeyframeHandler;
|
||||
import software.bernie.geckolib.util.GeckoLibUtil;
|
||||
import net.minecraft.network.syncher.EntityDataAccessor;
|
||||
import net.minecraft.network.syncher.EntityDataSerializers;
|
||||
import net.minecraft.network.syncher.SynchedEntityData;
|
||||
|
||||
import java.util.UUID;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
public class BasiliskEntity extends Monster implements GeoEntity {
|
||||
private static final EntityDataAccessor<Integer> ANIMATION_STATE =
|
||||
SynchedEntityData.defineId(BasiliskEntity.class, EntityDataSerializers.INT);
|
||||
private static final byte ATTACK_ENTITY_EVENT = 4;
|
||||
private static final int ATTACK_ANIM_TICKS = 18;
|
||||
private static final int DEATH_TICKS = 25;
|
||||
|
||||
private static final int ANIM_IDLE = 0;
|
||||
private static final int ANIM_WALK = 1;
|
||||
private static final int ANIM_ATTACK = 2;
|
||||
private static final int ANIM_DEATH = 3;
|
||||
|
||||
private static final RawAnimation IDLE_ANIM = RawAnimation.begin().thenLoop("idle");
|
||||
private static final RawAnimation WALK_ANIM = RawAnimation.begin().thenLoop("walk");
|
||||
private static final RawAnimation ATTACK_ANIM = RawAnimation.begin().thenPlay("attack");
|
||||
private static final RawAnimation DEATH_ANIM = RawAnimation.begin().thenPlay("death");
|
||||
|
||||
private static final int HISS_COOLDOWN_TICKS = 600;
|
||||
private static final double GAZE_RANGE = 12.0D;
|
||||
@@ -82,6 +94,12 @@ public class BasiliskEntity extends Monster implements GeoEntity {
|
||||
this.xpReward = 50;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void defineSynchedData(SynchedEntityData.Builder builder) {
|
||||
super.defineSynchedData(builder);
|
||||
builder.define(ANIMATION_STATE, ANIM_IDLE);
|
||||
}
|
||||
|
||||
public static AttributeSupplier.Builder createAttributes() {
|
||||
return Monster.createMonsterAttributes()
|
||||
.add(Attributes.MAX_HEALTH, 150.0D)
|
||||
@@ -149,12 +167,18 @@ public class BasiliskEntity extends Monster implements GeoEntity {
|
||||
this.attackAnimTicks--;
|
||||
}
|
||||
|
||||
if (this.isDeadOrDying()) {
|
||||
this.updateAnimationState();
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.level().isClientSide) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.tickPlayerPetrification();
|
||||
this.tickPreyPetrification();
|
||||
this.updateAnimationState();
|
||||
}
|
||||
|
||||
private void tickPlayerPetrification() {
|
||||
@@ -346,9 +370,15 @@ public class BasiliskEntity extends Monster implements GeoEntity {
|
||||
}
|
||||
|
||||
private PlayState mainController(AnimationState<BasiliskEntity> state) {
|
||||
if (this.attackAnimTicks > 0) {
|
||||
if (this.getAnimationState() == ANIM_DEATH) {
|
||||
return state.setAndContinue(DEATH_ANIM);
|
||||
}
|
||||
if (this.getAnimationState() == ANIM_ATTACK) {
|
||||
return state.setAndContinue(ATTACK_ANIM);
|
||||
}
|
||||
if (this.getAnimationState() == ANIM_WALK) {
|
||||
return state.setAndContinue(WALK_ANIM);
|
||||
}
|
||||
if (this.getTarget() != null || this.hissChargeTimer > 0 || this.pendingTargetId != null) {
|
||||
return state.setAndContinue(WALK_ANIM);
|
||||
}
|
||||
@@ -367,11 +397,64 @@ public class BasiliskEntity extends Monster implements GeoEntity {
|
||||
public void handleEntityEvent(byte id) {
|
||||
if (id == ATTACK_ENTITY_EVENT) {
|
||||
this.attackAnimTicks = ATTACK_ANIM_TICKS;
|
||||
this.setAnimationState(ANIM_ATTACK);
|
||||
return;
|
||||
}
|
||||
super.handleEntityEvent(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void die(DamageSource damageSource) {
|
||||
if (!this.level().isClientSide) {
|
||||
this.setAnimationState(ANIM_DEATH);
|
||||
this.attackAnimTicks = 0;
|
||||
this.hissChargeTimer = 0;
|
||||
this.pendingTargetId = null;
|
||||
this.getNavigation().stop();
|
||||
this.setDeltaMovement(Vec3.ZERO);
|
||||
}
|
||||
super.die(damageSource);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tickDeath() {
|
||||
this.deathTime++;
|
||||
if (this.deathTime == 1) {
|
||||
this.setAnimationState(ANIM_DEATH);
|
||||
}
|
||||
if (this.deathTime >= DEATH_TICKS) {
|
||||
this.remove(RemovalReason.KILLED);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateAnimationState() {
|
||||
if (this.isDeadOrDying()) {
|
||||
this.setAnimationState(ANIM_DEATH);
|
||||
return;
|
||||
}
|
||||
if (this.attackAnimTicks > 0) {
|
||||
this.setAnimationState(ANIM_ATTACK);
|
||||
return;
|
||||
}
|
||||
if (this.getTarget() != null || this.hissChargeTimer > 0 || this.pendingTargetId != null) {
|
||||
this.setAnimationState(ANIM_WALK);
|
||||
return;
|
||||
}
|
||||
if (this.getDeltaMovement().horizontalDistanceSqr() > 1.0E-4D) {
|
||||
this.setAnimationState(ANIM_WALK);
|
||||
return;
|
||||
}
|
||||
this.setAnimationState(ANIM_IDLE);
|
||||
}
|
||||
|
||||
private int getAnimationState() {
|
||||
return this.entityData.get(ANIMATION_STATE);
|
||||
}
|
||||
|
||||
private void setAnimationState(int state) {
|
||||
this.entityData.set(ANIMATION_STATE, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAttack(LivingEntity target) {
|
||||
if (target instanceof Player player) {
|
||||
|
||||
+237
-555
File diff suppressed because it is too large.
Load diff
@@ -34,5 +34,6 @@ public abstract class SplashManagerMixin {
|
||||
this.splashes.add("Ants Ants Revolution!");
|
||||
this.splashes.add("Rainbow sugar yummy");
|
||||
this.splashes.add("Now with inverted gravity!");
|
||||
this.splashes.add("Everything we need is already here");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user