Skip to content

Commit

Permalink
Revert "newinput"
Browse files Browse the repository at this point in the history
This reverts commit 7802275.
  • Loading branch information
AmyMialee committed May 28, 2022
1 parent aaff5ee commit 99f932d
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 87 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ minecraft_version=1.18.2
yarn_mappings=1.18.2+build.2
loader_version=0.13.3
# Mod Properties
mod_version=1.18.2-fabric-1.4.2
mod_version=1.18.2-fabric-1.4.1
maven_group=amymialee
archives_base_name=visiblebarriers
# Dependencies
Expand Down
28 changes: 24 additions & 4 deletions src/main/java/amymialee/visiblebarriers/VisibleBarriers.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.minecraft.block.Blocks;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.util.InputUtil;
Expand All @@ -22,13 +22,14 @@

@Environment(EnvType.CLIENT)
public class VisibleBarriers implements ClientModInitializer {
public final static String MOD_ID = "visiblebarriers";
public final static String MODID = "visiblebarriers";
public static VisibleBarriersConfig config = null;
private static KeyBinding keyBinding;

public static boolean visible = false;
public static boolean visible_air = false;

public static final ItemGroup EXTRA_ITEMS = FabricItemGroupBuilder.create(new Identifier(MOD_ID, "extra_items")).icon(() -> new ItemStack(Items.COMMAND_BLOCK))
public static final ItemGroup EXTRA_ITEMS = FabricItemGroupBuilder.create(new Identifier(MODID, "extra_items")).icon(() -> new ItemStack(Items.COMMAND_BLOCK))
.appendItems(stacks -> {
stacks.add(new ItemStack(Items.COMMAND_BLOCK));
stacks.add(new ItemStack(Items.CHAIN_COMMAND_BLOCK));
Expand Down Expand Up @@ -61,6 +62,25 @@ public void onInitializeClient() {
BlockRenderLayerMap.INSTANCE.putBlock(Blocks.CAVE_AIR, RenderLayer.getTranslucent());
BlockRenderLayerMap.INSTANCE.putBlock(Blocks.VOID_AIR, RenderLayer.getTranslucent());

KeyBindingHelper.registerKeyBinding(VisibleControls.VISIBILITY);
keyBinding = KeyBindingHelper.registerKeyBinding(new KeyBinding(
"key.visiblebarriers.bind",
InputUtil.Type.KEYSYM,
GLFW.GLFW_KEY_B,
"category.visiblebarriers.bind"
));
ClientTickEvents.END_CLIENT_TICK.register(client -> {
if (keyBinding.wasPressed()) {
visible = !visible;
if (Screen.hasShiftDown()) {
if (visible) {
visible_air = true;
}
}
if (!visible) {
visible_air = false;
}
client.worldRenderer.reload();
}
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import me.shedaniel.autoconfig.ConfigData;
import me.shedaniel.autoconfig.annotation.Config;

@Config(name = VisibleBarriers.MOD_ID)
@Config(name = VisibleBarriers.MODID)
public final class VisibleBarriersConfig implements ConfigData {
/// Decides if you can save items in the hotbar tab by dragging them in.
public boolean allowHotbarQuickSaving = false;
Expand Down
38 changes: 0 additions & 38 deletions src/main/java/amymialee/visiblebarriers/VisibleControls.java

This file was deleted.

This file was deleted.

16 changes: 0 additions & 16 deletions src/main/java/amymialee/visiblebarriers/mixin/KeyboardMixin.java

This file was deleted.

4 changes: 2 additions & 2 deletions src/main/resources/assets/visiblebarriers/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"category.visiblebarriers" : "Visible Barriers",
"key.visiblebarriers.visibility" : "Toggle Visibility",
"category.visiblebarriers.bind" : "Visible Barriers",
"key.visiblebarriers.bind" : "Toggle Visibility",
"itemGroup.visiblebarriers.extra_items" : "Extra Items",
"config.visiblebarriers.allowHotbarQuickSaving" : "Allow saving directly to the Saved Hotbars tab."
}
4 changes: 2 additions & 2 deletions src/main/resources/assets/visiblebarriers/lang/ru_ru.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"category.visiblebarriers" : "Visible Barriers",
"key.visiblebarriers.visibility" : "Переключить видимость",
"category.visiblebarriers.bind" : "Visible Barriers",
"key.visiblebarriers.bind" : "Переключить видимость",
"itemGroup.visiblebarriers.extra_items" : "Дополнительные предметы",
"config.visiblebarriers.allowHotbarQuickSaving" : "Разрешить добавление прямо в «Сохранённые инструменты»."
}
2 changes: 0 additions & 2 deletions src/main/resources/visiblebarriers.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
"CreativeInventoryScreenMixin",
"EmptyEntityRendererMixin",
"EntityRendererMixin",
"KeyBindingAccessor",
"KeyboardMixin",
"visibility.AirBlockMixin",
"visibility.BarrierBlockMixin",
"visibility.EntityTypeMixin",
Expand Down

0 comments on commit 99f932d

Please sign in to comment.