Skip to content

Commit

Permalink
refactor: Force spaces for indentation absolutely everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
jellysquid3 committed Apr 5, 2020
1 parent 0f99f78 commit de7bd47
Show file tree
Hide file tree
Showing 12 changed files with 119 additions and 117 deletions.
88 changes: 44 additions & 44 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
buildscript {
repositories {
jcenter()
maven {
name = "Fabric"
url = "https://maven.fabricmc.net/"
}
maven {
name = "Forge"
url = "https://files.minecraftforge.net/maven/"
}
maven {
name = "Jitpack"
url 'https://jitpack.io/'
}
}
dependencies {
classpath 'com.github.Chocohead:fabric-loom:e5d69cb'
}
repositories {
jcenter()
maven {
name = "Fabric"
url = "https://maven.fabricmc.net/"
}
maven {
name = "Forge"
url = "https://files.minecraftforge.net/maven/"
}
maven {
name = "Jitpack"
url 'https://jitpack.io/'
}
}
dependencies {
classpath 'com.github.Chocohead:fabric-loom:e5d69cb'
}
}

apply plugin: "fabric-loom"
Expand All @@ -33,64 +33,64 @@ minecraft {
}

repositories {
// Fabric-ASM
maven { url 'https://jitpack.io' }
// Fabric-ASM
maven { url 'https://jitpack.io' }
}

minecraft {
refmapName = "mixins.sodium.refmap.json"
AT = file("src/main/resources/access-transformers.txt")
refmapName = "mixins.sodium.refmap.json"
AT = file("src/main/resources/access-transformers.txt")
}

dependencies {
//to change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modCompile "net.fabricmc:fabric-loader:${project.loader_version}"
//to change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modCompile "net.fabricmc:fabric-loader:${project.loader_version}"

include "com.moandjiezana.toml:toml4j:0.7.2"
compile "com.moandjiezana.toml:toml4j:0.7.2"
include "com.moandjiezana.toml:toml4j:0.7.2"
compile "com.moandjiezana.toml:toml4j:0.7.2"

include "com.github.Chocohead:Fabric-ASM:${project.fabric_asm_version}"
compile "com.github.Chocohead:Fabric-ASM:${project.fabric_asm_version}:dev"
include "com.github.Chocohead:Fabric-ASM:${project.fabric_asm_version}"
compile "com.github.Chocohead:Fabric-ASM:${project.fabric_asm_version}:dev"
}

processResources {
inputs.property "version", project.version
inputs.property "version", project.version

from(sourceSets.main.resources.srcDirs) {
include "fabric.mod.json"
from(sourceSets.main.resources.srcDirs) {
include "fabric.mod.json"

expand "version": project.version
}
expand "version": project.version
}

from(sourceSets.main.resources.srcDirs) {
exclude "fabric.mod.json"
}
from(sourceSets.main.resources.srcDirs) {
exclude "fabric.mod.json"
}
}

// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.encoding = "UTF-8"
}

// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this task, sources will not be generated.
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources"
from sourceSets.main.allSource
classifier = "sources"
from sourceSets.main.allSource
}

jar {
from "LICENSE.txt"
from "LICENSE.txt"
}

task modJar(type: RemappingJar, dependsOn: classes) {
classifier = "mod"
from sourceSets.main.output
classifier = "mod"
from sourceSets.main.output
}

build.dependsOn modJar
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ yarn_mappings=1.15.2+build.14
loader_version=0.7.8+build.189

