Skip to content

Commit

Permalink
update to 1.16.1 fabric
Browse files Browse the repository at this point in the history
  • Loading branch information
zlainsama committed Jul 5, 2020
1 parent 4447371 commit c9aa8ab
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '0.2.6-SNAPSHOT'
id 'fabric-loom' version '0.4-SNAPSHOT'
id 'maven-publish'
}

Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.15.2
yarn_mappings=1.15.2+build.1
loader_version=0.7.5+build.178
minecraft_version=1.16.1
yarn_mappings=1.16.1+build.1
loader_version=0.8.8+build.202

# Mod Properties
mod_version = 1.15.2-v1b-fabric
mod_version = 1.16.1-v1-fabric
maven_group = lain.mods.cleanview
archives_base_name = CleanView

# Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_version=0.4.29+build.290-1.15
fabric_version=0.14.1+build.372-1.16
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
18 changes: 8 additions & 10 deletions src/main/java/lain/mods/cleanview/CleanView.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@
import java.lang.ref.WeakReference;
import java.lang.reflect.Field;
import java.util.Collection;
import org.lwjgl.glfw.GLFW;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.keybinding.FabricKeyBinding;
import net.fabricmc.fabric.api.client.keybinding.KeyBindingRegistry;
import net.fabricmc.fabric.api.event.client.ClientTickCallback;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.options.KeyBinding;
import net.minecraft.client.util.InputUtil;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.data.TrackedData;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.potion.PotionUtil;
import net.minecraft.util.Identifier;

public class CleanView implements ClientModInitializer
{

private FabricKeyBinding keyToggle;
private KeyBinding keyToggle;
private boolean lastState;
private boolean disabled;
private TrackedData<Integer> colors;
Expand Down Expand Up @@ -56,7 +56,7 @@ public void onInitializeClient()
setupEvents();
}

private void onKeyBindingActivate(FabricKeyBinding keybinding)
private void onKeyBindingActivate(KeyBinding keybinding)
{
if (keybinding == keyToggle)
disabled = !disabled;
Expand All @@ -77,17 +77,15 @@ private void setupEvents()
}

lastCam = new WeakReference<Entity>(null);
ClientTickCallback.EVENT.register(client -> {
ClientTickEvents.END_CLIENT_TICK.register(client -> {
tickKeyBindings();
onClientTick(client);
});
}

private void setupKeyBindings()
{
keyToggle = FabricKeyBinding.Builder.create(Identifier.tryParse("cleanview:togglecleanview"), InputUtil.Type.KEYSYM, InputUtil.UNKNOWN_KEYCODE.getKeyCode(), "key.categories.misc").build();
if (!KeyBindingRegistry.INSTANCE.register(keyToggle))
keyToggle = null;
keyToggle = KeyBindingHelper.registerKeyBinding(new KeyBinding("key.cleanview.togglecleanview", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_UNKNOWN, "key.categories.misc"));
}

private void tickKeyBindings()
Expand Down

0 comments on commit c9aa8ab

Please sign in to comment.