mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-01 19:46:42 +01:00
Fixed crash when spawning a butterfly, when updating a cuccoon entity,
This commit is contained in:
parent
d95086c807
commit
77ccd14745
3 changed files with 9 additions and 16 deletions
|
@ -6,7 +6,6 @@ import javax.annotation.Nullable;
|
||||||
|
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityCategory;
|
|
||||||
import net.minecraft.entity.EntityPose;
|
import net.minecraft.entity.EntityPose;
|
||||||
import net.minecraft.entity.EntityType;
|
import net.minecraft.entity.EntityType;
|
||||||
import net.minecraft.entity.SpawnType;
|
import net.minecraft.entity.SpawnType;
|
||||||
|
@ -29,11 +28,7 @@ import net.minecraft.world.biome.Biome.SpawnEntry;
|
||||||
|
|
||||||
public class ButterflyEntity extends AmbientEntity {
|
public class ButterflyEntity extends AmbientEntity {
|
||||||
|
|
||||||
public static final EntityType<ButterflyEntity> TYPE = EntityType.Builder.create(ButterflyEntity::new, EntityCategory.AMBIENT)
|
public static final SpawnEntry SPAWN_ENTRY = new SpawnEntry(UEntities.BUTTERFLY, 15, 9, 15);
|
||||||
.setDimensions(0.1F, 0.1F)
|
|
||||||
.build("butterfly");
|
|
||||||
|
|
||||||
public static final SpawnEntry SPAWN_ENTRY = new SpawnEntry(TYPE, 15, 9, 15);
|
|
||||||
|
|
||||||
private static final TrackedData<Boolean> RESTING = DataTracker.registerData(ButterflyEntity.class, TrackedDataHandlerRegistry.BOOLEAN);
|
private static final TrackedData<Boolean> RESTING = DataTracker.registerData(ButterflyEntity.class, TrackedDataHandlerRegistry.BOOLEAN);
|
||||||
|
|
||||||
|
|
|
@ -110,8 +110,9 @@ public class CuccoonEntity extends LivingEntity implements IMagicals, InAnimate
|
||||||
public void tick() {
|
public void tick() {
|
||||||
super.tick();
|
super.tick();
|
||||||
|
|
||||||
if (hasPassengers()) {
|
Entity passenger = getPrimaryPassenger();
|
||||||
Entity passenger = getPrimaryPassenger();
|
|
||||||
|
if (passenger != null) {
|
||||||
|
|
||||||
boolean sneaking = passenger.isSneaking();
|
boolean sneaking = passenger.isSneaking();
|
||||||
|
|
||||||
|
|
|
@ -46,18 +46,15 @@ import net.minecraft.world.explosion.Explosion.DestructionType;
|
||||||
|
|
||||||
public class SpellcastEntity extends MobEntityWithAi implements IMagicals, Caster<LivingEntity>, InAnimate, PickedItemSupplier {
|
public class SpellcastEntity extends MobEntityWithAi implements IMagicals, Caster<LivingEntity>, InAnimate, PickedItemSupplier {
|
||||||
|
|
||||||
|
private static final TrackedData<Integer> LEVEL = DataTracker.registerData(SpellcastEntity.class, TrackedDataHandlerRegistry.INTEGER);
|
||||||
|
private static final TrackedData<Optional<UUID>> OWNER = DataTracker.registerData(SpellcastEntity.class, TrackedDataHandlerRegistry.OPTIONAL_UUID);
|
||||||
|
private static final TrackedData<CompoundTag> EFFECT = DataTracker.registerData(SpellcastEntity.class, TrackedDataHandlerRegistry.TAG_COMPOUND);
|
||||||
|
private static final TrackedData<Integer> AFFINITY = DataTracker.registerData(SpellcastEntity.class, TrackedDataHandlerRegistry.INTEGER);
|
||||||
|
|
||||||
private LivingEntity owner = null;
|
private LivingEntity owner = null;
|
||||||
|
|
||||||
public float hoverStart;
|
public float hoverStart;
|
||||||
|
|
||||||
private static final TrackedData<Integer> LEVEL = DataTracker.registerData(SpellcastEntity.class, TrackedDataHandlerRegistry.INTEGER);
|
|
||||||
|
|
||||||
private static final TrackedData<Optional<UUID>> OWNER = DataTracker.registerData(SpellcastEntity.class, TrackedDataHandlerRegistry.OPTIONAL_UUID);
|
|
||||||
|
|
||||||
private static final TrackedData<CompoundTag> EFFECT = DataTracker.registerData(SpellcastEntity.class, TrackedDataHandlerRegistry.TAG_COMPOUND);
|
|
||||||
|
|
||||||
private static final TrackedData<Integer> AFFINITY = DataTracker.registerData(SpellcastEntity.class, TrackedDataHandlerRegistry.INTEGER);
|
|
||||||
|
|
||||||
private final EffectSync effectDelegate = new EffectSync(this, EFFECT);
|
private final EffectSync effectDelegate = new EffectSync(this, EFFECT);
|
||||||
|
|
||||||
public SpellcastEntity(EntityType<SpellcastEntity> type, World w) {
|
public SpellcastEntity(EntityType<SpellcastEntity> type, World w) {
|
||||||
|
|
Loading…
Reference in a new issue