mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-12-27 07:26:48 +01:00
Fix else formatting
This commit is contained in:
parent
f615825846
commit
3f03d1f071
21 changed files with 31 additions and 60 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -45,8 +45,7 @@ public class OptifineHandler {
|
|||
|
||||
if (optifine == null) {
|
||||
Backend.log.info("Optifine not detected.");
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Backend.log.info("Optifine detected.");
|
||||
|
||||
refresh();
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,8 +47,7 @@ public class ShaderTemplate {
|
|||
|
||||
if (struct != null) {
|
||||
s = s.replace(name, struct.name);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
missing.add(name);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,8 +35,7 @@ public class ExtensibleGlProgram extends GlProgram {
|
|||
list.add(extension);
|
||||
}
|
||||
this.extensions = list;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
this.extensions = Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue