mirror of
https://github.com/ACGaming/Spackenmobs
synced 2024-05-19 20:04:10 +02:00
Compare commits
2 commits
5fedcd0fda
...
1a07d7c71a
Author | SHA1 | Date | |
---|---|---|---|
1a07d7c71a | |||
00dcec01a8 |
|
@ -20,7 +20,7 @@ sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = co
|
|||
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
|
||||
|
||||
minecraft {
|
||||
mappings channel: 'snapshot', version: '20201028-1.16.3'
|
||||
mappings channel: 'official', version: '1.16.5'
|
||||
|
||||
runs {
|
||||
client {
|
||||
|
@ -74,7 +74,7 @@ minecraft {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
minecraft 'net.minecraftforge:forge:1.16.5-36.1.0'
|
||||
minecraft 'net.minecraftforge:forge:1.16.5-36.2.29'
|
||||
}
|
||||
|
||||
jar {
|
||||
|
|
|
@ -8,5 +8,5 @@ jar_name=Spackenmobs
|
|||
mod_id=spackenmobs
|
||||
|
||||
# Version
|
||||
mc_version=1.16.4
|
||||
mc_version=1.16.5
|
||||
version=1.1
|
|
@ -21,13 +21,13 @@ public abstract class AbstractDrachenlordRenderer<T extends DrachenlordEntity, M
|
|||
this.addLayer(new BipedArmorLayer<>(this, p_i50974_3_, p_i50974_4_));
|
||||
}
|
||||
|
||||
public ResourceLocation getEntityTexture(DrachenlordEntity entity)
|
||||
public ResourceLocation getTextureLocation(DrachenlordEntity entity)
|
||||
{
|
||||
return DRACHENLORD_TEXTURES;
|
||||
}
|
||||
|
||||
protected boolean func_230495_a_(T p_230495_1_)
|
||||
protected boolean isShaking(T p_230495_1_)
|
||||
{
|
||||
return p_230495_1_.isDrowning();
|
||||
return p_230495_1_.isUnderWaterConverting();
|
||||
}
|
||||
}
|
|
@ -21,13 +21,13 @@ public abstract class AbstractMarcellDAvisRenderer<T extends MarcellDAvisEntity,
|
|||
this.addLayer(new BipedArmorLayer<>(this, p_i50974_3_, p_i50974_4_));
|
||||
}
|
||||
|
||||
public ResourceLocation getEntityTexture(MarcellDAvisEntity entity)
|
||||
public ResourceLocation getTextureLocation(MarcellDAvisEntity entity)
|
||||
{
|
||||
return MARCELLDAVIS_TEXTURES;
|
||||
}
|
||||
|
||||
protected boolean func_230495_a_(T p_230495_1_)
|
||||
protected boolean isShaking(T p_230495_1_)
|
||||
{
|
||||
return p_230495_1_.isDrowning();
|
||||
return p_230495_1_.isUnderWaterConverting();
|
||||
}
|
||||
}
|
|
@ -21,13 +21,13 @@ public abstract class AbstractMrBeanRenderer<T extends MrBeanEntity, M extends Z
|
|||
this.addLayer(new BipedArmorLayer<>(this, p_i50974_3_, p_i50974_4_));
|
||||
}
|
||||
|
||||
public ResourceLocation getEntityTexture(MrBeanEntity entity)
|
||||
public ResourceLocation getTextureLocation(MrBeanEntity entity)
|
||||
{
|
||||
return MRBEAN_TEXTURES;
|
||||
}
|
||||
|
||||
protected boolean func_230495_a_(T p_230495_1_)
|
||||
protected boolean isShaking(T p_230495_1_)
|
||||
{
|
||||
return p_230495_1_.isDrowning();
|
||||
return p_230495_1_.isUnderWaterConverting();
|
||||
}
|
||||
}
|
|
@ -21,7 +21,7 @@ public class ApoRedRenderer extends BipedRenderer<AbstractApoRedEntity, Skeleton
|
|||
this.addLayer(new BipedArmorLayer<>(this, new SkeletonModel(0.5F, true), new SkeletonModel(1.0F, true)));
|
||||
}
|
||||
|
||||
public ResourceLocation getEntityTexture(AbstractApoRedEntity entity)
|
||||
public ResourceLocation getTextureLocation(AbstractApoRedEntity entity)
|
||||
{
|
||||
return APORED_TEXTURES;
|
||||
}
|
||||
|
|
|
@ -23,18 +23,18 @@ public class BakaMitaiCreeperRenderer extends MobRenderer<BakaMitaiCreeperEntity
|
|||
this.addLayer(new BakaMitaiCreeperChargeLayer(this));
|
||||
}
|
||||
|
||||
public ResourceLocation getEntityTexture(BakaMitaiCreeperEntity entity)
|
||||
public ResourceLocation getTextureLocation(BakaMitaiCreeperEntity entity)
|
||||
{
|
||||
return CREEPER_TEXTURES;
|
||||
}
|
||||
|
||||
protected float getOverlayProgress(BakaMitaiCreeperEntity livingEntityIn, float partialTicks)
|
||||
protected float getWhiteOverlayProgress(BakaMitaiCreeperEntity livingEntityIn, float partialTicks)
|
||||
{
|
||||
float f = livingEntityIn.getCreeperFlashIntensity(partialTicks);
|
||||
return (int) (f * 10.0F) % 2 == 0 ? 0.0F : MathHelper.clamp(f, 0.5F, 1.0F);
|
||||
}
|
||||
|
||||
protected void preRenderCallback(BakaMitaiCreeperEntity entitylivingbaseIn, MatrixStack matrixStackIn, float partialTickTime)
|
||||
protected void scale(BakaMitaiCreeperEntity entitylivingbaseIn, MatrixStack matrixStackIn, float partialTickTime)
|
||||
{
|
||||
float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime);
|
||||
float f1 = 1.0F + MathHelper.sin(f * 100.0F) * f * 0.01F;
|
||||
|
|
|
@ -12,25 +12,25 @@ import mod.acgaming.spackenmobs.entity.DagiBeeEntity;
|
|||
@OnlyIn(Dist.CLIENT)
|
||||
public class DagiBeeRenderer extends MobRenderer<DagiBeeEntity, BeeModel<DagiBeeEntity>>
|
||||
{
|
||||
private static final ResourceLocation field_229040_a_ = new ResourceLocation("textures/entity/bee/bee_angry.png");
|
||||
private static final ResourceLocation field_229041_g_ = new ResourceLocation("textures/entity/bee/bee_angry_nectar.png");
|
||||
private static final ResourceLocation field_229042_h_ = new ResourceLocation("textures/entity/bee/bee.png");
|
||||
private static final ResourceLocation field_229043_i_ = new ResourceLocation("textures/entity/bee/bee_nectar.png");
|
||||
private static final ResourceLocation ANGRY_BEE_TEXTURE = new ResourceLocation("textures/entity/bee/bee_angry.png");
|
||||
private static final ResourceLocation ANGRY_NECTAR_BEE_TEXTURE = new ResourceLocation("textures/entity/bee/bee_angry_nectar.png");
|
||||
private static final ResourceLocation BEE_TEXTURE = new ResourceLocation("textures/entity/bee/bee.png");
|
||||
private static final ResourceLocation NECTAR_BEE_TEXTURE = new ResourceLocation("textures/entity/bee/bee_nectar.png");
|
||||
|
||||
public DagiBeeRenderer(EntityRendererManager p_i226033_1_)
|
||||
{
|
||||
super(p_i226033_1_, new BeeModel<>(), 0.4F);
|
||||
}
|
||||
|
||||
public ResourceLocation getEntityTexture(DagiBeeEntity entity)
|
||||
public ResourceLocation getTextureLocation(DagiBeeEntity entity)
|
||||
{
|
||||
if (entity.func_233678_J__())
|
||||
if (entity.isAngry())
|
||||
{
|
||||
return entity.hasNectar() ? field_229041_g_ : field_229040_a_;
|
||||
return entity.hasNectar() ? ANGRY_NECTAR_BEE_TEXTURE : ANGRY_BEE_TEXTURE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return entity.hasNectar() ? field_229043_i_ : field_229042_h_;
|
||||
return entity.hasNectar() ? NECTAR_BEE_TEXTURE : BEE_TEXTURE;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -21,7 +21,7 @@ public class FriedrichLiechtensteinRenderer extends MobRenderer<FriedrichLiechte
|
|||
this.addLayer(new HeldItemLayer<>(this));
|
||||
}
|
||||
|
||||
public ResourceLocation getEntityTexture(FriedrichLiechtensteinEntity entity)
|
||||
public ResourceLocation getTextureLocation(FriedrichLiechtensteinEntity entity)
|
||||
{
|
||||
return FRIEDRICH_TEXTURES;
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ public class GiselaRenderer extends MobRenderer<GiselaEntity, BipedModel<GiselaE
|
|||
super(renderManagerIn, new BipedModel<>(0.0F), 0.25F);
|
||||
}
|
||||
|
||||
public ResourceLocation getEntityTexture(GiselaEntity entity)
|
||||
public ResourceLocation getTextureLocation(GiselaEntity entity)
|
||||
{
|
||||
return GISELA_TEXTURES;
|
||||
}
|
||||
|
|
|
@ -20,12 +20,12 @@ public class HolzstammhuhnRenderer extends MobRenderer<HolzstammhuhnEntity, Chic
|
|||
super(renderManagerIn, new ChickenModel<>(), 0.3F);
|
||||
}
|
||||
|
||||
public ResourceLocation getEntityTexture(HolzstammhuhnEntity entity)
|
||||
public ResourceLocation getTextureLocation(HolzstammhuhnEntity entity)
|
||||
{
|
||||
return HOLZSTAMMHUHN_TEXTURES;
|
||||
}
|
||||
|
||||
protected float handleRotationFloat(HolzstammhuhnEntity livingBase, float partialTicks)
|
||||
protected float getBob(HolzstammhuhnEntity livingBase, float partialTicks)
|
||||
{
|
||||
float f = MathHelper.lerp(partialTicks, livingBase.oFlap, livingBase.wingRotation);
|
||||
float f1 = MathHelper.lerp(partialTicks, livingBase.oFlapSpeed, livingBase.destPos);
|
||||
|
|
|
@ -24,18 +24,18 @@ public class IslamistRenderer extends MobRenderer<IslamistEntity, CreeperModel<I
|
|||
this.addLayer(new IslamistChargeLayer(this));
|
||||
}
|
||||
|
||||
public ResourceLocation getEntityTexture(IslamistEntity entity)
|
||||
public ResourceLocation getTextureLocation(IslamistEntity entity)
|
||||
{
|
||||
return ISLAMIST_TEXTURES;
|
||||
}
|
||||
|
||||
protected float getOverlayProgress(IslamistEntity livingEntityIn, float partialTicks)
|
||||
protected float getWhiteOverlayProgress(IslamistEntity livingEntityIn, float partialTicks)
|
||||
{
|
||||
float f = livingEntityIn.getCreeperFlashIntensity(partialTicks);
|
||||
return (int) (f * 10.0F) % 2 == 0 ? 0.0F : MathHelper.clamp(f, 0.5F, 1.0F);
|
||||
}
|
||||
|
||||
protected void preRenderCallback(IslamistEntity entitylivingbaseIn, MatrixStack matrixStackIn, float partialTickTime)
|
||||
protected void scale(IslamistEntity entitylivingbaseIn, MatrixStack matrixStackIn, float partialTickTime)
|
||||
{
|
||||
float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime);
|
||||
float f1 = 1.0F + MathHelper.sin(f * 100.0F) * f * 0.01F;
|
||||
|
|
|
@ -19,7 +19,7 @@ public class JensRenderer extends MobRenderer<JensEntity, BipedModel<JensEntity>
|
|||
super(renderManagerIn, new BipedModel<>(0.0F), 0.25F);
|
||||
}
|
||||
|
||||
public ResourceLocation getEntityTexture(JensEntity entity)
|
||||
public ResourceLocation getTextureLocation(JensEntity entity)
|
||||
{
|
||||
return JENS_TEXTURES;
|
||||
}
|
||||
|
|
|
@ -30,29 +30,29 @@ public class MZTEWolfRenderer extends MobRenderer<MZTEWolfEntity, MZTEWolfModel<
|
|||
if (entityIn.isWolfWet())
|
||||
{
|
||||
float f = entityIn.getShadingWhileWet(partialTicks);
|
||||
this.entityModel.setTint(f, f, f);
|
||||
this.model.setColor(f, f, f);
|
||||
}
|
||||
|
||||
super.render(entityIn, entityYaw, partialTicks, matrixStackIn, bufferIn, packedLightIn);
|
||||
if (entityIn.isWolfWet())
|
||||
{
|
||||
this.entityModel.setTint(1.0F, 1.0F, 1.0F);
|
||||
this.model.setColor(1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
public ResourceLocation getEntityTexture(MZTEWolfEntity entity)
|
||||
public ResourceLocation getTextureLocation(MZTEWolfEntity entity)
|
||||
{
|
||||
if (entity.isTamed())
|
||||
if (entity.isTame())
|
||||
{
|
||||
return TAMED_MZTEWOLF_TEXTURES;
|
||||
}
|
||||
else
|
||||
{
|
||||
return entity.func_233678_J__() ? ANGRY_MZTEWOLF_TEXTURES : MZTEWOLF_TEXTURES;
|
||||
return entity.isAngry() ? ANGRY_MZTEWOLF_TEXTURES : MZTEWOLF_TEXTURES;
|
||||
}
|
||||
}
|
||||
|
||||
protected float handleRotationFloat(MZTEWolfEntity livingBase, float partialTicks)
|
||||
protected float getBob(MZTEWolfEntity livingBase, float partialTicks)
|
||||
{
|
||||
return livingBase.getTailRotation();
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ public class SchalkerRenderer extends MobRenderer<SchalkerEntity, SchalkerModel<
|
|||
}
|
||||
}
|
||||
|
||||
public ResourceLocation getEntityTexture(SchalkerEntity entity)
|
||||
public ResourceLocation getTextureLocation(SchalkerEntity entity)
|
||||
{
|
||||
return SCHALKER_TEXTURES;
|
||||
}
|
||||
|
@ -61,20 +61,20 @@ public class SchalkerRenderer extends MobRenderer<SchalkerEntity, SchalkerModel<
|
|||
{
|
||||
if (livingEntityIn.getClientTeleportInterp() > 0 && livingEntityIn.isAttachedToBlock())
|
||||
{
|
||||
Vector3d vector3d = Vector3d.copy(Objects.requireNonNull(livingEntityIn.getAttachmentPos()));
|
||||
Vector3d vector3d1 = Vector3d.copy(livingEntityIn.getOldAttachPos());
|
||||
return camera.isBoundingBoxInFrustum(new AxisAlignedBB(vector3d1.x, vector3d1.y, vector3d1.z, vector3d.x, vector3d.y, vector3d.z));
|
||||
Vector3d vector3d = Vector3d.atLowerCornerOf(Objects.requireNonNull(livingEntityIn.getAttachmentPos()));
|
||||
Vector3d vector3d1 = Vector3d.atLowerCornerOf(livingEntityIn.getOldAttachPos());
|
||||
return camera.isVisible(new AxisAlignedBB(vector3d1.x, vector3d1.y, vector3d1.z, vector3d.x, vector3d.y, vector3d.z));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
protected void applyRotations(SchalkerEntity entityLiving, MatrixStack matrixStackIn, float ageInTicks, float rotationYaw, float partialTicks)
|
||||
protected void setupRotations(SchalkerEntity entityLiving, MatrixStack matrixStackIn, float ageInTicks, float rotationYaw, float partialTicks)
|
||||
{
|
||||
super.applyRotations(entityLiving, matrixStackIn, ageInTicks, rotationYaw + 180.0F, partialTicks);
|
||||
super.setupRotations(entityLiving, matrixStackIn, ageInTicks, rotationYaw + 180.0F, partialTicks);
|
||||
matrixStackIn.translate(0.0D, 0.5D, 0.0D);
|
||||
matrixStackIn.rotate(entityLiving.getAttachmentFacing().getOpposite().getRotation());
|
||||
matrixStackIn.mulPose(entityLiving.getAttachmentFacing().getOpposite().getRotation());
|
||||
matrixStackIn.translate(0.0D, -0.5D, 0.0D);
|
||||
}
|
||||
}
|
|
@ -24,18 +24,18 @@ public class SmavaCreeperRenderer extends MobRenderer<SmavaCreeperEntity, Creepe
|
|||
this.addLayer(new SmavaCreeperChargeLayer(this));
|
||||
}
|
||||
|
||||
public ResourceLocation getEntityTexture(SmavaCreeperEntity entity)
|
||||
public ResourceLocation getTextureLocation(SmavaCreeperEntity entity)
|
||||
{
|
||||
return SMAVA_CREEPER_TEXTURES;
|
||||
}
|
||||
|
||||
protected float getOverlayProgress(SmavaCreeperEntity livingEntityIn, float partialTicks)
|
||||
protected float getWhiteOverlayProgress(SmavaCreeperEntity livingEntityIn, float partialTicks)
|
||||
{
|
||||
float f = livingEntityIn.getCreeperFlashIntensity(partialTicks);
|
||||
return (int) (f * 10.0F) % 2 == 0 ? 0.0F : MathHelper.clamp(f, 0.5F, 1.0F);
|
||||
}
|
||||
|
||||
protected void preRenderCallback(SmavaCreeperEntity entitylivingbaseIn, MatrixStack matrixStackIn, float partialTickTime)
|
||||
protected void scale(SmavaCreeperEntity entitylivingbaseIn, MatrixStack matrixStackIn, float partialTickTime)
|
||||
{
|
||||
float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime);
|
||||
float f1 = 1.0F + MathHelper.sin(f * 100.0F) * f * 0.01F;
|
||||
|
|
|
@ -21,17 +21,17 @@ public class BakaMitaiCreeperChargeLayer extends EnergyLayer<BakaMitaiCreeperEnt
|
|||
super(p_i50947_1_);
|
||||
}
|
||||
|
||||
protected float func_225634_a_(float p_225634_1_)
|
||||
protected float xOffset(float p_225634_1_)
|
||||
{
|
||||
return p_225634_1_ * 0.01F;
|
||||
}
|
||||
|
||||
protected ResourceLocation func_225633_a_()
|
||||
protected ResourceLocation getTextureLocation()
|
||||
{
|
||||
return LIGHTNING_TEXTURE;
|
||||
}
|
||||
|
||||
protected EntityModel<BakaMitaiCreeperEntity> func_225635_b_()
|
||||
protected EntityModel<BakaMitaiCreeperEntity> model()
|
||||
{
|
||||
return this.creeperModel;
|
||||
}
|
||||
|
|
|
@ -21,17 +21,17 @@ public class IslamistChargeLayer extends EnergyLayer<IslamistEntity, CreeperMode
|
|||
super(p_i50947_1_);
|
||||
}
|
||||
|
||||
protected float func_225634_a_(float p_225634_1_)
|
||||
protected float xOffset(float p_225634_1_)
|
||||
{
|
||||
return p_225634_1_ * 0.01F;
|
||||
}
|
||||
|
||||
protected ResourceLocation func_225633_a_()
|
||||
protected ResourceLocation getTextureLocation()
|
||||
{
|
||||
return LIGHTNING_TEXTURE;
|
||||
}
|
||||
|
||||
protected EntityModel<IslamistEntity> func_225635_b_()
|
||||
protected EntityModel<IslamistEntity> model()
|
||||
{
|
||||
return this.creeperModel;
|
||||
}
|
||||
|
|
|
@ -23,10 +23,10 @@ public class MZTEWolfCollarLayer extends LayerRenderer<MZTEWolfEntity, MZTEWolfM
|
|||
|
||||
public void render(MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int packedLightIn, MZTEWolfEntity entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch)
|
||||
{
|
||||
if (entitylivingbaseIn.isTamed() && !entitylivingbaseIn.isInvisible())
|
||||
if (entitylivingbaseIn.isTame() && !entitylivingbaseIn.isInvisible())
|
||||
{
|
||||
float[] afloat = entitylivingbaseIn.getCollarColor().getColorComponentValues();
|
||||
renderCutoutModel(this.getEntityModel(), WOLF_COLLAR, matrixStackIn, bufferIn, packedLightIn, entitylivingbaseIn, afloat[0], afloat[1], afloat[2]);
|
||||
float[] afloat = entitylivingbaseIn.getCollarColor().getTextureDiffuseColors();
|
||||
renderColoredCutoutModel(this.getParentModel(), WOLF_COLLAR, matrixStackIn, bufferIn, packedLightIn, entitylivingbaseIn, afloat[0], afloat[1], afloat[2]);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -21,17 +21,17 @@ public class SmavaCreeperChargeLayer extends EnergyLayer<SmavaCreeperEntity, Cre
|
|||
super(p_i50947_1_);
|
||||
}
|
||||
|
||||
protected float func_225634_a_(float p_225634_1_)
|
||||
protected float xOffset(float p_225634_1_)
|
||||
{
|
||||
return p_225634_1_ * 0.01F;
|
||||
}
|
||||
|
||||
protected ResourceLocation func_225633_a_()
|
||||
protected ResourceLocation getTextureLocation()
|
||||
{
|
||||
return LIGHTNING_TEXTURE;
|
||||
}
|
||||
|
||||
protected EntityModel<SmavaCreeperEntity> func_225635_b_()
|
||||
protected EntityModel<SmavaCreeperEntity> model()
|
||||
{
|
||||
return this.creeperModel;
|
||||
}
|
||||
|
|
|
@ -25,105 +25,103 @@ public class MZTEWolfModel<T extends MZTEWolfEntity> extends TintedAgeableModel<
|
|||
|
||||
public MZTEWolfModel()
|
||||
{
|
||||
float f = 0.0F;
|
||||
float f1 = 13.5F;
|
||||
this.head = new ModelRenderer(this, 0, 0);
|
||||
this.head.setRotationPoint(-1.0F, 13.5F, -7.0F);
|
||||
this.head.setPos(-1.0F, 13.5F, -7.0F);
|
||||
this.headChild = new ModelRenderer(this, 0, 0);
|
||||
this.headChild.addBox(-2.0F, -3.0F, -2.0F, 6.0F, 6.0F, 4.0F, 0.0F);
|
||||
this.head.addChild(this.headChild);
|
||||
this.body = new ModelRenderer(this, 18, 14);
|
||||
this.body.addBox(-3.0F, -2.0F, -3.0F, 6.0F, 9.0F, 6.0F, 0.0F);
|
||||
this.body.setRotationPoint(0.0F, 14.0F, 2.0F);
|
||||
this.body.setPos(0.0F, 14.0F, 2.0F);
|
||||
this.mane = new ModelRenderer(this, 21, 0);
|
||||
this.mane.addBox(-3.0F, -3.0F, -3.0F, 8.0F, 6.0F, 7.0F, 0.0F);
|
||||
this.mane.setRotationPoint(-1.0F, 14.0F, 2.0F);
|
||||
this.mane.setPos(-1.0F, 14.0F, 2.0F);
|
||||
this.legBackRight = new ModelRenderer(this, 0, 18);
|
||||
this.legBackRight.addBox(0.0F, 0.0F, -1.0F, 2.0F, 8.0F, 2.0F, 0.0F);
|
||||
this.legBackRight.setRotationPoint(-2.5F, 16.0F, 7.0F);
|
||||
this.legBackRight.setPos(-2.5F, 16.0F, 7.0F);
|
||||
this.legBackLeft = new ModelRenderer(this, 0, 18);
|
||||
this.legBackLeft.addBox(0.0F, 0.0F, -1.0F, 2.0F, 8.0F, 2.0F, 0.0F);
|
||||
this.legBackLeft.setRotationPoint(0.5F, 16.0F, 7.0F);
|
||||
this.legBackLeft.setPos(0.5F, 16.0F, 7.0F);
|
||||
this.legFrontRight = new ModelRenderer(this, 0, 18);
|
||||
this.legFrontRight.addBox(0.0F, 0.0F, -1.0F, 2.0F, 8.0F, 2.0F, 0.0F);
|
||||
this.legFrontRight.setRotationPoint(-2.5F, 16.0F, -4.0F);
|
||||
this.legFrontRight.setPos(-2.5F, 16.0F, -4.0F);
|
||||
this.legFrontLeft = new ModelRenderer(this, 0, 18);
|
||||
this.legFrontLeft.addBox(0.0F, 0.0F, -1.0F, 2.0F, 8.0F, 2.0F, 0.0F);
|
||||
this.legFrontLeft.setRotationPoint(0.5F, 16.0F, -4.0F);
|
||||
this.legFrontLeft.setPos(0.5F, 16.0F, -4.0F);
|
||||
this.tail = new ModelRenderer(this, 9, 18);
|
||||
this.tail.setRotationPoint(-1.0F, 12.0F, 8.0F);
|
||||
this.tail.setPos(-1.0F, 12.0F, 8.0F);
|
||||
this.tailChild = new ModelRenderer(this, 9, 18);
|
||||
this.tailChild.addBox(0.0F, 0.0F, -1.0F, 2.0F, 8.0F, 2.0F, 0.0F);
|
||||
this.tail.addChild(this.tailChild);
|
||||
this.headChild.setTextureOffset(16, 14).addBox(-2.0F, -5.0F, 0.0F, 2.0F, 2.0F, 1.0F, 0.0F);
|
||||
this.headChild.setTextureOffset(16, 14).addBox(2.0F, -5.0F, 0.0F, 2.0F, 2.0F, 1.0F, 0.0F);
|
||||
this.headChild.setTextureOffset(0, 10).addBox(-0.5F, 0.0F, -5.0F, 3.0F, 3.0F, 4.0F, 0.0F);
|
||||
this.headChild.texOffs(16, 14).addBox(-2.0F, -5.0F, 0.0F, 2.0F, 2.0F, 1.0F, 0.0F);
|
||||
this.headChild.texOffs(16, 14).addBox(2.0F, -5.0F, 0.0F, 2.0F, 2.0F, 1.0F, 0.0F);
|
||||
this.headChild.texOffs(0, 10).addBox(-0.5F, 0.0F, -5.0F, 3.0F, 3.0F, 4.0F, 0.0F);
|
||||
}
|
||||
|
||||
public void setRotationAngles(T entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch)
|
||||
public void setupAnim(T entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch)
|
||||
{
|
||||
this.head.rotateAngleX = headPitch * ((float) Math.PI / 180F);
|
||||
this.head.rotateAngleY = netHeadYaw * ((float) Math.PI / 180F);
|
||||
this.tail.rotateAngleX = ageInTicks;
|
||||
this.head.xRot = headPitch * ((float) Math.PI / 180F);
|
||||
this.head.yRot = netHeadYaw * ((float) Math.PI / 180F);
|
||||
this.tail.xRot = ageInTicks;
|
||||
}
|
||||
|
||||
public void setLivingAnimations(T entityIn, float limbSwing, float limbSwingAmount, float partialTick)
|
||||
public void prepareMobModel(T entityIn, float limbSwing, float limbSwingAmount, float partialTick)
|
||||
{
|
||||
if (entityIn.func_233678_J__())
|
||||
if (entityIn.isAngry())
|
||||
{
|
||||
this.tail.rotateAngleY = 0.0F;
|
||||
this.tail.yRot = 0.0F;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.tail.rotateAngleY = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount;
|
||||
this.tail.yRot = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount;
|
||||
}
|
||||
|
||||
if (entityIn.isEntitySleeping())
|
||||
if (entityIn.isInSittingPose())
|
||||
{
|
||||
this.mane.setRotationPoint(-1.0F, 16.0F, -3.0F);
|
||||
this.mane.rotateAngleX = 1.2566371F;
|
||||
this.mane.rotateAngleY = 0.0F;
|
||||
this.body.setRotationPoint(0.0F, 18.0F, 0.0F);
|
||||
this.body.rotateAngleX = ((float) Math.PI / 4F);
|
||||
this.tail.setRotationPoint(-1.0F, 21.0F, 6.0F);
|
||||
this.legBackRight.setRotationPoint(-2.5F, 22.7F, 2.0F);
|
||||
this.legBackRight.rotateAngleX = ((float) Math.PI * 1.5F);
|
||||
this.legBackLeft.setRotationPoint(0.5F, 22.7F, 2.0F);
|
||||
this.legBackLeft.rotateAngleX = ((float) Math.PI * 1.5F);
|
||||
this.legFrontRight.rotateAngleX = 5.811947F;
|
||||
this.legFrontRight.setRotationPoint(-2.49F, 17.0F, -4.0F);
|
||||
this.legFrontLeft.rotateAngleX = 5.811947F;
|
||||
this.legFrontLeft.setRotationPoint(0.51F, 17.0F, -4.0F);
|
||||
this.mane.setPos(-1.0F, 16.0F, -3.0F);
|
||||
this.mane.xRot = 1.2566371F;
|
||||
this.mane.yRot = 0.0F;
|
||||
this.body.setPos(0.0F, 18.0F, 0.0F);
|
||||
this.body.xRot = ((float) Math.PI / 4F);
|
||||
this.tail.setPos(-1.0F, 21.0F, 6.0F);
|
||||
this.legBackRight.setPos(-2.5F, 22.7F, 2.0F);
|
||||
this.legBackRight.xRot = ((float) Math.PI * 1.5F);
|
||||
this.legBackLeft.setPos(0.5F, 22.7F, 2.0F);
|
||||
this.legBackLeft.xRot = ((float) Math.PI * 1.5F);
|
||||
this.legFrontRight.xRot = 5.811947F;
|
||||
this.legFrontRight.setPos(-2.49F, 17.0F, -4.0F);
|
||||
this.legFrontLeft.xRot = 5.811947F;
|
||||
this.legFrontLeft.setPos(0.51F, 17.0F, -4.0F);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.body.setRotationPoint(0.0F, 14.0F, 2.0F);
|
||||
this.body.rotateAngleX = ((float) Math.PI / 2F);
|
||||
this.mane.setRotationPoint(-1.0F, 14.0F, -3.0F);
|
||||
this.mane.rotateAngleX = this.body.rotateAngleX;
|
||||
this.tail.setRotationPoint(-1.0F, 12.0F, 8.0F);
|
||||
this.legBackRight.setRotationPoint(-2.5F, 16.0F, 7.0F);
|
||||
this.legBackLeft.setRotationPoint(0.5F, 16.0F, 7.0F);
|
||||
this.legFrontRight.setRotationPoint(-2.5F, 16.0F, -4.0F);
|
||||
this.legFrontLeft.setRotationPoint(0.5F, 16.0F, -4.0F);
|
||||
this.legBackRight.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount;
|
||||
this.legBackLeft.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float) Math.PI) * 1.4F * limbSwingAmount;
|
||||
this.legFrontRight.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float) Math.PI) * 1.4F * limbSwingAmount;
|
||||
this.legFrontLeft.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount;
|
||||
this.body.setPos(0.0F, 14.0F, 2.0F);
|
||||
this.body.xRot = ((float) Math.PI / 2F);
|
||||
this.mane.setPos(-1.0F, 14.0F, -3.0F);
|
||||
this.mane.xRot = this.body.xRot;
|
||||
this.tail.setPos(-1.0F, 12.0F, 8.0F);
|
||||
this.legBackRight.setPos(-2.5F, 16.0F, 7.0F);
|
||||
this.legBackLeft.setPos(0.5F, 16.0F, 7.0F);
|
||||
this.legFrontRight.setPos(-2.5F, 16.0F, -4.0F);
|
||||
this.legFrontLeft.setPos(0.5F, 16.0F, -4.0F);
|
||||
this.legBackRight.xRot = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount;
|
||||
this.legBackLeft.xRot = MathHelper.cos(limbSwing * 0.6662F + (float) Math.PI) * 1.4F * limbSwingAmount;
|
||||
this.legFrontRight.xRot = MathHelper.cos(limbSwing * 0.6662F + (float) Math.PI) * 1.4F * limbSwingAmount;
|
||||
this.legFrontLeft.xRot = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount;
|
||||
}
|
||||
|
||||
this.headChild.rotateAngleZ = entityIn.getInterestedAngle(partialTick) + entityIn.getShakeAngle(partialTick, 0.0F);
|
||||
this.mane.rotateAngleZ = entityIn.getShakeAngle(partialTick, -0.08F);
|
||||
this.body.rotateAngleZ = entityIn.getShakeAngle(partialTick, -0.16F);
|
||||
this.tailChild.rotateAngleZ = entityIn.getShakeAngle(partialTick, -0.2F);
|
||||
this.headChild.zRot = entityIn.getInterestedAngle(partialTick) + entityIn.getShakeAngle(partialTick, 0.0F);
|
||||
this.mane.zRot = entityIn.getShakeAngle(partialTick, -0.08F);
|
||||
this.body.zRot = entityIn.getShakeAngle(partialTick, -0.16F);
|
||||
this.tailChild.zRot = entityIn.getShakeAngle(partialTick, -0.2F);
|
||||
}
|
||||
|
||||
protected Iterable<ModelRenderer> getHeadParts()
|
||||
protected Iterable<ModelRenderer> headParts()
|
||||
{
|
||||
return ImmutableList.of(this.head);
|
||||
}
|
||||
|
||||
protected Iterable<ModelRenderer> getBodyParts()
|
||||
protected Iterable<ModelRenderer> bodyParts()
|
||||
{
|
||||
return ImmutableList.of(this.body, this.legBackRight, this.legBackLeft, this.legFrontRight, this.legFrontLeft, this.tail, this.mane);
|
||||
}
|
||||
|
|
|
@ -19,20 +19,20 @@ public class SchalkerModel<T extends SchalkerEntity> extends SegmentedModel<T>
|
|||
|
||||
public SchalkerModel()
|
||||
{
|
||||
super(RenderType::getEntityCutoutNoCullZOffset);
|
||||
super(RenderType::entityCutoutNoCullZOffset);
|
||||
this.base = new ModelRenderer(64, 64, 0, 28);
|
||||
this.head = new ModelRenderer(64, 64, 0, 52);
|
||||
this.lid.addBox(-8.0F, -16.0F, -8.0F, 16.0F, 12.0F, 16.0F);
|
||||
this.lid.setRotationPoint(0.0F, 24.0F, 0.0F);
|
||||
this.lid.setPos(0.0F, 24.0F, 0.0F);
|
||||
this.base.addBox(-8.0F, -8.0F, -8.0F, 16.0F, 8.0F, 16.0F);
|
||||
this.base.setRotationPoint(0.0F, 24.0F, 0.0F);
|
||||
this.base.setPos(0.0F, 24.0F, 0.0F);
|
||||
this.head.addBox(-3.0F, 0.0F, -3.0F, 6.0F, 6.0F, 6.0F);
|
||||
this.head.setRotationPoint(0.0F, 12.0F, 0.0F);
|
||||
this.head.setPos(0.0F, 12.0F, 0.0F);
|
||||
}
|
||||
|
||||
public void setRotationAngles(T entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch)
|
||||
public void setupAnim(T entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch)
|
||||
{
|
||||
float f = ageInTicks - (float) entityIn.ticksExisted;
|
||||
float f = ageInTicks - (float) entityIn.tickCount;
|
||||
float f1 = (0.5F + entityIn.getClientPeekAmount(f)) * (float) Math.PI;
|
||||
float f2 = -1.0F + MathHelper.sin(f1);
|
||||
float f3 = 0.0F;
|
||||
|
@ -41,21 +41,21 @@ public class SchalkerModel<T extends SchalkerEntity> extends SegmentedModel<T>
|
|||
f3 = MathHelper.sin(ageInTicks * 0.1F) * 0.7F;
|
||||
}
|
||||
|
||||
this.lid.setRotationPoint(0.0F, 16.0F + MathHelper.sin(f1) * 8.0F + f3, 0.0F);
|
||||
this.lid.setPos(0.0F, 16.0F + MathHelper.sin(f1) * 8.0F + f3, 0.0F);
|
||||
if (entityIn.getClientPeekAmount(f) > 0.3F)
|
||||
{
|
||||
this.lid.rotateAngleY = f2 * f2 * f2 * f2 * (float) Math.PI * 0.125F;
|
||||
this.lid.yRot = f2 * f2 * f2 * f2 * (float) Math.PI * 0.125F;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.lid.rotateAngleY = 0.0F;
|
||||
this.lid.yRot = 0.0F;
|
||||
}
|
||||
|
||||
this.head.rotateAngleX = headPitch * ((float) Math.PI / 180F);
|
||||
this.head.rotateAngleY = (entityIn.rotationYawHead - 180.0F - entityIn.renderYawOffset) * ((float) Math.PI / 180F);
|
||||
this.head.xRot = headPitch * ((float) Math.PI / 180F);
|
||||
this.head.yRot = (entityIn.yHeadRot - 180.0F - entityIn.yBodyRot) * ((float) Math.PI / 180F);
|
||||
}
|
||||
|
||||
public Iterable<ModelRenderer> getParts()
|
||||
public Iterable<ModelRenderer> parts()
|
||||
{
|
||||
return ImmutableList.of(this.base, this.lid);
|
||||
}
|
||||
|
|
|
@ -35,23 +35,23 @@ public abstract class AbstractApoRedEntity extends MonsterEntity implements IRan
|
|||
{
|
||||
public static AttributeModifierMap.MutableAttribute registerAttributes()
|
||||
{
|
||||
return MonsterEntity.func_234295_eP_().createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.25D);
|
||||
return MonsterEntity.createMonsterAttributes().add(Attributes.MOVEMENT_SPEED, 0.25D);
|
||||
}
|
||||
|
||||
private final RangedBowAttackGoal<AbstractApoRedEntity> aiArrowAttack = new RangedBowAttackGoal<>(this, 1.0D, 20, 15.0F);
|
||||
private final MeleeAttackGoal aiAttackOnCollide = new MeleeAttackGoal(this, 1.2D, false)
|
||||
{
|
||||
|
||||
public void startExecuting()
|
||||
public void start()
|
||||
{
|
||||
super.startExecuting();
|
||||
AbstractApoRedEntity.this.setAggroed(true);
|
||||
super.start();
|
||||
AbstractApoRedEntity.this.setAggressive(true);
|
||||
}
|
||||
|
||||
public void resetTask()
|
||||
public void stop()
|
||||
{
|
||||
super.resetTask();
|
||||
AbstractApoRedEntity.this.setAggroed(false);
|
||||
super.stop();
|
||||
AbstractApoRedEntity.this.setAggressive(false);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -61,18 +61,18 @@ public abstract class AbstractApoRedEntity extends MonsterEntity implements IRan
|
|||
this.setCombatTask();
|
||||
}
|
||||
|
||||
public CreatureAttribute getCreatureAttribute()
|
||||
public CreatureAttribute getMobType()
|
||||
{
|
||||
return CreatureAttribute.UNDEAD;
|
||||
}
|
||||
|
||||
public void updateRidden()
|
||||
public void rideTick()
|
||||
{
|
||||
super.updateRidden();
|
||||
if (this.getRidingEntity() instanceof CreatureEntity)
|
||||
super.rideTick();
|
||||
if (this.getVehicle() instanceof CreatureEntity)
|
||||
{
|
||||
CreatureEntity creatureentity = (CreatureEntity) this.getRidingEntity();
|
||||
this.renderYawOffset = creatureentity.renderYawOffset;
|
||||
CreatureEntity creatureentity = (CreatureEntity) this.getVehicle();
|
||||
this.yBodyRot = creatureentity.yBodyRot;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -82,21 +82,21 @@ public abstract class AbstractApoRedEntity extends MonsterEntity implements IRan
|
|||
return 1.74F;
|
||||
}
|
||||
|
||||
public void livingTick()
|
||||
public void aiStep()
|
||||
{
|
||||
boolean flag = this.isInDaylight();
|
||||
boolean flag = this.isSunBurnTick();
|
||||
if (flag)
|
||||
{
|
||||
ItemStack itemstack = this.getItemStackFromSlot(EquipmentSlotType.HEAD);
|
||||
ItemStack itemstack = this.getItemBySlot(EquipmentSlotType.HEAD);
|
||||
if (!itemstack.isEmpty())
|
||||
{
|
||||
if (itemstack.isDamageable())
|
||||
if (itemstack.isDamageableItem())
|
||||
{
|
||||
itemstack.setDamage(itemstack.getDamage() + this.rand.nextInt(2));
|
||||
if (itemstack.getDamage() >= itemstack.getMaxDamage())
|
||||
itemstack.setDamageValue(itemstack.getDamageValue() + this.random.nextInt(2));
|
||||
if (itemstack.getDamageValue() >= itemstack.getMaxDamage())
|
||||
{
|
||||
this.sendBreakAnimation(EquipmentSlotType.HEAD);
|
||||
this.setItemStackToSlot(EquipmentSlotType.HEAD, ItemStack.EMPTY);
|
||||
this.broadcastBreakEvent(EquipmentSlotType.HEAD);
|
||||
this.setItemSlot(EquipmentSlotType.HEAD, ItemStack.EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -105,29 +105,29 @@ public abstract class AbstractApoRedEntity extends MonsterEntity implements IRan
|
|||
|
||||
if (flag)
|
||||
{
|
||||
this.setFire(8);
|
||||
this.setSecondsOnFire(8);
|
||||
}
|
||||
}
|
||||
|
||||
super.livingTick();
|
||||
super.aiStep();
|
||||
}
|
||||
|
||||
public void setCombatTask()
|
||||
{
|
||||
if (this.world != null && !this.world.isRemote)
|
||||
if (this.level != null && !this.level.isClientSide)
|
||||
{
|
||||
this.goalSelector.removeGoal(this.aiAttackOnCollide);
|
||||
this.goalSelector.removeGoal(this.aiArrowAttack);
|
||||
ItemStack itemstack = this.getHeldItem(ProjectileHelper.getHandWith(this, Items.BOW));
|
||||
ItemStack itemstack = this.getItemInHand(ProjectileHelper.getWeaponHoldingHand(this, Items.BOW));
|
||||
if (itemstack.getItem() instanceof net.minecraft.item.BowItem)
|
||||
{
|
||||
int i = 20;
|
||||
if (this.world.getDifficulty() != Difficulty.HARD)
|
||||
if (this.level.getDifficulty() != Difficulty.HARD)
|
||||
{
|
||||
i = 40;
|
||||
}
|
||||
|
||||
this.aiArrowAttack.setAttackCooldown(i);
|
||||
this.aiArrowAttack.setMinAttackInterval(i);
|
||||
this.goalSelector.addGoal(4, this.aiArrowAttack);
|
||||
}
|
||||
else
|
||||
|
@ -138,19 +138,19 @@ public abstract class AbstractApoRedEntity extends MonsterEntity implements IRan
|
|||
}
|
||||
}
|
||||
|
||||
public void attackEntityWithRangedAttack(LivingEntity target, float distanceFactor)
|
||||
public void performRangedAttack(LivingEntity target, float distanceFactor)
|
||||
{
|
||||
ItemStack itemstack = this.findAmmo(this.getHeldItem(ProjectileHelper.getHandWith(this, Items.BOW)));
|
||||
ItemStack itemstack = this.getProjectile(this.getItemInHand(ProjectileHelper.getWeaponHoldingHand(this, Items.BOW)));
|
||||
AbstractArrowEntity abstractarrowentity = this.fireArrow(itemstack, distanceFactor);
|
||||
if (this.getHeldItemMainhand().getItem() instanceof net.minecraft.item.BowItem)
|
||||
abstractarrowentity = ((net.minecraft.item.BowItem) this.getHeldItemMainhand().getItem()).customArrow(abstractarrowentity);
|
||||
double d0 = target.getPosX() - this.getPosX();
|
||||
double d1 = target.getPosYHeight(0.3333333333333333D) - abstractarrowentity.getPosY();
|
||||
double d2 = target.getPosZ() - this.getPosZ();
|
||||
if (this.getMainHandItem().getItem() instanceof net.minecraft.item.BowItem)
|
||||
abstractarrowentity = ((net.minecraft.item.BowItem) this.getMainHandItem().getItem()).customArrow(abstractarrowentity);
|
||||
double d0 = target.getX() - this.getX();
|
||||
double d1 = target.getY(0.3333333333333333D) - abstractarrowentity.getY();
|
||||
double d2 = target.getZ() - this.getZ();
|
||||
double d3 = MathHelper.sqrt(d0 * d0 + d2 * d2);
|
||||
abstractarrowentity.shoot(d0, d1 + d3 * (double) 0.2F, d2, 1.6F, (float) (14 - this.world.getDifficulty().getId() * 4));
|
||||
this.playSound(SoundEvents.ENTITY_SKELETON_SHOOT, 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));
|
||||
this.world.addEntity(abstractarrowentity);
|
||||
abstractarrowentity.shoot(d0, d1 + d3 * (double) 0.2F, d2, 1.6F, (float) (14 - this.level.getDifficulty().getId() * 4));
|
||||
this.playSound(SoundEvents.SKELETON_SHOOT, 1.0F, 1.0F / (this.getRandom().nextFloat() * 0.4F + 0.8F));
|
||||
this.level.addFreshEntity(abstractarrowentity);
|
||||
}
|
||||
|
||||
protected void registerGoals()
|
||||
|
@ -164,53 +164,53 @@ public abstract class AbstractApoRedEntity extends MonsterEntity implements IRan
|
|||
this.targetSelector.addGoal(1, new HurtByTargetGoal(this));
|
||||
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, PlayerEntity.class, true));
|
||||
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, IronGolemEntity.class, true));
|
||||
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, TurtleEntity.class, 10, true, false, TurtleEntity.TARGET_DRY_BABY));
|
||||
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, TurtleEntity.class, 10, true, false, TurtleEntity.BABY_ON_LAND_SELECTOR));
|
||||
}
|
||||
|
||||
public boolean func_230280_a_(ShootableItem p_230280_1_)
|
||||
public boolean canFireProjectileWeapon(ShootableItem p_230280_1_)
|
||||
{
|
||||
return p_230280_1_ == Items.BOW;
|
||||
}
|
||||
|
||||
public void readAdditional(CompoundNBT compound)
|
||||
public void readAdditionalSaveData(CompoundNBT compound)
|
||||
{
|
||||
super.readAdditional(compound);
|
||||
super.readAdditionalSaveData(compound);
|
||||
this.setCombatTask();
|
||||
}
|
||||
|
||||
public void setItemStackToSlot(EquipmentSlotType slotIn, ItemStack stack)
|
||||
public void setItemSlot(EquipmentSlotType slotIn, ItemStack stack)
|
||||
{
|
||||
super.setItemStackToSlot(slotIn, stack);
|
||||
if (!this.world.isRemote)
|
||||
super.setItemSlot(slotIn, stack);
|
||||
if (!this.level.isClientSide)
|
||||
{
|
||||
this.setCombatTask();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void setEquipmentBasedOnDifficulty(DifficultyInstance difficulty)
|
||||
protected void populateDefaultEquipmentSlots(DifficultyInstance difficulty)
|
||||
{
|
||||
super.setEquipmentBasedOnDifficulty(difficulty);
|
||||
this.setItemStackToSlot(EquipmentSlotType.MAINHAND, new ItemStack(Items.BOW));
|
||||
super.populateDefaultEquipmentSlots(difficulty);
|
||||
this.setItemSlot(EquipmentSlotType.MAINHAND, new ItemStack(Items.BOW));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public ILivingEntityData onInitialSpawn(IServerWorld worldIn, DifficultyInstance difficultyIn, SpawnReason reason, @Nullable ILivingEntityData spawnDataIn, @Nullable CompoundNBT dataTag)
|
||||
public ILivingEntityData finalizeSpawn(IServerWorld worldIn, DifficultyInstance difficultyIn, SpawnReason reason, @Nullable ILivingEntityData spawnDataIn, @Nullable CompoundNBT dataTag)
|
||||
{
|
||||
spawnDataIn = super.onInitialSpawn(worldIn, difficultyIn, reason, spawnDataIn, dataTag);
|
||||
this.setEquipmentBasedOnDifficulty(difficultyIn);
|
||||
this.setEnchantmentBasedOnDifficulty(difficultyIn);
|
||||
spawnDataIn = super.finalizeSpawn(worldIn, difficultyIn, reason, spawnDataIn, dataTag);
|
||||
this.populateDefaultEquipmentSlots(difficultyIn);
|
||||
this.populateDefaultEquipmentEnchantments(difficultyIn);
|
||||
this.setCombatTask();
|
||||
this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * difficultyIn.getClampedAdditionalDifficulty());
|
||||
if (this.getItemStackFromSlot(EquipmentSlotType.HEAD).isEmpty())
|
||||
this.setCanPickUpLoot(this.random.nextFloat() < 0.55F * difficultyIn.getSpecialMultiplier());
|
||||
if (this.getItemBySlot(EquipmentSlotType.HEAD).isEmpty())
|
||||
{
|
||||
LocalDate localdate = LocalDate.now();
|
||||
int i = localdate.get(ChronoField.DAY_OF_MONTH);
|
||||
int j = localdate.get(ChronoField.MONTH_OF_YEAR);
|
||||
if (j == 10 && i == 31 && this.rand.nextFloat() < 0.25F)
|
||||
if (j == 10 && i == 31 && this.random.nextFloat() < 0.25F)
|
||||
{
|
||||
this.setItemStackToSlot(EquipmentSlotType.HEAD, new ItemStack(this.rand.nextFloat() < 0.1F ? Blocks.JACK_O_LANTERN : Blocks.CARVED_PUMPKIN));
|
||||
this.inventoryArmorDropChances[EquipmentSlotType.HEAD.getIndex()] = 0.0F;
|
||||
this.setItemSlot(EquipmentSlotType.HEAD, new ItemStack(this.random.nextFloat() < 0.1F ? Blocks.JACK_O_LANTERN : Blocks.CARVED_PUMPKIN));
|
||||
this.armorDropChances[EquipmentSlotType.HEAD.getIndex()] = 0.0F;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -222,7 +222,7 @@ public abstract class AbstractApoRedEntity extends MonsterEntity implements IRan
|
|||
this.playSound(this.getStepSound(), 0.15F, 1.0F);
|
||||
}
|
||||
|
||||
public double getYOffset()
|
||||
public double getMyRidingOffset()
|
||||
{
|
||||
return -0.6D;
|
||||
}
|
||||
|
@ -231,6 +231,6 @@ public abstract class AbstractApoRedEntity extends MonsterEntity implements IRan
|
|||
|
||||
protected AbstractArrowEntity fireArrow(ItemStack arrowStack, float distanceFactor)
|
||||
{
|
||||
return ProjectileHelper.fireArrow(this, arrowStack, distanceFactor);
|
||||
return ProjectileHelper.getMobArrow(this, arrowStack, distanceFactor);
|
||||
}
|
||||
}
|
|
@ -22,17 +22,17 @@ public class ApoRedEntity extends AbstractApoRedEntity
|
|||
return SpackenmobsRegistry.ENTITY_APORED_AMBIENT.get();
|
||||
}
|
||||
|
||||
protected void dropSpecialItems(DamageSource source, int looting, boolean recentlyHitIn)
|
||||
protected void dropCustomDeathLoot(DamageSource source, int looting, boolean recentlyHitIn)
|
||||
{
|
||||
super.dropSpecialItems(source, looting, recentlyHitIn);
|
||||
Entity entity = source.getTrueSource();
|
||||
super.dropCustomDeathLoot(source, looting, recentlyHitIn);
|
||||
Entity entity = source.getEntity();
|
||||
if (entity instanceof SmavaCreeperEntity)
|
||||
{
|
||||
SmavaCreeperEntity smavacreeperentity = (SmavaCreeperEntity) entity;
|
||||
if (smavacreeperentity.ableToCauseSkullDrop())
|
||||
{
|
||||
smavacreeperentity.incrementDroppedSkulls();
|
||||
this.entityDropItem(Items.SKELETON_SKULL);
|
||||
this.spawnAtLocation(Items.SKELETON_SKULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ public class ApoRedEntity extends AbstractApoRedEntity
|
|||
|
||||
protected SoundEvent getStepSound()
|
||||
{
|
||||
return SoundEvents.ENTITY_ZOMBIE_STEP;
|
||||
return SoundEvents.ZOMBIE_STEP;
|
||||
}
|
||||
|
||||
protected float getSoundVolume()
|
||||
|
|
|
@ -38,13 +38,13 @@ import mod.acgaming.spackenmobs.init.SpackenmobsRegistry;
|
|||
)
|
||||
public class BakaMitaiCreeperEntity extends MonsterEntity implements IChargeableMob
|
||||
{
|
||||
private static final DataParameter<Integer> STATE = EntityDataManager.createKey(BakaMitaiCreeperEntity.class, DataSerializers.VARINT);
|
||||
private static final DataParameter<Boolean> POWERED = EntityDataManager.createKey(BakaMitaiCreeperEntity.class, DataSerializers.BOOLEAN);
|
||||
private static final DataParameter<Boolean> IGNITED = EntityDataManager.createKey(BakaMitaiCreeperEntity.class, DataSerializers.BOOLEAN);
|
||||
private static final DataParameter<Integer> STATE = EntityDataManager.defineId(BakaMitaiCreeperEntity.class, DataSerializers.INT);
|
||||
private static final DataParameter<Boolean> POWERED = EntityDataManager.defineId(BakaMitaiCreeperEntity.class, DataSerializers.BOOLEAN);
|
||||
private static final DataParameter<Boolean> IGNITED = EntityDataManager.defineId(BakaMitaiCreeperEntity.class, DataSerializers.BOOLEAN);
|
||||
|
||||
public static AttributeModifierMap.MutableAttribute registerAttributes()
|
||||
{
|
||||
return MonsterEntity.func_234295_eP_().createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.25D);
|
||||
return MonsterEntity.createMonsterAttributes().add(Attributes.MOVEMENT_SPEED, 0.25D);
|
||||
}
|
||||
|
||||
private int lastActiveTime;
|
||||
|
@ -58,9 +58,9 @@ public class BakaMitaiCreeperEntity extends MonsterEntity implements IChargeable
|
|||
super(type, worldIn);
|
||||
}
|
||||
|
||||
public boolean onLivingFall(float distance, float damageMultiplier)
|
||||
public boolean causeFallDamage(float distance, float damageMultiplier)
|
||||
{
|
||||
boolean flag = super.onLivingFall(distance, damageMultiplier);
|
||||
boolean flag = super.causeFallDamage(distance, damageMultiplier);
|
||||
this.timeSinceIgnited = (int) ((float) this.timeSinceIgnited + distance * 1.5F);
|
||||
if (this.timeSinceIgnited > this.fuseTime - 5)
|
||||
{
|
||||
|
@ -70,9 +70,9 @@ public class BakaMitaiCreeperEntity extends MonsterEntity implements IChargeable
|
|||
return flag;
|
||||
}
|
||||
|
||||
public boolean isCharged()
|
||||
public boolean isPowered()
|
||||
{
|
||||
return this.dataManager.get(POWERED);
|
||||
return this.entityData.get(POWERED);
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
|
@ -83,33 +83,33 @@ public class BakaMitaiCreeperEntity extends MonsterEntity implements IChargeable
|
|||
|
||||
public int getCreeperState()
|
||||
{
|
||||
return this.dataManager.get(STATE);
|
||||
return this.entityData.get(STATE);
|
||||
}
|
||||
|
||||
public void setCreeperState(int state)
|
||||
{
|
||||
this.dataManager.set(STATE, state);
|
||||
this.entityData.set(STATE, state);
|
||||
}
|
||||
|
||||
public void func_241841_a(ServerWorld p_241841_1_, LightningBoltEntity p_241841_2_)
|
||||
public void thunderHit(ServerWorld p_241841_1_, LightningBoltEntity p_241841_2_)
|
||||
{
|
||||
super.func_241841_a(p_241841_1_, p_241841_2_);
|
||||
this.dataManager.set(POWERED, true);
|
||||
super.thunderHit(p_241841_1_, p_241841_2_);
|
||||
this.entityData.set(POWERED, true);
|
||||
}
|
||||
|
||||
public boolean hasIgnited()
|
||||
{
|
||||
return this.dataManager.get(IGNITED);
|
||||
return this.entityData.get(IGNITED);
|
||||
}
|
||||
|
||||
public void ignite()
|
||||
{
|
||||
this.dataManager.set(IGNITED, true);
|
||||
this.entityData.set(IGNITED, true);
|
||||
}
|
||||
|
||||
public boolean ableToCauseSkullDrop()
|
||||
{
|
||||
return this.isCharged() && this.droppedSkulls < 1;
|
||||
return this.isPowered() && this.droppedSkulls < 1;
|
||||
}
|
||||
|
||||
public void incrementDroppedSkulls()
|
||||
|
@ -131,12 +131,12 @@ public class BakaMitaiCreeperEntity extends MonsterEntity implements IChargeable
|
|||
this.targetSelector.addGoal(2, new HurtByTargetGoal(this));
|
||||
}
|
||||
|
||||
protected void registerData()
|
||||
protected void defineSynchedData()
|
||||
{
|
||||
super.registerData();
|
||||
this.dataManager.register(STATE, -1);
|
||||
this.dataManager.register(POWERED, false);
|
||||
this.dataManager.register(IGNITED, false);
|
||||
super.defineSynchedData();
|
||||
this.entityData.define(STATE, -1);
|
||||
this.entityData.define(POWERED, false);
|
||||
this.entityData.define(IGNITED, false);
|
||||
}
|
||||
|
||||
public void tick()
|
||||
|
@ -171,10 +171,10 @@ public class BakaMitaiCreeperEntity extends MonsterEntity implements IChargeable
|
|||
super.tick();
|
||||
}
|
||||
|
||||
public void writeAdditional(CompoundNBT compound)
|
||||
public void addAdditionalSaveData(CompoundNBT compound)
|
||||
{
|
||||
super.writeAdditional(compound);
|
||||
if (this.dataManager.get(POWERED))
|
||||
super.addAdditionalSaveData(compound);
|
||||
if (this.entityData.get(POWERED))
|
||||
{
|
||||
compound.putBoolean("powered", true);
|
||||
}
|
||||
|
@ -184,10 +184,10 @@ public class BakaMitaiCreeperEntity extends MonsterEntity implements IChargeable
|
|||
compound.putBoolean("ignited", this.hasIgnited());
|
||||
}
|
||||
|
||||
public void readAdditional(CompoundNBT compound)
|
||||
public void readAdditionalSaveData(CompoundNBT compound)
|
||||
{
|
||||
super.readAdditional(compound);
|
||||
this.dataManager.set(POWERED, compound.getBoolean("powered"));
|
||||
super.readAdditionalSaveData(compound);
|
||||
this.entityData.set(POWERED, compound.getBoolean("powered"));
|
||||
if (compound.contains("Fuse", 99))
|
||||
{
|
||||
this.fuseTime = compound.getShort("Fuse");
|
||||
|
@ -205,73 +205,73 @@ public class BakaMitaiCreeperEntity extends MonsterEntity implements IChargeable
|
|||
|
||||
}
|
||||
|
||||
public int getMaxFallHeight()
|
||||
public int getMaxFallDistance()
|
||||
{
|
||||
return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F);
|
||||
return this.getTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F);
|
||||
}
|
||||
|
||||
protected void dropSpecialItems(DamageSource source, int looting, boolean recentlyHitIn)
|
||||
protected void dropCustomDeathLoot(DamageSource source, int looting, boolean recentlyHitIn)
|
||||
{
|
||||
super.dropSpecialItems(source, looting, recentlyHitIn);
|
||||
Entity entity = source.getTrueSource();
|
||||
super.dropCustomDeathLoot(source, looting, recentlyHitIn);
|
||||
Entity entity = source.getEntity();
|
||||
if (entity != this && entity instanceof BakaMitaiCreeperEntity)
|
||||
{
|
||||
BakaMitaiCreeperEntity creeperentity = (BakaMitaiCreeperEntity) entity;
|
||||
if (creeperentity.ableToCauseSkullDrop())
|
||||
{
|
||||
creeperentity.incrementDroppedSkulls();
|
||||
this.entityDropItem(Items.CREEPER_HEAD);
|
||||
this.spawnAtLocation(Items.CREEPER_HEAD);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected ActionResultType func_230254_b_(PlayerEntity p_230254_1_, Hand p_230254_2_)
|
||||
protected ActionResultType mobInteract(PlayerEntity p_230254_1_, Hand p_230254_2_)
|
||||
{
|
||||
ItemStack itemstack = p_230254_1_.getHeldItem(p_230254_2_);
|
||||
ItemStack itemstack = p_230254_1_.getItemInHand(p_230254_2_);
|
||||
if (itemstack.getItem() == Items.FLINT_AND_STEEL)
|
||||
{
|
||||
this.world.playSound(p_230254_1_, this.getPosX(), this.getPosY(), this.getPosZ(), SoundEvents.ITEM_FLINTANDSTEEL_USE, this.getSoundCategory(), 1.0F, this.rand.nextFloat() * 0.4F + 0.8F);
|
||||
if (!this.world.isRemote)
|
||||
this.level.playSound(p_230254_1_, this.getX(), this.getY(), this.getZ(), SoundEvents.FLINTANDSTEEL_USE, this.getSoundSource(), 1.0F, this.random.nextFloat() * 0.4F + 0.8F);
|
||||
if (!this.level.isClientSide)
|
||||
{
|
||||
this.ignite();
|
||||
itemstack.damageItem(1, p_230254_1_, (player) ->
|
||||
itemstack.hurtAndBreak(1, p_230254_1_, (player) ->
|
||||
{
|
||||
player.sendBreakAnimation(p_230254_2_);
|
||||
player.broadcastBreakEvent(p_230254_2_);
|
||||
});
|
||||
}
|
||||
|
||||
return ActionResultType.func_233537_a_(this.world.isRemote);
|
||||
return ActionResultType.sidedSuccess(this.level.isClientSide);
|
||||
}
|
||||
else
|
||||
{
|
||||
return super.func_230254_b_(p_230254_1_, p_230254_2_);
|
||||
return super.mobInteract(p_230254_1_, p_230254_2_);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean attackEntityAsMob(Entity entityIn)
|
||||
public boolean doHurtTarget(Entity entityIn)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
|
||||
{
|
||||
return SoundEvents.ENTITY_CREEPER_HURT;
|
||||
return SoundEvents.CREEPER_HURT;
|
||||
}
|
||||
|
||||
protected SoundEvent getDeathSound()
|
||||
{
|
||||
return SoundEvents.ENTITY_CREEPER_DEATH;
|
||||
return SoundEvents.CREEPER_DEATH;
|
||||
}
|
||||
|
||||
private void explode()
|
||||
{
|
||||
if (!this.world.isRemote)
|
||||
if (!this.level.isClientSide)
|
||||
{
|
||||
Explosion.Mode explosion$mode = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.world, this) ? Explosion.Mode.DESTROY : Explosion.Mode.NONE;
|
||||
float f = this.isCharged() ? 2.0F : 1.0F;
|
||||
Explosion.Mode explosion$mode = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.level, this) ? Explosion.Mode.DESTROY : Explosion.Mode.NONE;
|
||||
float f = this.isPowered() ? 2.0F : 1.0F;
|
||||
this.dead = true;
|
||||
this.playSound(SpackenmobsRegistry.ENTITY_BAKAMITAI_CREEPER_BLOW.get(), 2.0F, 1.0F);
|
||||
this.world.createExplosion(this, this.getPosX(), this.getPosY(), this.getPosZ(), (float) this.explosionRadius * f, explosion$mode);
|
||||
this.level.explode(this, this.getX(), this.getY(), this.getZ(), (float) this.explosionRadius * f, explosion$mode);
|
||||
this.remove();
|
||||
this.spawnLingeringCloud();
|
||||
}
|
||||
|
@ -280,10 +280,10 @@ public class BakaMitaiCreeperEntity extends MonsterEntity implements IChargeable
|
|||
|
||||
private void spawnLingeringCloud()
|
||||
{
|
||||
Collection<EffectInstance> collection = this.getActivePotionEffects();
|
||||
Collection<EffectInstance> collection = this.getActiveEffects();
|
||||
if (!collection.isEmpty())
|
||||
{
|
||||
AreaEffectCloudEntity areaeffectcloudentity = new AreaEffectCloudEntity(this.world, this.getPosX(), this.getPosY(), this.getPosZ());
|
||||
AreaEffectCloudEntity areaeffectcloudentity = new AreaEffectCloudEntity(this.level, this.getX(), this.getY(), this.getZ());
|
||||
areaeffectcloudentity.setRadius(2.5F);
|
||||
areaeffectcloudentity.setRadiusOnUse(-0.5F);
|
||||
areaeffectcloudentity.setWaitTime(10);
|
||||
|
@ -295,7 +295,7 @@ public class BakaMitaiCreeperEntity extends MonsterEntity implements IChargeable
|
|||
areaeffectcloudentity.addEffect(new EffectInstance(effectinstance));
|
||||
}
|
||||
|
||||
this.world.addEntity(areaeffectcloudentity);
|
||||
this.level.addFreshEntity(areaeffectcloudentity);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ public class DrachenlordEntity extends ZombieEntity
|
|||
{
|
||||
public static AttributeModifierMap.MutableAttribute registerAttributes()
|
||||
{
|
||||
return MonsterEntity.func_234295_eP_().createMutableAttribute(Attributes.FOLLOW_RANGE, 35.0D).createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.2F).createMutableAttribute(Attributes.ATTACK_DAMAGE, 3.0D).createMutableAttribute(Attributes.ARMOR, 2.0D).createMutableAttribute(Attributes.ZOMBIE_SPAWN_REINFORCEMENTS);
|
||||
return MonsterEntity.createMonsterAttributes().add(Attributes.FOLLOW_RANGE, 35.0D).add(Attributes.MOVEMENT_SPEED, 0.2F).add(Attributes.ATTACK_DAMAGE, 3.0D).add(Attributes.ARMOR, 2.0D).add(Attributes.SPAWN_REINFORCEMENTS_CHANCE);
|
||||
}
|
||||
|
||||
private int angerLevel;
|
||||
|
@ -35,16 +35,16 @@ public class DrachenlordEntity extends ZombieEntity
|
|||
public DrachenlordEntity(EntityType<? extends DrachenlordEntity> type, World worldIn)
|
||||
{
|
||||
super(type, worldIn);
|
||||
this.isImmuneToFire();
|
||||
this.fireImmune();
|
||||
}
|
||||
|
||||
public void setRevengeTarget(@Nullable LivingEntity livingEntity)
|
||||
public void setLastHurtByMob(@Nullable LivingEntity livingEntity)
|
||||
{
|
||||
super.setRevengeTarget(livingEntity);
|
||||
super.setLastHurtByMob(livingEntity);
|
||||
|
||||
if (livingEntity != null)
|
||||
{
|
||||
this.angerTargetUUID = livingEntity.getUniqueID();
|
||||
this.angerTargetUUID = livingEntity.getUUID();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -55,12 +55,12 @@ public class DrachenlordEntity extends ZombieEntity
|
|||
|
||||
public void becomeAngryAt(Entity entity)
|
||||
{
|
||||
this.angerLevel = 400 + this.rand.nextInt(400);
|
||||
this.randomSoundDelay = this.rand.nextInt(40);
|
||||
this.angerLevel = 400 + this.random.nextInt(400);
|
||||
this.randomSoundDelay = this.random.nextInt(40);
|
||||
|
||||
if (entity instanceof LivingEntity)
|
||||
{
|
||||
this.setRevengeTarget((LivingEntity) entity);
|
||||
this.setLastHurtByMob((LivingEntity) entity);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -79,17 +79,17 @@ public class DrachenlordEntity extends ZombieEntity
|
|||
{
|
||||
this.playSound(SpackenmobsRegistry.ENTITY_DRACHENLORD_ANGRY.get(), 1.0F, 1.0F);
|
||||
}
|
||||
if (this.angerLevel > 0 && this.angerTargetUUID != null && this.getRevengeTarget() == null)
|
||||
if (this.angerLevel > 0 && this.angerTargetUUID != null && this.getLastHurtByMob() == null)
|
||||
{
|
||||
PlayerEntity entityplayer = this.world.getPlayerByUuid(this.angerTargetUUID);
|
||||
this.setRevengeTarget(entityplayer);
|
||||
this.attackingPlayer = entityplayer;
|
||||
this.recentlyHit = this.getRevengeTimer();
|
||||
PlayerEntity entityplayer = this.level.getPlayerByUUID(this.angerTargetUUID);
|
||||
this.setLastHurtByMob(entityplayer);
|
||||
this.lastHurtByPlayer = entityplayer;
|
||||
this.lastHurtByPlayerTime = this.getLastHurtByMobTimestamp();
|
||||
}
|
||||
super.tick();
|
||||
}
|
||||
|
||||
public boolean attackEntityFrom(DamageSource source, float amount)
|
||||
public boolean hurt(DamageSource source, float amount)
|
||||
{
|
||||
if (this.isInvulnerableTo(source))
|
||||
{
|
||||
|
@ -97,14 +97,14 @@ public class DrachenlordEntity extends ZombieEntity
|
|||
}
|
||||
else
|
||||
{
|
||||
Entity entity = source.getTrueSource();
|
||||
Entity entity = source.getEntity();
|
||||
|
||||
if (entity instanceof PlayerEntity)
|
||||
{
|
||||
this.becomeAngryAt(entity);
|
||||
}
|
||||
|
||||
return super.attackEntityFrom(source, amount);
|
||||
return super.hurt(source, amount);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -123,9 +123,9 @@ public class DrachenlordEntity extends ZombieEntity
|
|||
return SpackenmobsRegistry.ENTITY_DRACHENLORD_DEATH.get();
|
||||
}
|
||||
|
||||
protected void setEquipmentBasedOnDifficulty(DifficultyInstance difficulty)
|
||||
protected void populateDefaultEquipmentSlots(DifficultyInstance difficulty)
|
||||
{
|
||||
super.setEquipmentBasedOnDifficulty(difficulty);
|
||||
this.setItemStackToSlot(EquipmentSlotType.MAINHAND, new ItemStack(Items.GOLDEN_AXE));
|
||||
super.populateDefaultEquipmentSlots(difficulty);
|
||||
this.setItemSlot(EquipmentSlotType.MAINHAND, new ItemStack(Items.GOLDEN_AXE));
|
||||
}
|
||||
}
|
|
@ -23,69 +23,69 @@ public class FriedrichLiechtensteinEntity extends AnimalEntity
|
|||
{
|
||||
public static AttributeModifierMap.MutableAttribute registerAttributes()
|
||||
{
|
||||
return MobEntity.func_233666_p_().createMutableAttribute(Attributes.MAX_HEALTH, 20.0D).createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.2F);
|
||||
return MobEntity.createMobAttributes().add(Attributes.MAX_HEALTH, 20.0D).add(Attributes.MOVEMENT_SPEED, 0.2F);
|
||||
}
|
||||
|
||||
public FriedrichLiechtensteinEntity(EntityType<? extends FriedrichLiechtensteinEntity> type, World worldIn)
|
||||
{
|
||||
super(type, worldIn);
|
||||
this.setItemStackToSlot(EquipmentSlotType.MAINHAND, new ItemStack(SpackenmobsRegistry.AHOJ_BRAUSE.get()));
|
||||
this.setItemStackToSlot(EquipmentSlotType.OFFHAND, new ItemStack(SpackenmobsRegistry.AHOJ_BRAUSE_DRINK.get()));
|
||||
this.setItemSlot(EquipmentSlotType.MAINHAND, new ItemStack(SpackenmobsRegistry.AHOJ_BRAUSE.get()));
|
||||
this.setItemSlot(EquipmentSlotType.OFFHAND, new ItemStack(SpackenmobsRegistry.AHOJ_BRAUSE_DRINK.get()));
|
||||
}
|
||||
|
||||
public ActionResultType func_230254_b_(PlayerEntity player, Hand hand)
|
||||
public ActionResultType mobInteract(PlayerEntity player, Hand hand)
|
||||
{
|
||||
ItemStack itemstack = player.getHeldItem(hand);
|
||||
if (itemstack.getItem() == Items.GLASS_BOTTLE && !this.isChild())
|
||||
ItemStack itemstack = player.getItemInHand(hand);
|
||||
if (itemstack.getItem() == Items.GLASS_BOTTLE && !this.isBaby())
|
||||
{
|
||||
player.playSound(SpackenmobsRegistry.ENTITY_FRIEDRICH_DEATH.get(), 1.0F, 1.0F);
|
||||
player.playSound(SoundEvents.ENTITY_COW_MILK, 1.0F, 1.0F);
|
||||
player.playSound(SoundEvents.COW_MILK, 1.0F, 1.0F);
|
||||
for (int i = 0; i < 7; ++i)
|
||||
{
|
||||
double d0 = this.rand.nextGaussian() * 0.02D;
|
||||
double d1 = this.rand.nextGaussian() * 0.02D;
|
||||
double d2 = this.rand.nextGaussian() * 0.02D;
|
||||
this.world.addParticle(ParticleTypes.HAPPY_VILLAGER, this.getPosXRandom(1.0D), this.getPosYRandom() + 0.5D, this.getPosZRandom(1.0D), d0, d1, d2);
|
||||
double d0 = this.random.nextGaussian() * 0.02D;
|
||||
double d1 = this.random.nextGaussian() * 0.02D;
|
||||
double d2 = this.random.nextGaussian() * 0.02D;
|
||||
this.level.addParticle(ParticleTypes.HAPPY_VILLAGER, this.getRandomX(1.0D), this.getRandomY() + 0.5D, this.getRandomZ(1.0D), d0, d1, d2);
|
||||
}
|
||||
itemstack.shrink(1);
|
||||
if (itemstack.isEmpty())
|
||||
{
|
||||
player.setHeldItem(hand, new ItemStack(SpackenmobsRegistry.AHOJ_BRAUSE_DRINK.get()));
|
||||
player.setItemInHand(hand, new ItemStack(SpackenmobsRegistry.AHOJ_BRAUSE_DRINK.get()));
|
||||
}
|
||||
else if (!player.inventory.addItemStackToInventory(new ItemStack(SpackenmobsRegistry.AHOJ_BRAUSE_DRINK.get())))
|
||||
else if (!player.inventory.add(new ItemStack(SpackenmobsRegistry.AHOJ_BRAUSE_DRINK.get())))
|
||||
{
|
||||
player.dropItem(new ItemStack(SpackenmobsRegistry.AHOJ_BRAUSE_DRINK.get()), false);
|
||||
player.drop(new ItemStack(SpackenmobsRegistry.AHOJ_BRAUSE_DRINK.get()), false);
|
||||
}
|
||||
return ActionResultType.func_233537_a_(this.world.isRemote);
|
||||
return ActionResultType.sidedSuccess(this.level.isClientSide);
|
||||
}
|
||||
else if (itemstack.getItem() == Items.PAPER && !this.isChild())
|
||||
else if (itemstack.getItem() == Items.PAPER && !this.isBaby())
|
||||
{
|
||||
player.playSound(SpackenmobsRegistry.ENTITY_FRIEDRICH_AMBIENT.get(), 1.0F, 1.0F);
|
||||
for (int i = 0; i < 7; ++i)
|
||||
{
|
||||
double d0 = this.rand.nextGaussian() * 0.02D;
|
||||
double d1 = this.rand.nextGaussian() * 0.02D;
|
||||
double d2 = this.rand.nextGaussian() * 0.02D;
|
||||
this.world.addParticle(ParticleTypes.HAPPY_VILLAGER, this.getPosXRandom(1.0D), this.getPosYRandom() + 0.5D, this.getPosZRandom(1.0D), d0, d1, d2);
|
||||
double d0 = this.random.nextGaussian() * 0.02D;
|
||||
double d1 = this.random.nextGaussian() * 0.02D;
|
||||
double d2 = this.random.nextGaussian() * 0.02D;
|
||||
this.level.addParticle(ParticleTypes.HAPPY_VILLAGER, this.getRandomX(1.0D), this.getRandomY() + 0.5D, this.getRandomZ(1.0D), d0, d1, d2);
|
||||
}
|
||||
itemstack.shrink(1);
|
||||
if (itemstack.isEmpty())
|
||||
{
|
||||
player.setHeldItem(hand, new ItemStack(SpackenmobsRegistry.AHOJ_BRAUSE.get()));
|
||||
player.setItemInHand(hand, new ItemStack(SpackenmobsRegistry.AHOJ_BRAUSE.get()));
|
||||
}
|
||||
else if (!player.inventory.addItemStackToInventory(new ItemStack(SpackenmobsRegistry.AHOJ_BRAUSE.get())))
|
||||
else if (!player.inventory.add(new ItemStack(SpackenmobsRegistry.AHOJ_BRAUSE.get())))
|
||||
{
|
||||
player.dropItem(new ItemStack(SpackenmobsRegistry.AHOJ_BRAUSE.get()), false);
|
||||
player.drop(new ItemStack(SpackenmobsRegistry.AHOJ_BRAUSE.get()), false);
|
||||
}
|
||||
return ActionResultType.func_233537_a_(this.world.isRemote);
|
||||
return ActionResultType.sidedSuccess(this.level.isClientSide);
|
||||
}
|
||||
else
|
||||
{
|
||||
return super.func_230254_b_(player, hand);
|
||||
return super.mobInteract(player, hand);
|
||||
}
|
||||
}
|
||||
|
||||
public FriedrichLiechtensteinEntity func_241840_a(ServerWorld p_241840_1_, AgeableEntity p_241840_2_)
|
||||
public FriedrichLiechtensteinEntity getBreedOffspring(ServerWorld p_241840_1_, AgeableEntity p_241840_2_)
|
||||
{
|
||||
return SpackenmobsRegistry.FRIEDRICH_LIECHTENSTEIN.get().create(p_241840_1_);
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ public class FriedrichLiechtensteinEntity extends AnimalEntity
|
|||
this.goalSelector.addGoal(0, new SwimGoal(this));
|
||||
this.goalSelector.addGoal(1, new PanicGoal(this, 2.0D));
|
||||
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0D));
|
||||
this.goalSelector.addGoal(3, new TemptGoal(this, 1.25D, Ingredient.fromItems(Items.SUGAR), false));
|
||||
this.goalSelector.addGoal(3, new TemptGoal(this, 1.25D, Ingredient.of(Items.SUGAR), false));
|
||||
this.goalSelector.addGoal(4, new FollowParentGoal(this, 1.25D));
|
||||
this.goalSelector.addGoal(5, new WaterAvoidingRandomWalkingGoal(this, 1.0D));
|
||||
this.goalSelector.addGoal(6, new LookAtGoal(this, PlayerEntity.class, 6.0F));
|
||||
|
@ -124,11 +124,11 @@ public class FriedrichLiechtensteinEntity extends AnimalEntity
|
|||
|
||||
protected float getStandingEyeHeight(Pose poseIn, EntitySize sizeIn)
|
||||
{
|
||||
return this.isChild() ? sizeIn.height * 0.95F : 1.3F;
|
||||
return this.isBaby() ? sizeIn.height * 0.95F : 1.3F;
|
||||
}
|
||||
|
||||
protected void playStepSound(BlockPos pos, BlockState blockIn)
|
||||
{
|
||||
this.playSound(SoundEvents.ENTITY_COW_STEP, 0.15F, 1.0F);
|
||||
this.playSound(SoundEvents.COW_STEP, 0.15F, 1.0F);
|
||||
}
|
||||
}
|
|
@ -20,7 +20,7 @@ public class GiselaEntity extends AnimalEntity
|
|||
{
|
||||
public static AttributeModifierMap.MutableAttribute registerAttributes()
|
||||
{
|
||||
return MobEntity.func_233666_p_().createMutableAttribute(Attributes.MAX_HEALTH, 20.0D).createMutableAttribute(Attributes.MOVEMENT_SPEED, 1.25F);
|
||||
return MobEntity.createMobAttributes().add(Attributes.MAX_HEALTH, 20.0D).add(Attributes.MOVEMENT_SPEED, 1.25F);
|
||||
}
|
||||
|
||||
public GiselaEntity(EntityType<? extends GiselaEntity> type, World worldIn)
|
||||
|
@ -28,12 +28,12 @@ public class GiselaEntity extends AnimalEntity
|
|||
super(type, worldIn);
|
||||
}
|
||||
|
||||
public int getTalkInterval()
|
||||
public int getAmbientSoundInterval()
|
||||
{
|
||||
return 20;
|
||||
}
|
||||
|
||||
public GiselaEntity func_241840_a(ServerWorld p_241840_1_, AgeableEntity p_241840_2_)
|
||||
public GiselaEntity getBreedOffspring(ServerWorld p_241840_1_, AgeableEntity p_241840_2_)
|
||||
{
|
||||
return SpackenmobsRegistry.GISELA.get().create(p_241840_1_);
|
||||
}
|
||||
|
@ -71,11 +71,11 @@ public class GiselaEntity extends AnimalEntity
|
|||
|
||||
protected float getStandingEyeHeight(Pose poseIn, EntitySize sizeIn)
|
||||
{
|
||||
return this.isChild() ? sizeIn.height * 0.95F : 1.3F;
|
||||
return this.isBaby() ? sizeIn.height * 0.95F : 1.3F;
|
||||
}
|
||||
|
||||
protected void playStepSound(BlockPos pos, BlockState blockIn)
|
||||
{
|
||||
this.playSound(SoundEvents.ENTITY_COW_STEP, 0.15F, 1.0F);
|
||||
this.playSound(SoundEvents.COW_STEP, 0.15F, 1.0F);
|
||||
}
|
||||
}
|
|
@ -25,11 +25,11 @@ import mod.acgaming.spackenmobs.init.SpackenmobsRegistry;
|
|||
|
||||
public class HolzstammhuhnEntity extends AnimalEntity
|
||||
{
|
||||
private static final Ingredient TEMPTATION_ITEMS = Ingredient.fromItems(Items.STICK);
|
||||
private static final Ingredient TEMPTATION_ITEMS = Ingredient.of(Items.STICK);
|
||||
|
||||
public static AttributeModifierMap.MutableAttribute registerAttributes()
|
||||
{
|
||||
return MobEntity.func_233666_p_().createMutableAttribute(Attributes.MAX_HEALTH, 4.0D).createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.25D);
|
||||
return MobEntity.createMobAttributes().add(Attributes.MAX_HEALTH, 4.0D).add(Attributes.MOVEMENT_SPEED, 0.25D);
|
||||
}
|
||||
|
||||
public float wingRotation;
|
||||
|
@ -37,18 +37,18 @@ public class HolzstammhuhnEntity extends AnimalEntity
|
|||
public float oFlapSpeed;
|
||||
public float oFlap;
|
||||
public float wingRotDelta = 1.0F;
|
||||
public int timeUntilNextEgg = this.rand.nextInt(6000) + 6000;
|
||||
public int timeUntilNextEgg = this.random.nextInt(6000) + 6000;
|
||||
public boolean chickenJockey;
|
||||
|
||||
public HolzstammhuhnEntity(EntityType<? extends HolzstammhuhnEntity> type, World worldIn)
|
||||
{
|
||||
super(type, worldIn);
|
||||
this.setPathPriority(PathNodeType.WATER, 0.0F);
|
||||
this.setPathfindingMalus(PathNodeType.WATER, 0.0F);
|
||||
}
|
||||
|
||||
public void livingTick()
|
||||
public void aiStep()
|
||||
{
|
||||
super.livingTick();
|
||||
super.aiStep();
|
||||
this.oFlap = this.wingRotation;
|
||||
this.oFlapSpeed = this.destPos;
|
||||
this.destPos = (float) ((double) this.destPos + (double) (this.onGround ? -1 : 4) * 0.3D);
|
||||
|
@ -59,31 +59,31 @@ public class HolzstammhuhnEntity extends AnimalEntity
|
|||
}
|
||||
|
||||
this.wingRotDelta = (float) ((double) this.wingRotDelta * 0.9D);
|
||||
Vector3d vector3d = this.getMotion();
|
||||
Vector3d vector3d = this.getDeltaMovement();
|
||||
if (!this.onGround && vector3d.y < 0.0D)
|
||||
{
|
||||
this.setMotion(vector3d.mul(1.0D, 0.6D, 1.0D));
|
||||
this.setDeltaMovement(vector3d.multiply(1.0D, 0.6D, 1.0D));
|
||||
}
|
||||
|
||||
this.wingRotation += this.wingRotDelta * 2.0F;
|
||||
if (!this.world.isRemote && this.isAlive() && !this.isChild() && !this.isChickenJockey() && --this.timeUntilNextEgg <= 0)
|
||||
if (!this.level.isClientSide && this.isAlive() && !this.isBaby() && !this.isChickenJockey() && --this.timeUntilNextEgg <= 0)
|
||||
{
|
||||
this.playSound(SoundEvents.ENTITY_CHICKEN_EGG, 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
|
||||
this.entityDropItem(Items.OAK_BUTTON);
|
||||
this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000;
|
||||
this.playSound(SoundEvents.CHICKEN_EGG, 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
|
||||
this.spawnAtLocation(Items.OAK_BUTTON);
|
||||
this.timeUntilNextEgg = this.random.nextInt(6000) + 6000;
|
||||
}
|
||||
}
|
||||
|
||||
public void writeAdditional(CompoundNBT compound)
|
||||
public void addAdditionalSaveData(CompoundNBT compound)
|
||||
{
|
||||
super.writeAdditional(compound);
|
||||
super.addAdditionalSaveData(compound);
|
||||
compound.putBoolean("IsChickenJockey", this.chickenJockey);
|
||||
compound.putInt("EggLayTime", this.timeUntilNextEgg);
|
||||
}
|
||||
|
||||
public void readAdditional(CompoundNBT compound)
|
||||
public void readAdditionalSaveData(CompoundNBT compound)
|
||||
{
|
||||
super.readAdditional(compound);
|
||||
super.readAdditionalSaveData(compound);
|
||||
this.chickenJockey = compound.getBoolean("IsChickenJockey");
|
||||
if (compound.contains("EggLayTime"))
|
||||
{
|
||||
|
@ -92,22 +92,22 @@ public class HolzstammhuhnEntity extends AnimalEntity
|
|||
|
||||
}
|
||||
|
||||
public boolean canDespawn(double distanceToClosestPlayer)
|
||||
public boolean removeWhenFarAway(double distanceToClosestPlayer)
|
||||
{
|
||||
return this.isChickenJockey();
|
||||
}
|
||||
|
||||
protected int getExperiencePoints(PlayerEntity player)
|
||||
protected int getExperienceReward(PlayerEntity player)
|
||||
{
|
||||
return this.isChickenJockey() ? 10 : super.getExperiencePoints(player);
|
||||
return this.isChickenJockey() ? 10 : super.getExperienceReward(player);
|
||||
}
|
||||
|
||||
public boolean isBreedingItem(ItemStack stack)
|
||||
public boolean isFood(ItemStack stack)
|
||||
{
|
||||
return TEMPTATION_ITEMS.test(stack);
|
||||
}
|
||||
|
||||
public HolzstammhuhnEntity func_241840_a(ServerWorld p_241840_1_, AgeableEntity p_241840_2_)
|
||||
public HolzstammhuhnEntity getBreedOffspring(ServerWorld p_241840_1_, AgeableEntity p_241840_2_)
|
||||
{
|
||||
return SpackenmobsRegistry.HOLZSTAMMHUHN.get().create(p_241840_1_);
|
||||
}
|
||||
|
@ -136,45 +136,45 @@ public class HolzstammhuhnEntity extends AnimalEntity
|
|||
|
||||
protected SoundEvent getAmbientSound()
|
||||
{
|
||||
return SoundEvents.BLOCK_WOOD_PLACE;
|
||||
return SoundEvents.WOOD_PLACE;
|
||||
}
|
||||
|
||||
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
|
||||
{
|
||||
return SoundEvents.BLOCK_WOOD_HIT;
|
||||
return SoundEvents.WOOD_HIT;
|
||||
}
|
||||
|
||||
protected SoundEvent getDeathSound()
|
||||
{
|
||||
return SoundEvents.BLOCK_WOOD_BREAK;
|
||||
return SoundEvents.WOOD_BREAK;
|
||||
}
|
||||
|
||||
public boolean onLivingFall(float distance, float damageMultiplier)
|
||||
public boolean causeFallDamage(float distance, float damageMultiplier)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected float getStandingEyeHeight(Pose poseIn, EntitySize sizeIn)
|
||||
{
|
||||
return this.isChild() ? sizeIn.height * 0.85F : sizeIn.height * 0.92F;
|
||||
return this.isBaby() ? sizeIn.height * 0.85F : sizeIn.height * 0.92F;
|
||||
}
|
||||
|
||||
protected void playStepSound(BlockPos pos, BlockState blockIn)
|
||||
{
|
||||
this.playSound(SoundEvents.BLOCK_WOOD_STEP, 0.15F, 1.0F);
|
||||
this.playSound(SoundEvents.WOOD_STEP, 0.15F, 1.0F);
|
||||
}
|
||||
|
||||
public void updatePassenger(Entity passenger)
|
||||
public void positionRider(Entity passenger)
|
||||
{
|
||||
super.updatePassenger(passenger);
|
||||
float f = MathHelper.sin(this.renderYawOffset * ((float) Math.PI / 180F));
|
||||
float f1 = MathHelper.cos(this.renderYawOffset * ((float) Math.PI / 180F));
|
||||
super.positionRider(passenger);
|
||||
float f = MathHelper.sin(this.yBodyRot * ((float) Math.PI / 180F));
|
||||
float f1 = MathHelper.cos(this.yBodyRot * ((float) Math.PI / 180F));
|
||||
float f2 = 0.1F;
|
||||
float f3 = 0.0F;
|
||||
passenger.setPosition(this.getPosX() + (double) (0.1F * f), this.getPosYHeight(0.5D) + passenger.getYOffset() + 0.0D, this.getPosZ() - (double) (0.1F * f1));
|
||||
passenger.setPos(this.getX() + (double) (0.1F * f), this.getY(0.5D) + passenger.getMyRidingOffset() + 0.0D, this.getZ() - (double) (0.1F * f1));
|
||||
if (passenger instanceof LivingEntity)
|
||||
{
|
||||
((LivingEntity) passenger).renderYawOffset = this.renderYawOffset;
|
||||
((LivingEntity) passenger).yBodyRot = this.yBodyRot;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -38,13 +38,13 @@ import mod.acgaming.spackenmobs.init.SpackenmobsRegistry;
|
|||
)
|
||||
public class IslamistEntity extends MonsterEntity implements IChargeableMob
|
||||
{
|
||||
private static final DataParameter<Integer> STATE = EntityDataManager.createKey(IslamistEntity.class, DataSerializers.VARINT);
|
||||
private static final DataParameter<Boolean> POWERED = EntityDataManager.createKey(IslamistEntity.class, DataSerializers.BOOLEAN);
|
||||
private static final DataParameter<Boolean> IGNITED = EntityDataManager.createKey(IslamistEntity.class, DataSerializers.BOOLEAN);
|
||||
private static final DataParameter<Integer> STATE = EntityDataManager.defineId(IslamistEntity.class, DataSerializers.INT);
|
||||
private static final DataParameter<Boolean> POWERED = EntityDataManager.defineId(IslamistEntity.class, DataSerializers.BOOLEAN);
|
||||
private static final DataParameter<Boolean> IGNITED = EntityDataManager.defineId(IslamistEntity.class, DataSerializers.BOOLEAN);
|
||||
|
||||
public static AttributeModifierMap.MutableAttribute registerAttributes()
|
||||
{
|
||||
return MonsterEntity.func_234295_eP_().createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.25D);
|
||||
return MonsterEntity.createMonsterAttributes().add(Attributes.MOVEMENT_SPEED, 0.25D);
|
||||
}
|
||||
|
||||
private int lastActiveTime;
|
||||
|
@ -58,9 +58,9 @@ public class IslamistEntity extends MonsterEntity implements IChargeableMob
|
|||
super(type, worldIn);
|
||||
}
|
||||
|
||||
public boolean onLivingFall(float distance, float damageMultiplier)
|
||||
public boolean causeFallDamage(float distance, float damageMultiplier)
|
||||
{
|
||||
boolean flag = super.onLivingFall(distance, damageMultiplier);
|
||||
boolean flag = super.causeFallDamage(distance, damageMultiplier);
|
||||
this.timeSinceIgnited = (int) ((float) this.timeSinceIgnited + distance * 1.5F);
|
||||
if (this.timeSinceIgnited > this.fuseTime - 5)
|
||||
{
|
||||
|
@ -75,9 +75,9 @@ public class IslamistEntity extends MonsterEntity implements IChargeableMob
|
|||
return 0.6F;
|
||||
}
|
||||
|
||||
public boolean isCharged()
|
||||
public boolean isPowered()
|
||||
{
|
||||
return this.dataManager.get(POWERED);
|
||||
return this.entityData.get(POWERED);
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
|
@ -88,33 +88,33 @@ public class IslamistEntity extends MonsterEntity implements IChargeableMob
|
|||
|
||||
public int getCreeperState()
|
||||
{
|
||||
return this.dataManager.get(STATE);
|
||||
return this.entityData.get(STATE);
|
||||
}
|
||||
|
||||
public void setCreeperState(int state)
|
||||
{
|
||||
this.dataManager.set(STATE, state);
|
||||
this.entityData.set(STATE, state);
|
||||
}
|
||||
|
||||
public void func_241841_a(ServerWorld p_241841_1_, LightningBoltEntity p_241841_2_)
|
||||
public void thunderHit(ServerWorld p_241841_1_, LightningBoltEntity p_241841_2_)
|
||||
{
|
||||
super.func_241841_a(p_241841_1_, p_241841_2_);
|
||||
this.dataManager.set(POWERED, true);
|
||||
super.thunderHit(p_241841_1_, p_241841_2_);
|
||||
this.entityData.set(POWERED, true);
|
||||
}
|
||||
|
||||
public boolean hasIgnited()
|
||||
{
|
||||
return this.dataManager.get(IGNITED);
|
||||
return this.entityData.get(IGNITED);
|
||||
}
|
||||
|
||||
public void ignite()
|
||||
{
|
||||
this.dataManager.set(IGNITED, true);
|
||||
this.entityData.set(IGNITED, true);
|
||||
}
|
||||
|
||||
public boolean ableToCauseSkullDrop()
|
||||
{
|
||||
return this.isCharged() && this.droppedSkulls < 1;
|
||||
return this.isPowered() && this.droppedSkulls < 1;
|
||||
}
|
||||
|
||||
public void incrementDroppedSkulls()
|
||||
|
@ -137,12 +137,12 @@ public class IslamistEntity extends MonsterEntity implements IChargeableMob
|
|||
this.targetSelector.addGoal(2, new HurtByTargetGoal(this));
|
||||
}
|
||||
|
||||
protected void registerData()
|
||||
protected void defineSynchedData()
|
||||
{
|
||||
super.registerData();
|
||||
this.dataManager.register(STATE, -1);
|
||||
this.dataManager.register(POWERED, false);
|
||||
this.dataManager.register(IGNITED, false);
|
||||
super.defineSynchedData();
|
||||
this.entityData.define(STATE, -1);
|
||||
this.entityData.define(POWERED, false);
|
||||
this.entityData.define(IGNITED, false);
|
||||
}
|
||||
|
||||
public void tick()
|
||||
|
@ -182,10 +182,10 @@ public class IslamistEntity extends MonsterEntity implements IChargeableMob
|
|||
return SpackenmobsRegistry.ENTITY_ISLAMIST_AMBIENT.get();
|
||||
}
|
||||
|
||||
public void writeAdditional(CompoundNBT compound)
|
||||
public void addAdditionalSaveData(CompoundNBT compound)
|
||||
{
|
||||
super.writeAdditional(compound);
|
||||
if (this.dataManager.get(POWERED))
|
||||
super.addAdditionalSaveData(compound);
|
||||
if (this.entityData.get(POWERED))
|
||||
{
|
||||
compound.putBoolean("powered", true);
|
||||
}
|
||||
|
@ -195,10 +195,10 @@ public class IslamistEntity extends MonsterEntity implements IChargeableMob
|
|||
compound.putBoolean("ignited", this.hasIgnited());
|
||||
}
|
||||
|
||||
public void readAdditional(CompoundNBT compound)
|
||||
public void readAdditionalSaveData(CompoundNBT compound)
|
||||
{
|
||||
super.readAdditional(compound);
|
||||
this.dataManager.set(POWERED, compound.getBoolean("powered"));
|
||||
super.readAdditionalSaveData(compound);
|
||||
this.entityData.set(POWERED, compound.getBoolean("powered"));
|
||||
if (compound.contains("Fuse", 99))
|
||||
{
|
||||
this.fuseTime = compound.getShort("Fuse");
|
||||
|
@ -216,48 +216,48 @@ public class IslamistEntity extends MonsterEntity implements IChargeableMob
|
|||
|
||||
}
|
||||
|
||||
public int getMaxFallHeight()
|
||||
public int getMaxFallDistance()
|
||||
{
|
||||
return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F);
|
||||
return this.getTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F);
|
||||
}
|
||||
|
||||
protected void dropSpecialItems(DamageSource source, int looting, boolean recentlyHitIn)
|
||||
protected void dropCustomDeathLoot(DamageSource source, int looting, boolean recentlyHitIn)
|
||||
{
|
||||
super.dropSpecialItems(source, looting, recentlyHitIn);
|
||||
Entity entity = source.getTrueSource();
|
||||
super.dropCustomDeathLoot(source, looting, recentlyHitIn);
|
||||
Entity entity = source.getEntity();
|
||||
if (entity != this && entity instanceof IslamistEntity)
|
||||
{
|
||||
IslamistEntity creeperentity = (IslamistEntity) entity;
|
||||
if (creeperentity.ableToCauseSkullDrop())
|
||||
{
|
||||
creeperentity.incrementDroppedSkulls();
|
||||
this.entityDropItem(Items.CREEPER_HEAD);
|
||||
this.spawnAtLocation(Items.CREEPER_HEAD);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected ActionResultType func_230254_b_(PlayerEntity p_230254_1_, Hand p_230254_2_)
|
||||
protected ActionResultType mobInteract(PlayerEntity p_230254_1_, Hand p_230254_2_)
|
||||
{
|
||||
ItemStack itemstack = p_230254_1_.getHeldItem(p_230254_2_);
|
||||
ItemStack itemstack = p_230254_1_.getItemInHand(p_230254_2_);
|
||||
if (itemstack.getItem() == Items.FLINT_AND_STEEL)
|
||||
{
|
||||
this.world.playSound(p_230254_1_, this.getPosX(), this.getPosY(), this.getPosZ(), SoundEvents.ITEM_FLINTANDSTEEL_USE, this.getSoundCategory(), 1.0F, this.rand.nextFloat() * 0.4F + 0.8F);
|
||||
if (!this.world.isRemote)
|
||||
this.level.playSound(p_230254_1_, this.getX(), this.getY(), this.getZ(), SoundEvents.FLINTANDSTEEL_USE, this.getSoundSource(), 1.0F, this.random.nextFloat() * 0.4F + 0.8F);
|
||||
if (!this.level.isClientSide)
|
||||
{
|
||||
this.ignite();
|
||||
itemstack.damageItem(1, p_230254_1_, (player) ->
|
||||
player.sendBreakAnimation(p_230254_2_));
|
||||
itemstack.hurtAndBreak(1, p_230254_1_, (player) ->
|
||||
player.broadcastBreakEvent(p_230254_2_));
|
||||
}
|
||||
|
||||
return ActionResultType.func_233537_a_(this.world.isRemote);
|
||||
return ActionResultType.sidedSuccess(this.level.isClientSide);
|
||||
}
|
||||
else
|
||||
{
|
||||
return super.func_230254_b_(p_230254_1_, p_230254_2_);
|
||||
return super.mobInteract(p_230254_1_, p_230254_2_);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean attackEntityAsMob(Entity entityIn)
|
||||
public boolean doHurtTarget(Entity entityIn)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -274,13 +274,13 @@ public class IslamistEntity extends MonsterEntity implements IChargeableMob
|
|||
|
||||
private void explode()
|
||||
{
|
||||
if (!this.world.isRemote)
|
||||
if (!this.level.isClientSide)
|
||||
{
|
||||
Explosion.Mode explosion$mode = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.world, this) ? Explosion.Mode.DESTROY : Explosion.Mode.NONE;
|
||||
float f = this.isCharged() ? 2.0F : 1.0F;
|
||||
Explosion.Mode explosion$mode = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.level, this) ? Explosion.Mode.DESTROY : Explosion.Mode.NONE;
|
||||
float f = this.isPowered() ? 2.0F : 1.0F;
|
||||
this.dead = true;
|
||||
this.playSound(SpackenmobsRegistry.ENTITY_ISLAMIST_BLOW.get(), 1.0F, 1.0F);
|
||||
this.world.createExplosion(this, this.getPosX(), this.getPosY(), this.getPosZ(), (float) this.explosionRadius * f, explosion$mode);
|
||||
this.level.explode(this, this.getX(), this.getY(), this.getZ(), (float) this.explosionRadius * f, explosion$mode);
|
||||
this.remove();
|
||||
this.spawnLingeringCloud();
|
||||
}
|
||||
|
@ -289,10 +289,10 @@ public class IslamistEntity extends MonsterEntity implements IChargeableMob
|
|||
|
||||
private void spawnLingeringCloud()
|
||||
{
|
||||
Collection<EffectInstance> collection = this.getActivePotionEffects();
|
||||
Collection<EffectInstance> collection = this.getActiveEffects();
|
||||
if (!collection.isEmpty())
|
||||
{
|
||||
AreaEffectCloudEntity areaeffectcloudentity = new AreaEffectCloudEntity(this.world, this.getPosX(), this.getPosY(), this.getPosZ());
|
||||
AreaEffectCloudEntity areaeffectcloudentity = new AreaEffectCloudEntity(this.level, this.getX(), this.getY(), this.getZ());
|
||||
areaeffectcloudentity.setRadius(2.5F);
|
||||
areaeffectcloudentity.setRadiusOnUse(-0.5F);
|
||||
areaeffectcloudentity.setWaitTime(10);
|
||||
|
@ -304,7 +304,7 @@ public class IslamistEntity extends MonsterEntity implements IChargeableMob
|
|||
areaeffectcloudentity.addEffect(new EffectInstance(effectinstance));
|
||||
}
|
||||
|
||||
this.world.addEntity(areaeffectcloudentity);
|
||||
this.level.addFreshEntity(areaeffectcloudentity);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -35,18 +35,18 @@ import mod.acgaming.spackenmobs.util.ConfigurationHandler;
|
|||
|
||||
public class JensEntity extends AnimalEntity implements IRideable, IEquipable
|
||||
{
|
||||
private static final DataParameter<Boolean> DIGESTING = EntityDataManager.createKey(JensEntity.class, DataSerializers.BOOLEAN);
|
||||
private static final DataParameter<Integer> DIGEST_TIME = EntityDataManager.createKey(JensEntity.class, DataSerializers.VARINT);
|
||||
private static final Ingredient TEMPTATION_ITEMS = Ingredient.fromItems(Items.COD, Items.SALMON, Items.TROPICAL_FISH, SpackenmobsRegistry.RAM.get());
|
||||
private static final Ingredient BREEDING_ITEMS = Ingredient.fromItems(SpackenmobsRegistry.RAM.get());
|
||||
private static final Ingredient FISH_ITEMS = Ingredient.fromItems(Items.COD, Items.SALMON, Items.TROPICAL_FISH);
|
||||
private static final DataParameter<Boolean> DIGESTING = EntityDataManager.defineId(JensEntity.class, DataSerializers.BOOLEAN);
|
||||
private static final DataParameter<Integer> DIGEST_TIME = EntityDataManager.defineId(JensEntity.class, DataSerializers.INT);
|
||||
private static final Ingredient TEMPTATION_ITEMS = Ingredient.of(Items.COD, Items.SALMON, Items.TROPICAL_FISH, SpackenmobsRegistry.RAM.get());
|
||||
private static final Ingredient BREEDING_ITEMS = Ingredient.of(SpackenmobsRegistry.RAM.get());
|
||||
private static final Ingredient FISH_ITEMS = Ingredient.of(Items.COD, Items.SALMON, Items.TROPICAL_FISH);
|
||||
|
||||
public static AttributeModifierMap.MutableAttribute registerAttributes()
|
||||
{
|
||||
return MobEntity.func_233666_p_().createMutableAttribute(Attributes.MAX_HEALTH, 20.0D).createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.25D);
|
||||
return MobEntity.createMobAttributes().add(Attributes.MAX_HEALTH, 20.0D).add(Attributes.MOVEMENT_SPEED, 0.25D);
|
||||
}
|
||||
|
||||
private final BoostHelper field_234214_bx_ = new BoostHelper(this.dataManager, DIGEST_TIME, DIGESTING);
|
||||
private final BoostHelper steering = new BoostHelper(this.entityData, DIGEST_TIME, DIGESTING);
|
||||
public boolean digesting;
|
||||
public int digestTime;
|
||||
|
||||
|
@ -55,96 +55,96 @@ public class JensEntity extends AnimalEntity implements IRideable, IEquipable
|
|||
super(p_i50250_1_, p_i50250_2_);
|
||||
}
|
||||
|
||||
public boolean func_230264_L__()
|
||||
public boolean isSaddleable()
|
||||
{
|
||||
return this.isAlive() && !this.isChild();
|
||||
return this.isAlive() && !this.isBaby();
|
||||
}
|
||||
|
||||
public void func_230266_a_(@Nullable SoundCategory p_230266_1_)
|
||||
public void equipSaddle(@Nullable SoundCategory p_230266_1_)
|
||||
{
|
||||
this.field_234214_bx_.setSaddledFromBoolean(true);
|
||||
this.steering.setSaddle(true);
|
||||
if (p_230266_1_ != null)
|
||||
{
|
||||
this.world.playMovingSound(null, this, SoundEvents.ENTITY_PIG_SADDLE, p_230266_1_, 0.5F, 1.0F);
|
||||
this.level.playSound(null, this, SoundEvents.PIG_SADDLE, p_230266_1_, 0.5F, 1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHorseSaddled()
|
||||
public boolean isSaddled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void livingTick()
|
||||
public void aiStep()
|
||||
{
|
||||
super.livingTick();
|
||||
super.aiStep();
|
||||
|
||||
if (this.digesting && this.digestTime > 0)
|
||||
{
|
||||
this.digestTime--;
|
||||
this.dataManager.set(DIGEST_TIME, this.digestTime);
|
||||
this.entityData.set(DIGEST_TIME, this.digestTime);
|
||||
}
|
||||
|
||||
if (this.digesting && this.digestTime <= 0)
|
||||
{
|
||||
for (int i = 0; i < 7; ++i)
|
||||
{
|
||||
double d0 = this.rand.nextGaussian() * 0.02D;
|
||||
double d1 = this.rand.nextGaussian() * 0.02D;
|
||||
double d2 = this.rand.nextGaussian() * 0.02D;
|
||||
this.world.addParticle(ParticleTypes.POOF, this.getPosXRandom(1.0D), this.getPosYRandom() + 0.5D, this.getPosZRandom(1.0D), d0, d1, d2);
|
||||
double d0 = this.random.nextGaussian() * 0.02D;
|
||||
double d1 = this.random.nextGaussian() * 0.02D;
|
||||
double d2 = this.random.nextGaussian() * 0.02D;
|
||||
this.level.addParticle(ParticleTypes.POOF, this.getRandomX(1.0D), this.getRandomY() + 0.5D, this.getRandomZ(1.0D), d0, d1, d2);
|
||||
}
|
||||
this.playSound(SpackenmobsRegistry.ENTITY_JENS_POOP.get(), 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
|
||||
this.entityDropItem(SpackenmobsRegistry.SURSTROEMMING.get());
|
||||
this.clearActivePotions();
|
||||
this.playSound(SpackenmobsRegistry.ENTITY_JENS_POOP.get(), 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
|
||||
this.spawnAtLocation(SpackenmobsRegistry.SURSTROEMMING.get());
|
||||
this.removeAllEffects();
|
||||
|
||||
this.digesting = false;
|
||||
this.dataManager.set(DIGESTING, false);
|
||||
this.entityData.set(DIGESTING, false);
|
||||
|
||||
this.digestTime = 0;
|
||||
this.dataManager.set(DIGEST_TIME, 0);
|
||||
this.entityData.set(DIGEST_TIME, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public void writeAdditional(CompoundNBT compound)
|
||||
public void addAdditionalSaveData(CompoundNBT compound)
|
||||
{
|
||||
super.writeAdditional(compound);
|
||||
super.addAdditionalSaveData(compound);
|
||||
compound.putBoolean("Digesting", this.digesting);
|
||||
compound.putInt("DigestTime", this.digestTime);
|
||||
}
|
||||
|
||||
public void readAdditional(CompoundNBT compound)
|
||||
public void readAdditionalSaveData(CompoundNBT compound)
|
||||
{
|
||||
super.readAdditional(compound);
|
||||
super.readAdditionalSaveData(compound);
|
||||
this.digesting = compound.getBoolean("Digesting");
|
||||
this.digestTime = compound.getInt("DigestTime");
|
||||
}
|
||||
|
||||
public boolean isBreedingItem(ItemStack stack)
|
||||
public boolean isFood(ItemStack stack)
|
||||
{
|
||||
return BREEDING_ITEMS.test(stack);
|
||||
}
|
||||
|
||||
public ActionResultType func_230254_b_(PlayerEntity player, Hand hand)
|
||||
public ActionResultType mobInteract(PlayerEntity player, Hand hand)
|
||||
{
|
||||
boolean breeding_item = this.isBreedingItem(player.getHeldItem(hand));
|
||||
boolean fish_item = this.isFishItem(player.getHeldItem(hand));
|
||||
boolean breeding_item = this.isFood(player.getItemInHand(hand));
|
||||
boolean fish_item = this.isFishItem(player.getItemInHand(hand));
|
||||
|
||||
if (!breeding_item && !this.isBeingRidden() && !player.isSecondaryUseActive())
|
||||
if (!breeding_item && !this.isVehicle() && !player.isSecondaryUseActive())
|
||||
{
|
||||
if (!this.world.isRemote)
|
||||
if (!this.level.isClientSide)
|
||||
{
|
||||
player.startRiding(this);
|
||||
}
|
||||
return ActionResultType.func_233537_a_(this.world.isRemote);
|
||||
return ActionResultType.sidedSuccess(this.level.isClientSide);
|
||||
}
|
||||
else
|
||||
{
|
||||
ActionResultType actionresulttype = super.func_230254_b_(player, hand);
|
||||
if (fish_item && !this.isChild() && !this.digesting && !actionresulttype.isSuccessOrConsume())
|
||||
ActionResultType actionresulttype = super.mobInteract(player, hand);
|
||||
if (fish_item && !this.isBaby() && !this.digesting && !actionresulttype.consumesAction())
|
||||
{
|
||||
ItemStack itemstack = player.getHeldItem(hand);
|
||||
itemstack.interactWithEntity(player, this, hand);
|
||||
ItemStack itemstack = player.getItemInHand(hand);
|
||||
itemstack.interactLivingEntity(player, this, hand);
|
||||
digestFish();
|
||||
return ActionResultType.PASS;
|
||||
}
|
||||
|
@ -157,56 +157,56 @@ public class JensEntity extends AnimalEntity implements IRideable, IEquipable
|
|||
|
||||
public void digestFish()
|
||||
{
|
||||
this.playSound(SoundEvents.ENTITY_PLAYER_BURP, 1.0F, 1.0F);
|
||||
this.playSound(SoundEvents.PLAYER_BURP, 1.0F, 1.0F);
|
||||
this.playSound(SpackenmobsRegistry.ENTITY_JENS_EAT.get(), 1.0F, 1.0F);
|
||||
|
||||
this.digesting = true;
|
||||
this.dataManager.set(DIGESTING, true);
|
||||
this.entityData.set(DIGESTING, true);
|
||||
|
||||
this.digestTime = (ConfigurationHandler.GENERAL.jens_digest_time.get() * 20);
|
||||
this.dataManager.set(DIGEST_TIME, this.digestTime);
|
||||
this.entityData.set(DIGEST_TIME, this.digestTime);
|
||||
|
||||
for (int i = 0; i < 7; ++i)
|
||||
{
|
||||
double d0 = this.rand.nextGaussian() * 0.02D;
|
||||
double d1 = this.rand.nextGaussian() * 0.02D;
|
||||
double d2 = this.rand.nextGaussian() * 0.02D;
|
||||
this.world.addParticle(ParticleTypes.HEART, this.getPosXRandom(1.0D), this.getPosYRandom() + 0.5D, this.getPosZRandom(1.0D), d0, d1, d2);
|
||||
double d0 = this.random.nextGaussian() * 0.02D;
|
||||
double d1 = this.random.nextGaussian() * 0.02D;
|
||||
double d2 = this.random.nextGaussian() * 0.02D;
|
||||
this.level.addParticle(ParticleTypes.HEART, this.getRandomX(1.0D), this.getRandomY() + 0.5D, this.getRandomZ(1.0D), d0, d1, d2);
|
||||
}
|
||||
|
||||
this.addPotionEffect(new EffectInstance(Effects.NAUSEA, ConfigurationHandler.GENERAL.jens_digest_time.get() * 20, 1));
|
||||
this.addEffect(new EffectInstance(Effects.CONFUSION, ConfigurationHandler.GENERAL.jens_digest_time.get() * 20, 1));
|
||||
}
|
||||
|
||||
public boolean boost()
|
||||
{
|
||||
return this.field_234214_bx_.boost(this.getRNG());
|
||||
return this.steering.boost(this.getRandom());
|
||||
}
|
||||
|
||||
public void travelTowards(Vector3d travelVec)
|
||||
public void travelWithInput(Vector3d travelVec)
|
||||
{
|
||||
super.travel(travelVec);
|
||||
}
|
||||
|
||||
public float getMountedSpeed()
|
||||
public float getSteeringSpeed()
|
||||
{
|
||||
return (float) this.getAttributeValue(Attributes.MOVEMENT_SPEED) * 0.5F;
|
||||
}
|
||||
|
||||
public JensEntity func_241840_a(ServerWorld p_241840_1_, AgeableEntity p_241840_2_)
|
||||
public JensEntity getBreedOffspring(ServerWorld p_241840_1_, AgeableEntity p_241840_2_)
|
||||
{
|
||||
return SpackenmobsRegistry.JENS.get().create(p_241840_1_);
|
||||
}
|
||||
|
||||
protected void registerData()
|
||||
protected void defineSynchedData()
|
||||
{
|
||||
super.registerData();
|
||||
this.dataManager.register(DIGESTING, false);
|
||||
this.dataManager.register(DIGEST_TIME, 0);
|
||||
super.defineSynchedData();
|
||||
this.entityData.define(DIGESTING, false);
|
||||
this.entityData.define(DIGEST_TIME, 0);
|
||||
}
|
||||
|
||||
public void notifyDataManagerChange(DataParameter<?> key)
|
||||
public void onSyncedDataUpdated(DataParameter<?> key)
|
||||
{
|
||||
super.notifyDataManagerChange(key);
|
||||
super.onSyncedDataUpdated(key);
|
||||
}
|
||||
|
||||
public boolean isFishItem(ItemStack stack)
|
||||
|
@ -221,7 +221,7 @@ public class JensEntity extends AnimalEntity implements IRideable, IEquipable
|
|||
this.goalSelector.addGoal(2, new JensDanceGoal(this));
|
||||
this.goalSelector.addGoal(2, new JensEatDroppedFishGoal(this));
|
||||
this.goalSelector.addGoal(3, new BreedGoal(this, 1.0D));
|
||||
this.goalSelector.addGoal(4, new TemptGoal(this, 1.2D, Ingredient.fromItems(SpackenmobsRegistry.RAM_ON_A_STICK.get()), false));
|
||||
this.goalSelector.addGoal(4, new TemptGoal(this, 1.2D, Ingredient.of(SpackenmobsRegistry.RAM_ON_A_STICK.get()), false));
|
||||
this.goalSelector.addGoal(4, new TemptGoal(this, 1.2D, false, TEMPTATION_ITEMS));
|
||||
this.goalSelector.addGoal(5, new FollowParentGoal(this, 1.1D));
|
||||
this.goalSelector.addGoal(6, new WaterAvoidingRandomWalkingGoal(this, 1.0D));
|
||||
|
@ -234,7 +234,7 @@ public class JensEntity extends AnimalEntity implements IRideable, IEquipable
|
|||
return SpackenmobsRegistry.ENTITY_JENS_AMBIENT.get();
|
||||
}
|
||||
|
||||
public boolean canBeSteered()
|
||||
public boolean canBeControlledByRider()
|
||||
{
|
||||
Entity entity = this.getControllingPassenger();
|
||||
if (!(entity instanceof PlayerEntity))
|
||||
|
@ -244,19 +244,19 @@ public class JensEntity extends AnimalEntity implements IRideable, IEquipable
|
|||
else
|
||||
{
|
||||
PlayerEntity playerentity = (PlayerEntity) entity;
|
||||
return playerentity.getHeldItemMainhand().getItem() == SpackenmobsRegistry.RAM_ON_A_STICK.get() || playerentity.getHeldItemOffhand().getItem() == SpackenmobsRegistry.RAM_ON_A_STICK.get();
|
||||
return playerentity.getMainHandItem().getItem() == SpackenmobsRegistry.RAM_ON_A_STICK.get() || playerentity.getOffhandItem().getItem() == SpackenmobsRegistry.RAM_ON_A_STICK.get();
|
||||
}
|
||||
}
|
||||
|
||||
protected void playStepSound(BlockPos pos, BlockState blockIn)
|
||||
{
|
||||
this.playSound(SoundEvents.ENTITY_PIG_STEP, 0.15F, 1.0F);
|
||||
this.playSound(SoundEvents.PIG_STEP, 0.15F, 1.0F);
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public Vector3d func_241205_ce_()
|
||||
public Vector3d getLeashOffset()
|
||||
{
|
||||
return new Vector3d(0.0D, 0.6F * this.getEyeHeight(), this.getWidth() * 0.4F);
|
||||
return new Vector3d(0.0D, 0.6F * this.getEyeHeight(), this.getBbWidth() * 0.4F);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
@ -265,31 +265,31 @@ public class JensEntity extends AnimalEntity implements IRideable, IEquipable
|
|||
return this.getPassengers().isEmpty() ? null : this.getPassengers().get(0);
|
||||
}
|
||||
|
||||
public Vector3d func_230268_c_(LivingEntity livingEntity)
|
||||
public Vector3d getDismountLocationForPassenger(LivingEntity livingEntity)
|
||||
{
|
||||
Direction direction = this.getAdjustedHorizontalFacing();
|
||||
Direction direction = this.getMotionDirection();
|
||||
if (direction.getAxis() == Direction.Axis.Y)
|
||||
{
|
||||
return super.func_230268_c_(livingEntity);
|
||||
return super.getDismountLocationForPassenger(livingEntity);
|
||||
}
|
||||
else
|
||||
{
|
||||
int[][] aint = TransportationHelper.func_234632_a_(direction);
|
||||
BlockPos blockpos = this.getPosition();
|
||||
int[][] aint = TransportationHelper.offsetsForDirection(direction);
|
||||
BlockPos blockpos = this.blockPosition();
|
||||
BlockPos.Mutable blockpos$mutable = new BlockPos.Mutable();
|
||||
|
||||
for (Pose pose : livingEntity.getAvailablePoses())
|
||||
for (Pose pose : livingEntity.getDismountPoses())
|
||||
{
|
||||
AxisAlignedBB axisalignedbb = livingEntity.getPoseAABB(pose);
|
||||
AxisAlignedBB axisalignedbb = livingEntity.getLocalBoundsForPose(pose);
|
||||
|
||||
for (int[] aint1 : aint)
|
||||
{
|
||||
blockpos$mutable.setPos(blockpos.getX() + aint1[0], blockpos.getY(), blockpos.getZ() + aint1[1]);
|
||||
double d0 = this.world.func_242403_h(blockpos$mutable);
|
||||
if (TransportationHelper.func_234630_a_(d0))
|
||||
blockpos$mutable.set(blockpos.getX() + aint1[0], blockpos.getY(), blockpos.getZ() + aint1[1]);
|
||||
double d0 = this.level.getBlockFloorHeight(blockpos$mutable);
|
||||
if (TransportationHelper.isBlockFloorValid(d0))
|
||||
{
|
||||
Vector3d vector3d = Vector3d.copyCenteredWithVerticalOffset(blockpos$mutable, d0);
|
||||
if (TransportationHelper.func_234631_a_(this.world, livingEntity, axisalignedbb.offset(vector3d)))
|
||||
Vector3d vector3d = Vector3d.upFromBottomCenterOf(blockpos$mutable, d0);
|
||||
if (TransportationHelper.canDismountTo(this.level, livingEntity, axisalignedbb.move(vector3d)))
|
||||
{
|
||||
livingEntity.setPose(pose);
|
||||
return vector3d;
|
||||
|
@ -297,13 +297,13 @@ public class JensEntity extends AnimalEntity implements IRideable, IEquipable
|
|||
}
|
||||
}
|
||||
}
|
||||
return super.func_230268_c_(livingEntity);
|
||||
return super.getDismountLocationForPassenger(livingEntity);
|
||||
}
|
||||
}
|
||||
|
||||
protected void dropInventory()
|
||||
protected void dropEquipment()
|
||||
{
|
||||
super.dropInventory();
|
||||
super.dropEquipment();
|
||||
}
|
||||
|
||||
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
|
||||
|
@ -323,6 +323,6 @@ public class JensEntity extends AnimalEntity implements IRideable, IEquipable
|
|||
|
||||
public void travel(Vector3d travelVector)
|
||||
{
|
||||
this.ride(this, this.field_234214_bx_, travelVector);
|
||||
this.travel(this, this.steering, travelVector);
|
||||
}
|
||||
}
|
|
@ -44,14 +44,14 @@ public class MZTEWolfEntity extends TameableEntity implements IAngerable
|
|||
EntityType<?> entitytype = p_213440_0_.getType();
|
||||
return entitytype == EntityType.SHEEP || entitytype == EntityType.RABBIT || entitytype == EntityType.FOX;
|
||||
};
|
||||
private static final DataParameter<Boolean> BEGGING = EntityDataManager.createKey(MZTEWolfEntity.class, DataSerializers.BOOLEAN);
|
||||
private static final DataParameter<Integer> COLLAR_COLOR = EntityDataManager.createKey(MZTEWolfEntity.class, DataSerializers.VARINT);
|
||||
private static final DataParameter<Integer> field_234232_bz_ = EntityDataManager.createKey(MZTEWolfEntity.class, DataSerializers.VARINT);
|
||||
private static final RangedInteger field_234230_bG_ = TickRangeConverter.convertRange(20, 39);
|
||||
private static final DataParameter<Boolean> BEGGING = EntityDataManager.defineId(MZTEWolfEntity.class, DataSerializers.BOOLEAN);
|
||||
private static final DataParameter<Integer> COLLAR_COLOR = EntityDataManager.defineId(MZTEWolfEntity.class, DataSerializers.INT);
|
||||
private static final DataParameter<Integer> DATA_REMAINING_ANGER_TIME = EntityDataManager.defineId(MZTEWolfEntity.class, DataSerializers.INT);
|
||||
private static final RangedInteger PERSISTENT_ANGER_TIME = TickRangeConverter.rangeOfSeconds(20, 39);
|
||||
|
||||
public static AttributeModifierMap.MutableAttribute registerAttributes()
|
||||
{
|
||||
return MobEntity.func_233666_p_().createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.3F).createMutableAttribute(Attributes.MAX_HEALTH, 8.0D).createMutableAttribute(Attributes.ATTACK_DAMAGE, 2.0D);
|
||||
return MobEntity.createMobAttributes().add(Attributes.MOVEMENT_SPEED, 0.3F).add(Attributes.MAX_HEALTH, 8.0D).add(Attributes.ATTACK_DAMAGE, 2.0D);
|
||||
}
|
||||
|
||||
private float headRotationCourse;
|
||||
|
@ -60,33 +60,33 @@ public class MZTEWolfEntity extends TameableEntity implements IAngerable
|
|||
private boolean isShaking;
|
||||
private float timeWolfIsShaking;
|
||||
private float prevTimeWolfIsShaking;
|
||||
private UUID field_234231_bH_;
|
||||
private UUID persistentAngerTarget;
|
||||
|
||||
public MZTEWolfEntity(EntityType<? extends MZTEWolfEntity> type, World worldIn)
|
||||
{
|
||||
super(type, worldIn);
|
||||
this.setTamed(false);
|
||||
this.setTame(false);
|
||||
}
|
||||
|
||||
public void livingTick()
|
||||
public void aiStep()
|
||||
{
|
||||
super.livingTick();
|
||||
if (!this.world.isRemote && this.isWet && !this.isShaking && !this.hasPath() && this.onGround)
|
||||
super.aiStep();
|
||||
if (!this.level.isClientSide && this.isWet && !this.isShaking && !this.isPathFinding() && this.onGround)
|
||||
{
|
||||
this.isShaking = true;
|
||||
this.timeWolfIsShaking = 0.0F;
|
||||
this.prevTimeWolfIsShaking = 0.0F;
|
||||
this.world.setEntityState(this, (byte) 8);
|
||||
this.level.broadcastEntityEvent(this, (byte) 8);
|
||||
}
|
||||
|
||||
if (!this.world.isRemote)
|
||||
if (!this.level.isClientSide)
|
||||
{
|
||||
this.func_241359_a_((ServerWorld) this.world, true);
|
||||
this.updatePersistentAnger((ServerWorld) this.level, true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public boolean attackEntityFrom(DamageSource source, float amount)
|
||||
public boolean hurt(DamageSource source, float amount)
|
||||
{
|
||||
if (this.isInvulnerableTo(source))
|
||||
{
|
||||
|
@ -94,56 +94,56 @@ public class MZTEWolfEntity extends TameableEntity implements IAngerable
|
|||
}
|
||||
else
|
||||
{
|
||||
Entity entity = source.getTrueSource();
|
||||
this.func_233687_w_(false);
|
||||
Entity entity = source.getEntity();
|
||||
this.setOrderedToSit(false);
|
||||
if (entity != null && !(entity instanceof PlayerEntity) && !(entity instanceof AbstractArrowEntity))
|
||||
{
|
||||
amount = (amount + 1.0F) / 2.0F;
|
||||
}
|
||||
|
||||
return super.attackEntityFrom(source, amount);
|
||||
return super.hurt(source, amount);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isBreedingItem(ItemStack stack)
|
||||
public boolean isFood(ItemStack stack)
|
||||
{
|
||||
Item item = stack.getItem();
|
||||
return item.isFood() && item.getFood().isMeat();
|
||||
return item.isEdible() && item.getFoodProperties().isMeat();
|
||||
}
|
||||
|
||||
public ActionResultType func_230254_b_(PlayerEntity p_230254_1_, Hand p_230254_2_)
|
||||
public ActionResultType mobInteract(PlayerEntity p_230254_1_, Hand p_230254_2_)
|
||||
{
|
||||
ItemStack itemstack = p_230254_1_.getHeldItem(p_230254_2_);
|
||||
ItemStack itemstack = p_230254_1_.getItemInHand(p_230254_2_);
|
||||
Item item = itemstack.getItem();
|
||||
if (this.world.isRemote)
|
||||
if (this.level.isClientSide)
|
||||
{
|
||||
boolean flag = this.isOwner(p_230254_1_) || this.isTamed() || item == Items.BONE && !this.isTamed() && !this.func_233678_J__();
|
||||
boolean flag = this.isOwnedBy(p_230254_1_) || this.isTame() || item == Items.BONE && !this.isTame() && !this.isAngry();
|
||||
return flag ? ActionResultType.CONSUME : ActionResultType.PASS;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.isTamed())
|
||||
if (this.isTame())
|
||||
{
|
||||
if (this.isBreedingItem(itemstack) && this.getHealth() < this.getMaxHealth())
|
||||
if (this.isFood(itemstack) && this.getHealth() < this.getMaxHealth())
|
||||
{
|
||||
if (!p_230254_1_.abilities.isCreativeMode)
|
||||
if (!p_230254_1_.abilities.instabuild)
|
||||
{
|
||||
itemstack.shrink(1);
|
||||
}
|
||||
|
||||
this.heal((float) item.getFood().getHealing());
|
||||
this.heal((float) item.getFoodProperties().getNutrition());
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
|
||||
if (!(item instanceof DyeItem))
|
||||
{
|
||||
ActionResultType actionresulttype = super.func_230254_b_(p_230254_1_, p_230254_2_);
|
||||
if ((!actionresulttype.isSuccessOrConsume() || this.isChild()) && this.isOwner(p_230254_1_))
|
||||
ActionResultType actionresulttype = super.mobInteract(p_230254_1_, p_230254_2_);
|
||||
if ((!actionresulttype.consumesAction() || this.isBaby()) && this.isOwnedBy(p_230254_1_))
|
||||
{
|
||||
this.func_233687_w_(!this.isSitting());
|
||||
this.isJumping = false;
|
||||
this.navigator.clearPath();
|
||||
this.setAttackTarget(null);
|
||||
this.setOrderedToSit(!this.isOrderedToSit());
|
||||
this.jumping = false;
|
||||
this.navigation.stop();
|
||||
this.setTarget(null);
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -154,7 +154,7 @@ public class MZTEWolfEntity extends TameableEntity implements IAngerable
|
|||
if (dyecolor != this.getCollarColor())
|
||||
{
|
||||
this.setCollarColor(dyecolor);
|
||||
if (!p_230254_1_.abilities.isCreativeMode)
|
||||
if (!p_230254_1_.abilities.instabuild)
|
||||
{
|
||||
itemstack.shrink(1);
|
||||
}
|
||||
|
@ -162,40 +162,40 @@ public class MZTEWolfEntity extends TameableEntity implements IAngerable
|
|||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
}
|
||||
else if (item == Items.BONE && !this.func_233678_J__())
|
||||
else if (item == Items.BONE && !this.isAngry())
|
||||
{
|
||||
if (!p_230254_1_.abilities.isCreativeMode)
|
||||
if (!p_230254_1_.abilities.instabuild)
|
||||
{
|
||||
itemstack.shrink(1);
|
||||
}
|
||||
|
||||
if (this.rand.nextInt(3) == 0 && !net.minecraftforge.event.ForgeEventFactory.onAnimalTame(this, p_230254_1_))
|
||||
if (this.random.nextInt(3) == 0 && !net.minecraftforge.event.ForgeEventFactory.onAnimalTame(this, p_230254_1_))
|
||||
{
|
||||
this.setTamedBy(p_230254_1_);
|
||||
this.navigator.clearPath();
|
||||
this.setAttackTarget(null);
|
||||
this.func_233687_w_(true);
|
||||
this.world.setEntityState(this, (byte) 7);
|
||||
this.tame(p_230254_1_);
|
||||
this.navigation.stop();
|
||||
this.setTarget(null);
|
||||
this.setOrderedToSit(true);
|
||||
this.level.broadcastEntityEvent(this, (byte) 7);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.world.setEntityState(this, (byte) 6);
|
||||
this.level.broadcastEntityEvent(this, (byte) 6);
|
||||
}
|
||||
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
|
||||
return super.func_230254_b_(p_230254_1_, p_230254_2_);
|
||||
return super.mobInteract(p_230254_1_, p_230254_2_);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canMateWith(AnimalEntity otherAnimal)
|
||||
public boolean canMate(AnimalEntity otherAnimal)
|
||||
{
|
||||
if (otherAnimal == this)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (!this.isTamed())
|
||||
else if (!this.isTame())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -206,11 +206,11 @@ public class MZTEWolfEntity extends TameableEntity implements IAngerable
|
|||
else
|
||||
{
|
||||
MZTEWolfEntity wolfentity = (MZTEWolfEntity) otherAnimal;
|
||||
if (!wolfentity.isTamed())
|
||||
if (!wolfentity.isTame())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (wolfentity.isEntitySleeping())
|
||||
else if (wolfentity.isInSittingPose())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -258,65 +258,65 @@ public class MZTEWolfEntity extends TameableEntity implements IAngerable
|
|||
@OnlyIn(Dist.CLIENT)
|
||||
public float getTailRotation()
|
||||
{
|
||||
if (this.func_233678_J__())
|
||||
if (this.isAngry())
|
||||
{
|
||||
return 1.5393804F;
|
||||
}
|
||||
else
|
||||
{
|
||||
return this.isTamed() ? (0.55F - (this.getMaxHealth() - this.getHealth()) * 0.02F) * (float) Math.PI : ((float) Math.PI / 5F);
|
||||
return this.isTame() ? (0.55F - (this.getMaxHealth() - this.getHealth()) * 0.02F) * (float) Math.PI : ((float) Math.PI / 5F);
|
||||
}
|
||||
}
|
||||
|
||||
public int getAngerTime()
|
||||
public int getRemainingPersistentAngerTime()
|
||||
{
|
||||
return this.dataManager.get(field_234232_bz_);
|
||||
return this.entityData.get(DATA_REMAINING_ANGER_TIME);
|
||||
}
|
||||
|
||||
public void setAngerTime(int time)
|
||||
public void setRemainingPersistentAngerTime(int time)
|
||||
{
|
||||
this.dataManager.set(field_234232_bz_, time);
|
||||
this.entityData.set(DATA_REMAINING_ANGER_TIME, time);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public UUID getAngerTarget()
|
||||
public UUID getPersistentAngerTarget()
|
||||
{
|
||||
return this.field_234231_bH_;
|
||||
return this.persistentAngerTarget;
|
||||
}
|
||||
|
||||
public void setAngerTarget(@Nullable UUID target)
|
||||
public void setPersistentAngerTarget(@Nullable UUID target)
|
||||
{
|
||||
this.field_234231_bH_ = target;
|
||||
this.persistentAngerTarget = target;
|
||||
}
|
||||
|
||||
public void func_230258_H__()
|
||||
public void startPersistentAngerTimer()
|
||||
{
|
||||
this.setAngerTime(field_234230_bG_.getRandomWithinRange(this.rand));
|
||||
this.setRemainingPersistentAngerTime(PERSISTENT_ANGER_TIME.randomValue(this.random));
|
||||
}
|
||||
|
||||
public DyeColor getCollarColor()
|
||||
{
|
||||
return DyeColor.byId(this.dataManager.get(COLLAR_COLOR));
|
||||
return DyeColor.byId(this.entityData.get(COLLAR_COLOR));
|
||||
}
|
||||
|
||||
public void setCollarColor(DyeColor collarcolor)
|
||||
{
|
||||
this.dataManager.set(COLLAR_COLOR, collarcolor.getId());
|
||||
this.entityData.set(COLLAR_COLOR, collarcolor.getId());
|
||||
}
|
||||
|
||||
public MZTEWolfEntity func_241840_a(ServerWorld p_241840_1_, AgeableEntity p_241840_2_)
|
||||
public MZTEWolfEntity getBreedOffspring(ServerWorld p_241840_1_, AgeableEntity p_241840_2_)
|
||||
{
|
||||
return SpackenmobsRegistry.MZTEWOLF.get().create(p_241840_1_);
|
||||
}
|
||||
|
||||
public boolean isBegging()
|
||||
{
|
||||
return this.dataManager.get(BEGGING);
|
||||
return this.entityData.get(BEGGING);
|
||||
}
|
||||
|
||||
public void setBegging(boolean beg)
|
||||
{
|
||||
this.dataManager.set(BEGGING, beg);
|
||||
this.entityData.set(BEGGING, beg);
|
||||
}
|
||||
|
||||
protected void registerGoals()
|
||||
|
@ -334,10 +334,10 @@ public class MZTEWolfEntity extends TameableEntity implements IAngerable
|
|||
this.goalSelector.addGoal(10, new LookRandomlyGoal(this));
|
||||
this.targetSelector.addGoal(1, new OwnerHurtByTargetGoal(this));
|
||||
this.targetSelector.addGoal(2, new OwnerHurtTargetGoal(this));
|
||||
this.targetSelector.addGoal(3, (new HurtByTargetGoal(this)).setCallsForHelp());
|
||||
this.targetSelector.addGoal(4, new NearestAttackableTargetGoal<>(this, PlayerEntity.class, 10, true, false, this::func_233680_b_));
|
||||
this.targetSelector.addGoal(3, (new HurtByTargetGoal(this)).setAlertOthers());
|
||||
this.targetSelector.addGoal(4, new NearestAttackableTargetGoal<>(this, PlayerEntity.class, 10, true, false, this::isAngryAt));
|
||||
this.targetSelector.addGoal(5, new NonTamedTargetGoal<>(this, AnimalEntity.class, false, TARGET_ENTITIES));
|
||||
this.targetSelector.addGoal(6, new NonTamedTargetGoal<>(this, TurtleEntity.class, false, TurtleEntity.TARGET_DRY_BABY));
|
||||
this.targetSelector.addGoal(6, new NonTamedTargetGoal<>(this, TurtleEntity.class, false, TurtleEntity.BABY_ON_LAND_SELECTOR));
|
||||
this.targetSelector.addGoal(7, new NearestAttackableTargetGoal<>(this, AbstractSkeletonEntity.class, false));
|
||||
this.targetSelector.addGoal(8, new ResetAngerGoal<>(this, true));
|
||||
}
|
||||
|
@ -357,20 +357,20 @@ public class MZTEWolfEntity extends TameableEntity implements IAngerable
|
|||
this.headRotationCourse += (0.0F - this.headRotationCourse) * 0.4F;
|
||||
}
|
||||
|
||||
if (this.isInWaterRainOrBubbleColumn())
|
||||
if (this.isInWaterRainOrBubble())
|
||||
{
|
||||
this.isWet = true;
|
||||
if (this.isShaking && !this.world.isRemote)
|
||||
if (this.isShaking && !this.level.isClientSide)
|
||||
{
|
||||
this.world.setEntityState(this, (byte) 56);
|
||||
this.func_242326_eZ();
|
||||
this.level.broadcastEntityEvent(this, (byte) 56);
|
||||
this.cancelShake();
|
||||
}
|
||||
}
|
||||
else if ((this.isWet || this.isShaking) && this.isShaking)
|
||||
{
|
||||
if (this.timeWolfIsShaking == 0.0F)
|
||||
{
|
||||
this.playSound(SoundEvents.ENTITY_WOLF_SHAKE, this.getSoundVolume(), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
|
||||
this.playSound(SoundEvents.WOLF_SHAKE, this.getSoundVolume(), (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
|
||||
}
|
||||
|
||||
this.prevTimeWolfIsShaking = this.timeWolfIsShaking;
|
||||
|
@ -385,15 +385,15 @@ public class MZTEWolfEntity extends TameableEntity implements IAngerable
|
|||
|
||||
if (this.timeWolfIsShaking > 0.4F)
|
||||
{
|
||||
float f = (float) this.getPosY();
|
||||
float f = (float) this.getY();
|
||||
int i = (int) (MathHelper.sin((this.timeWolfIsShaking - 0.4F) * (float) Math.PI) * 7.0F);
|
||||
Vector3d vector3d = this.getMotion();
|
||||
Vector3d vector3d = this.getDeltaMovement();
|
||||
|
||||
for (int j = 0; j < i; ++j)
|
||||
{
|
||||
float f1 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.getWidth() * 0.5F;
|
||||
float f2 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.getWidth() * 0.5F;
|
||||
this.world.addParticle(ParticleTypes.SPLASH, this.getPosX() + (double) f1, f + 0.8F, this.getPosZ() + (double) f2, vector3d.x, vector3d.y, vector3d.z);
|
||||
float f1 = (this.random.nextFloat() * 2.0F - 1.0F) * this.getBbWidth() * 0.5F;
|
||||
float f2 = (this.random.nextFloat() * 2.0F - 1.0F) * this.getBbWidth() * 0.5F;
|
||||
this.level.addParticle(ParticleTypes.SPLASH, this.getX() + (double) f1, f + 0.8F, this.getZ() + (double) f2, vector3d.x, vector3d.y, vector3d.z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -403,13 +403,13 @@ public class MZTEWolfEntity extends TameableEntity implements IAngerable
|
|||
|
||||
protected SoundEvent getAmbientSound()
|
||||
{
|
||||
if (this.func_233678_J__())
|
||||
if (this.isAngry())
|
||||
{
|
||||
return SoundEvents.ENTITY_WOLF_GROWL;
|
||||
return SoundEvents.WOLF_GROWL;
|
||||
}
|
||||
else if (this.rand.nextInt(3) == 0)
|
||||
else if (this.random.nextInt(3) == 0)
|
||||
{
|
||||
return this.isTamed() && this.getHealth() < 10.0F ? SoundEvents.ENTITY_WOLF_WHINE : SoundEvents.ENTITY_WOLF_PANT;
|
||||
return this.isTame() && this.getHealth() < 10.0F ? SoundEvents.WOLF_WHINE : SoundEvents.WOLF_PANT;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -417,60 +417,60 @@ public class MZTEWolfEntity extends TameableEntity implements IAngerable
|
|||
}
|
||||
}
|
||||
|
||||
public int getVerticalFaceSpeed()
|
||||
public int getMaxHeadXRot()
|
||||
{
|
||||
return this.isEntitySleeping() ? 20 : super.getVerticalFaceSpeed();
|
||||
return this.isInSittingPose() ? 20 : super.getMaxHeadXRot();
|
||||
}
|
||||
|
||||
public int getMaxSpawnedInChunk()
|
||||
public int getMaxSpawnClusterSize()
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
|
||||
public boolean attackEntityAsMob(Entity entityIn)
|
||||
public boolean doHurtTarget(Entity entityIn)
|
||||
{
|
||||
boolean flag = entityIn.attackEntityFrom(DamageSource.causeMobDamage(this), (float) ((int) this.getAttributeValue(Attributes.ATTACK_DAMAGE)));
|
||||
boolean flag = entityIn.hurt(DamageSource.mobAttack(this), (float) ((int) this.getAttributeValue(Attributes.ATTACK_DAMAGE)));
|
||||
if (flag)
|
||||
{
|
||||
this.applyEnchantments(this, entityIn);
|
||||
this.doEnchantDamageEffects(this, entityIn);
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
protected void registerData()
|
||||
protected void defineSynchedData()
|
||||
{
|
||||
super.registerData();
|
||||
this.dataManager.register(BEGGING, false);
|
||||
this.dataManager.register(COLLAR_COLOR, DyeColor.RED.getId());
|
||||
this.dataManager.register(field_234232_bz_, 0);
|
||||
super.defineSynchedData();
|
||||
this.entityData.define(BEGGING, false);
|
||||
this.entityData.define(COLLAR_COLOR, DyeColor.RED.getId());
|
||||
this.entityData.define(DATA_REMAINING_ANGER_TIME, 0);
|
||||
}
|
||||
|
||||
public void writeAdditional(CompoundNBT compound)
|
||||
public void addAdditionalSaveData(CompoundNBT compound)
|
||||
{
|
||||
super.writeAdditional(compound);
|
||||
super.addAdditionalSaveData(compound);
|
||||
compound.putByte("CollarColor", (byte) this.getCollarColor().getId());
|
||||
this.writeAngerNBT(compound);
|
||||
this.addPersistentAngerSaveData(compound);
|
||||
}
|
||||
|
||||
public void readAdditional(CompoundNBT compound)
|
||||
public void readAdditionalSaveData(CompoundNBT compound)
|
||||
{
|
||||
super.readAdditional(compound);
|
||||
super.readAdditionalSaveData(compound);
|
||||
if (compound.contains("CollarColor", 99))
|
||||
{
|
||||
this.setCollarColor(DyeColor.byId(compound.getInt("CollarColor")));
|
||||
}
|
||||
|
||||
this.readAngerNBT((ServerWorld) this.world, compound);
|
||||
this.readPersistentAngerSaveData((ServerWorld) this.level, compound);
|
||||
}
|
||||
|
||||
public boolean canBeLeashedTo(PlayerEntity player)
|
||||
public boolean canBeLeashed(PlayerEntity player)
|
||||
{
|
||||
return !this.func_233678_J__() && super.canBeLeashedTo(player);
|
||||
return !this.isAngry() && super.canBeLeashed(player);
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void handleStatusUpdate(byte id)
|
||||
public void handleEntityEvent(byte id)
|
||||
{
|
||||
if (id == 8)
|
||||
{
|
||||
|
@ -480,18 +480,18 @@ public class MZTEWolfEntity extends TameableEntity implements IAngerable
|
|||
}
|
||||
else if (id == 56)
|
||||
{
|
||||
this.func_242326_eZ();
|
||||
this.cancelShake();
|
||||
}
|
||||
else
|
||||
{
|
||||
super.handleStatusUpdate(id);
|
||||
super.handleEntityEvent(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void setTamed(boolean tamed)
|
||||
public void setTame(boolean tamed)
|
||||
{
|
||||
super.setTamed(tamed);
|
||||
super.setTame(tamed);
|
||||
if (tamed)
|
||||
{
|
||||
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(20.0D);
|
||||
|
@ -505,26 +505,26 @@ public class MZTEWolfEntity extends TameableEntity implements IAngerable
|
|||
this.getAttribute(Attributes.ATTACK_DAMAGE).setBaseValue(4.0D);
|
||||
}
|
||||
|
||||
public boolean shouldAttackEntity(LivingEntity target, LivingEntity owner)
|
||||
public boolean wantsToAttack(LivingEntity target, LivingEntity owner)
|
||||
{
|
||||
if (!(target instanceof CreeperEntity) && !(target instanceof GhastEntity))
|
||||
{
|
||||
if (target instanceof MZTEWolfEntity)
|
||||
{
|
||||
MZTEWolfEntity wolfentity = (MZTEWolfEntity) target;
|
||||
return !wolfentity.isTamed() || wolfentity.getOwner() != owner;
|
||||
return !wolfentity.isTame() || wolfentity.getOwner() != owner;
|
||||
}
|
||||
else if (target instanceof PlayerEntity && owner instanceof PlayerEntity && !((PlayerEntity) owner).canAttackPlayer((PlayerEntity) target))
|
||||
else if (target instanceof PlayerEntity && owner instanceof PlayerEntity && !((PlayerEntity) owner).canHarmPlayer((PlayerEntity) target))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (target instanceof AbstractHorseEntity && ((AbstractHorseEntity) target).isTame())
|
||||
else if (target instanceof AbstractHorseEntity && ((AbstractHorseEntity) target).isTamed())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return !(target instanceof TameableEntity) || !((TameableEntity) target).isTamed();
|
||||
return !(target instanceof TameableEntity) || !((TameableEntity) target).isTame();
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -533,34 +533,34 @@ public class MZTEWolfEntity extends TameableEntity implements IAngerable
|
|||
}
|
||||
}
|
||||
|
||||
public void onDeath(DamageSource cause)
|
||||
public void die(DamageSource cause)
|
||||
{
|
||||
this.isWet = false;
|
||||
this.isShaking = false;
|
||||
this.prevTimeWolfIsShaking = 0.0F;
|
||||
this.timeWolfIsShaking = 0.0F;
|
||||
super.onDeath(cause);
|
||||
super.die(cause);
|
||||
}
|
||||
|
||||
protected void playStepSound(BlockPos pos, BlockState blockIn)
|
||||
{
|
||||
this.playSound(SoundEvents.ENTITY_WOLF_STEP, 0.15F, 1.0F);
|
||||
this.playSound(SoundEvents.WOLF_STEP, 0.15F, 1.0F);
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public Vector3d func_241205_ce_()
|
||||
public Vector3d getLeashOffset()
|
||||
{
|
||||
return new Vector3d(0.0D, 0.6F * this.getEyeHeight(), this.getWidth() * 0.4F);
|
||||
return new Vector3d(0.0D, 0.6F * this.getEyeHeight(), this.getBbWidth() * 0.4F);
|
||||
}
|
||||
|
||||
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
|
||||
{
|
||||
return SoundEvents.ENTITY_WOLF_HURT;
|
||||
return SoundEvents.WOLF_HURT;
|
||||
}
|
||||
|
||||
protected SoundEvent getDeathSound()
|
||||
{
|
||||
return SoundEvents.ENTITY_WOLF_DEATH;
|
||||
return SoundEvents.WOLF_DEATH;
|
||||
}
|
||||
|
||||
protected float getSoundVolume()
|
||||
|
@ -573,7 +573,7 @@ public class MZTEWolfEntity extends TameableEntity implements IAngerable
|
|||
return sizeIn.height * 0.8F;
|
||||
}
|
||||
|
||||
private void func_242326_eZ()
|
||||
private void cancelShake()
|
||||
{
|
||||
this.isShaking = false;
|
||||
this.timeWolfIsShaking = 0.0F;
|
||||
|
@ -590,11 +590,11 @@ public class MZTEWolfEntity extends TameableEntity implements IAngerable
|
|||
this.wolf = wolfIn;
|
||||
}
|
||||
|
||||
public boolean shouldExecute()
|
||||
public boolean canUse()
|
||||
{
|
||||
if (super.shouldExecute() && this.avoidTarget instanceof LlamaEntity)
|
||||
if (super.canUse() && this.toAvoid instanceof LlamaEntity)
|
||||
{
|
||||
return !this.wolf.isTamed() && this.avoidLlama((LlamaEntity) this.avoidTarget);
|
||||
return !this.wolf.isTame() && this.avoidLlama((LlamaEntity) this.toAvoid);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -602,21 +602,21 @@ public class MZTEWolfEntity extends TameableEntity implements IAngerable
|
|||
}
|
||||
}
|
||||
|
||||
public void startExecuting()
|
||||
public void start()
|
||||
{
|
||||
MZTEWolfEntity.this.setAttackTarget(null);
|
||||
super.startExecuting();
|
||||
MZTEWolfEntity.this.setTarget(null);
|
||||
super.start();
|
||||
}
|
||||
|
||||
public void tick()
|
||||
{
|
||||
MZTEWolfEntity.this.setAttackTarget(null);
|
||||
MZTEWolfEntity.this.setTarget(null);
|
||||
super.tick();
|
||||
}
|
||||
|
||||
private boolean avoidLlama(LlamaEntity llamaIn)
|
||||
{
|
||||
return llamaIn.getStrength() >= MZTEWolfEntity.this.rand.nextInt(5);
|
||||
return llamaIn.getStrength() >= MZTEWolfEntity.this.random.nextInt(5);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -15,7 +15,7 @@ public class MarcellDAvisEntity extends ZombieEntity
|
|||
{
|
||||
public static AttributeModifierMap.MutableAttribute registerAttributes()
|
||||
{
|
||||
return MonsterEntity.func_234295_eP_().createMutableAttribute(Attributes.FOLLOW_RANGE, 35.0D).createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.23F).createMutableAttribute(Attributes.ATTACK_DAMAGE, 3.0D).createMutableAttribute(Attributes.ARMOR, 2.0D).createMutableAttribute(Attributes.ZOMBIE_SPAWN_REINFORCEMENTS);
|
||||
return MonsterEntity.createMonsterAttributes().add(Attributes.FOLLOW_RANGE, 35.0D).add(Attributes.MOVEMENT_SPEED, 0.23F).add(Attributes.ATTACK_DAMAGE, 3.0D).add(Attributes.ARMOR, 2.0D).add(Attributes.SPAWN_REINFORCEMENTS_CHANCE);
|
||||
}
|
||||
|
||||
public MarcellDAvisEntity(EntityType<? extends MarcellDAvisEntity> type, World worldIn)
|
||||
|
|
|
@ -15,7 +15,7 @@ public class MrBeanEntity extends ZombieEntity
|
|||
{
|
||||
public static AttributeModifierMap.MutableAttribute registerAttributes()
|
||||
{
|
||||
return MonsterEntity.func_234295_eP_().createMutableAttribute(Attributes.FOLLOW_RANGE, 35.0D).createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.23F).createMutableAttribute(Attributes.ATTACK_DAMAGE, 3.0D).createMutableAttribute(Attributes.ARMOR, 2.0D).createMutableAttribute(Attributes.ZOMBIE_SPAWN_REINFORCEMENTS);
|
||||
return MonsterEntity.createMonsterAttributes().add(Attributes.FOLLOW_RANGE, 35.0D).add(Attributes.MOVEMENT_SPEED, 0.23F).add(Attributes.ATTACK_DAMAGE, 3.0D).add(Attributes.ARMOR, 2.0D).add(Attributes.SPAWN_REINFORCEMENTS_CHANCE);
|
||||
}
|
||||
|
||||
public MrBeanEntity(EntityType<? extends MrBeanEntity> type, World worldIn)
|
||||
|
|
|
@ -18,7 +18,6 @@ import net.minecraft.entity.passive.GolemEntity;
|
|||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.projectile.AbstractArrowEntity;
|
||||
import net.minecraft.entity.projectile.ShulkerBulletEntity;
|
||||
import net.minecraft.item.DyeColor;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.network.datasync.DataParameter;
|
||||
import net.minecraft.network.datasync.DataSerializers;
|
||||
|
@ -37,16 +36,16 @@ import mod.acgaming.spackenmobs.init.SpackenmobsRegistry;
|
|||
|
||||
public class SchalkerEntity extends GolemEntity implements IMob
|
||||
{
|
||||
protected static final DataParameter<Direction> ATTACHED_FACE = EntityDataManager.createKey(SchalkerEntity.class, DataSerializers.DIRECTION);
|
||||
protected static final DataParameter<Optional<BlockPos>> ATTACHED_BLOCK_POS = EntityDataManager.createKey(SchalkerEntity.class, DataSerializers.OPTIONAL_BLOCK_POS);
|
||||
protected static final DataParameter<Byte> PEEK_TICK = EntityDataManager.createKey(SchalkerEntity.class, DataSerializers.BYTE);
|
||||
protected static final DataParameter<Byte> COLOR = EntityDataManager.createKey(SchalkerEntity.class, DataSerializers.BYTE);
|
||||
protected static final DataParameter<Direction> ATTACHED_FACE = EntityDataManager.defineId(SchalkerEntity.class, DataSerializers.DIRECTION);
|
||||
protected static final DataParameter<Optional<BlockPos>> ATTACHED_BLOCK_POS = EntityDataManager.defineId(SchalkerEntity.class, DataSerializers.OPTIONAL_BLOCK_POS);
|
||||
protected static final DataParameter<Byte> PEEK_TICK = EntityDataManager.defineId(SchalkerEntity.class, DataSerializers.BYTE);
|
||||
protected static final DataParameter<Byte> COLOR = EntityDataManager.defineId(SchalkerEntity.class, DataSerializers.BYTE);
|
||||
private static final UUID COVERED_ARMOR_BONUS_ID = UUID.fromString("7E0292F2-9434-48D5-A29F-9583AF7DF27F");
|
||||
private static final AttributeModifier COVERED_ARMOR_BONUS_MODIFIER = new AttributeModifier(COVERED_ARMOR_BONUS_ID, "Covered armor bonus", 20.0D, AttributeModifier.Operation.ADDITION);
|
||||
|
||||
public static AttributeModifierMap.MutableAttribute registerAttributes()
|
||||
{
|
||||
return MobEntity.func_233666_p_().createMutableAttribute(Attributes.MAX_HEALTH, 30.0D);
|
||||
return MobEntity.createMobAttributes().add(Attributes.MAX_HEALTH, 30.0D);
|
||||
}
|
||||
|
||||
private float prevPeekAmount;
|
||||
|
@ -57,23 +56,23 @@ public class SchalkerEntity extends GolemEntity implements IMob
|
|||
public SchalkerEntity(EntityType<? extends SchalkerEntity> p_i50196_1_, World p_i50196_2_)
|
||||
{
|
||||
super(p_i50196_1_, p_i50196_2_);
|
||||
this.experienceValue = 5;
|
||||
this.xpReward = 5;
|
||||
}
|
||||
|
||||
public void setPosition(double x, double y, double z)
|
||||
public void setPos(double x, double y, double z)
|
||||
{
|
||||
super.setPosition(x, y, z);
|
||||
if (this.dataManager != null && this.ticksExisted != 0)
|
||||
super.setPos(x, y, z);
|
||||
if (this.entityData != null && this.tickCount != 0)
|
||||
{
|
||||
Optional<BlockPos> optional = this.dataManager.get(ATTACHED_BLOCK_POS);
|
||||
if (this.isAddedToWorld() && this.world instanceof net.minecraft.world.server.ServerWorld)
|
||||
((net.minecraft.world.server.ServerWorld) this.world).chunkCheck(this); // Forge - Process chunk registration after moving.
|
||||
Optional<BlockPos> optional = this.entityData.get(ATTACHED_BLOCK_POS);
|
||||
if (this.isAddedToWorld() && this.level instanceof net.minecraft.world.server.ServerWorld)
|
||||
((net.minecraft.world.server.ServerWorld) this.level).updateChunkPos(this); // Forge - Process chunk registration after moving.
|
||||
Optional<BlockPos> optional1 = Optional.of(new BlockPos(x, y, z));
|
||||
if (!optional1.equals(optional))
|
||||
{
|
||||
this.dataManager.set(ATTACHED_BLOCK_POS, optional1);
|
||||
this.dataManager.set(PEEK_TICK, (byte) 0);
|
||||
this.isAirBorne = true;
|
||||
this.entityData.set(ATTACHED_BLOCK_POS, optional1);
|
||||
this.entityData.set(PEEK_TICK, (byte) 0);
|
||||
this.hasImpulse = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -92,40 +91,35 @@ public class SchalkerEntity extends GolemEntity implements IMob
|
|||
|
||||
}
|
||||
|
||||
protected boolean canTriggerWalking()
|
||||
protected boolean isMovementNoisy()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean func_241845_aY()
|
||||
{
|
||||
return this.isAlive();
|
||||
}
|
||||
|
||||
public float getCollisionBorderSize()
|
||||
public float getPickRadius()
|
||||
{
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
public SoundCategory getSoundCategory()
|
||||
public SoundCategory getSoundSource()
|
||||
{
|
||||
return SoundCategory.HOSTILE;
|
||||
}
|
||||
|
||||
public boolean attackEntityFrom(DamageSource source, float amount)
|
||||
public boolean hurt(DamageSource source, float amount)
|
||||
{
|
||||
if (this.isClosed())
|
||||
{
|
||||
Entity entity = source.getImmediateSource();
|
||||
Entity entity = source.getDirectEntity();
|
||||
if (entity instanceof AbstractArrowEntity)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (super.attackEntityFrom(source, amount))
|
||||
if (super.hurt(source, amount))
|
||||
{
|
||||
if ((double) this.getHealth() < (double) this.getMaxHealth() * 0.5D && this.rand.nextInt(4) == 0)
|
||||
if ((double) this.getHealth() < (double) this.getMaxHealth() * 0.5D && this.random.nextInt(4) == 0)
|
||||
{
|
||||
this.tryTeleportToNewPosition();
|
||||
}
|
||||
|
@ -143,19 +137,24 @@ public class SchalkerEntity extends GolemEntity implements IMob
|
|||
return 0.6F;
|
||||
}
|
||||
|
||||
public void applyEntityCollision(Entity entityIn)
|
||||
public void push(Entity entityIn)
|
||||
{
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void setPositionAndRotationDirect(double x, double y, double z, float yaw, float pitch, int posRotationIncrements, boolean teleport)
|
||||
public void lerpTo(double x, double y, double z, float yaw, float pitch, int posRotationIncrements, boolean teleport)
|
||||
{
|
||||
this.newPosRotationIncrements = 0;
|
||||
this.lerpSteps = 0;
|
||||
}
|
||||
|
||||
public void notifyDataManagerChange(DataParameter<?> key)
|
||||
public boolean isPickable()
|
||||
{
|
||||
if (ATTACHED_BLOCK_POS.equals(key) && this.world.isRemote && !this.isPassenger())
|
||||
return this.isAlive();
|
||||
}
|
||||
|
||||
public void onSyncedDataUpdated(DataParameter<?> key)
|
||||
{
|
||||
if (ATTACHED_BLOCK_POS.equals(key) && this.level.isClientSide && !this.isPassenger())
|
||||
{
|
||||
BlockPos blockpos = this.getAttachmentPos();
|
||||
if (blockpos != null)
|
||||
|
@ -169,11 +168,11 @@ public class SchalkerEntity extends GolemEntity implements IMob
|
|||
this.clientSideTeleportInterpolation = 6;
|
||||
}
|
||||
|
||||
this.forceSetPosition((double) blockpos.getX() + 0.5D, blockpos.getY(), (double) blockpos.getZ() + 0.5D);
|
||||
this.setPosAndOldPos((double) blockpos.getX() + 0.5D, blockpos.getY(), (double) blockpos.getZ() + 0.5D);
|
||||
}
|
||||
}
|
||||
|
||||
super.notifyDataManagerChange(key);
|
||||
super.onSyncedDataUpdated(key);
|
||||
}
|
||||
|
||||
protected float getStandingEyeHeight(Pose poseIn, EntitySize sizeIn)
|
||||
|
@ -183,34 +182,34 @@ public class SchalkerEntity extends GolemEntity implements IMob
|
|||
|
||||
public Direction getAttachmentFacing()
|
||||
{
|
||||
return this.dataManager.get(ATTACHED_FACE);
|
||||
return this.entityData.get(ATTACHED_FACE);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public BlockPos getAttachmentPos()
|
||||
{
|
||||
return this.dataManager.get(ATTACHED_BLOCK_POS).orElse(null);
|
||||
return this.entityData.get(ATTACHED_BLOCK_POS).orElse(null);
|
||||
}
|
||||
|
||||
public void setAttachmentPos(@Nullable BlockPos pos)
|
||||
{
|
||||
this.dataManager.set(ATTACHED_BLOCK_POS, Optional.ofNullable(pos));
|
||||
this.entityData.set(ATTACHED_BLOCK_POS, Optional.ofNullable(pos));
|
||||
}
|
||||
|
||||
public int getPeekTick()
|
||||
{
|
||||
return this.dataManager.get(PEEK_TICK);
|
||||
return this.entityData.get(PEEK_TICK);
|
||||
}
|
||||
|
||||
public void updateArmorModifier(int p_184691_1_)
|
||||
{
|
||||
if (!this.world.isRemote)
|
||||
if (!this.level.isClientSide)
|
||||
{
|
||||
Objects.requireNonNull(this.getAttribute(Attributes.ARMOR)).removeModifier(COVERED_ARMOR_BONUS_MODIFIER);
|
||||
if (p_184691_1_ == 0)
|
||||
{
|
||||
Objects.requireNonNull(this.getAttribute(Attributes.ARMOR)).applyPersistentModifier(COVERED_ARMOR_BONUS_MODIFIER);
|
||||
this.playSound(SoundEvents.ENTITY_SHULKER_CLOSE, 1.0F, 1.0F);
|
||||
Objects.requireNonNull(this.getAttribute(Attributes.ARMOR)).addPermanentModifier(COVERED_ARMOR_BONUS_MODIFIER);
|
||||
this.playSound(SoundEvents.SHULKER_CLOSE, 1.0F, 1.0F);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -218,7 +217,7 @@ public class SchalkerEntity extends GolemEntity implements IMob
|
|||
}
|
||||
}
|
||||
|
||||
this.dataManager.set(PEEK_TICK, (byte) p_184691_1_);
|
||||
this.entityData.set(PEEK_TICK, (byte) p_184691_1_);
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
|
@ -245,37 +244,29 @@ public class SchalkerEntity extends GolemEntity implements IMob
|
|||
return this.currentAttachmentPosition != null && this.getAttachmentPos() != null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public DyeColor getColor()
|
||||
{
|
||||
byte obyte = this.dataManager.get(COLOR);
|
||||
return obyte <= 15 ? DyeColor.byId(obyte) : null;
|
||||
}
|
||||
|
||||
protected void registerGoals()
|
||||
{
|
||||
this.goalSelector.addGoal(1, new LookAtGoal(this, PlayerEntity.class, 8.0F));
|
||||
this.goalSelector.addGoal(4, new SchalkerEntity.AttackGoal());
|
||||
this.goalSelector.addGoal(7, new SchalkerEntity.PeekGoal());
|
||||
this.goalSelector.addGoal(8, new LookRandomlyGoal(this));
|
||||
this.targetSelector.addGoal(1, (new HurtByTargetGoal(this)).setCallsForHelp());
|
||||
this.targetSelector.addGoal(1, (new HurtByTargetGoal(this)).setAlertOthers());
|
||||
this.targetSelector.addGoal(2, new SchalkerEntity.AttackNearestGoal(this));
|
||||
this.targetSelector.addGoal(3, new SchalkerEntity.DefenseAttackGoal(this));
|
||||
}
|
||||
|
||||
protected BodyController createBodyController()
|
||||
protected BodyController createBodyControl()
|
||||
{
|
||||
return new BodyHelperController(this);
|
||||
}
|
||||
|
||||
protected void registerData()
|
||||
protected void defineSynchedData()
|
||||
{
|
||||
super.registerData();
|
||||
this.dataManager.register(ATTACHED_FACE, Direction.DOWN);
|
||||
this.dataManager.register(ATTACHED_BLOCK_POS, Optional.empty());
|
||||
this.dataManager.register(PEEK_TICK, (byte) 0);
|
||||
this.dataManager.register(COLOR, (byte) 16);
|
||||
super.defineSynchedData();
|
||||
this.entityData.define(ATTACHED_FACE, Direction.DOWN);
|
||||
this.entityData.define(ATTACHED_BLOCK_POS, Optional.empty());
|
||||
this.entityData.define(PEEK_TICK, (byte) 0);
|
||||
this.entityData.define(COLOR, (byte) 16);
|
||||
}
|
||||
|
||||
public void playAmbientSound()
|
||||
|
@ -289,48 +280,48 @@ public class SchalkerEntity extends GolemEntity implements IMob
|
|||
public void tick()
|
||||
{
|
||||
super.tick();
|
||||
BlockPos blockpos = this.dataManager.get(ATTACHED_BLOCK_POS).orElse(null);
|
||||
if (blockpos == null && !this.world.isRemote)
|
||||
BlockPos blockpos = this.entityData.get(ATTACHED_BLOCK_POS).orElse(null);
|
||||
if (blockpos == null && !this.level.isClientSide)
|
||||
{
|
||||
blockpos = this.getPosition();
|
||||
this.dataManager.set(ATTACHED_BLOCK_POS, Optional.of(blockpos));
|
||||
blockpos = this.blockPosition();
|
||||
this.entityData.set(ATTACHED_BLOCK_POS, Optional.of(blockpos));
|
||||
}
|
||||
|
||||
if (this.isPassenger())
|
||||
{
|
||||
blockpos = null;
|
||||
float f = Objects.requireNonNull(this.getRidingEntity()).rotationYaw;
|
||||
this.rotationYaw = f;
|
||||
this.renderYawOffset = f;
|
||||
this.prevRenderYawOffset = f;
|
||||
float f = Objects.requireNonNull(this.getVehicle()).yRot;
|
||||
this.yRot = f;
|
||||
this.yBodyRot = f;
|
||||
this.yBodyRotO = f;
|
||||
this.clientSideTeleportInterpolation = 0;
|
||||
}
|
||||
else if (!this.world.isRemote)
|
||||
else if (!this.level.isClientSide)
|
||||
{
|
||||
assert blockpos != null;
|
||||
BlockState blockstate = this.world.getBlockState(blockpos);
|
||||
if (!blockstate.isAir(this.world, blockpos))
|
||||
BlockState blockstate = this.level.getBlockState(blockpos);
|
||||
if (!blockstate.isAir(this.level, blockpos))
|
||||
{
|
||||
if (blockstate.isIn(Blocks.MOVING_PISTON))
|
||||
if (blockstate.is(Blocks.MOVING_PISTON))
|
||||
{
|
||||
Direction direction = blockstate.get(PistonBlock.FACING);
|
||||
if (this.world.isAirBlock(blockpos.offset(direction)))
|
||||
Direction direction = blockstate.getValue(PistonBlock.FACING);
|
||||
if (this.level.isEmptyBlock(blockpos.relative(direction)))
|
||||
{
|
||||
blockpos = blockpos.offset(direction);
|
||||
this.dataManager.set(ATTACHED_BLOCK_POS, Optional.of(blockpos));
|
||||
blockpos = blockpos.relative(direction);
|
||||
this.entityData.set(ATTACHED_BLOCK_POS, Optional.of(blockpos));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.tryTeleportToNewPosition();
|
||||
}
|
||||
}
|
||||
else if (blockstate.isIn(Blocks.PISTON_HEAD))
|
||||
else if (blockstate.is(Blocks.PISTON_HEAD))
|
||||
{
|
||||
Direction direction3 = blockstate.get(PistonHeadBlock.FACING);
|
||||
if (this.world.isAirBlock(blockpos.offset(direction3)))
|
||||
Direction direction3 = blockstate.getValue(PistonHeadBlock.FACING);
|
||||
if (this.level.isEmptyBlock(blockpos.relative(direction3)))
|
||||
{
|
||||
blockpos = blockpos.offset(direction3);
|
||||
this.dataManager.set(ATTACHED_BLOCK_POS, Optional.of(blockpos));
|
||||
blockpos = blockpos.relative(direction3);
|
||||
this.entityData.set(ATTACHED_BLOCK_POS, Optional.of(blockpos));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -344,12 +335,12 @@ public class SchalkerEntity extends GolemEntity implements IMob
|
|||
}
|
||||
|
||||
Direction direction4 = this.getAttachmentFacing();
|
||||
if (!this.func_234298_a_(blockpos, direction4))
|
||||
if (!this.canAttachOnBlockFace(blockpos, direction4))
|
||||
{
|
||||
Direction direction1 = this.func_234299_g_(blockpos);
|
||||
Direction direction1 = this.findAttachableFace(blockpos);
|
||||
if (direction1 != null)
|
||||
{
|
||||
this.dataManager.set(ATTACHED_FACE, direction1);
|
||||
this.entityData.set(ATTACHED_FACE, direction1);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -371,7 +362,7 @@ public class SchalkerEntity extends GolemEntity implements IMob
|
|||
|
||||
if (blockpos != null)
|
||||
{
|
||||
if (this.world.isRemote)
|
||||
if (this.level.isClientSide)
|
||||
{
|
||||
if (this.clientSideTeleportInterpolation > 0 && this.currentAttachmentPosition != null)
|
||||
{
|
||||
|
@ -383,24 +374,24 @@ public class SchalkerEntity extends GolemEntity implements IMob
|
|||
}
|
||||
}
|
||||
|
||||
this.forceSetPosition((double) blockpos.getX() + 0.5D, blockpos.getY(), (double) blockpos.getZ() + 0.5D);
|
||||
this.setPosAndOldPos((double) blockpos.getX() + 0.5D, blockpos.getY(), (double) blockpos.getZ() + 0.5D);
|
||||
double d2 = 0.5D - (double) MathHelper.sin((0.5F + this.peekAmount) * (float) Math.PI) * 0.5D;
|
||||
double d0 = 0.5D - (double) MathHelper.sin((0.5F + this.prevPeekAmount) * (float) Math.PI) * 0.5D;
|
||||
if (this.isAddedToWorld() && this.world instanceof net.minecraft.world.server.ServerWorld)
|
||||
((net.minecraft.world.server.ServerWorld) this.world).chunkCheck(this); // Forge - Process chunk registration after moving.
|
||||
if (this.isAddedToWorld() && this.level instanceof net.minecraft.world.server.ServerWorld)
|
||||
((net.minecraft.world.server.ServerWorld) this.level).updateChunkPos(this); // Forge - Process chunk registration after moving.
|
||||
Direction direction2 = this.getAttachmentFacing().getOpposite();
|
||||
this.setBoundingBox((new AxisAlignedBB(this.getPosX() - 0.5D, this.getPosY(), this.getPosZ() - 0.5D, this.getPosX() + 0.5D, this.getPosY() + 1.0D, this.getPosZ() + 0.5D)).expand((double) direction2.getXOffset() * d2, (double) direction2.getYOffset() * d2, (double) direction2.getZOffset() * d2));
|
||||
this.setBoundingBox((new AxisAlignedBB(this.getX() - 0.5D, this.getY(), this.getZ() - 0.5D, this.getX() + 0.5D, this.getY() + 1.0D, this.getZ() + 0.5D)).expandTowards((double) direction2.getStepX() * d2, (double) direction2.getStepY() * d2, (double) direction2.getStepZ() * d2));
|
||||
double d1 = d2 - d0;
|
||||
if (d1 > 0.0D)
|
||||
{
|
||||
List<Entity> list = this.world.getEntitiesWithinAABBExcludingEntity(this, this.getBoundingBox());
|
||||
List<Entity> list = this.level.getEntities(this, this.getBoundingBox());
|
||||
if (!list.isEmpty())
|
||||
{
|
||||
for (Entity entity : list)
|
||||
{
|
||||
if (!(entity instanceof SchalkerEntity) && !entity.noClip)
|
||||
if (!(entity instanceof SchalkerEntity) && !entity.noPhysics)
|
||||
{
|
||||
entity.move(MoverType.SHULKER, new Vector3d(d1 * (double) direction2.getXOffset(), d1 * (double) direction2.getYOffset(), d1 * (double) direction2.getZOffset()));
|
||||
entity.move(MoverType.SHULKER, new Vector3d(d1 * (double) direction2.getStepX(), d1 * (double) direction2.getStepY(), d1 * (double) direction2.getStepZ()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -409,12 +400,12 @@ public class SchalkerEntity extends GolemEntity implements IMob
|
|||
|
||||
}
|
||||
|
||||
public void writeAdditional(CompoundNBT compound)
|
||||
public void addAdditionalSaveData(CompoundNBT compound)
|
||||
{
|
||||
super.writeAdditional(compound);
|
||||
compound.putByte("AttachFace", (byte) this.dataManager.get(ATTACHED_FACE).getIndex());
|
||||
compound.putByte("Peek", this.dataManager.get(PEEK_TICK));
|
||||
compound.putByte("Color", this.dataManager.get(COLOR));
|
||||
super.addAdditionalSaveData(compound);
|
||||
compound.putByte("AttachFace", (byte) this.entityData.get(ATTACHED_FACE).get3DDataValue());
|
||||
compound.putByte("Peek", this.entityData.get(PEEK_TICK));
|
||||
compound.putByte("Color", this.entityData.get(COLOR));
|
||||
BlockPos blockpos = this.getAttachmentPos();
|
||||
if (blockpos != null)
|
||||
{
|
||||
|
@ -425,44 +416,44 @@ public class SchalkerEntity extends GolemEntity implements IMob
|
|||
|
||||
}
|
||||
|
||||
public void readAdditional(CompoundNBT compound)
|
||||
public void readAdditionalSaveData(CompoundNBT compound)
|
||||
{
|
||||
super.readAdditional(compound);
|
||||
this.dataManager.set(ATTACHED_FACE, Direction.byIndex(compound.getByte("AttachFace")));
|
||||
this.dataManager.set(PEEK_TICK, compound.getByte("Peek"));
|
||||
this.dataManager.set(COLOR, compound.getByte("Color"));
|
||||
super.readAdditionalSaveData(compound);
|
||||
this.entityData.set(ATTACHED_FACE, Direction.from3DDataValue(compound.getByte("AttachFace")));
|
||||
this.entityData.set(PEEK_TICK, compound.getByte("Peek"));
|
||||
this.entityData.set(COLOR, compound.getByte("Color"));
|
||||
if (compound.contains("APX"))
|
||||
{
|
||||
int i = compound.getInt("APX");
|
||||
int j = compound.getInt("APY");
|
||||
int k = compound.getInt("APZ");
|
||||
this.dataManager.set(ATTACHED_BLOCK_POS, Optional.of(new BlockPos(i, j, k)));
|
||||
this.entityData.set(ATTACHED_BLOCK_POS, Optional.of(new BlockPos(i, j, k)));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.dataManager.set(ATTACHED_BLOCK_POS, Optional.empty());
|
||||
this.entityData.set(ATTACHED_BLOCK_POS, Optional.empty());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void livingTick()
|
||||
public void aiStep()
|
||||
{
|
||||
super.livingTick();
|
||||
this.setMotion(Vector3d.ZERO);
|
||||
if (!this.isAIDisabled())
|
||||
super.aiStep();
|
||||
this.setDeltaMovement(Vector3d.ZERO);
|
||||
if (!this.isNoAi())
|
||||
{
|
||||
this.prevRenderYawOffset = 0.0F;
|
||||
this.renderYawOffset = 0.0F;
|
||||
this.yBodyRotO = 0.0F;
|
||||
this.yBodyRot = 0.0F;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public int getVerticalFaceSpeed()
|
||||
public int getMaxHeadXRot()
|
||||
{
|
||||
return 180;
|
||||
}
|
||||
|
||||
public int getHorizontalFaceSpeed()
|
||||
public int getMaxHeadYRot()
|
||||
{
|
||||
return 180;
|
||||
}
|
||||
|
@ -474,7 +465,7 @@ public class SchalkerEntity extends GolemEntity implements IMob
|
|||
|
||||
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
|
||||
{
|
||||
return this.isClosed() ? SoundEvents.ENTITY_SHULKER_HURT_CLOSED : SoundEvents.ENTITY_SHULKER_HURT;
|
||||
return this.isClosed() ? SoundEvents.SHULKER_HURT_CLOSED : SoundEvents.SHULKER_HURT;
|
||||
}
|
||||
|
||||
protected SoundEvent getDeathSound()
|
||||
|
@ -483,11 +474,11 @@ public class SchalkerEntity extends GolemEntity implements IMob
|
|||
}
|
||||
|
||||
@Nullable
|
||||
protected Direction func_234299_g_(BlockPos p_234299_1_)
|
||||
protected Direction findAttachableFace(BlockPos p_234299_1_)
|
||||
{
|
||||
for (Direction direction : Direction.values())
|
||||
{
|
||||
if (this.func_234298_a_(p_234299_1_, direction))
|
||||
if (this.canAttachOnBlockFace(p_234299_1_, direction))
|
||||
{
|
||||
return direction;
|
||||
}
|
||||
|
@ -498,16 +489,16 @@ public class SchalkerEntity extends GolemEntity implements IMob
|
|||
|
||||
protected boolean tryTeleportToNewPosition()
|
||||
{
|
||||
if (!this.isAIDisabled() && this.isAlive())
|
||||
if (!this.isNoAi() && this.isAlive())
|
||||
{
|
||||
BlockPos blockpos = this.getPosition();
|
||||
BlockPos blockpos = this.blockPosition();
|
||||
|
||||
for (int i = 0; i < 5; ++i)
|
||||
{
|
||||
BlockPos blockpos1 = blockpos.add(8 - this.rand.nextInt(17), 8 - this.rand.nextInt(17), 8 - this.rand.nextInt(17));
|
||||
if (blockpos1.getY() > 0 && this.world.isAirBlock(blockpos1) && this.world.getWorldBorder().contains(blockpos1) && this.world.hasNoCollisions(this, new AxisAlignedBB(blockpos1)))
|
||||
BlockPos blockpos1 = blockpos.offset(8 - this.random.nextInt(17), 8 - this.random.nextInt(17), 8 - this.random.nextInt(17));
|
||||
if (blockpos1.getY() > 0 && this.level.isEmptyBlock(blockpos1) && this.level.getWorldBorder().isWithinBounds(blockpos1) && this.level.noCollision(this, new AxisAlignedBB(blockpos1)))
|
||||
{
|
||||
Direction direction = this.func_234299_g_(blockpos1);
|
||||
Direction direction = this.findAttachableFace(blockpos1);
|
||||
if (direction != null)
|
||||
{
|
||||
net.minecraftforge.event.entity.living.EnderTeleportEvent event = new net.minecraftforge.event.entity.living.EnderTeleportEvent(this, blockpos1.getX(), blockpos1.getY(), blockpos1.getZ(), 0);
|
||||
|
@ -517,11 +508,11 @@ public class SchalkerEntity extends GolemEntity implements IMob
|
|||
|
||||
if (direction != null)
|
||||
{
|
||||
this.dataManager.set(ATTACHED_FACE, direction);
|
||||
this.playSound(SoundEvents.ENTITY_SHULKER_TELEPORT, 1.0F, 1.0F);
|
||||
this.dataManager.set(ATTACHED_BLOCK_POS, Optional.of(blockpos1));
|
||||
this.dataManager.set(PEEK_TICK, (byte) 0);
|
||||
this.setAttackTarget(null);
|
||||
this.entityData.set(ATTACHED_FACE, direction);
|
||||
this.playSound(SoundEvents.SHULKER_TELEPORT, 1.0F, 1.0F);
|
||||
this.entityData.set(ATTACHED_BLOCK_POS, Optional.of(blockpos1));
|
||||
this.entityData.set(PEEK_TICK, (byte) 0);
|
||||
this.setTarget(null);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -535,9 +526,9 @@ public class SchalkerEntity extends GolemEntity implements IMob
|
|||
}
|
||||
}
|
||||
|
||||
private boolean func_234298_a_(BlockPos p_234298_1_, Direction p_234298_2_)
|
||||
private boolean canAttachOnBlockFace(BlockPos p_234298_1_, Direction p_234298_2_)
|
||||
{
|
||||
return this.world.isDirectionSolid(p_234298_1_.offset(p_234298_2_), this, p_234298_2_.getOpposite()) && this.world.hasNoCollisions(this, ShulkerAABBHelper.getOpenedCollisionBox(p_234298_1_, p_234298_2_.getOpposite()));
|
||||
return this.level.loadedAndEntityCanStandOnFace(p_234298_1_.relative(p_234298_2_), this, p_234298_2_.getOpposite()) && this.level.noCollision(this, ShulkerAABBHelper.openBoundingBox(p_234298_1_, p_234298_2_.getOpposite()));
|
||||
}
|
||||
|
||||
private boolean isClosed()
|
||||
|
@ -553,21 +544,21 @@ public class SchalkerEntity extends GolemEntity implements IMob
|
|||
p_200826_0_ instanceof IMob);
|
||||
}
|
||||
|
||||
public boolean shouldExecute()
|
||||
public boolean canUse()
|
||||
{
|
||||
return this.goalOwner.getTeam() != null && super.shouldExecute();
|
||||
return this.mob.getTeam() != null && super.canUse();
|
||||
}
|
||||
|
||||
protected AxisAlignedBB getTargetableArea(double targetDistance)
|
||||
protected AxisAlignedBB getTargetSearchArea(double targetDistance)
|
||||
{
|
||||
Direction direction = ((SchalkerEntity) this.goalOwner).getAttachmentFacing();
|
||||
Direction direction = ((SchalkerEntity) this.mob).getAttachmentFacing();
|
||||
if (direction.getAxis() == Direction.Axis.X)
|
||||
{
|
||||
return this.goalOwner.getBoundingBox().grow(4.0D, targetDistance, targetDistance);
|
||||
return this.mob.getBoundingBox().inflate(4.0D, targetDistance, targetDistance);
|
||||
}
|
||||
else
|
||||
{
|
||||
return direction.getAxis() == Direction.Axis.Z ? this.goalOwner.getBoundingBox().grow(targetDistance, targetDistance, 4.0D) : this.goalOwner.getBoundingBox().grow(targetDistance, 4.0D, targetDistance);
|
||||
return direction.getAxis() == Direction.Axis.Z ? this.mob.getBoundingBox().inflate(targetDistance, targetDistance, 4.0D) : this.mob.getBoundingBox().inflate(targetDistance, 4.0D, targetDistance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -579,7 +570,7 @@ public class SchalkerEntity extends GolemEntity implements IMob
|
|||
super(p_i50612_2_);
|
||||
}
|
||||
|
||||
public void updateRenderAngles()
|
||||
public void clientTick()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -590,15 +581,15 @@ public class SchalkerEntity extends GolemEntity implements IMob
|
|||
|
||||
public AttackGoal()
|
||||
{
|
||||
this.setMutexFlags(EnumSet.of(Goal.Flag.MOVE, Goal.Flag.LOOK));
|
||||
this.setFlags(EnumSet.of(Goal.Flag.MOVE, Goal.Flag.LOOK));
|
||||
}
|
||||
|
||||
public boolean shouldExecute()
|
||||
public boolean canUse()
|
||||
{
|
||||
LivingEntity livingentity = SchalkerEntity.this.getAttackTarget();
|
||||
LivingEntity livingentity = SchalkerEntity.this.getTarget();
|
||||
if (livingentity != null && livingentity.isAlive())
|
||||
{
|
||||
return SchalkerEntity.this.world.getDifficulty() != Difficulty.PEACEFUL;
|
||||
return SchalkerEntity.this.level.getDifficulty() != Difficulty.PEACEFUL;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -606,38 +597,38 @@ public class SchalkerEntity extends GolemEntity implements IMob
|
|||
}
|
||||
}
|
||||
|
||||
public void startExecuting()
|
||||
public void start()
|
||||
{
|
||||
this.attackTime = 20;
|
||||
SchalkerEntity.this.updateArmorModifier(100);
|
||||
}
|
||||
|
||||
public void resetTask()
|
||||
public void stop()
|
||||
{
|
||||
SchalkerEntity.this.updateArmorModifier(0);
|
||||
}
|
||||
|
||||
public void tick()
|
||||
{
|
||||
if (SchalkerEntity.this.world.getDifficulty() != Difficulty.PEACEFUL)
|
||||
if (SchalkerEntity.this.level.getDifficulty() != Difficulty.PEACEFUL)
|
||||
{
|
||||
--this.attackTime;
|
||||
LivingEntity livingentity = SchalkerEntity.this.getAttackTarget();
|
||||
LivingEntity livingentity = SchalkerEntity.this.getTarget();
|
||||
assert livingentity != null;
|
||||
SchalkerEntity.this.getLookController().setLookPositionWithEntity(livingentity, 180.0F, 180.0F);
|
||||
double d0 = SchalkerEntity.this.getDistanceSq(livingentity);
|
||||
SchalkerEntity.this.getLookControl().setLookAt(livingentity, 180.0F, 180.0F);
|
||||
double d0 = SchalkerEntity.this.distanceToSqr(livingentity);
|
||||
if (d0 < 400.0D)
|
||||
{
|
||||
if (this.attackTime <= 0)
|
||||
{
|
||||
this.attackTime = 20 + SchalkerEntity.this.rand.nextInt(10) * 20 / 2;
|
||||
SchalkerEntity.this.world.addEntity(new ShulkerBulletEntity(SchalkerEntity.this.world, SchalkerEntity.this, livingentity, SchalkerEntity.this.getAttachmentFacing().getAxis()));
|
||||
SchalkerEntity.this.playSound(SpackenmobsRegistry.ENTITY_SCHALKER_SHOOT.get(), 2.0F, (SchalkerEntity.this.rand.nextFloat() - SchalkerEntity.this.rand.nextFloat()) * 0.2F + 1.0F);
|
||||
this.attackTime = 20 + SchalkerEntity.this.random.nextInt(10) * 20 / 2;
|
||||
SchalkerEntity.this.level.addFreshEntity(new ShulkerBulletEntity(SchalkerEntity.this.level, SchalkerEntity.this, livingentity, SchalkerEntity.this.getAttachmentFacing().getAxis()));
|
||||
SchalkerEntity.this.playSound(SpackenmobsRegistry.ENTITY_SCHALKER_SHOOT.get(), 2.0F, (SchalkerEntity.this.random.nextFloat() - SchalkerEntity.this.random.nextFloat()) * 0.2F + 1.0F);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SchalkerEntity.this.setAttackTarget(null);
|
||||
SchalkerEntity.this.setTarget(null);
|
||||
}
|
||||
|
||||
super.tick();
|
||||
|
@ -652,21 +643,21 @@ public class SchalkerEntity extends GolemEntity implements IMob
|
|||
super(schalker, PlayerEntity.class, true);
|
||||
}
|
||||
|
||||
public boolean shouldExecute()
|
||||
public boolean canUse()
|
||||
{
|
||||
return SchalkerEntity.this.world.getDifficulty() != Difficulty.PEACEFUL && super.shouldExecute();
|
||||
return SchalkerEntity.this.level.getDifficulty() != Difficulty.PEACEFUL && super.canUse();
|
||||
}
|
||||
|
||||
protected AxisAlignedBB getTargetableArea(double targetDistance)
|
||||
protected AxisAlignedBB getTargetSearchArea(double targetDistance)
|
||||
{
|
||||
Direction direction = ((SchalkerEntity) this.goalOwner).getAttachmentFacing();
|
||||
Direction direction = ((SchalkerEntity) this.mob).getAttachmentFacing();
|
||||
if (direction.getAxis() == Direction.Axis.X)
|
||||
{
|
||||
return this.goalOwner.getBoundingBox().grow(4.0D, targetDistance, targetDistance);
|
||||
return this.mob.getBoundingBox().inflate(4.0D, targetDistance, targetDistance);
|
||||
}
|
||||
else
|
||||
{
|
||||
return direction.getAxis() == Direction.Axis.Z ? this.goalOwner.getBoundingBox().grow(targetDistance, targetDistance, 4.0D) : this.goalOwner.getBoundingBox().grow(targetDistance, 4.0D, targetDistance);
|
||||
return direction.getAxis() == Direction.Axis.Z ? this.mob.getBoundingBox().inflate(targetDistance, targetDistance, 4.0D) : this.mob.getBoundingBox().inflate(targetDistance, 4.0D, targetDistance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -679,25 +670,25 @@ public class SchalkerEntity extends GolemEntity implements IMob
|
|||
{
|
||||
}
|
||||
|
||||
public boolean shouldExecute()
|
||||
public boolean canUse()
|
||||
{
|
||||
return SchalkerEntity.this.getAttackTarget() == null && SchalkerEntity.this.rand.nextInt(40) == 0;
|
||||
return SchalkerEntity.this.getTarget() == null && SchalkerEntity.this.random.nextInt(40) == 0;
|
||||
}
|
||||
|
||||
public boolean shouldContinueExecuting()
|
||||
public boolean canContinueToUse()
|
||||
{
|
||||
return SchalkerEntity.this.getAttackTarget() == null && this.peekTime > 0;
|
||||
return SchalkerEntity.this.getTarget() == null && this.peekTime > 0;
|
||||
}
|
||||
|
||||
public void startExecuting()
|
||||
public void start()
|
||||
{
|
||||
this.peekTime = 20 * (1 + SchalkerEntity.this.rand.nextInt(3));
|
||||
this.peekTime = 20 * (1 + SchalkerEntity.this.random.nextInt(3));
|
||||
SchalkerEntity.this.updateArmorModifier(30);
|
||||
}
|
||||
|
||||
public void resetTask()
|
||||
public void stop()
|
||||
{
|
||||
if (SchalkerEntity.this.getAttackTarget() == null)
|
||||
if (SchalkerEntity.this.getTarget() == null)
|
||||
{
|
||||
SchalkerEntity.this.updateArmorModifier(0);
|
||||
}
|
||||
|
|
|
@ -38,13 +38,13 @@ import mod.acgaming.spackenmobs.init.SpackenmobsRegistry;
|
|||
)
|
||||
public class SmavaCreeperEntity extends MonsterEntity implements IChargeableMob
|
||||
{
|
||||
private static final DataParameter<Integer> STATE = EntityDataManager.createKey(SmavaCreeperEntity.class, DataSerializers.VARINT);
|
||||
private static final DataParameter<Boolean> POWERED = EntityDataManager.createKey(SmavaCreeperEntity.class, DataSerializers.BOOLEAN);
|
||||
private static final DataParameter<Boolean> IGNITED = EntityDataManager.createKey(SmavaCreeperEntity.class, DataSerializers.BOOLEAN);
|
||||
private static final DataParameter<Integer> STATE = EntityDataManager.defineId(SmavaCreeperEntity.class, DataSerializers.INT);
|
||||
private static final DataParameter<Boolean> POWERED = EntityDataManager.defineId(SmavaCreeperEntity.class, DataSerializers.BOOLEAN);
|
||||
private static final DataParameter<Boolean> IGNITED = EntityDataManager.defineId(SmavaCreeperEntity.class, DataSerializers.BOOLEAN);
|
||||
|
||||
public static AttributeModifierMap.MutableAttribute registerAttributes()
|
||||
{
|
||||
return MonsterEntity.func_234295_eP_().createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.5D);
|
||||
return MonsterEntity.createMonsterAttributes().add(Attributes.MOVEMENT_SPEED, 0.5D);
|
||||
}
|
||||
|
||||
private int lastActiveTime;
|
||||
|
@ -58,9 +58,9 @@ public class SmavaCreeperEntity extends MonsterEntity implements IChargeableMob
|
|||
super(type, worldIn);
|
||||
}
|
||||
|
||||
public boolean onLivingFall(float distance, float damageMultiplier)
|
||||
public boolean causeFallDamage(float distance, float damageMultiplier)
|
||||
{
|
||||
boolean flag = super.onLivingFall(distance, damageMultiplier);
|
||||
boolean flag = super.causeFallDamage(distance, damageMultiplier);
|
||||
this.timeSinceIgnited = (int) ((float) this.timeSinceIgnited + distance * 1.5F);
|
||||
if (this.timeSinceIgnited > this.fuseTime - 5)
|
||||
{
|
||||
|
@ -75,9 +75,9 @@ public class SmavaCreeperEntity extends MonsterEntity implements IChargeableMob
|
|||
return 0.6F;
|
||||
}
|
||||
|
||||
public boolean isCharged()
|
||||
public boolean isPowered()
|
||||
{
|
||||
return this.dataManager.get(POWERED);
|
||||
return this.entityData.get(POWERED);
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
|
@ -88,33 +88,33 @@ public class SmavaCreeperEntity extends MonsterEntity implements IChargeableMob
|
|||
|
||||
public int getCreeperState()
|
||||
{
|
||||
return this.dataManager.get(STATE);
|
||||
return this.entityData.get(STATE);
|
||||
}
|
||||
|
||||
public void setCreeperState(int state)
|
||||
{
|
||||
this.dataManager.set(STATE, state);
|
||||
this.entityData.set(STATE, state);
|
||||
}
|
||||
|
||||
public void func_241841_a(ServerWorld p_241841_1_, LightningBoltEntity p_241841_2_)
|
||||
public void thunderHit(ServerWorld p_241841_1_, LightningBoltEntity p_241841_2_)
|
||||
{
|
||||
super.func_241841_a(p_241841_1_, p_241841_2_);
|
||||
this.dataManager.set(POWERED, true);
|
||||
super.thunderHit(p_241841_1_, p_241841_2_);
|
||||
this.entityData.set(POWERED, true);
|
||||
}
|
||||
|
||||
public boolean hasIgnited()
|
||||
{
|
||||
return this.dataManager.get(IGNITED);
|
||||
return this.entityData.get(IGNITED);
|
||||
}
|
||||
|
||||
public void ignite()
|
||||
{
|
||||
this.dataManager.set(IGNITED, true);
|
||||
this.entityData.set(IGNITED, true);
|
||||
}
|
||||
|
||||
public boolean ableToCauseSkullDrop()
|
||||
{
|
||||
return this.isCharged() && this.droppedSkulls < 1;
|
||||
return this.isPowered() && this.droppedSkulls < 1;
|
||||
}
|
||||
|
||||
public void incrementDroppedSkulls()
|
||||
|
@ -136,12 +136,12 @@ public class SmavaCreeperEntity extends MonsterEntity implements IChargeableMob
|
|||
this.targetSelector.addGoal(2, new HurtByTargetGoal(this));
|
||||
}
|
||||
|
||||
protected void registerData()
|
||||
protected void defineSynchedData()
|
||||
{
|
||||
super.registerData();
|
||||
this.dataManager.register(STATE, -1);
|
||||
this.dataManager.register(POWERED, false);
|
||||
this.dataManager.register(IGNITED, false);
|
||||
super.defineSynchedData();
|
||||
this.entityData.define(STATE, -1);
|
||||
this.entityData.define(POWERED, false);
|
||||
this.entityData.define(IGNITED, false);
|
||||
}
|
||||
|
||||
public void tick()
|
||||
|
@ -181,10 +181,10 @@ public class SmavaCreeperEntity extends MonsterEntity implements IChargeableMob
|
|||
return SpackenmobsRegistry.ENTITY_SMAVA_CREEPER_AMBIENT.get();
|
||||
}
|
||||
|
||||
public void writeAdditional(CompoundNBT compound)
|
||||
public void addAdditionalSaveData(CompoundNBT compound)
|
||||
{
|
||||
super.writeAdditional(compound);
|
||||
if (this.dataManager.get(POWERED))
|
||||
super.addAdditionalSaveData(compound);
|
||||
if (this.entityData.get(POWERED))
|
||||
{
|
||||
compound.putBoolean("powered", true);
|
||||
}
|
||||
|
@ -194,10 +194,10 @@ public class SmavaCreeperEntity extends MonsterEntity implements IChargeableMob
|
|||
compound.putBoolean("ignited", this.hasIgnited());
|
||||
}
|
||||
|
||||
public void readAdditional(CompoundNBT compound)
|
||||
public void readAdditionalSaveData(CompoundNBT compound)
|
||||
{
|
||||
super.readAdditional(compound);
|
||||
this.dataManager.set(POWERED, compound.getBoolean("powered"));
|
||||
super.readAdditionalSaveData(compound);
|
||||
this.entityData.set(POWERED, compound.getBoolean("powered"));
|
||||
if (compound.contains("Fuse", 99))
|
||||
{
|
||||
this.fuseTime = compound.getShort("Fuse");
|
||||
|
@ -215,48 +215,48 @@ public class SmavaCreeperEntity extends MonsterEntity implements IChargeableMob
|
|||
|
||||
}
|
||||
|
||||
public int getMaxFallHeight()
|
||||
public int getMaxFallDistance()
|
||||
{
|
||||
return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F);
|
||||
return this.getTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F);
|
||||
}
|
||||
|
||||
protected void dropSpecialItems(DamageSource source, int looting, boolean recentlyHitIn)
|
||||
protected void dropCustomDeathLoot(DamageSource source, int looting, boolean recentlyHitIn)
|
||||
{
|
||||
super.dropSpecialItems(source, looting, recentlyHitIn);
|
||||
Entity entity = source.getTrueSource();
|
||||
super.dropCustomDeathLoot(source, looting, recentlyHitIn);
|
||||
Entity entity = source.getEntity();
|
||||
if (entity instanceof SmavaCreeperEntity)
|
||||
{
|
||||
SmavaCreeperEntity smavacreeperentity = (SmavaCreeperEntity) entity;
|
||||
if (smavacreeperentity.ableToCauseSkullDrop())
|
||||
{
|
||||
smavacreeperentity.incrementDroppedSkulls();
|
||||
this.entityDropItem(Items.CREEPER_HEAD);
|
||||
this.spawnAtLocation(Items.CREEPER_HEAD);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected ActionResultType func_230254_b_(PlayerEntity p_230254_1_, Hand p_230254_2_)
|
||||
protected ActionResultType mobInteract(PlayerEntity p_230254_1_, Hand p_230254_2_)
|
||||
{
|
||||
ItemStack itemstack = p_230254_1_.getHeldItem(p_230254_2_);
|
||||
ItemStack itemstack = p_230254_1_.getItemInHand(p_230254_2_);
|
||||
if (itemstack.getItem() == Items.FLINT_AND_STEEL)
|
||||
{
|
||||
this.world.playSound(p_230254_1_, this.getPosX(), this.getPosY(), this.getPosZ(), SoundEvents.ITEM_FLINTANDSTEEL_USE, this.getSoundCategory(), 1.0F, this.rand.nextFloat() * 0.4F + 0.8F);
|
||||
if (!this.world.isRemote)
|
||||
this.level.playSound(p_230254_1_, this.getX(), this.getY(), this.getZ(), SoundEvents.FLINTANDSTEEL_USE, this.getSoundSource(), 1.0F, this.random.nextFloat() * 0.4F + 0.8F);
|
||||
if (!this.level.isClientSide)
|
||||
{
|
||||
this.ignite();
|
||||
itemstack.damageItem(1, p_230254_1_, (player) ->
|
||||
player.sendBreakAnimation(p_230254_2_));
|
||||
itemstack.hurtAndBreak(1, p_230254_1_, (player) ->
|
||||
player.broadcastBreakEvent(p_230254_2_));
|
||||
}
|
||||
|
||||
return ActionResultType.func_233537_a_(this.world.isRemote);
|
||||
return ActionResultType.sidedSuccess(this.level.isClientSide);
|
||||
}
|
||||
else
|
||||
{
|
||||
return super.func_230254_b_(p_230254_1_, p_230254_2_);
|
||||
return super.mobInteract(p_230254_1_, p_230254_2_);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean attackEntityAsMob(Entity entityIn)
|
||||
public boolean doHurtTarget(Entity entityIn)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -273,13 +273,13 @@ public class SmavaCreeperEntity extends MonsterEntity implements IChargeableMob
|
|||
|
||||
private void explode()
|
||||
{
|
||||
if (!this.world.isRemote)
|
||||
if (!this.level.isClientSide)
|
||||
{
|
||||
Explosion.Mode explosion$mode = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.world, this) ? Explosion.Mode.DESTROY : Explosion.Mode.NONE;
|
||||
float f = this.isCharged() ? 2.0F : 1.0F;
|
||||
Explosion.Mode explosion$mode = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.level, this) ? Explosion.Mode.DESTROY : Explosion.Mode.NONE;
|
||||
float f = this.isPowered() ? 2.0F : 1.0F;
|
||||
this.dead = true;
|
||||
this.playSound(SpackenmobsRegistry.ENTITY_SMAVA_CREEPER_BLOW.get(), 1.0F, 1.0F);
|
||||
this.world.createExplosion(this, this.getPosX(), this.getPosY(), this.getPosZ(), (float) this.explosionRadius * f, explosion$mode);
|
||||
this.level.explode(this, this.getX(), this.getY(), this.getZ(), (float) this.explosionRadius * f, explosion$mode);
|
||||
this.remove();
|
||||
this.spawnLingeringCloud();
|
||||
}
|
||||
|
@ -287,10 +287,10 @@ public class SmavaCreeperEntity extends MonsterEntity implements IChargeableMob
|
|||
|
||||
private void spawnLingeringCloud()
|
||||
{
|
||||
Collection<EffectInstance> collection = this.getActivePotionEffects();
|
||||
Collection<EffectInstance> collection = this.getActiveEffects();
|
||||
if (!collection.isEmpty())
|
||||
{
|
||||
AreaEffectCloudEntity areaeffectcloudentity = new AreaEffectCloudEntity(this.world, this.getPosX(), this.getPosY(), this.getPosZ());
|
||||
AreaEffectCloudEntity areaeffectcloudentity = new AreaEffectCloudEntity(this.level, this.getX(), this.getY(), this.getZ());
|
||||
areaeffectcloudentity.setRadius(2.5F);
|
||||
areaeffectcloudentity.setRadiusOnUse(-0.5F);
|
||||
areaeffectcloudentity.setWaitTime(10);
|
||||
|
@ -302,7 +302,7 @@ public class SmavaCreeperEntity extends MonsterEntity implements IChargeableMob
|
|||
areaeffectcloudentity.addEffect(new EffectInstance(effectinstance));
|
||||
}
|
||||
|
||||
this.world.addEntity(areaeffectcloudentity);
|
||||
this.level.addFreshEntity(areaeffectcloudentity);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -15,22 +15,22 @@ public class BakaMitaiCreeperSwellGoal extends Goal
|
|||
public BakaMitaiCreeperSwellGoal(BakaMitaiCreeperEntity entitybakamitaicreeperIn)
|
||||
{
|
||||
this.swellingCreeper = entitybakamitaicreeperIn;
|
||||
this.setMutexFlags(EnumSet.of(Flag.MOVE));
|
||||
this.setFlags(EnumSet.of(Flag.MOVE));
|
||||
}
|
||||
|
||||
public boolean shouldExecute()
|
||||
public boolean canUse()
|
||||
{
|
||||
LivingEntity livingentity = this.swellingCreeper.getAttackTarget();
|
||||
return this.swellingCreeper.getCreeperState() > 0 || livingentity != null && this.swellingCreeper.getDistanceSq(livingentity) < 9.0D;
|
||||
LivingEntity livingentity = this.swellingCreeper.getTarget();
|
||||
return this.swellingCreeper.getCreeperState() > 0 || livingentity != null && this.swellingCreeper.distanceToSqr(livingentity) < 9.0D;
|
||||
}
|
||||
|
||||
public void startExecuting()
|
||||
public void start()
|
||||
{
|
||||
this.swellingCreeper.getNavigator().clearPath();
|
||||
this.creeperAttackTarget = this.swellingCreeper.getAttackTarget();
|
||||
this.swellingCreeper.getNavigation().stop();
|
||||
this.creeperAttackTarget = this.swellingCreeper.getTarget();
|
||||
}
|
||||
|
||||
public void resetTask()
|
||||
public void stop()
|
||||
{
|
||||
this.creeperAttackTarget = null;
|
||||
}
|
||||
|
@ -41,11 +41,11 @@ public class BakaMitaiCreeperSwellGoal extends Goal
|
|||
{
|
||||
this.swellingCreeper.setCreeperState(-1);
|
||||
}
|
||||
else if (this.swellingCreeper.getDistanceSq(this.creeperAttackTarget) > 49.0D)
|
||||
else if (this.swellingCreeper.distanceToSqr(this.creeperAttackTarget) > 49.0D)
|
||||
{
|
||||
this.swellingCreeper.setCreeperState(-1);
|
||||
}
|
||||
else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget))
|
||||
else if (!this.swellingCreeper.getSensing().canSee(this.creeperAttackTarget))
|
||||
{
|
||||
this.swellingCreeper.setCreeperState(-1);
|
||||
}
|
||||
|
|
|
@ -15,22 +15,22 @@ public class IslamistSwellGoal extends Goal
|
|||
public IslamistSwellGoal(IslamistEntity entityislamistIn)
|
||||
{
|
||||
this.swellingCreeper = entityislamistIn;
|
||||
this.setMutexFlags(EnumSet.of(Flag.MOVE));
|
||||
this.setFlags(EnumSet.of(Flag.MOVE));
|
||||
}
|
||||
|
||||
public boolean shouldExecute()
|
||||
public boolean canUse()
|
||||
{
|
||||
LivingEntity livingentity = this.swellingCreeper.getAttackTarget();
|
||||
return this.swellingCreeper.getCreeperState() > 0 || livingentity != null && this.swellingCreeper.getDistanceSq(livingentity) < 9.0D;
|
||||
LivingEntity livingentity = this.swellingCreeper.getTarget();
|
||||
return this.swellingCreeper.getCreeperState() > 0 || livingentity != null && this.swellingCreeper.distanceToSqr(livingentity) < 9.0D;
|
||||
}
|
||||
|
||||
public void startExecuting()
|
||||
public void start()
|
||||
{
|
||||
this.swellingCreeper.getNavigator().clearPath();
|
||||
this.creeperAttackTarget = this.swellingCreeper.getAttackTarget();
|
||||
this.swellingCreeper.getNavigation().stop();
|
||||
this.creeperAttackTarget = this.swellingCreeper.getTarget();
|
||||
}
|
||||
|
||||
public void resetTask()
|
||||
public void stop()
|
||||
{
|
||||
this.creeperAttackTarget = null;
|
||||
}
|
||||
|
@ -41,11 +41,11 @@ public class IslamistSwellGoal extends Goal
|
|||
{
|
||||
this.swellingCreeper.setCreeperState(-1);
|
||||
}
|
||||
else if (this.swellingCreeper.getDistanceSq(this.creeperAttackTarget) > 49.0D)
|
||||
else if (this.swellingCreeper.distanceToSqr(this.creeperAttackTarget) > 49.0D)
|
||||
{
|
||||
this.swellingCreeper.setCreeperState(-1);
|
||||
}
|
||||
else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget))
|
||||
else if (!this.swellingCreeper.getSensing().canSee(this.creeperAttackTarget))
|
||||
{
|
||||
this.swellingCreeper.setCreeperState(-1);
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ public class JensDanceGoal extends Goal
|
|||
this.searchRadius = ConfigurationHandler.GENERAL.jens_search_distance.get();
|
||||
}
|
||||
|
||||
public boolean shouldExecute()
|
||||
public boolean canUse()
|
||||
{
|
||||
for (int x = -this.searchRadius; x <= this.searchRadius; x++)
|
||||
{
|
||||
|
@ -29,7 +29,7 @@ public class JensDanceGoal extends Goal
|
|||
{
|
||||
for (int z = -this.searchRadius; z <= this.searchRadius; z++)
|
||||
{
|
||||
if (this.jens.world.getBlockState(this.jens.getPosition().add(x, y, z)).getBlock() == Blocks.JUKEBOX && this.jens.world.getBlockState(this.jens.getPosition().add(x, y, z)).get(JukeboxBlock.HAS_RECORD))
|
||||
if (this.jens.level.getBlockState(this.jens.blockPosition().offset(x, y, z)).getBlock() == Blocks.JUKEBOX && this.jens.level.getBlockState(this.jens.blockPosition().offset(x, y, z)).getValue(JukeboxBlock.HAS_RECORD))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -37,17 +37,17 @@ public class JensDanceGoal extends Goal
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean shouldContinueExecuting()
|
||||
public boolean canContinueToUse()
|
||||
{
|
||||
return shouldExecute();
|
||||
return canUse();
|
||||
}
|
||||
|
||||
public void startExecuting()
|
||||
public void start()
|
||||
{
|
||||
this.danceStage = 1;
|
||||
}
|
||||
|
||||
public void resetTask()
|
||||
public void stop()
|
||||
{
|
||||
this.lastDanceMoveTime = 0;
|
||||
this.danceStage = 0;
|
||||
|
@ -60,20 +60,20 @@ public class JensDanceGoal extends Goal
|
|||
switch (this.danceStage)
|
||||
{
|
||||
case 1:
|
||||
this.danceStage = this.jens.world.rand.nextBoolean() ? 1 : 2;
|
||||
this.jens.setMotion(0, 0.5, 0);
|
||||
this.danceStage = this.jens.level.random.nextBoolean() ? 1 : 2;
|
||||
this.jens.setDeltaMovement(0, 0.5, 0);
|
||||
break;
|
||||
case 2:
|
||||
this.jens.setSneaking(true);
|
||||
this.jens.setMotion(0, -3, 0);
|
||||
this.jens.setShiftKeyDown(true);
|
||||
this.jens.setDeltaMovement(0, -3, 0);
|
||||
this.danceStage = 3;
|
||||
break;
|
||||
case 3:
|
||||
this.danceStage = this.jens.world.rand.nextBoolean() ? 1 : 2;
|
||||
this.jens.setSneaking(false);
|
||||
this.danceStage = this.jens.level.random.nextBoolean() ? 1 : 2;
|
||||
this.jens.setShiftKeyDown(false);
|
||||
break;
|
||||
}
|
||||
this.lastDanceMoveTime = this.jens.world.rand.nextInt(20) + 10;
|
||||
this.lastDanceMoveTime = this.jens.level.random.nextInt(20) + 10;
|
||||
}
|
||||
this.lastDanceMoveTime--;
|
||||
}
|
||||
|
|
|
@ -21,8 +21,8 @@ public class JensEatDroppedFishGoal extends Goal
|
|||
public JensEatDroppedFishGoal(JensEntity jens)
|
||||
{
|
||||
this.jens = jens;
|
||||
this.world = jens.world;
|
||||
this.setMutexFlags(EnumSet.of(Goal.Flag.MOVE, Goal.Flag.LOOK, Goal.Flag.JUMP));
|
||||
this.world = jens.level;
|
||||
this.setFlags(EnumSet.of(Goal.Flag.MOVE, Goal.Flag.LOOK, Goal.Flag.JUMP));
|
||||
}
|
||||
|
||||
public ItemEntity getNearbyFood()
|
||||
|
@ -35,10 +35,10 @@ public class JensEatDroppedFishGoal extends Goal
|
|||
return null;
|
||||
}
|
||||
|
||||
public boolean shouldExecute()
|
||||
public boolean canUse()
|
||||
{
|
||||
ItemEntity getNearbyFood = getNearbyFood();
|
||||
if (getNearbyFood != null && !this.jens.isChild() && !this.jens.digesting
|
||||
if (getNearbyFood != null && !this.jens.isBaby() && !this.jens.digesting
|
||||
&& this.jens.isFishItem(getNearbyFood.getItem()))
|
||||
{
|
||||
execute(this.jens, getNearbyFood);
|
||||
|
@ -48,9 +48,9 @@ public class JensEatDroppedFishGoal extends Goal
|
|||
|
||||
public boolean execute(JensEntity jens, ItemEntity item)
|
||||
{
|
||||
if (jens.getNavigator().tryMoveToXYZ(item.getPosX(), item.getPosY(), item.getPosZ(), 1.25D))
|
||||
if (jens.getNavigation().moveTo(item.getX(), item.getY(), item.getZ(), 1.25D))
|
||||
{
|
||||
if (jens.getDistance(item) < 1.5F)
|
||||
if (jens.distanceTo(item) < 1.5F)
|
||||
{
|
||||
eatItem(item);
|
||||
jens.digestFish();
|
||||
|
@ -71,9 +71,9 @@ public class JensEatDroppedFishGoal extends Goal
|
|||
|
||||
List<ItemEntity> getItems()
|
||||
{
|
||||
return this.world.getEntitiesWithinAABB(ItemEntity.class,
|
||||
new AxisAlignedBB(this.jens.getPosX() - this.searchDistance, this.jens.getPosY() - this.searchDistance,
|
||||
this.jens.getPosZ() - this.searchDistance, this.jens.getPosX() + this.searchDistance,
|
||||
this.jens.getPosY() + this.searchDistance, this.jens.getPosZ() + this.searchDistance));
|
||||
return this.world.getEntitiesOfClass(ItemEntity.class,
|
||||
new AxisAlignedBB(this.jens.getX() - this.searchDistance, this.jens.getY() - this.searchDistance,
|
||||
this.jens.getZ() - this.searchDistance, this.jens.getX() + this.searchDistance,
|
||||
this.jens.getY() + this.searchDistance, this.jens.getZ() + this.searchDistance));
|
||||
}
|
||||
}
|
|
@ -24,25 +24,25 @@ public class MZTEWolfBegGoal extends Goal
|
|||
public MZTEWolfBegGoal(MZTEWolfEntity wolf, float minDistance)
|
||||
{
|
||||
this.wolf = wolf;
|
||||
this.world = wolf.world;
|
||||
this.world = wolf.level;
|
||||
this.minPlayerDistance = minDistance;
|
||||
this.playerPredicate = (new EntityPredicate()).setDistance(minDistance).allowInvulnerable().allowFriendlyFire().setSkipAttackChecks();
|
||||
this.setMutexFlags(EnumSet.of(Goal.Flag.LOOK));
|
||||
this.playerPredicate = (new EntityPredicate()).range(minDistance).allowInvulnerable().allowSameTeam().allowNonAttackable();
|
||||
this.setFlags(EnumSet.of(Goal.Flag.LOOK));
|
||||
}
|
||||
|
||||
public boolean shouldExecute()
|
||||
public boolean canUse()
|
||||
{
|
||||
this.player = this.world.getClosestPlayer(this.playerPredicate, this.wolf);
|
||||
this.player = this.world.getNearestPlayer(this.playerPredicate, this.wolf);
|
||||
return this.player != null && this.hasTemptationItemInHand(this.player);
|
||||
}
|
||||
|
||||
public boolean shouldContinueExecuting()
|
||||
public boolean canContinueToUse()
|
||||
{
|
||||
if (!this.player.isAlive())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (this.wolf.getDistanceSq(this.player) > (double) (this.minPlayerDistance * this.minPlayerDistance))
|
||||
else if (this.wolf.distanceToSqr(this.player) > (double) (this.minPlayerDistance * this.minPlayerDistance))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -52,13 +52,13 @@ public class MZTEWolfBegGoal extends Goal
|
|||
}
|
||||
}
|
||||
|
||||
public void startExecuting()
|
||||
public void start()
|
||||
{
|
||||
this.wolf.setBegging(true);
|
||||
this.timeoutCounter = 40 + this.wolf.getRNG().nextInt(40);
|
||||
this.timeoutCounter = 40 + this.wolf.getRandom().nextInt(40);
|
||||
}
|
||||
|
||||
public void resetTask()
|
||||
public void stop()
|
||||
{
|
||||
this.wolf.setBegging(false);
|
||||
this.player = null;
|
||||
|
@ -66,7 +66,7 @@ public class MZTEWolfBegGoal extends Goal
|
|||
|
||||
public void tick()
|
||||
{
|
||||
this.wolf.getLookController().setLookPosition(this.player.getPosX(), this.player.getPosYEye(), this.player.getPosZ(), 10.0F, (float) this.wolf.getVerticalFaceSpeed());
|
||||
this.wolf.getLookControl().setLookAt(this.player.getX(), this.player.getEyeY(), this.player.getZ(), 10.0F, (float) this.wolf.getMaxHeadXRot());
|
||||
--this.timeoutCounter;
|
||||
}
|
||||
|
||||
|
@ -74,12 +74,12 @@ public class MZTEWolfBegGoal extends Goal
|
|||
{
|
||||
for (Hand hand : Hand.values())
|
||||
{
|
||||
ItemStack itemstack = player.getHeldItem(hand);
|
||||
if (this.wolf.isTamed() && itemstack.getItem() == Items.BONE)
|
||||
ItemStack itemstack = player.getItemInHand(hand);
|
||||
if (this.wolf.isTame() && itemstack.getItem() == Items.BONE)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (this.wolf.isBreedingItem(itemstack))
|
||||
if (this.wolf.isFood(itemstack))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -15,22 +15,22 @@ public class SmavaCreeperSwellGoal extends Goal
|
|||
public SmavaCreeperSwellGoal(SmavaCreeperEntity entitysmavacreeperIn)
|
||||
{
|
||||
this.swellingCreeper = entitysmavacreeperIn;
|
||||
this.setMutexFlags(EnumSet.of(Goal.Flag.MOVE));
|
||||
this.setFlags(EnumSet.of(Goal.Flag.MOVE));
|
||||
}
|
||||
|
||||
public boolean shouldExecute()
|
||||
public boolean canUse()
|
||||
{
|
||||
LivingEntity livingentity = this.swellingCreeper.getAttackTarget();
|
||||
return this.swellingCreeper.getCreeperState() > 0 || livingentity != null && this.swellingCreeper.getDistanceSq(livingentity) < 9.0D;
|
||||
LivingEntity livingentity = this.swellingCreeper.getTarget();
|
||||
return this.swellingCreeper.getCreeperState() > 0 || livingentity != null && this.swellingCreeper.distanceToSqr(livingentity) < 9.0D;
|
||||
}
|
||||
|
||||
public void startExecuting()
|
||||
public void start()
|
||||
{
|
||||
this.swellingCreeper.getNavigator().clearPath();
|
||||
this.creeperAttackTarget = this.swellingCreeper.getAttackTarget();
|
||||
this.swellingCreeper.getNavigation().stop();
|
||||
this.creeperAttackTarget = this.swellingCreeper.getTarget();
|
||||
}
|
||||
|
||||
public void resetTask()
|
||||
public void stop()
|
||||
{
|
||||
this.creeperAttackTarget = null;
|
||||
}
|
||||
|
@ -41,11 +41,11 @@ public class SmavaCreeperSwellGoal extends Goal
|
|||
{
|
||||
this.swellingCreeper.setCreeperState(-1);
|
||||
}
|
||||
else if (this.swellingCreeper.getDistanceSq(this.creeperAttackTarget) > 49.0D)
|
||||
else if (this.swellingCreeper.distanceToSqr(this.creeperAttackTarget) > 49.0D)
|
||||
{
|
||||
this.swellingCreeper.setCreeperState(-1);
|
||||
}
|
||||
else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget))
|
||||
else if (!this.swellingCreeper.getSensing().canSee(this.creeperAttackTarget))
|
||||
{
|
||||
this.swellingCreeper.setCreeperState(-1);
|
||||
}
|
||||
|
|
|
@ -30,11 +30,11 @@ public class SpackenmobsEntities
|
|||
Biome biome = ForgeRegistries.BIOMES.getValue(event.getName());
|
||||
if (biome != null)
|
||||
{
|
||||
MobSpawnInfo info = biome.getMobSpawnInfo();
|
||||
MobSpawnInfo info = biome.getMobSettings();
|
||||
List<MobSpawnInfo.Spawners> monster_spawns = event.getSpawns().getSpawner(EntityClassification.MONSTER);
|
||||
List<MobSpawnInfo.Spawners> creature_spawns = event.getSpawns().getSpawner(EntityClassification.CREATURE);
|
||||
|
||||
for (Spawners entry : info.getSpawners(EntityClassification.MONSTER))
|
||||
for (Spawners entry : info.getMobs(EntityClassification.MONSTER))
|
||||
{
|
||||
registerSpawn(monster_spawns, entry, ConfigurationHandler.SPAWN.apored_weight.get(), ConfigurationHandler.SPAWN.apored_min.get(), ConfigurationHandler.SPAWN.apored_max.get(), EntityType.SKELETON, SpackenmobsRegistry.APORED.get());
|
||||
registerSpawn(monster_spawns, entry, ConfigurationHandler.SPAWN.bakamitai_creeper_weight.get(), ConfigurationHandler.SPAWN.bakamitai_creeper_min.get(), ConfigurationHandler.SPAWN.bakamitai_creeper_max.get(), EntityType.CREEPER, SpackenmobsRegistry.BAKAMITAI_CREEPER.get());
|
||||
|
@ -46,49 +46,49 @@ public class SpackenmobsEntities
|
|||
registerSpawn(monster_spawns, entry, ConfigurationHandler.SPAWN.smava_creeper_weight.get(), ConfigurationHandler.SPAWN.smava_creeper_min.get(), ConfigurationHandler.SPAWN.smava_creeper_max.get(), EntityType.CREEPER, SpackenmobsRegistry.SMAVA_CREEPER.get());
|
||||
}
|
||||
|
||||
for (Spawners entry : info.getSpawners(EntityClassification.CREATURE))
|
||||
for (Spawners entry : info.getMobs(EntityClassification.CREATURE))
|
||||
{
|
||||
registerSpawn(creature_spawns, entry, ConfigurationHandler.SPAWN.holzstammhuhn_weight.get(), ConfigurationHandler.SPAWN.holzstammhuhn_min.get(), ConfigurationHandler.SPAWN.holzstammhuhn_max.get(), EntityType.CHICKEN, SpackenmobsRegistry.HOLZSTAMMHUHN.get());
|
||||
registerSpawn(creature_spawns, entry, ConfigurationHandler.SPAWN.gisela_weight.get(), ConfigurationHandler.SPAWN.gisela_min.get(), ConfigurationHandler.SPAWN.gisela_max.get(), EntityType.SHEEP, SpackenmobsRegistry.GISELA.get());
|
||||
registerSpawn(creature_spawns, entry, ConfigurationHandler.SPAWN.jens_weight.get(), ConfigurationHandler.SPAWN.jens_min.get(), ConfigurationHandler.SPAWN.jens_max.get(), EntityType.PIG, SpackenmobsRegistry.JENS.get());
|
||||
registerSpawn(creature_spawns, entry, ConfigurationHandler.SPAWN.friedrich_weight.get(), ConfigurationHandler.SPAWN.friedrich_min.get(), ConfigurationHandler.SPAWN.friedrich_max.get(), EntityType.COW, SpackenmobsRegistry.FRIEDRICH_LIECHTENSTEIN.get());
|
||||
registerSpawn(creature_spawns, entry, ConfigurationHandler.SPAWN.mztewolf_weight.get(), ConfigurationHandler.SPAWN.mztewolf_min.get(), ConfigurationHandler.SPAWN.mztewolf_max.get(), EntityType.WOLF, SpackenmobsRegistry.MZTEWOLF.get());
|
||||
registerSpawn(creature_spawns, entry, ConfigurationHandler.SPAWN.dagibee_weight.get(), ConfigurationHandler.SPAWN.dagibee_min.get(), ConfigurationHandler.SPAWN.dagibee_max.get(), EntityType.BEE, SpackenmobsRegistry.DAGIBEE.get());
|
||||
//registerSpawn(creature_spawns, entry, ConfigurationHandler.SPAWN.dagibee_weight.get(), ConfigurationHandler.SPAWN.dagibee_min.get(), ConfigurationHandler.SPAWN.dagibee_max.get(), EntityType.BEE, SpackenmobsRegistry.DAGIBEE.get());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void initializeEntities()
|
||||
{
|
||||
EntitySpawnPlacementRegistry.register(SpackenmobsRegistry.APORED.get(), PlacementType.ON_GROUND, Type.MOTION_BLOCKING_NO_LEAVES, MonsterEntity::canMonsterSpawnInLight);
|
||||
EntitySpawnPlacementRegistry.register(SpackenmobsRegistry.BAKAMITAI_CREEPER.get(), PlacementType.ON_GROUND, Type.MOTION_BLOCKING_NO_LEAVES, MonsterEntity::canMonsterSpawnInLight);
|
||||
EntitySpawnPlacementRegistry.register(SpackenmobsRegistry.DAGIBEE.get(), PlacementType.ON_GROUND, Type.MOTION_BLOCKING_NO_LEAVES, AnimalEntity::canAnimalSpawn);
|
||||
EntitySpawnPlacementRegistry.register(SpackenmobsRegistry.DRACHENLORD.get(), PlacementType.ON_GROUND, Type.MOTION_BLOCKING_NO_LEAVES, MonsterEntity::canMonsterSpawnInLight);
|
||||
EntitySpawnPlacementRegistry.register(SpackenmobsRegistry.FRIEDRICH_LIECHTENSTEIN.get(), PlacementType.ON_GROUND, Type.MOTION_BLOCKING_NO_LEAVES, AnimalEntity::canAnimalSpawn);
|
||||
EntitySpawnPlacementRegistry.register(SpackenmobsRegistry.GISELA.get(), PlacementType.ON_GROUND, Type.MOTION_BLOCKING_NO_LEAVES, AnimalEntity::canAnimalSpawn);
|
||||
EntitySpawnPlacementRegistry.register(SpackenmobsRegistry.HOLZSTAMMHUHN.get(), PlacementType.ON_GROUND, Type.MOTION_BLOCKING_NO_LEAVES, AnimalEntity::canAnimalSpawn);
|
||||
EntitySpawnPlacementRegistry.register(SpackenmobsRegistry.ISLAMIST.get(), PlacementType.ON_GROUND, Type.MOTION_BLOCKING_NO_LEAVES, MonsterEntity::canMonsterSpawnInLight);
|
||||
EntitySpawnPlacementRegistry.register(SpackenmobsRegistry.JENS.get(), PlacementType.ON_GROUND, Type.MOTION_BLOCKING_NO_LEAVES, AnimalEntity::canAnimalSpawn);
|
||||
EntitySpawnPlacementRegistry.register(SpackenmobsRegistry.MARCELLDAVIS.get(), PlacementType.ON_GROUND, Type.MOTION_BLOCKING_NO_LEAVES, MonsterEntity::canMonsterSpawnInLight);
|
||||
EntitySpawnPlacementRegistry.register(SpackenmobsRegistry.MRBEAN.get(), PlacementType.ON_GROUND, Type.MOTION_BLOCKING_NO_LEAVES, MonsterEntity::canMonsterSpawnInLight);
|
||||
EntitySpawnPlacementRegistry.register(SpackenmobsRegistry.MZTEWOLF.get(), PlacementType.ON_GROUND, Type.MOTION_BLOCKING_NO_LEAVES, AnimalEntity::canAnimalSpawn);
|
||||
EntitySpawnPlacementRegistry.register(SpackenmobsRegistry.SCHALKER.get(), PlacementType.NO_RESTRICTIONS, Type.MOTION_BLOCKING_NO_LEAVES, MobEntity::canSpawnOn);
|
||||
EntitySpawnPlacementRegistry.register(SpackenmobsRegistry.SMAVA_CREEPER.get(), PlacementType.ON_GROUND, Type.MOTION_BLOCKING_NO_LEAVES, MonsterEntity::canMonsterSpawnInLight);
|
||||
EntitySpawnPlacementRegistry.register(SpackenmobsRegistry.APORED.get(), PlacementType.ON_GROUND, Type.MOTION_BLOCKING_NO_LEAVES, MonsterEntity::checkMonsterSpawnRules);
|
||||
EntitySpawnPlacementRegistry.register(SpackenmobsRegistry.BAKAMITAI_CREEPER.get(), PlacementType.ON_GROUND, Type.MOTION_BLOCKING_NO_LEAVES, MonsterEntity::checkMonsterSpawnRules);
|
||||
//EntitySpawnPlacementRegistry.register(SpackenmobsRegistry.DAGIBEE.get(), PlacementType.ON_GROUND, Type.MOTION_BLOCKING_NO_LEAVES, AnimalEntity::checkAnimalSpawnRules);
|
||||
EntitySpawnPlacementRegistry.register(SpackenmobsRegistry.DRACHENLORD.get(), PlacementType.ON_GROUND, Type.MOTION_BLOCKING_NO_LEAVES, MonsterEntity::checkMonsterSpawnRules);
|
||||
EntitySpawnPlacementRegistry.register(SpackenmobsRegistry.FRIEDRICH_LIECHTENSTEIN.get(), PlacementType.ON_GROUND, Type.MOTION_BLOCKING_NO_LEAVES, AnimalEntity::checkAnimalSpawnRules);
|
||||
EntitySpawnPlacementRegistry.register(SpackenmobsRegistry.GISELA.get(), PlacementType.ON_GROUND, Type.MOTION_BLOCKING_NO_LEAVES, AnimalEntity::checkAnimalSpawnRules);
|
||||
EntitySpawnPlacementRegistry.register(SpackenmobsRegistry.HOLZSTAMMHUHN.get(), PlacementType.ON_GROUND, Type.MOTION_BLOCKING_NO_LEAVES, AnimalEntity::checkAnimalSpawnRules);
|
||||
EntitySpawnPlacementRegistry.register(SpackenmobsRegistry.ISLAMIST.get(), PlacementType.ON_GROUND, Type.MOTION_BLOCKING_NO_LEAVES, MonsterEntity::checkMonsterSpawnRules);
|
||||
EntitySpawnPlacementRegistry.register(SpackenmobsRegistry.JENS.get(), PlacementType.ON_GROUND, Type.MOTION_BLOCKING_NO_LEAVES, AnimalEntity::checkAnimalSpawnRules);
|
||||
EntitySpawnPlacementRegistry.register(SpackenmobsRegistry.MARCELLDAVIS.get(), PlacementType.ON_GROUND, Type.MOTION_BLOCKING_NO_LEAVES, MonsterEntity::checkMonsterSpawnRules);
|
||||
EntitySpawnPlacementRegistry.register(SpackenmobsRegistry.MRBEAN.get(), PlacementType.ON_GROUND, Type.MOTION_BLOCKING_NO_LEAVES, MonsterEntity::checkMonsterSpawnRules);
|
||||
EntitySpawnPlacementRegistry.register(SpackenmobsRegistry.MZTEWOLF.get(), PlacementType.ON_GROUND, Type.MOTION_BLOCKING_NO_LEAVES, AnimalEntity::checkAnimalSpawnRules);
|
||||
EntitySpawnPlacementRegistry.register(SpackenmobsRegistry.SCHALKER.get(), PlacementType.NO_RESTRICTIONS, Type.MOTION_BLOCKING_NO_LEAVES, MobEntity::checkMobSpawnRules);
|
||||
EntitySpawnPlacementRegistry.register(SpackenmobsRegistry.SMAVA_CREEPER.get(), PlacementType.ON_GROUND, Type.MOTION_BLOCKING_NO_LEAVES, MonsterEntity::checkMonsterSpawnRules);
|
||||
|
||||
GlobalEntityTypeAttributes.put(SpackenmobsRegistry.APORED.get(), AbstractApoRedEntity.registerAttributes().create());
|
||||
GlobalEntityTypeAttributes.put(SpackenmobsRegistry.BAKAMITAI_CREEPER.get(), BakaMitaiCreeperEntity.registerAttributes().create());
|
||||
GlobalEntityTypeAttributes.put(SpackenmobsRegistry.DAGIBEE.get(), DagiBeeEntity.registerAttributes().create());
|
||||
GlobalEntityTypeAttributes.put(SpackenmobsRegistry.DRACHENLORD.get(), DrachenlordEntity.registerAttributes().create());
|
||||
GlobalEntityTypeAttributes.put(SpackenmobsRegistry.FRIEDRICH_LIECHTENSTEIN.get(), FriedrichLiechtensteinEntity.registerAttributes().create());
|
||||
GlobalEntityTypeAttributes.put(SpackenmobsRegistry.GISELA.get(), GiselaEntity.registerAttributes().create());
|
||||
GlobalEntityTypeAttributes.put(SpackenmobsRegistry.HOLZSTAMMHUHN.get(), HolzstammhuhnEntity.registerAttributes().create());
|
||||
GlobalEntityTypeAttributes.put(SpackenmobsRegistry.ISLAMIST.get(), IslamistEntity.registerAttributes().create());
|
||||
GlobalEntityTypeAttributes.put(SpackenmobsRegistry.JENS.get(), JensEntity.registerAttributes().create());
|
||||
GlobalEntityTypeAttributes.put(SpackenmobsRegistry.MARCELLDAVIS.get(), MarcellDAvisEntity.registerAttributes().create());
|
||||
GlobalEntityTypeAttributes.put(SpackenmobsRegistry.MRBEAN.get(), MrBeanEntity.registerAttributes().create());
|
||||
GlobalEntityTypeAttributes.put(SpackenmobsRegistry.MZTEWOLF.get(), MZTEWolfEntity.registerAttributes().create());
|
||||
GlobalEntityTypeAttributes.put(SpackenmobsRegistry.SCHALKER.get(), SchalkerEntity.registerAttributes().create());
|
||||
GlobalEntityTypeAttributes.put(SpackenmobsRegistry.SMAVA_CREEPER.get(), SmavaCreeperEntity.registerAttributes().create());
|
||||
GlobalEntityTypeAttributes.put(SpackenmobsRegistry.APORED.get(), AbstractApoRedEntity.registerAttributes().build());
|
||||
GlobalEntityTypeAttributes.put(SpackenmobsRegistry.BAKAMITAI_CREEPER.get(), BakaMitaiCreeperEntity.registerAttributes().build());
|
||||
//GlobalEntityTypeAttributes.put(SpackenmobsRegistry.DAGIBEE.get(), DagiBeeEntity.createLivingAttributes().build());
|
||||
GlobalEntityTypeAttributes.put(SpackenmobsRegistry.DRACHENLORD.get(), DrachenlordEntity.registerAttributes().build());
|
||||
GlobalEntityTypeAttributes.put(SpackenmobsRegistry.FRIEDRICH_LIECHTENSTEIN.get(), FriedrichLiechtensteinEntity.registerAttributes().build());
|
||||
GlobalEntityTypeAttributes.put(SpackenmobsRegistry.GISELA.get(), GiselaEntity.registerAttributes().build());
|
||||
GlobalEntityTypeAttributes.put(SpackenmobsRegistry.HOLZSTAMMHUHN.get(), HolzstammhuhnEntity.registerAttributes().build());
|
||||
GlobalEntityTypeAttributes.put(SpackenmobsRegistry.ISLAMIST.get(), IslamistEntity.registerAttributes().build());
|
||||
GlobalEntityTypeAttributes.put(SpackenmobsRegistry.JENS.get(), JensEntity.registerAttributes().build());
|
||||
GlobalEntityTypeAttributes.put(SpackenmobsRegistry.MARCELLDAVIS.get(), MarcellDAvisEntity.registerAttributes().build());
|
||||
GlobalEntityTypeAttributes.put(SpackenmobsRegistry.MRBEAN.get(), MrBeanEntity.registerAttributes().build());
|
||||
GlobalEntityTypeAttributes.put(SpackenmobsRegistry.MZTEWOLF.get(), MZTEWolfEntity.registerAttributes().build());
|
||||
GlobalEntityTypeAttributes.put(SpackenmobsRegistry.SCHALKER.get(), SchalkerEntity.registerAttributes().build());
|
||||
GlobalEntityTypeAttributes.put(SpackenmobsRegistry.SMAVA_CREEPER.get(), SmavaCreeperEntity.registerAttributes().build());
|
||||
}
|
||||
|
||||
public static void registerSpawn(List<Spawners> spawns, Spawners entry, Integer weight, Integer min, Integer max, EntityType<? extends LivingEntity> oldEntity, EntityType<? extends LivingEntity> newEntity)
|
||||
|
|
|
@ -27,79 +27,79 @@ public class SpackenmobsRegistry
|
|||
// --- ENTITIES ---
|
||||
// ApoRed
|
||||
public static final RegistryObject<EntityType<ApoRedEntity>> APORED = ENTITIES.register("apored",
|
||||
() -> register("apored", EntityType.Builder.create(ApoRedEntity::new, EntityClassification.MONSTER)
|
||||
.size(0.6F, 1.99F).trackingRange(10)));
|
||||
() -> register("apored", EntityType.Builder.of(ApoRedEntity::new, EntityClassification.MONSTER)
|
||||
.sized(0.6F, 1.99F).clientTrackingRange(10)));
|
||||
public static final RegistryObject<Item> APORED_SPAWN_EGG = ITEMS.register("apored_spawn_egg", () -> new CustomSpawnEggItem(SpackenmobsRegistry.APORED::get, 2039583, 16711680, itemBuilder()));
|
||||
// Baka Mitai Creeper
|
||||
public static final RegistryObject<EntityType<BakaMitaiCreeperEntity>> BAKAMITAI_CREEPER = ENTITIES.register("bakamitai_creeper",
|
||||
() -> register("bakamitai_creeper", EntityType.Builder.create(BakaMitaiCreeperEntity::new, EntityClassification.MONSTER)
|
||||
.size(0.6F, 1.7F).trackingRange(10)));
|
||||
() -> register("bakamitai_creeper", EntityType.Builder.of(BakaMitaiCreeperEntity::new, EntityClassification.MONSTER)
|
||||
.sized(0.6F, 1.7F).clientTrackingRange(10)));
|
||||
public static final RegistryObject<Item> BAKAMITAI_CREEPER_SPAWN_EGG = ITEMS.register("bakamitai_creeper_spawn_egg", () -> new CustomSpawnEggItem(SpackenmobsRegistry.BAKAMITAI_CREEPER::get, 826890, 0, itemBuilder()));
|
||||
// DagiBee
|
||||
public static final RegistryObject<EntityType<DagiBeeEntity>> DAGIBEE = ENTITIES.register("dagibee",
|
||||
() -> register("dagibee", EntityType.Builder.create(DagiBeeEntity::new, EntityClassification.CREATURE)
|
||||
.size(0.6F, 0.6F).trackingRange(10)));
|
||||
// public static final RegistryObject<EntityType<DagiBeeEntity>> DAGIBEE = ENTITIES.register("dagibee",
|
||||
// () -> register("dagibee", EntityType.Builder.of(DagiBeeEntity::new, EntityClassification.CREATURE)
|
||||
// .sized(0.6F, 0.6F).clientTrackingRange(10)));
|
||||
// Drachenlord
|
||||
public static final RegistryObject<EntityType<DrachenlordEntity>> DRACHENLORD = ENTITIES.register("drachenlord",
|
||||
() -> register("drachenlord", EntityType.Builder.create(DrachenlordEntity::new, EntityClassification.MONSTER)
|
||||
.size(0.6F, 1.95F).trackingRange(10)));
|
||||
() -> register("drachenlord", EntityType.Builder.of(DrachenlordEntity::new, EntityClassification.MONSTER)
|
||||
.sized(0.6F, 1.95F).clientTrackingRange(10)));
|
||||
public static final RegistryObject<Item> DRACHENLORD_SPAWN_EGG = ITEMS.register("drachenlord_spawn_egg", () -> new CustomSpawnEggItem(SpackenmobsRegistry.DRACHENLORD::get, 15256745, 8738878, itemBuilder()));
|
||||
// Gisela
|
||||
public static final RegistryObject<EntityType<GiselaEntity>> GISELA = ENTITIES.register("gisela",
|
||||
() -> register("gisela", EntityType.Builder.create(GiselaEntity::new, EntityClassification.CREATURE)
|
||||
.size(0.6F, 1.8F).trackingRange(10)));
|
||||
() -> register("gisela", EntityType.Builder.of(GiselaEntity::new, EntityClassification.CREATURE)
|
||||
.sized(0.6F, 1.8F).clientTrackingRange(10)));
|
||||
public static final RegistryObject<Item> GISELA_SPAWN_EGG = ITEMS.register("gisela_spawn_egg", () -> new CustomSpawnEggItem(SpackenmobsRegistry.GISELA::get, 39835, 16448250, itemBuilder()));
|
||||
// Holzstammhuhn
|
||||
public static final RegistryObject<EntityType<HolzstammhuhnEntity>> HOLZSTAMMHUHN = ENTITIES.register("holzstammhuhn",
|
||||
() -> register("holzstammhuhn", EntityType.Builder.create(HolzstammhuhnEntity::new, EntityClassification.CREATURE)
|
||||
.size(0.4F, 0.7F).trackingRange(10)));
|
||||
() -> register("holzstammhuhn", EntityType.Builder.of(HolzstammhuhnEntity::new, EntityClassification.CREATURE)
|
||||
.sized(0.4F, 0.7F).clientTrackingRange(10)));
|
||||
public static final RegistryObject<Item> HOLZSTAMMHUHN_SPAWN_EGG = ITEMS.register("holzstammhuhn_spawn_egg", () -> new CustomSpawnEggItem(SpackenmobsRegistry.HOLZSTAMMHUHN::get, 12096347, 5295899, itemBuilder()));
|
||||
// Islamist
|
||||
public static final RegistryObject<EntityType<IslamistEntity>> ISLAMIST = ENTITIES.register("islamist",
|
||||
() -> register("islamist", EntityType.Builder.create(IslamistEntity::new, EntityClassification.MONSTER)
|
||||
.size(0.6F, 1.7F).trackingRange(10)));
|
||||
() -> register("islamist", EntityType.Builder.of(IslamistEntity::new, EntityClassification.MONSTER)
|
||||
.sized(0.6F, 1.7F).clientTrackingRange(10)));
|
||||
public static final RegistryObject<Item> ISLAMIST_SPAWN_EGG = ITEMS.register("islamist_spawn_egg", () -> new CustomSpawnEggItem(SpackenmobsRegistry.ISLAMIST::get, 15263976, 15211548, itemBuilder()));
|
||||
// Jens
|
||||
public static final RegistryObject<EntityType<JensEntity>> JENS = ENTITIES.register("jens",
|
||||
() -> register("jens", EntityType.Builder.create(JensEntity::new, EntityClassification.CREATURE)
|
||||
.size(0.6F, 1.8F).trackingRange(10)));
|
||||
() -> register("jens", EntityType.Builder.of(JensEntity::new, EntityClassification.CREATURE)
|
||||
.sized(0.6F, 1.8F).clientTrackingRange(10)));
|
||||
public static final RegistryObject<Item> JENS_SPAWN_EGG = ITEMS.register("jens_spawn_egg", () -> new CustomSpawnEggItem(SpackenmobsRegistry.JENS::get, 6704526, 6767911, itemBuilder()));
|
||||
// Marcell D'Avis
|
||||
public static final RegistryObject<EntityType<MarcellDAvisEntity>> MARCELLDAVIS = ENTITIES.register("marcell_davis",
|
||||
() -> register("marcell_davis", EntityType.Builder.create(MarcellDAvisEntity::new, EntityClassification.MONSTER)
|
||||
.size(0.6F, 1.95F).trackingRange(10)));
|
||||
() -> register("marcell_davis", EntityType.Builder.of(MarcellDAvisEntity::new, EntityClassification.MONSTER)
|
||||
.sized(0.6F, 1.95F).clientTrackingRange(10)));
|
||||
public static final RegistryObject<Item> MARCELLDAVIS_SPAWN_EGG = ITEMS.register("marcell_davis_spawn_egg", () -> new CustomSpawnEggItem(SpackenmobsRegistry.MARCELLDAVIS::get, 15759, 16777215, itemBuilder()));
|
||||
// Mr. Bean
|
||||
public static final RegistryObject<EntityType<MrBeanEntity>> MRBEAN = ENTITIES.register("mr_bean",
|
||||
() -> register("mr_bean", EntityType.Builder.create(MrBeanEntity::new, EntityClassification.MONSTER)
|
||||
.size(0.6F, 1.95F).trackingRange(10)));
|
||||
() -> register("mr_bean", EntityType.Builder.of(MrBeanEntity::new, EntityClassification.MONSTER)
|
||||
.sized(0.6F, 1.95F).clientTrackingRange(10)));
|
||||
public static final RegistryObject<Item> MRBEAN_SPAWN_EGG = ITEMS.register("mr_bean_spawn_egg", () -> new CustomSpawnEggItem(SpackenmobsRegistry.MRBEAN::get, 4802350, 3220238, itemBuilder()));
|
||||
// MZTEWolf
|
||||
public static final RegistryObject<EntityType<MZTEWolfEntity>> MZTEWOLF = ENTITIES.register("mztewolf",
|
||||
() -> register("mztewolf", EntityType.Builder.create(MZTEWolfEntity::new, EntityClassification.CREATURE)
|
||||
.size(0.6F, 0.85F).trackingRange(10)));
|
||||
() -> register("mztewolf", EntityType.Builder.of(MZTEWolfEntity::new, EntityClassification.CREATURE)
|
||||
.sized(0.6F, 0.85F).clientTrackingRange(10)));
|
||||
public static final RegistryObject<Item> MZTEWOLF_SPAWN_EGG = ITEMS.register("mztewolf_spawn_egg", () -> new CustomSpawnEggItem(SpackenmobsRegistry.MZTEWOLF::get, 16711680, 0, itemBuilder()));
|
||||
// Schalker
|
||||
public static final RegistryObject<EntityType<SchalkerEntity>> SCHALKER = ENTITIES.register("schalker",
|
||||
() -> register("schalker", EntityType.Builder.create(SchalkerEntity::new, EntityClassification.MONSTER)
|
||||
.size(1.0F, 1.0F).trackingRange(10)));
|
||||
() -> register("schalker", EntityType.Builder.of(SchalkerEntity::new, EntityClassification.MONSTER)
|
||||
.sized(1.0F, 1.0F).clientTrackingRange(10)));
|
||||
public static final RegistryObject<Item> SCHALKER_SPAWN_EGG = ITEMS.register("schalker_spawn_egg", () -> new CustomSpawnEggItem(SpackenmobsRegistry.SCHALKER::get, 24745, 16777215, itemBuilder()));
|
||||
// Smava Creeper
|
||||
public static final RegistryObject<EntityType<SmavaCreeperEntity>> SMAVA_CREEPER = ENTITIES.register("smava_creeper",
|
||||
() -> register("smava_creeper", EntityType.Builder.create(SmavaCreeperEntity::new, EntityClassification.MONSTER)
|
||||
.size(0.6F, 1.7F).trackingRange(10)));
|
||||
() -> register("smava_creeper", EntityType.Builder.of(SmavaCreeperEntity::new, EntityClassification.MONSTER)
|
||||
.sized(0.6F, 1.7F).clientTrackingRange(10)));
|
||||
public static final RegistryObject<Item> SMAVA_CREEPER_SPAWN_EGG = ITEMS.register("smava_creeper_spawn_egg", () -> new CustomSpawnEggItem(SpackenmobsRegistry.SMAVA_CREEPER::get, 7649828, 11053224, itemBuilder()));
|
||||
// --- ITEMS ---
|
||||
public static final RegistryObject<Item> AHOJ_BRAUSE = ITEMS.register("ahoj_brause", () -> new Item(new Item.Properties().group(SpackenmobsTab.SPACKENMOBS_TAB).food(new Food.Builder().effect(new EffectInstance(Effects.SPEED, 200, 4), 1.0F).setAlwaysEdible().build())));
|
||||
public static final RegistryObject<Item> AHOJ_BRAUSE_DRINK = ITEMS.register("ahoj_brause_drink", () -> new HoneyBottleItem(new HoneyBottleItem.Properties().group(SpackenmobsTab.SPACKENMOBS_TAB).food(new Food.Builder().effect(new EffectInstance(Effects.SPEED, 400, 9), 1.0F).setAlwaysEdible().build())));
|
||||
public static final RegistryObject<Item> AHOJ_BRAUSE = ITEMS.register("ahoj_brause", () -> new Item(new Item.Properties().tab(SpackenmobsTab.SPACKENMOBS_TAB).food(new Food.Builder().effect(new EffectInstance(Effects.MOVEMENT_SPEED, 200, 4), 1.0F).alwaysEat().build())));
|
||||
public static final RegistryObject<Item> AHOJ_BRAUSE_DRINK = ITEMS.register("ahoj_brause_drink", () -> new HoneyBottleItem(new Item.Properties().tab(SpackenmobsTab.SPACKENMOBS_TAB).food(new Food.Builder().effect(new EffectInstance(Effects.MOVEMENT_SPEED, 400, 9), 1.0F).alwaysEat().build())));
|
||||
// Friedrich Liechtenstein
|
||||
public static final RegistryObject<EntityType<FriedrichLiechtensteinEntity>> FRIEDRICH_LIECHTENSTEIN = ENTITIES.register("friedrich",
|
||||
() -> register("friedrich", EntityType.Builder.create(FriedrichLiechtensteinEntity::new, EntityClassification.CREATURE)
|
||||
.size(0.6F, 1.8F).trackingRange(10)));
|
||||
() -> register("friedrich", EntityType.Builder.of(FriedrichLiechtensteinEntity::new, EntityClassification.CREATURE)
|
||||
.sized(0.6F, 1.8F).clientTrackingRange(10)));
|
||||
public static final RegistryObject<Item> FRIEDRICH_LIECHTENSTEIN_SPAWN_EGG = ITEMS.register("friedrich_spawn_egg", () -> new CustomSpawnEggItem(SpackenmobsRegistry.FRIEDRICH_LIECHTENSTEIN::get, 16447728, 15878595, itemBuilder()));
|
||||
public static final RegistryObject<Item> RAM = ITEMS.register("ram", () -> new Item(new Item.Properties().group(SpackenmobsTab.SPACKENMOBS_TAB)));
|
||||
public static final RegistryObject<Item> RAM_ON_A_STICK = ITEMS.register("ram_on_a_stick", () -> new Item(new Item.Properties().maxStackSize(1).group(SpackenmobsTab.SPACKENMOBS_TAB)));
|
||||
public static final RegistryObject<Item> SURSTROEMMING = ITEMS.register("surstroemming", () -> new Item(new Item.Properties().group(SpackenmobsTab.SPACKENMOBS_TAB).food(new Food.Builder().hunger(6).saturation(3).effect(new EffectInstance(Effects.NAUSEA, 200, 0), 1.0F).build())));
|
||||
public static final RegistryObject<Item> RAM = ITEMS.register("ram", () -> new Item(new Item.Properties().tab(SpackenmobsTab.SPACKENMOBS_TAB)));
|
||||
public static final RegistryObject<Item> RAM_ON_A_STICK = ITEMS.register("ram_on_a_stick", () -> new Item(new Item.Properties().stacksTo(1).tab(SpackenmobsTab.SPACKENMOBS_TAB)));
|
||||
public static final RegistryObject<Item> SURSTROEMMING = ITEMS.register("surstroemming", () -> new Item(new Item.Properties().tab(SpackenmobsTab.SPACKENMOBS_TAB).food(new Food.Builder().nutrition(6).saturationMod(3).effect(new EffectInstance(Effects.CONFUSION, 200, 0), 1.0F).build())));
|
||||
// --- SOUND EVENTS ---
|
||||
// Baka Mitai Creeper
|
||||
public static final RegistryObject<SoundEvent> ENTITY_BAKAMITAI_CREEPER_FUSE = SOUND_EVENTS.register("entities.bakamitai_creeper.fuse", () -> createSound("entities.bakamitai_creeper.fuse"));
|
||||
|
@ -171,6 +171,6 @@ public class SpackenmobsRegistry
|
|||
|
||||
private static Item.Properties itemBuilder()
|
||||
{
|
||||
return new Item.Properties().group(SpackenmobsTab.SPACKENMOBS_TAB);
|
||||
return new Item.Properties().tab(SpackenmobsTab.SPACKENMOBS_TAB);
|
||||
}
|
||||
}
|
|
@ -12,7 +12,7 @@ public class SpackenmobsTab
|
|||
public static final ItemGroup SPACKENMOBS_TAB = new ItemGroup(Reference.MOD_ID)
|
||||
{
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public ItemStack createIcon()
|
||||
public ItemStack makeIcon()
|
||||
{
|
||||
return new ItemStack(SpackenmobsRegistry.SURSTROEMMING.get());
|
||||
}
|
||||
|
|
|
@ -57,26 +57,26 @@ public class CustomSpawnEggItem extends Item
|
|||
EGGS.put(type, this);
|
||||
}
|
||||
|
||||
public ActionResultType onItemUse(ItemUseContext context)
|
||||
public ActionResultType useOn(ItemUseContext context)
|
||||
{
|
||||
World worldIn = context.getWorld();
|
||||
if (!worldIn.isRemote)
|
||||
World worldIn = context.getLevel();
|
||||
if (!worldIn.isClientSide)
|
||||
{
|
||||
ItemStack stack = context.getItem();
|
||||
BlockPos pos = context.getPos();
|
||||
Direction dir = context.getFace();
|
||||
ItemStack stack = context.getItemInHand();
|
||||
BlockPos pos = context.getClickedPos();
|
||||
Direction dir = context.getClickedFace();
|
||||
BlockState state = worldIn.getBlockState(pos);
|
||||
Block block = state.getBlock();
|
||||
if (block == Blocks.SPAWNER)
|
||||
{
|
||||
TileEntity tile = worldIn.getTileEntity(pos);
|
||||
TileEntity tile = worldIn.getBlockEntity(pos);
|
||||
if (tile instanceof MobSpawnerTileEntity)
|
||||
{
|
||||
AbstractSpawner spawner = ((MobSpawnerTileEntity) tile).getSpawnerBaseLogic();
|
||||
AbstractSpawner spawner = ((MobSpawnerTileEntity) tile).getSpawner();
|
||||
EntityType<?> type = this.getType(stack.getTag());
|
||||
spawner.setEntityType(type);
|
||||
tile.markDirty();
|
||||
worldIn.notifyBlockUpdate(pos, state, state, 3);
|
||||
spawner.setEntityId(type);
|
||||
tile.setChanged();
|
||||
worldIn.sendBlockUpdated(pos, state, state, 3);
|
||||
stack.shrink(1);
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ public class CustomSpawnEggItem extends Item
|
|||
}
|
||||
else
|
||||
{
|
||||
pos2 = pos.offset(dir);
|
||||
pos2 = pos.relative(dir);
|
||||
}
|
||||
|
||||
EntityType<?> type = this.getType(stack.getTag());
|
||||
|
@ -102,46 +102,46 @@ public class CustomSpawnEggItem extends Item
|
|||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
|
||||
public ActionResult<ItemStack> onItemRightClick(World worldIn, PlayerEntity playerIn, Hand handIn)
|
||||
public ActionResult<ItemStack> use(World worldIn, PlayerEntity playerIn, Hand handIn)
|
||||
{
|
||||
ItemStack itemstack = playerIn.getHeldItem(handIn);
|
||||
BlockRayTraceResult raytraceresult = rayTrace(worldIn, playerIn, RayTraceContext.FluidMode.SOURCE_ONLY);
|
||||
ItemStack itemstack = playerIn.getItemInHand(handIn);
|
||||
BlockRayTraceResult raytraceresult = getPlayerPOVHitResult(worldIn, playerIn, RayTraceContext.FluidMode.SOURCE_ONLY);
|
||||
if (raytraceresult.getType() != RayTraceResult.Type.BLOCK)
|
||||
{
|
||||
return ActionResult.resultPass(itemstack);
|
||||
return ActionResult.pass(itemstack);
|
||||
}
|
||||
else if (worldIn.isRemote)
|
||||
else if (worldIn.isClientSide)
|
||||
{
|
||||
return ActionResult.resultSuccess(itemstack);
|
||||
return ActionResult.success(itemstack);
|
||||
}
|
||||
else
|
||||
{
|
||||
BlockPos blockpos = raytraceresult.getPos();
|
||||
BlockPos blockpos = raytraceresult.getBlockPos();
|
||||
if (!(worldIn.getBlockState(blockpos).getBlock() instanceof FlowingFluidBlock))
|
||||
{
|
||||
return ActionResult.resultPass(itemstack);
|
||||
return ActionResult.pass(itemstack);
|
||||
}
|
||||
else if (worldIn.isBlockModifiable(playerIn, blockpos) && playerIn.canPlayerEdit(blockpos, raytraceresult.getFace(), itemstack))
|
||||
else if (worldIn.mayInteract(playerIn, blockpos) && playerIn.mayUseItemAt(blockpos, raytraceresult.getDirection(), itemstack))
|
||||
{
|
||||
EntityType<?> entitytype = this.getType(itemstack.getTag());
|
||||
if (entitytype.spawn((ServerWorld) worldIn, itemstack, playerIn, blockpos, SpawnReason.SPAWN_EGG, false, false) == null)
|
||||
{
|
||||
return ActionResult.resultPass(itemstack);
|
||||
return ActionResult.pass(itemstack);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!playerIn.abilities.isCreativeMode)
|
||||
if (!playerIn.abilities.instabuild)
|
||||
{
|
||||
itemstack.shrink(1);
|
||||
}
|
||||
|
||||
playerIn.addStat(Stats.ITEM_USED.get(this));
|
||||
return ActionResult.resultSuccess(itemstack);
|
||||
playerIn.awardStat(Stats.ITEM_USED.get(this));
|
||||
return ActionResult.success(itemstack);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return ActionResult.resultFail(itemstack);
|
||||
return ActionResult.fail(itemstack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ public class CustomSpawnEggItem extends Item
|
|||
CompoundNBT lvt_2_1_ = compound.getCompound("EntityTag");
|
||||
if (lvt_2_1_.contains("id", 8))
|
||||
{
|
||||
return EntityType.byKey(lvt_2_1_.getString("id")).orElse(this.typeIn.get());
|
||||
return EntityType.byString(lvt_2_1_.getString("id")).orElse(this.typeIn.get());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue