Fix else formatting

This commit is contained in:
Jozsef 2021-06-30 13:03:02 -07:00
parent 6817ddec45
commit 8bf0b31039
21 changed files with 31 additions and 60 deletions

View file

@ -16,6 +16,7 @@ indent_size = 2
[*.java]
indent_style = tab
ij_java_else_on_new_line = false
ij_continuation_indent_size = 8
ij_java_class_count_to_use_import_on_demand = 99
ij_java_names_count_to_use_import_on_demand = 99

View file

@ -1,14 +1,11 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
# mod version info
mod_version=0.0.3
mc_update_version=1.16
minecraft_version=1.16.5
forge_version=36.0.42
mcp_mappings=20200920-mixed-1.16.3
projectId=486392
curse_type=beta
github_project=Jozufozu/Flywheel

View file

@ -45,8 +45,7 @@ public class OptifineHandler {
if (optifine == null) {
Backend.log.info("Optifine not detected.");
}
else {
} else {
Backend.log.info("Optifine detected.");
refresh();

View file

@ -207,8 +207,7 @@ public class ShaderSources implements ISelectiveResourceReloadListener {
while (filechannel.read(bytebuffer) != -1) {
}
}
else {
} else {
bytebuffer = MemoryUtil.memAlloc(8192);
ReadableByteChannel readablebytechannel = Channels.newChannel(is);

View file

@ -53,11 +53,9 @@ public enum GlNumericType {
public void castAndBuffer(ByteBuffer buf, int val) {
if (this == UBYTE || this == BYTE) {
buf.put((byte) val);
}
else if (this == USHORT || this == SHORT) {
} else if (this == USHORT || this == SHORT) {
buf.putShort((short) val);
}
else if (this == UINT || this == INT) {
} else if (this == UINT || this == INT) {
buf.putInt(val);
}
}

View file

@ -56,8 +56,7 @@ public class GlBuffer extends GlObject {
public MappedBuffer getBuffer(int offset, int length) {
if (Backend.getInstance().compat.mapBufferRange != MapBufferRange.UNSUPPORTED) {
return new MappedBufferRange(this, offset, length, GL30.GL_MAP_WRITE_BIT);
}
else {
} else {
MappedFullBuffer fullBuffer = new MappedFullBuffer(this, MappedBufferUsage.WRITE_ONLY);
fullBuffer.position(offset);
return fullBuffer;

View file

@ -125,8 +125,7 @@ public abstract class InstanceManager<T> implements MaterialManager.OriginShiftL
removeInternal(obj, instance);
createInternal(obj);
}
else {
} else {
instance.update();
}
}
@ -177,11 +176,9 @@ public abstract class InstanceManager<T> implements MaterialManager.OriginShiftL
if (instance != null) {
return instance;
}
else if (create && canCreateInstance(obj)) {
} else if (create && canCreateInstance(obj)) {
return createInternal(obj);
}
else {
} else {
return null;
}
}

View file

@ -47,8 +47,7 @@ public class ShaderTemplate {
if (struct != null) {
s = s.replace(name, struct.name);
}
else {
} else {
missing.add(name);
}
}

View file

@ -101,8 +101,7 @@ public class QuadConverter {
ByteBuffer indices;
if (bytes > stack.getSize()) {
indices = MemoryUtil.memAlloc(bytes); // not enough space on the preallocated stack
}
else {
} else {
stack.push();
indices = stack.malloc(bytes);
}
@ -119,8 +118,7 @@ public class QuadConverter {
if (bytes > stack.getSize()) {
MemoryUtil.memFree(indices);
}
else {
} else {
stack.pop();
}

View file

@ -38,8 +38,7 @@ public class ConditionalInstance<D extends InstanceData> {
if (shouldShow && instance == null) {
instance = model.createInstance();
if (setupFunc != null) setupFunc.accept(instance);
}
else if (!shouldShow && instance != null) {
} else if (!shouldShow && instance != null) {
instance.delete();
instance = null;
}

View file

@ -46,8 +46,7 @@ public class GroupInstance<D extends InstanceData> extends AbstractCollection<D>
for (int i = size; i < count; i++) {
addInstance();
}
}
else {
} else {
List<D> unnecessary = backing.subList(count, size);
unnecessary.forEach(InstanceData::delete);
unnecessary.clear();

View file

@ -37,8 +37,7 @@ public class SelectInstance<D extends InstanceData> {
current.delete();
current = null;
}
}
else if (i != last) {
} else if (i != last) {
if (current != null) current.delete();
current = models.get(i)

View file

@ -44,8 +44,7 @@ public abstract class BasicData extends InstanceData implements IFlatLight<Basic
if (alpha) {
byte a = (byte) ((color >> 24) & 0xFF);
return setColor(r, g, b, a);
}
else {
} else {
return setColor(r, g, b);
}
}

View file

@ -35,8 +35,7 @@ public class ExtensibleGlProgram extends GlProgram {
list.add(extension);
}
this.extensions = list;
}
else {
} else {
this.extensions = Collections.emptyList();
}
}

View file

@ -29,8 +29,7 @@ public class ForgeEvents {
if (right.size() < 10) {
right.add("");
right.add(text);
}
else {
} else {
right.add(9, "");
right.add(10, text);
}

View file

@ -150,8 +150,7 @@ public class LightUpdater {
if (set == null) {
set = new LongRBTreeSet();
listeners.put(listener, set);
}
else {
} else {
set.forEach((LongConsumer) l -> {
WeakHashSet<ILightUpdateListener> listeningSections = lookup.get(l);

View file

@ -126,13 +126,11 @@ public class LightVolume {
sampleVolume = newSampleVolume;
copyLight(world, newArea);
}
else {
} else {
sampleVolume = newSampleVolume;
initialize(world);
}
}
else {
} else {
setSampleVolume(newSampleVolume);
int volume = textureVolume.volume();
if (volume * 2 > lightData.capacity()) {

View file

@ -1,7 +1,5 @@
package com.jozufozu.flywheel.mixin;
import com.jozufozu.flywheel.backend.OptifineHandler;
import org.lwjgl.opengl.GL20;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
@ -10,6 +8,7 @@ import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import com.jozufozu.flywheel.backend.Backend;
import com.jozufozu.flywheel.backend.OptifineHandler;
import com.jozufozu.flywheel.backend.instancing.InstancedRenderDispatcher;
import com.jozufozu.flywheel.event.BeginFrameEvent;
import com.jozufozu.flywheel.event.ReloadRenderersEvent;
@ -56,7 +55,8 @@ public class RenderHooksMixin {
.getProjectionMatrix());
MinecraftForge.EVENT_BUS.post(new RenderLayerEvent(world, type, viewProjection, camX, camY, camZ));
GL20.glUseProgram(0);
if (!OptifineHandler.usingShaders()) GL20.glUseProgram(0);
}
@Inject(at = @At("TAIL"), method = "loadRenderers")
@ -83,8 +83,7 @@ public class RenderHooksMixin {
Vector3d cameraPos = info.getProjectedView();
InstancedRenderDispatcher.renderBreaking(world, viewProjection, cameraPos.x, cameraPos.y, cameraPos.z);
if (!OptifineHandler.usingShaders())
GL20.glUseProgram(0);
if (!OptifineHandler.usingShaders()) GL20.glUseProgram(0);
}
// Instancing

View file

@ -16,8 +16,7 @@ public class AnimationTickHolder {
if (!Minecraft.getInstance()
.isGamePaused()) {
ticks = (ticks + 1) % 1_728_000; // wrap around every 24 hours so we maintain enough floating point precision
}
else {
} else {
paused_ticks = (paused_ticks + 1) % 1_728_000;
}
}

View file

@ -201,19 +201,15 @@ public class BakedQuadWrapper {
int intOffset = FORMAT.getOffset(elementId) / Integer.BYTES;
if (element.getUsage() == VertexFormatElement.Usage.POSITION) {
position = intOffset;
}
else if (element.getUsage() == VertexFormatElement.Usage.COLOR) {
} else if (element.getUsage() == VertexFormatElement.Usage.COLOR) {
color = intOffset;
}
else if (element.getUsage() == VertexFormatElement.Usage.UV) {
} else if (element.getUsage() == VertexFormatElement.Usage.UV) {
if (element.getIndex() == 0) {
texture = intOffset;
}
else if (element.getIndex() == 2) {
} else if (element.getIndex() == 2) {
light = intOffset;
}
}
else if (element.getUsage() == VertexFormatElement.Usage.NORMAL) {
} else if (element.getUsage() == VertexFormatElement.Usage.NORMAL) {
normal = intOffset;
}
}

View file

@ -16,8 +16,7 @@ public class CodecUtil {
.xmap(either -> either.map(l -> l, Collections::singletonList), list -> {
if (list.size() == 1) {
return Either.right(list.get(0));
}
else {
} else {
return Either.left(list);
}
});