Skip to content

Commit

Permalink
Fixed some Serval issues
Browse files Browse the repository at this point in the history
  • Loading branch information
GirafiStudios committed Mar 18, 2021
1 parent e7ff13f commit 2598971
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 23 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '4.1.+', changing: true
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '4.1.+', changing: false
}
}
apply plugin: 'net.minecraftforge.gradle'
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
minecraft_version=1.16.5
forge_version=36.0.58
forge_version=36.1.1
mappings=20201028-1.16.3
mod_version=2.2.0
jei_version=7.6.1.65
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,23 @@ public ServalModel(float size) {
textureHeight = 32;

body = new ModelRenderer(this);
body.setRotationPoint(0.0F, 17.0F, 1.0F);
body.setTextureOffset(50, 21).addBox(2.0F, -5.0F, -8.0F, 1.0F, 5.0F, 6.0F, size, false);
body.setTextureOffset(50, 10).addBox(-3.0F, -5.0F, -8.0F, 1.0F, 5.0F, 6.0F, size, false);
body.setTextureOffset(26, 25).addBox(-3.0F, -6.0F, -8.0F, 6.0F, 1.0F, 6.0F, size, false);
body.setTextureOffset(54, 6).addBox(-1.9F, -2.0F, -9.0F, 4.0F, 3.0F, 1.0F, size, false);

body_r1 = new ModelRenderer(this);
body_r1.setRotationPoint(0.0F, 7.0F, -1.0F);
this.body.addChild(body_r1);
setRotationAngle(body_r1, 1.5708F, 0.0F, 0.0F);
body_r1.setTextureOffset(20, 0).addBox(-2.0F, -7.0F, 6.0F, 4.0F, 16.0F, 6.0F, size, false);

head = new ModelRenderer(this);
head.setRotationPoint(0.0F, 13.0F, -9.0F);
head.setTextureOffset(0, 0).addBox(-2.5F, -2.0F, -3.0F, 5.0F, 4.0F, 5.0F, size, false);
head.setTextureOffset(0, 28).addBox(-1.5F, -0.0156F, -4.0F, 3.0F, 2.0F, 2.0F, size, false);
head.setTextureOffset(26, 22).addBox(-2.0F, -6.0F, -1.0F, 1.0F, 4.0F, 2.0F, size, false);
head.setTextureOffset(20, 22).addBox(1.0F, -6.0F, -1.0F, 1.0F, 4.0F, 2.0F, size, false);

tail = new ModelRenderer(this);
tail.setRotationPoint(0.0F, 15.0F, 8.0F);

tail_r1 = new ModelRenderer(this);
tail_r1.setRotationPoint(0.0F, 9.0F, -8.0F);
Expand All @@ -59,19 +55,15 @@ public ServalModel(float size) {
tail_r1.setTextureOffset(0, 15).addBox(-0.5F, -5.0F, 13.0F, 1.0F, 11.0F, 1.0F, size, false);

backLeftLeg = new ModelRenderer(this);
backLeftLeg.setRotationPoint(1.1F, 18.0F, 7.0F);
backLeftLeg.setTextureOffset(8, 13).addBox(-1.0F, 0.0F, -1.0F, 2.0F, 6.0F, 2.0F, size, false);

backRightLeg = new ModelRenderer(this);
backRightLeg.setRotationPoint(-1.1F, 18.0F, 7.0F);
backRightLeg.setTextureOffset(8, 13).addBox(-1.0F, 0.0F, -1.0F, 2.0F, 6.0F, 2.0F, size, false);

frontLeftLeg = new ModelRenderer(this);
frontLeftLeg.setRotationPoint(1.2F, 14.0F, -4.0F);
frontLeftLeg.setTextureOffset(40, 0).addBox(-1.0F, -0.2F, -1.0F, 2.0F, 10.0F, 2.0F, size, false);

frontRightLeg = new ModelRenderer(this);
frontRightLeg.setRotationPoint(-1.2F, 14.0F, -4.0F);
frontRightLeg.setTextureOffset(40, 0).addBox(-1.0F, -0.2F, -1.0F, 2.0F, 10.0F, 2.0F, size, false);
}

Expand Down Expand Up @@ -115,9 +107,9 @@ public void setLivingAnimations(T entity, float limbSwing, float limbSwingAmount

this.baseLivingAnimations(entity, limbSwing, limbSwingAmount, partialTick);
if (entity.isEntitySleeping()) {
this.body.rotateAngleX = ((float) Math.PI / 4F);
this.body.rotationPointY += -4.0F;
this.body.rotationPointZ += 5.0F;
this.body.rotateAngleX = ((float) Math.PI / -4F);
this.body.rotationPointY += 2.0F;
this.body.rotationPointZ += -4.0F;
this.head.rotationPointY += -3.3F;
++this.head.rotationPointZ;
this.tail.rotationPointY += 8.0F;
Expand All @@ -140,6 +132,14 @@ public void setLivingAnimations(T entity, float limbSwing, float limbSwingAmount
}

public void baseLivingAnimations(T entity, float limbSwing, float limbSwingAmount, float partialTick) {
body.setRotationPoint(0.0F, 17.0F, 1.0F);
body_r1.setRotationPoint(0.0F, 7.0F, -1.0F);
head.setRotationPoint(0.0F, 13.0F, -9.0F);
tail.setRotationPoint(0.0F, 15.0F, 8.0F);
backLeftLeg.setRotationPoint(1.1F, 18.0F, 7.0F);
backRightLeg.setRotationPoint(-1.1F, 18.0F, 7.0F);
frontLeftLeg.setRotationPoint(1.2F, 14.0F, -4.0F);
frontRightLeg.setRotationPoint(-1.2F, 14.0F, -4.0F);
this.tail.rotateAngleX = 0.9F;
if (entity.isCrouching()) {
++this.body.rotationPointY;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,5 @@ protected void applyRotations(@Nonnull ServalEntity serval, @Nonnull MatrixStack
}
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ public class ServalEntity extends CatEntity {
private static final Ingredient BREEDING_ITEMS = Ingredient.fromItems(AtumItems.SKELETAL_FISH);
private TemptGoal temptGoal;
public static final Map<Integer, ResourceLocation> SERVAL_TEXTURE_BY_ID = Util.make(Maps.newHashMap(), (m) -> {
m.put(1, new ResourceLocation(Atum.MOD_ID, "textures/entity/serval/black.png"));
m.put(2, new ResourceLocation(Atum.MOD_ID, "textures/entity/serval/white.png"));
m.put(3, new ResourceLocation(Atum.MOD_ID, "textures/entity/serval/white_spotted.png"));
m.put(4, new ResourceLocation(Atum.MOD_ID, "textures/entity/serval/beige.png"));
m.put(5, new ResourceLocation(Atum.MOD_ID, "textures/entity/serval/beige_spotted.png"));
m.put(0, new ResourceLocation(Atum.MOD_ID, "textures/entity/serval/black.png"));
m.put(1, new ResourceLocation(Atum.MOD_ID, "textures/entity/serval/white.png"));
m.put(2, new ResourceLocation(Atum.MOD_ID, "textures/entity/serval/white_spotted.png"));
m.put(3, new ResourceLocation(Atum.MOD_ID, "textures/entity/serval/beige.png"));
m.put(4, new ResourceLocation(Atum.MOD_ID, "textures/entity/serval/beige_spotted.png"));
});

public ServalEntity(EntityType<? extends CatEntity> type, World world) {
Expand Down Expand Up @@ -95,11 +95,11 @@ public void tick() {
@Override
public CatEntity func_241840_a(@Nonnull ServerWorld serverWorld, @Nonnull AgeableEntity ageableEntity) {
ServalEntity serval = AtumEntities.SERVAL.create(serverWorld);
if (ageableEntity instanceof ServalEntity) {
if (serval != null && ageableEntity instanceof ServalEntity) {
if (this.rand.nextBoolean()) {
serval.setCatType(this.getCatType());
} else {
serval.setCatType(((CatEntity)ageableEntity).getCatType());
serval.setCatType(((ServalEntity) ageableEntity).getCatType());
}

if (this.isTamed()) {
Expand All @@ -108,7 +108,7 @@ public CatEntity func_241840_a(@Nonnull ServerWorld serverWorld, @Nonnull Ageabl
if (this.rand.nextBoolean()) {
serval.setCollarColor(this.getCollarColor());
} else {
serval.setCollarColor(((CatEntity)ageableEntity).getCollarColor());
serval.setCollarColor(((ServalEntity) ageableEntity).getCollarColor());
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ license="All Rights Reserved"
[[dependencies.atum]]
modId="forge"
mandatory=true
versionRange="[36.0.43,)"
versionRange="[36.1,)"
ordering="AFTER"
side="BOTH"

Expand Down

0 comments on commit 2598971

Please sign in to comment.