# Mod Properties
mod_version = 0.1.0
maven_group = me.jellysquid.mods
archives_base_name = sodium
mod_version=0.1.0
maven_group=me.jellysquid.mods
archives_base_name=sodium
28 changes: 14 additions & 14 deletions idea/inspections.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Default" />
<inspection_tool class="CStyleArrayDeclaration" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="EqualsCalledOnEnumConstant" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="FallthruInSwitchStatement" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="MissingOverrideAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
<option name="ignoreObjectMethods" value="false" />
<option name="ignoreAnonymousClassMethods" value="false" />
</inspection_tool>
<inspection_tool class="SizeReplaceableByIsEmpty" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="UnnecessarySemicolon" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="UnqualifiedFieldAccess" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="UnqualifiedMethodAccess" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
<profile version="1.0">
<option name="myName" value="Default"/>
<inspection_tool class="CStyleArrayDeclaration" enabled="true" level="ERROR" enabled_by_default="true"/>
<inspection_tool class="EqualsCalledOnEnumConstant" enabled="true" level="WARNING" enabled_by_default="true"/>
<inspection_tool class="FallthruInSwitchStatement" enabled="true" level="WARNING" enabled_by_default="true"/>
<inspection_tool class="MissingOverrideAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
<option name="ignoreObjectMethods" value="false"/>
<option name="ignoreAnonymousClassMethods" value="false"/>
</inspection_tool>
<inspection_tool class="SizeReplaceableByIsEmpty" enabled="true" level="WARNING" enabled_by_default="true"/>
<inspection_tool class="UnnecessarySemicolon" enabled="true" level="ERROR" enabled_by_default="true"/>
<inspection_tool class="UnqualifiedFieldAccess" enabled="true" level="WARNING" enabled_by_default="true"/>
<inspection_tool class="UnqualifiedMethodAccess" enabled="true" level="WARNING" enabled_by_default="true"/>
</profile>
</component>
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class ChunkSlice implements BlockRenderView, BiomeAccess.Storage {

private final ChunkNibbleArray[] blockLightArrays;
private final ChunkNibbleArray[] skyLightArrays;

private final Map<ColorResolver, ColorizerCache> ourColorCache = new Reference2ReferenceArrayMap<>();
private final BiomeCache biomeCache;

Expand Down Expand Up @@ -154,7 +154,7 @@ public ChunkSlice(World world, ChunkSectionPos chunkPos, WorldChunk[] chunks) {
long seed = this.world.getSeed();

this.lightCache = new LightDataCache(this, minX, minY, minZ, BLOCK_LENGTH, BLOCK_LENGTH, BLOCK_LENGTH);
this.biomeCache = new BiomeCache( this, type, seed);
this.biomeCache = new BiomeCache(this, type, seed);
}

private ColorizerCache getColorizerCache(ColorResolver resolver) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
public interface Matrix3fExtended {
/**
* Applies the specified rotation to this matrix in-place.
*
* @param quaternion The quaternion to rotate this matrix by
*/
void rotate(Quaternion quaternion);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
public interface Matrix4fExtended {
/**
* Applies the specified rotation to this matrix in-place.
*
* @param quaternion The quaternion to rotate this matrix by
*/
void rotate(Quaternion quaternion);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ public boolean render(ChunkMeshInfo.Builder meshInfo, ChunkSlice world, BlockPos
Sprite[] sprites = lava ? this.lavaSprites : this.waterSprites;
int color = lava ? 0xFFFFFF : BiomeColors.getWaterColor(world, pos);

float baseRed = (float)(color >> 16 & 255) / 255.0F;
float baseGreen = (float)(color >> 8 & 255) / 255.0F;
float baseBlue = (float)(color & 255) / 255.0F;
float baseRed = (float) (color >> 16 & 255) / 255.0F;
float baseGreen = (float) (color >> 8 & 255) / 255.0F;
float baseBlue = (float) (color & 255) / 255.0F;

boolean rendered = false;

Expand Down Expand Up @@ -130,7 +130,7 @@ public boolean render(ChunkMeshInfo.Builder meshInfo, ChunkSlice world, BlockPos
float_21 = float_15;
} else {
Sprite sprite = sprites[1];
float float_22 = (float) MathHelper.atan2(velocity.z, velocity.x) - ((float)Math.PI / 2F);
float float_22 = (float) MathHelper.atan2(velocity.z, velocity.x) - ((float) Math.PI / 2F);
float float_23 = MathHelper.sin(float_22) * 0.25F;
float float_24 = MathHelper.cos(float_22) * 0.25F;
float_14 = sprite.getFrameU(8.0F + (-float_24 - float_23) * 16.0F);
Expand All @@ -145,8 +145,8 @@ public boolean render(ChunkMeshInfo.Builder meshInfo, ChunkSlice world, BlockPos

float float_34 = (float_14 + float_16 + float_18 + float_20) / 4.0F;
float float_35 = (float_15 + float_17 + float_19 + float_21) / 4.0F;
float float_36 = (float)sprites[0].getWidth() / (sprites[0].getMaxU() - sprites[0].getMinU());
float float_37 = (float)sprites[0].getHeight() / (sprites[0].getMaxV() - sprites[0].getMinV());
float float_36 = (float) sprites[0].getWidth() / (sprites[0].getMaxU() - sprites[0].getMinU());
float float_37 = (float) sprites[0].getHeight() / (sprites[0].getMaxV() - sprites[0].getMinV());
float float_38 = 4.0F / Math.max(float_37, float_36);

float_14 = MathHelper.lerp(float_38, float_14, float_34);
Expand All @@ -162,16 +162,16 @@ public boolean render(ChunkMeshInfo.Builder meshInfo, ChunkSlice world, BlockPos
float r = 1.0F * baseRed;
float g = 1.0F * baseGreen;
float b = 1.0F * baseBlue;
this.vertex(builder, x + 0.0D, y + (double)h1, z + 0.0D, r, g, b, float_14, float_15, light);
this.vertex(builder, x + 0.0D, y + (double)h2, z + 1.0D, r, g, b, float_16, float_17, light);
this.vertex(builder, x + 1.0D, y + (double)h3, z + 1.0D, r, g, b, float_18, float_19, light);
this.vertex(builder, x + 1.0D, y + (double)h4, z + 0.0D, r, g, b, float_20, float_21, light);
this.vertex(builder, x + 0.0D, y + (double) h1, z + 0.0D, r, g, b, float_14, float_15, light);
this.vertex(builder, x + 0.0D, y + (double) h2, z + 1.0D, r, g, b, float_16, float_17, light);
this.vertex(builder, x + 1.0D, y + (double) h3, z + 1.0D, r, g, b, float_18, float_19, light);
this.vertex(builder, x + 1.0D, y + (double) h4, z + 0.0D, r, g, b, float_20, float_21, light);

if (fluidState.method_15756(world, this.scratchPos.set(posX, posY + 1, posZ))) {
this.vertex(builder, x + 0.0D, y + (double)h1, z + 0.0D, r, g, b, float_14, float_15, light);
this.vertex(builder, x + 1.0D, y + (double)h4, z + 0.0D, r, g, b, float_20, float_21, light);
this.vertex(builder, x + 1.0D, y + (double)h3, z + 1.0D, r, g, b, float_18, float_19, light);
this.vertex(builder, x + 0.0D, y + (double)h2, z + 1.0D, r, g, b, float_16, float_17, light);
this.vertex(builder, x + 0.0D, y + (double) h1, z + 0.0D, r, g, b, float_14, float_15, light);
this.vertex(builder, x + 1.0D, y + (double) h4, z + 0.0D, r, g, b, float_20, float_21, light);
this.vertex(builder, x + 1.0D, y + (double) h3, z + 1.0D, r, g, b, float_18, float_19, light);
this.vertex(builder, x + 0.0D, y + (double) h2, z + 1.0D, r, g, b, float_16, float_17, light);
}
}

Expand All @@ -191,7 +191,7 @@ public boolean render(ChunkMeshInfo.Builder meshInfo, ChunkSlice world, BlockPos
rendered = true;
}

for(int i = 0; i < 4; ++i) {
for (int i = 0; i < 4; ++i) {
float float_49;
float float_50;
double double_4;
Expand All @@ -205,33 +205,33 @@ public boolean render(ChunkMeshInfo.Builder meshInfo, ChunkSlice world, BlockPos
float_50 = h4;
double_4 = x;
double_5 = x + 1.0D;
double_6 = z + (double)0.001F;
double_7 = z + (double)0.001F;
double_6 = z + (double) 0.001F;
double_7 = z + (double) 0.001F;
dir = Direction.NORTH;
boolean_9 = sfNorth;
} else if (i == 1) {
float_49 = h3;
float_50 = h2;
double_4 = x + 1.0D;
double_5 = x;
double_6 = z + 1.0D - (double)0.001F;
double_7 = z + 1.0D - (double)0.001F;
double_6 = z + 1.0D - (double) 0.001F;
double_7 = z + 1.0D - (double) 0.001F;
dir = Direction.SOUTH;
boolean_9 = sfSouth;
} else if (i == 2) {
float_49 = h2;
float_50 = h1;
double_4 = x + (double)0.001F;
double_5 = x + (double)0.001F;
double_4 = x + (double) 0.001F;
double_5 = x + (double) 0.001F;
double_6 = z + 1.0D;
double_7 = z;
dir = Direction.WEST;
boolean_9 = sfWest;
} else {
float_49 = h4;
float_50 = h3;
double_4 = x + 1.0D - (double)0.001F;
double_5 = x + 1.0D - (double)0.001F;
double_4 = x + 1.0D - (double) 0.001F;
double_5 = x + 1.0D - (double) 0.001F;
double_6 = z;
double_7 = z + 1.0D;
dir = Direction.EAST;
Expand Down Expand Up @@ -269,16 +269,16 @@ public boolean render(ChunkMeshInfo.Builder meshInfo, ChunkSlice world, BlockPos
float g = 1.0F * float_62 * baseGreen;
float b = 1.0F * float_62 * baseBlue;

this.vertex(builder, double_4, y + (double)float_49, double_6, r, g, b, float_57, float_59, light);
this.vertex(builder, double_5, y + (double)float_50, double_7, r, g, b, float_58, float_60, light);
this.vertex(builder, double_4, y + (double) float_49, double_6, r, g, b, float_57, float_59, light);
this.vertex(builder, double_5, y + (double) float_50, double_7, r, g, b, float_58, float_60, light);
this.vertex(builder, double_5, y + float_13, double_7, r, g, b, float_58, float_61, light);
this.vertex(builder, double_4, y + float_13, double_6, r, g, b, float_57, float_61, light);

if (sprite != this.waterOverlaySprite) {
this.vertex(builder, double_4, y + float_13, double_6, r, g, b, float_57, float_61, light);
this.vertex(builder, double_5, y + float_13, double_7, r, g, b, float_58, float_61, light);
this.vertex(builder, double_5, y + (double)float_50, double_7, r, g, b, float_58, float_60, light);
this.vertex(builder, double_4, y + (double)float_49, double_6, r, g, b, float_57, float_59, light);
this.vertex(builder, double_5, y + (double) float_50, double_7, r, g, b, float_58, float_60, light);
this.vertex(builder, double_4, y + (double) float_49, double_6, r, g, b, float_57, float_59, light);
}
}
}
Expand Down Expand Up @@ -309,7 +309,7 @@ private float getNorthWestCornerFluidHeight(ChunkSlice world, int x, int y, int
int int_1 = 0;
float float_1 = 0.0F;

for(int i = 0; i < 4; ++i) {
for (int i = 0; i < 4; ++i) {
int x2 = x - (i & 1);
int z2 = z - (i >> 1 & 1);

Expand All @@ -335,6 +335,6 @@ private float getNorthWestCornerFluidHeight(ChunkSlice world, int x, int y, int
}
}

return float_1 / (float)int_1;
return float_1 / (float) int_1;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ public interface DirectVertexConsumer extends BufferVertexConsumer {
* Writes a vertex directly into the consumer with no additional processing. This requires callers to do some
* upfront work to encode their values.
*
* @param x The x-position of the vertex
* @param y The y-position of the vertex
* @param z The z-position of the vertex
* @param u The u-position of the texture
* @param v The v-position of the texture
* @param color The color of the vertex in little-endian RGBA format
* @param light The light of the vertex
* @param x The x-position of the vertex
* @param y The y-position of the vertex
* @param z The z-position of the vertex
* @param u The u-position of the texture
* @param v The v-position of the texture
* @param color The color of the vertex in little-endian RGBA format
* @param light The light of the vertex
*/
void vertexParticle(float x, float y, float z, float u, float v, int color, int light);

Expand Down
Loading

0 comments on commit de7bd47

Please sign in to comment.