Skip to content
This repository has been archived by the owner on Dec 16, 2023. It is now read-only.

Commit

Permalink
Fix code formatting - add additional spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
percivalalb committed Oct 4, 2020
1 parent 343eb52 commit e1f2afb
Show file tree
Hide file tree
Showing 76 changed files with 326 additions and 326 deletions.
6 changes: 3 additions & 3 deletions src/api/java/doggytalents/api/feature/EnumGender.java
Expand Up @@ -66,15 +66,15 @@ public boolean canMateWith(EnumGender gender) {
}

public static EnumGender byIndex(int i) {
if(i < 0 | i >= VALUES.length) {
if (i < 0 | i >= VALUES.length) {
i = EnumGender.UNISEX.getIndex();
}
return VALUES[i];
}

public static EnumGender bySaveName(String saveName) {
for(EnumGender gender : EnumGender.values()) {
if(gender.getSaveName().equals(saveName)) {
for (EnumGender gender : EnumGender.values()) {
if (gender.getSaveName().equals(saveName)) {
return gender;
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/api/java/doggytalents/api/feature/EnumMode.java
Expand Up @@ -69,30 +69,30 @@ public void onModeSet(AbstractDogEntity dog, EnumMode prev) {

public EnumMode previousMode() {
int i = this.getIndex() - 1;
if(i < 0) {
if (i < 0) {
i = VALUES.length - 1;
}
return VALUES[i];
}

public EnumMode nextMode() {
int i = this.getIndex() + 1;
if(i >= VALUES.length) {
if (i >= VALUES.length) {
i = 0;
}
return VALUES[i];
}

public static EnumMode byIndex(int i) {
if(i < 0 || i >= VALUES.length) {
if (i < 0 || i >= VALUES.length) {
i = EnumMode.DOCILE.getIndex();
}
return VALUES[i];
}

public static EnumMode bySaveName(String saveName) {
for(EnumMode gender : EnumMode.values()) {
if(gender.saveName.equals(saveName)) {
for (EnumMode gender : EnumMode.values()) {
if (gender.saveName.equals(saveName)) {
return gender;
}
}
Expand Down
Expand Up @@ -37,7 +37,7 @@ public void setAttributeModifier(IAttribute attribute, UUID modifierUUID, BiFunc
AttributeModifier currentModifier = attributeInst.getModifier(modifierUUID);

// Remove modifier if it exists
if(currentModifier != null) {
if (currentModifier != null) {

// Use UUID version as it is more efficient since
// getModifier would need to be called again
Expand Down
2 changes: 1 addition & 1 deletion src/api/java/doggytalents/api/registry/Accessory.java
Expand Up @@ -32,7 +32,7 @@ public Accessory(Supplier<? extends AccessoryType> typeIn, Supplier<? extends II
}

public String getTranslationKey() {
if(this.translationKey == null) {
if (this.translationKey == null) {
this.translationKey = Util.makeTranslationKey("accessory", DoggyTalentsAPI.ACCESSORIES.getKey(this));
}
return this.translationKey;
Expand Down
2 changes: 1 addition & 1 deletion src/api/java/doggytalents/api/registry/AccessoryType.java
Expand Up @@ -16,7 +16,7 @@ public int numberToPutOn() {
}

public String getTranslationKey() {
if(this.translationKey == null) {
if (this.translationKey == null) {
this.translationKey = Util.makeTranslationKey("accessory_type", DoggyTalentsAPI.ACCESSORY_TYPE.getKey(this));
}
return this.translationKey;
Expand Down
4 changes: 2 additions & 2 deletions src/api/java/doggytalents/api/registry/Talent.java
Expand Up @@ -44,14 +44,14 @@ public int getCummulativeCost(int level) {
}

public String getTranslationKey() {
if(this.translationKey == null) {
if (this.translationKey == null) {
this.translationKey = Util.makeTranslationKey("talent", DoggyTalentsAPI.TALENTS.getKey(this));
}
return this.translationKey;
}

public String getInfoTranslationKey() {
if(this.translationInfoKey == null) {
if (this.translationInfoKey == null) {
this.translationInfoKey = this.getTranslationKey() + ".description";
}
return this.translationInfoKey;
Expand Down
Expand Up @@ -19,7 +19,7 @@ public class DogBedItemOverride extends ItemOverrideList {

@Override
public IBakedModel getModelWithOverrides(IBakedModel modelOriginal, ItemStack stack, World world, LivingEntity entity) {
if(modelOriginal instanceof DogBedModel) {
if (modelOriginal instanceof DogBedModel) {
Pair<ICasingMaterial, IBeddingMaterial> materials = DogBedUtil.getMaterials(stack);
return ((DogBedModel) modelOriginal).getModelVariant(materials.getLeft(), materials.getRight(), Direction.NORTH);
}
Expand Down
Expand Up @@ -94,12 +94,12 @@ public IModelData getModelData(@Nonnull ILightReader world, @Nonnull BlockPos po
Direction facing = null;

TileEntity tile = world.getTileEntity(pos);
if(tile instanceof DogBedTileEntity) {
if (tile instanceof DogBedTileEntity) {
casing = ((DogBedTileEntity) tile).getCasing();
bedding = ((DogBedTileEntity) tile).getBedding();
}

if(state.has(DogBedBlock.FACING)) {
if (state.has(DogBedBlock.FACING)) {
facing = state.get(DogBedBlock.FACING);
}

Expand Down
Expand Up @@ -27,8 +27,8 @@ public Iterable<ModelRenderer> getParts() {

@Override
public void setLivingAnimations(DogEntity dogIn, float limbSwing, float limbSwingAmount, float partialTickTime) {
if(dogIn.isSitting()) {
if(dogIn.isLying()) {
if (dogIn.isSitting()) {
if (dogIn.isLying()) {
this.rightChest.setRotationPoint(0.0F, 20.0F, 2.0F);
this.rightChest.rotateAngleX = ((float)Math.PI / 2F);
this.leftChest.setRotationPoint(0.0F, 20.0F, 2.0F);
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/doggytalents/client/entity/model/DogModel.java
Expand Up @@ -99,8 +99,8 @@ protected Iterable<ModelRenderer> getBodyParts() {
public void setLivingAnimations(T dog, float limbSwing, float limbSwingAmount, float partialTickTime) {
this.tail.rotateAngleY = dog.getWagAngle(limbSwing, limbSwingAmount, partialTickTime);

if(dog.isSitting()) {
if(dog.isLying()) {
if (dog.isSitting()) {
if (dog.isLying()) {
this.head.setRotationPoint(-1, 19.5F, -7);
this.body.setRotationPoint(0, 20, 2);
this.body.rotateAngleX = (float)Math.PI / 2F;
Expand Down Expand Up @@ -135,7 +135,7 @@ public void setLivingAnimations(T dog, float limbSwing, float limbSwingAmount, f
// this.legFrontRight.rotateAngleY = (float)Math.PI / 10;
// this.legFrontLeft.rotateAngleX = -(float)Math.PI / 2;
// this.legFrontLeft.rotateAngleY = -(float)Math.PI / 10;
} else if(dog.isLying() && false) {
} else if (dog.isLying() && false) {
this.body.setRotationPoint(0.0F, 19.0F, 2.0F);
this.body.rotateAngleX = ((float)Math.PI / 2F);
this.mane.setRotationPoint(-1.0F, 19.0F, -3.0F);
Expand Down
Expand Up @@ -44,7 +44,7 @@ public void render(DogEntity entityIn, float entityYaw, float partialTicks, Matr
if (this.canRenderName(entityIn)) {

double d0 = this.renderManager.squareDistanceTo(entityIn);
if(d0 <= 64 * 64) {
if (d0 <= 64 * 64) {
String tip = entityIn.getMode().getTip();
String label = String.format(ConfigValues.DOG_GENDER ? "%s(%d)%s" : "%s(%d)",
new TranslationTextComponent(tip).getFormattedText(),
Expand All @@ -53,7 +53,7 @@ public void render(DogEntity entityIn, float entityYaw, float partialTicks, Matr

RenderUtil.renderLabelWithScale(entityIn, this, label, matrixStackIn, bufferIn, packedLightIn, 0.01F, 0.12F);

if(d0 <= 5 * 5 && this.renderManager.info.getRenderViewEntity().isSneaking()) {
if (d0 <= 5 * 5 && this.renderManager.info.getRenderViewEntity().isSneaking()) {
RenderUtil.renderLabelWithScale(entityIn, this, entityIn.getOwnersName().orElseGet(() -> this.getNameUnknown(entityIn)), matrixStackIn, bufferIn, packedLightIn, 0.01F, -0.25F);
}
}
Expand Down
Expand Up @@ -20,11 +20,11 @@ public BoneLayer(DogRenderer dogRendererIn) {

@Override
public void render(MatrixStack matrixStack, IRenderTypeBuffer bufferSource, int packedLight, DogEntity dog, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) {
if(dog.hasBone()) {
if (dog.hasBone()) {

matrixStack.push();
DogModel model = this.getEntityModel();
if(model.isChild) {
if (model.isChild) {
// derived from AgeableModel head offset
matrixStack.translate(0.0F, 5.0F / 16.0F, 2.0F / 16.0F);
}
Expand Down
Expand Up @@ -20,7 +20,7 @@ public PackPuppyRenderer() {

@Override
public void render(LayerRenderer<DogEntity, EntityModel<DogEntity>> layer, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int packedLightIn, DogEntity dog, int level, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) {
if(!dog.isInvisible()) {
if (!dog.isInvisible()) {
layer.getEntityModel().copyModelAttributesTo(this.model);
this.model.setLivingAnimations(dog, limbSwing, limbSwingAmount, partialTicks);
this.model.setRotationAngles(dog, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch);
Expand Down
Expand Up @@ -21,7 +21,7 @@ public RescueDogRenderer() {
@Override
public void render(LayerRenderer<DogEntity, EntityModel<DogEntity>> layer, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int packedLightIn, DogEntity dog, int level, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) {

if(!dog.isInvisible() && level >= 5) {
if (!dog.isInvisible() && level >= 5) {
layer.getEntityModel().copyModelAttributesTo(this.model);
this.model.setLivingAnimations(dog, limbSwing, limbSwingAmount, partialTicks);
this.model.setRotationAngles(dog, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch);
Expand Down
Expand Up @@ -24,7 +24,7 @@ public ArmorAccessoryRenderer(ResourceLocation textureIn) {

@Override
public void render(LayerRenderer<DogEntity, EntityModel<DogEntity>> layer, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int packedLightIn, DogEntity dog, AccessoryInstance data, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) {
if(dog.isTamed() && !dog.isInvisible()) {
if (dog.isTamed() && !dog.isInvisible()) {
//ArmorAccessoryInstance armorInstance = data.cast(ArmorAccessoryInstance.class);
layer.getEntityModel().copyModelAttributesTo(this.model);
this.model.setLivingAnimations(dog, limbSwing, limbSwingAmount, partialTicks);
Expand Down
Expand Up @@ -21,7 +21,7 @@ public DefaultAccessoryRenderer(ResourceLocation textureIn) {

@Override
public void render(LayerRenderer<DogEntity, EntityModel<DogEntity>> layer, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int packedLightIn, DogEntity dog, AccessoryInstance data, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) {
if(dog.isTamed() && !dog.isInvisible()) {
if (dog.isTamed() && !dog.isInvisible()) {
LayerRenderer.renderCutoutModel(layer.getEntityModel(), this.getTexture(dog, data), matrixStackIn, bufferIn, packedLightIn, dog, 1.0f, 1.0f, 1.0f);
}
}
Expand Down
Expand Up @@ -21,7 +21,7 @@ public DyeableAccessoryRenderer(ResourceLocation textureIn) {

@Override
public void render(LayerRenderer<DogEntity, EntityModel<DogEntity>> layer, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int packedLightIn, DogEntity dog, AccessoryInstance data, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) {
if(dog.isTamed() && !dog.isInvisible()) {
if (dog.isTamed() && !dog.isInvisible()) {
float[] color = data.cast(DyeableAccessoryInstance.class).getFloatArray();

LayerRenderer.renderCutoutModel(layer.getEntityModel(), this.getTexture(dog, data), matrixStackIn, bufferIn, packedLightIn, dog, color[0], color[1], color[2]);
Expand Down
Expand Up @@ -24,7 +24,7 @@ public LeatherArmorAccessoryRenderer(ResourceLocation textureIn) {

@Override
public void render(LayerRenderer<DogEntity, EntityModel<DogEntity>> layer, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int packedLightIn, DogEntity dog, AccessoryInstance data, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) {
if(dog.isTamed() && !dog.isInvisible()) {
if (dog.isTamed() && !dog.isInvisible()) {
float[] color = data.cast(DyeableAccessoryInstance.class).getFloatArray();

layer.getEntityModel().copyModelAttributesTo(this.model);
Expand Down
Expand Up @@ -26,16 +26,16 @@ public class BedFinderRenderer {

public static void onWorldRenderLast(RenderWorldLastEvent event) {
PlayerEntity player = Minecraft.getInstance().player;
for(Entity passenger : player.getPassengers()) {
if(passenger instanceof DogEntity) {
for (Entity passenger : player.getPassengers()) {
if (passenger instanceof DogEntity) {
DogEntity dog = (DogEntity) passenger;
Optional<BlockPos> bedPosOpt = dog.getBedPos(player.dimension);

if (bedPosOpt.isPresent()) {
BlockPos bedPos = bedPosOpt.get();
int level = dog.getLevel(DoggyTalents.BED_FINDER.get());
double distance = (level * 200D) - Math.sqrt(bedPos.distanceSq(dog.getPosition()));
if(level == 5 || distance >= 0.0D) {
if (level == 5 || distance >= 0.0D) {
MatrixStack stack = event.getMatrixStack();

AxisAlignedBB boundingBox = new AxisAlignedBB(bedPos).grow(0.5D);
Expand Down
Expand Up @@ -207,7 +207,7 @@ public void drawSelectionBox(MatrixStack matrixStackIn, PlayerEntity player, flo

@SubscribeEvent
public void onPreRenderGameOverlay(final RenderGameOverlayEvent.Post event) {
label: if(event.getType() == RenderGameOverlayEvent.ElementType.HEALTHMOUNT) {
label: if (event.getType() == RenderGameOverlayEvent.ElementType.HEALTHMOUNT) {
Minecraft mc = Minecraft.getInstance();

if (mc.player == null || !(mc.player.getRidingEntity() instanceof DogEntity)) {
Expand Down Expand Up @@ -251,7 +251,7 @@ public void onPreRenderGameOverlay(final RenderGameOverlayEvent.Post event) {
int l6 = dog.getAir();
int j7 = dog.getMaxAir();

if(dog.areEyesInFluid(FluidTags.WATER) || l6 < j7) {
if (dog.areEyesInFluid(FluidTags.WATER) || l6 < j7) {
int air = dog.getAir();
int full = MathHelper.ceil((air - 2) * 10.0D / 300.0D);
int partial = MathHelper.ceil(air * 10.0D / 300.0D) - full;
Expand Down

0 comments on commit e1f2afb

Please sign in to comment.