diff --git a/build.gradle b/build.gradle index 21f0713..b6477a7 100644 --- a/build.gradle +++ b/build.gradle @@ -129,6 +129,7 @@ repositories { // If you have mod jar dependencies in ./libs, you can declare them as a repository like so. // See https://docs.gradle.org/current/userguide/declaring_repositories.html#sub:flat_dir_resolver + mavenCentral() flatDir { dir 'libs' } @@ -157,7 +158,9 @@ repositories { maven { url = "https://maven.bawnorton.com/releases" } } - mavenCentral() + maven { url = "https://maven.createmod.net" } // Create, Ponder, Flywheel + maven { url = "https://maven.ithundxr.dev/mirror" } // Registrate + maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" } // ForgeConfigAPIPort } @@ -175,19 +178,24 @@ dependencies { minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" // create dependencies - implementation fg.deobf("com.simibubi.create:create-${create_minecraft_version}:${create_version}:slim") { transitive = false } - implementation fg.deobf("com.jozufozu.flywheel:flywheel-forge-${flywheel_minecraft_version}:${flywheel_version}") - implementation fg.deobf("com.tterrag.registrate:Registrate:${registrate_version}") + implementation(fg.deobf("com.simibubi.create:create-${minecraft_version}:${create_version}:slim") { transitive = false }) + implementation(fg.deobf("net.createmod.ponder:Ponder-Forge-${minecraft_version}:${ponder_version}")) + compileOnly(fg.deobf("dev.engine-room.flywheel:flywheel-forge-api-${minecraft_version}:${flywheel_version}")) + runtimeOnly(fg.deobf("dev.engine-room.flywheel:flywheel-forge-${minecraft_version}:${flywheel_version}")) + implementation(fg.deobf("com.tterrag.registrate:Registrate:${registrate_version}")) + compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:0.4.1")) + implementation("io.github.llamalad7:mixinextras-forge:0.4.1") // vs2 dependencies - implementation fg.deobf("org.valkyrienskies:valkyrienskies-120-forge:${vs2_version}") { transitive = false } +/* implementation fg.deobf("org.valkyrienskies:valkyrienskies-120-forge:${vs2_version}") { transitive = false } compileOnly ("org.valkyrienskies.core:api:${vs_core_version}") compileOnly ("org.valkyrienskies.core:api-game:${vs_core_version}") compileOnly ("org.valkyrienskies.core:util:${vs_core_version}") compileOnly ("org.valkyrienskies.core:impl:${vs_core_version}") - implementation "com.fasterxml.jackson.core:jackson-annotations:2.13.3" + implementation "com.fasterxml.jackson.core:jackson-annotations:2.13.3"*/ + implementation "thedarkcolour:kotlinforforge:$forge_kotlin_version" //implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10" @@ -197,11 +205,15 @@ dependencies { implementation("org.joml:joml-primitives:1.10.0") { transitive = false } // cc:t dependencies - implementation fg.deobf("curse.maven:cc-tweaked-282001:5714507") + implementation fg.deobf("libs:cc-tweaked-1.20.1-forge:${cc_version}") + runtimeOnly fg.deobf("libs:jei-1.20.1-forge:15.20.0.116") + + runtimeOnly fg.deobf("libs:IconRenderer-Forge-1.20.1:1.2.0") // implementation fg.deobf("libs:peripheralium-forge:1.20.1-0.6.15") implementation fg.deobf("libs:peripheralworks-forge-1.20.1:1.4.3") + //runtimeOnly fg.deobf("libs:IconRenderer-Forge-1.20.1:1.2.0") compileOnly(annotationProcessor("com.bawnorton.mixinsquared:mixinsquared-common:0.2.0-beta.6")) implementation(jarJar("com.bawnorton.mixinsquared:mixinsquared-forge:0.2.0-beta.6")) { @@ -209,14 +221,14 @@ dependencies { } // Tweaked Controllers dependencies - implementation fg.deobf("curse.maven:create-tweaked-controllers-898849:5206625") + compileOnly fg.deobf("curse.maven:create-tweaked-controllers-898849:5206625") // Toms peripheral //implementation fg.deobf("curse.maven:toms-peripheral-931210:5265063") // VS CW runtimeOnly fg.deobf("curse.maven:architectury-api-419699:5137938") - runtimeOnly fg.deobf("curse.maven:clockwork-807792:5580456") + //runtimeOnly fg.deobf("curse.maven:clockwork-807792:5580456") annotationProcessor 'org.spongepowered:mixin:0.8.5:processor' // Example mod dependency with JEI - using fg.deobf() ensures the dependency is remapped to your development mappings @@ -268,16 +280,34 @@ tasks.named('jar', Jar).configure { "MixinConfigs": "mixins.void_power.json" ]) } - // This is the preferred method to reobfuscate your jar file finalizedBy 'reobfJar' } + // However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing: // tasks.named('publish').configure { // dependsOn 'reobfJar' // } +tasks.named('jarJar').configure { + manifest { + attributes([ + 'Specification-Title' : mod_id, + 'Specification-Vendor' : mod_authors, + 'Specification-Version' : '1', // We are version 1 of ourselves + 'Implementation-Title' : project.name, + 'Implementation-Version' : project.jar.archiveVersion, + 'Implementation-Vendor' : mod_authors, + 'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), + "MixinConfigs": "mixins.void_power.json" + ]) + } + + finalizedBy 'reobfJarJar' +} + + // Example configuration to allow publishing using the maven-publish plugin publishing { publications { diff --git a/gradle.properties b/gradle.properties index 025359c..7f147af 100644 --- a/gradle.properties +++ b/gradle.properties @@ -48,7 +48,7 @@ mod_name=VoidPower # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. mod_license=GPL3 # The mod version. See https://semver.org/ -mod_version=1.2.7 +mod_version=1.2.9.no_vs # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # This should match the base package used for the mod sources. # See https://maven.apache.org/guides/mini/guide-naming-conventions.html @@ -58,14 +58,14 @@ mod_authors=Tairitsu # The description of the mod. This is a simple multiline text string that is used for display purposes in the mod list. mod_description= - -create_minecraft_version = 1.20.1 -flywheel_minecraft_version = 1.20.1 -create_version = 0.5.1.f-26 -flywheel_version = 0.6.10-7 +create_version = 6.0.6-150 +ponder_version = 1.0.80 +flywheel_version = 1.0.4 registrate_version = MC1.20-1.3.3 -vs2_version=2.1.3-beta.1+a52f38bd68 -vs_core_version=1.1.0+b19b27c4a4 +cc_version = 1.116.1 + +vs2_version=2.3.0-beta.10 +vs_core_version=1.1.0+cf6990a85d forge_kotlin_version=4.10.0 \ No newline at end of file diff --git a/libs/IconRenderer-Forge-1.20.1-1.2.0.jar b/libs/IconRenderer-Forge-1.20.1-1.2.0.jar new file mode 100644 index 0000000..8e3c655 Binary files /dev/null and b/libs/IconRenderer-Forge-1.20.1-1.2.0.jar differ diff --git a/libs/cc-tweaked-1.20.1-forge-1.116.1.jar b/libs/cc-tweaked-1.20.1-forge-1.116.1.jar new file mode 100644 index 0000000..171f1f3 Binary files /dev/null and b/libs/cc-tweaked-1.20.1-forge-1.116.1.jar differ diff --git a/libs/jei-1.20.1-forge-15.20.0.116.jar b/libs/jei-1.20.1-forge-15.20.0.116.jar new file mode 100644 index 0000000..d264ef4 Binary files /dev/null and b/libs/jei-1.20.1-forge-15.20.0.116.jar differ diff --git a/src/generated/resources/assets/void_power/lang/en_us.json b/src/generated/resources/assets/void_power/lang/en_us.json index 903781c..bdac179 100644 --- a/src/generated/resources/assets/void_power/lang/en_us.json +++ b/src/generated/resources/assets/void_power/lang/en_us.json @@ -7,6 +7,9 @@ "block.void_power.redstone_router":"Wireless Redstone Router", "block.void_power.hologram":"Hologram", "item.void_power.vr_glasses": "VR Glasses", + "block.void_power.key_board": "Keyboard", "itemGroup.void_power.main": "Void Power", - "gui.void_power.terminal" : "HOLOGRAM" + "gui.void_power.terminal" : "HOLOGRAM", + + "gui.void_power.key_board.actived": "[Using Keyboard]" } \ No newline at end of file diff --git a/src/generated/resources/assets/void_power/lang/zh_cn.json b/src/generated/resources/assets/void_power/lang/zh_cn.json index 55a46f5..e76d891 100644 --- a/src/generated/resources/assets/void_power/lang/zh_cn.json +++ b/src/generated/resources/assets/void_power/lang/zh_cn.json @@ -7,7 +7,10 @@ "block.void_power.redstone_broadcaster":"无线红石信号发射器", "block.void_power.redstone_router":"无线红石信号路由器", "item.void_power.vr_glasses": "VR眼镜(需绑定全息显示器)", + "block.void_power.key_board": "键盘", "item.void_power.channel_modifier": "信道修改器", "itemGroup.void_power.main": "虚空动力", - "gui.void_power.terminal" : "全息显示器(终端)" + "gui.void_power.terminal" : "全息显示器(终端)", + + "gui.void_power.key_board.actived": "[正在使用键盘]" } \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json b/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json index ca476b9..9ebdb3a 100644 --- a/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json +++ b/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json @@ -1,7 +1,5 @@ { "values": [ - "void_power:void_engine", - "void_power:engine_controller", "void_power:glass_screen", "void_power:hologram" ] diff --git a/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json b/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json index ca476b9..9ebdb3a 100644 --- a/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json +++ b/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json @@ -1,7 +1,5 @@ { "values": [ - "void_power:void_engine", - "void_power:engine_controller", "void_power:glass_screen", "void_power:hologram" ] diff --git a/src/main/java/com/dfdyz/void_power/client/gui/ChannelModifierGUI.java b/src/main/java/com/dfdyz/void_power/client/gui/ChannelModifierGUI.java index 0f2a238..1cd5526 100644 --- a/src/main/java/com/dfdyz/void_power/client/gui/ChannelModifierGUI.java +++ b/src/main/java/com/dfdyz/void_power/client/gui/ChannelModifierGUI.java @@ -1,26 +1,20 @@ package com.dfdyz.void_power.client.gui; import com.dfdyz.void_power.menu.ChannelModifierMenu; -import com.dfdyz.void_power.menu.HologramMenu; import com.dfdyz.void_power.registry.VPItems; -import com.dfdyz.void_power.registry.VPTileEntities; import com.dfdyz.void_power.utils.ParamUtils; import com.dfdyz.void_power.world.items.ChannelModifierItem; import net.minecraft.client.gui.components.Button; import net.minecraft.client.gui.components.EditBox; import net.minecraft.client.gui.screens.Screen; import net.minecraft.client.gui.screens.inventory.MenuAccess; -import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.InteractionHand; import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.inventory.MenuType; import net.minecraft.world.item.ItemStack; import org.jetbrains.annotations.NotNull; -import javax.annotation.Nullable; -import java.util.regex.Matcher; import java.util.regex.Pattern; public class ChannelModifierGUI extends Screen implements MenuAccess { @@ -36,6 +30,10 @@ public ChannelModifierGUI(ChannelModifierMenu menu, Inventory inventory, Compone Pattern channel_pattern = Pattern.compile("^[a-z][a-z0-9_]*:[a-z][a-z0-9_/]*+$"); + @Override + public boolean isPauseScreen() { + return false; + } @Override protected void init() { diff --git a/src/main/java/com/dfdyz/void_power/client/gui/HologramGUI.java b/src/main/java/com/dfdyz/void_power/client/gui/HologramGUI.java index f888837..362f45c 100644 --- a/src/main/java/com/dfdyz/void_power/client/gui/HologramGUI.java +++ b/src/main/java/com/dfdyz/void_power/client/gui/HologramGUI.java @@ -1,7 +1,6 @@ package com.dfdyz.void_power.client.gui; import com.dfdyz.void_power.client.gui.widget.HologramTerminalWidget; -import com.dfdyz.void_power.menu.HologramMenu; import com.dfdyz.void_power.network.CP.CP_HologramRename; import com.dfdyz.void_power.network.PacketManager; import com.dfdyz.void_power.world.blocks.hologram.HologramTE; @@ -15,22 +14,18 @@ import net.minecraft.world.entity.player.Inventory; import org.jetbrains.annotations.NotNull; -public class HologramGUI extends Screen implements MenuAccess { - HologramTE te; +public class HologramGUI extends Screen { + final HologramTE te; HologramTerminalWidget htw; EditBox name_editor; Button set_name; float terminal_scale = 1; - final HologramMenu menu; - public HologramGUI(HologramMenu menu, Inventory inventory, Component component) { + public HologramGUI(Component component, HologramTE te) { super(component); - this.menu = menu; - if(menu != null){ - te = menu.te; - } + this.te = te; } float GetScale(){ @@ -87,11 +82,16 @@ public void ChangeName(Button b){ PacketManager.sendToServer(new CP_HologramRename(te)); } + @Override + public void onClose() { + super.onClose(); + } + @Override public void tick() { super.tick(); if(te == null || te.isRemoved()) { - Minecraft.getInstance().setScreen(null); + onClose(); return; } if(htw.ShouldResize()){ @@ -121,8 +121,4 @@ protected void setInitialFocus(GuiEventListener guiEventListener) { super.setInitialFocus(guiEventListener); } - @Override - public @NotNull HologramMenu getMenu() { - return menu; - } } diff --git a/src/main/java/com/dfdyz/void_power/client/gui/IMouseHandlerExtension.java b/src/main/java/com/dfdyz/void_power/client/gui/IMouseHandlerExtension.java new file mode 100644 index 0000000..d6d999a --- /dev/null +++ b/src/main/java/com/dfdyz/void_power/client/gui/IMouseHandlerExtension.java @@ -0,0 +1,6 @@ +package com.dfdyz.void_power.client.gui; + +public interface IMouseHandlerExtension { + void void_power$grabMouseOnScreen(); + void void_power$releaseMouseOnScreen(); +} diff --git a/src/main/java/com/dfdyz/void_power/client/gui/KeyBoardGUI.java b/src/main/java/com/dfdyz/void_power/client/gui/KeyBoardGUI.java new file mode 100644 index 0000000..3377e05 --- /dev/null +++ b/src/main/java/com/dfdyz/void_power/client/gui/KeyBoardGUI.java @@ -0,0 +1,138 @@ +package com.dfdyz.void_power.client.gui; + +import com.dfdyz.void_power.network.CP.CP_KeyBoardInputEvent; +import com.dfdyz.void_power.network.PacketManager; +import com.dfdyz.void_power.world.blocks.key_board.KeyBoardTE; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.client.gui.components.MultiLineTextWidget; +import net.minecraft.client.gui.components.StringWidget; +import net.minecraft.client.gui.screens.Screen; +import net.minecraft.network.chat.Component; + +import java.util.HashSet; + +public class KeyBoardGUI extends Screen { + + final KeyBoardTE te; + final HashSet pressedKeys = new HashSet(); + + public KeyBoardGUI(Component component, KeyBoardTE te) { + super(component); + this.te = te; + } + + + @Override + public void renderBackground(GuiGraphics guiGraphics) { + + } + + + + private StringWidget text; + @Override + protected void init() { + super.init(); + + assert minecraft != null; + assert minecraft.player != null; + + var mouseHandler = (IMouseHandlerExtension) minecraft.mouseHandler; + mouseHandler.void_power$grabMouseOnScreen(); + //minecraft.player.displayClientMessage(Component.literal("Keyboard Active."), true); + + int mid_x = width / 2; + + text = new StringWidget(mid_x - 200, height - 68, + 400, 24, + Component.translatable("gui.void_power.key_board.actived"), + Minecraft.getInstance().font); + + + addRenderableWidget(text); + } + + @Override + public void resize(Minecraft p_96575_, int p_96576_, int p_96577_) { + super.resize(p_96575_, p_96576_, p_96577_); + + int mid_x = width / 2; + text.setPosition(mid_x - 200, height - 100); + } + + @Override + public void render(GuiGraphics p_281549_, int p_281550_, int p_282878_, float p_282465_) { + super.render(p_281549_, p_281550_, p_282878_, p_282465_); + } + + @Override + public boolean keyPressed(int key, int scancode, int modifiers) { + if(key == 256){ // ESC + return super.keyPressed(key, scancode, modifiers); + } + + sendEvent("key", key, pressedKeys.contains(key)); + + // paste + if(isPaste(key)){ + assert this.minecraft != null; + String clipboard = this.minecraft.keyboardHandler.getClipboard(); + sendEvent("paste", clipboard); + } + + pressedKeys.add(key); + + return true; + } + + @Override + public final boolean charTyped(char ch, int modifiers){ + sendEvent("char", ch); + return super.charTyped(ch, modifiers); + } + + @Override + public boolean keyReleased(int key, int scancode, int modifiers) { + sendEvent("key_up", key); + pressedKeys.remove(key); + return super.keyReleased(key, scancode, modifiers); + } + + void sendEvent(String event, Object... data){ + if (te == null) return; + PacketManager.sendToServer(new CP_KeyBoardInputEvent(te, event, data + )); + } + + @Override + public void tick() { + if(te == null || te.isRemoved()) { + onClose(); + return; + } + + if(!te.canPlayerUse(getMinecraft().player)){ + onClose(); + return; + } + + super.tick(); + } + + @Override + public boolean isPauseScreen() { + return false; + } + + public void onClose() { + pressedKeys.removeIf((key) -> { + sendEvent("key", key, false); + return true; + }); + assert minecraft != null; + var mouseHandler = (IMouseHandlerExtension) minecraft.mouseHandler; + mouseHandler.void_power$releaseMouseOnScreen(); + super.onClose(); + } +} diff --git a/src/main/java/com/dfdyz/void_power/client/gui/widget/HologramTerminalWidget.java b/src/main/java/com/dfdyz/void_power/client/gui/widget/HologramTerminalWidget.java index dc28272..0f44a56 100644 --- a/src/main/java/com/dfdyz/void_power/client/gui/widget/HologramTerminalWidget.java +++ b/src/main/java/com/dfdyz/void_power/client/gui/widget/HologramTerminalWidget.java @@ -88,12 +88,10 @@ public boolean keyPressed(int key, int scancode, int modifiers) { } private void paste() { - String clipboard = StringUtil.normaliseClipboardString(Minecraft.getInstance().keyboardHandler.getClipboard()); + String clipboard = String.valueOf(StringUtil.getClipboardString(Minecraft.getInstance().keyboardHandler.getClipboard())); te.SendInputPack("vp_paste", te.name, clipboard); - } - @Override public void setFocused(boolean focused) { super.setFocused(focused); diff --git a/src/main/java/com/dfdyz/void_power/client/renderer/VPRenderTypes.java b/src/main/java/com/dfdyz/void_power/client/renderer/VPRenderTypes.java index 40b0e95..4dfe4b9 100644 --- a/src/main/java/com/dfdyz/void_power/client/renderer/VPRenderTypes.java +++ b/src/main/java/com/dfdyz/void_power/client/renderer/VPRenderTypes.java @@ -22,7 +22,6 @@ public class VPRenderTypes { public static final ResourceLocation FONT = new ResourceLocation(VoidPowerMod.MODID, "textures/block/term_font.png"); - public static final ResourceLocation FONT_NEG = new ResourceLocation(VoidPowerMod.MODID, "textures/block/term_font_neg.png"); //public static final ResourceLocation FONT = new ResourceLocation(VoidPowerMod.MODID, "textures/block/term_font.png"); @@ -32,6 +31,8 @@ public class VPRenderTypes { private static RenderType getText(ResourceLocation locationIn) { + + /* RenderType.CompositeState rendertype$state = RenderType.CompositeState.builder() .setShaderState(new RenderStateShard.ShaderStateShard(VPRenderTypes::text)) .setTextureState(new CustomizableTextureState(locationIn, () -> ForgeRenderTypes.enableTextTextureLinearFiltering, () -> false)) @@ -40,6 +41,8 @@ private static RenderType getText(ResourceLocation locationIn) { //.setOverlayState(RenderType.OV) .createCompositeState(false); return RenderType.create("cct_text", DefaultVertexFormat.POSITION_COLOR_TEX_LIGHTMAP, VertexFormat.Mode.QUADS, 256, false, true, rendertype$state); + */ + return RenderType.text(locationIn); } public static RenderType getHologram(ResourceLocation locationIn) { diff --git a/src/main/java/com/dfdyz/void_power/client/renderer/hud/VRGlassesHUDRenderer.java b/src/main/java/com/dfdyz/void_power/client/renderer/hud/VRGlassesHUDRenderer.java index 15668ed..6a7bf3a 100644 --- a/src/main/java/com/dfdyz/void_power/client/renderer/hud/VRGlassesHUDRenderer.java +++ b/src/main/java/com/dfdyz/void_power/client/renderer/hud/VRGlassesHUDRenderer.java @@ -21,7 +21,7 @@ import net.minecraft.world.level.block.entity.BlockEntity; import org.joml.Matrix4f; import org.lwjgl.opengl.GL11; -import org.valkyrienskies.mod.common.VSGameUtilsKt; +/*import org.valkyrienskies.mod.common.VSGameUtilsKt;*/ public class VRGlassesHUDRenderer { @@ -130,15 +130,17 @@ public static boolean _render(LocalPlayer player, GuiGraphics guiGraphics, float BlockEntity te = player.level().getBlockEntity(bp); if(te instanceof HologramTE hte){ - if(VSGameUtilsKt.squaredDistanceToInclShips(player, bp.getX(), bp.getY(), bp.getZ()) > distance_limit * distance_limit){ + /* if(VSGameUtilsKt.squaredDistanceToInclShips(player, bp.getX(), bp.getY(), bp.getZ()) > distance_limit * distance_limit){ return false; - } + }*/ if (hte.getBuffer().length == 0) return false; if (hte.renderCache == null)hte.renderCache = new ScreenCacheImpl(hte); ResourceLocation tex = hte.renderCache.getTexture(); if (tex == null) return false; + + // todo: Hover on face not on gui Window sr = Minecraft.getInstance().getWindow(); float width = sr.getGuiScaledWidth(); float height = sr.getGuiScaledHeight(); diff --git a/src/main/java/com/dfdyz/void_power/client/renderer/tileentities/SimpleBlockVisual.java b/src/main/java/com/dfdyz/void_power/client/renderer/tileentities/SimpleBlockVisual.java new file mode 100644 index 0000000..6793f75 --- /dev/null +++ b/src/main/java/com/dfdyz/void_power/client/renderer/tileentities/SimpleBlockVisual.java @@ -0,0 +1,32 @@ +package com.dfdyz.void_power.client.renderer.tileentities; + +import com.dfdyz.void_power.world.blocks.glass_screen.GlassScreenTE; +import com.simibubi.create.foundation.block.IBE; +import dev.engine_room.flywheel.api.instance.Instance; +import dev.engine_room.flywheel.api.visual.BlockEntityVisual; +import dev.engine_room.flywheel.api.visualization.VisualizationContext; +import net.minecraft.world.level.block.entity.BlockEntity; +import org.jetbrains.annotations.Nullable; + +import java.util.function.Consumer; + +public abstract class SimpleBlockVisual implements BlockEntityVisual { + public SimpleBlockVisual(VisualizationContext context, T blockEntity, float partialTick) { + + } + + @Override + public void collectCrumblingInstances(Consumer<@Nullable Instance> consumer) { + + } + + @Override + public void update(float v) { + + } + + @Override + public void delete() { + + } +} diff --git a/src/main/java/com/dfdyz/void_power/client/renderer/tileentities/glass_screen/GlassScreenInstance.java b/src/main/java/com/dfdyz/void_power/client/renderer/tileentities/glass_screen/GlassScreenInstance.java index d5334fc..90290ed 100644 --- a/src/main/java/com/dfdyz/void_power/client/renderer/tileentities/glass_screen/GlassScreenInstance.java +++ b/src/main/java/com/dfdyz/void_power/client/renderer/tileentities/glass_screen/GlassScreenInstance.java @@ -1,16 +1,19 @@ package com.dfdyz.void_power.client.renderer.tileentities.glass_screen; +import com.dfdyz.void_power.client.renderer.tileentities.SimpleBlockVisual; import com.dfdyz.void_power.world.blocks.glass_screen.GlassScreenTE; -import com.jozufozu.flywheel.api.MaterialManager; -import com.jozufozu.flywheel.backend.instancing.blockentity.BlockEntityInstance; +import dev.engine_room.flywheel.api.instance.Instance; +import dev.engine_room.flywheel.api.visual.BlockEntityVisual; +import dev.engine_room.flywheel.api.visualization.BlockEntityVisualizer; +import dev.engine_room.flywheel.api.visualization.VisualizationContext; +import dev.engine_room.flywheel.lib.visualization.SimpleBlockEntityVisualizer; +import org.jetbrains.annotations.Nullable; -public class GlassScreenInstance extends BlockEntityInstance { - public GlassScreenInstance(MaterialManager materialManager, GlassScreenTE blockEntity) { - super(materialManager, blockEntity); - } +import java.util.function.Consumer; - @Override - protected void remove() { +public class GlassScreenInstance extends SimpleBlockVisual { + public GlassScreenInstance(VisualizationContext context, GlassScreenTE blockEntity, float partialTick) { + super(context, blockEntity, partialTick); } } diff --git a/src/main/java/com/dfdyz/void_power/client/renderer/tileentities/glass_screen/GlassScreenRenderState.java b/src/main/java/com/dfdyz/void_power/client/renderer/tileentities/glass_screen/GlassScreenRenderState.java index 6b49f5e..d9337d1 100644 --- a/src/main/java/com/dfdyz/void_power/client/renderer/tileentities/glass_screen/GlassScreenRenderState.java +++ b/src/main/java/com/dfdyz/void_power/client/renderer/tileentities/glass_screen/GlassScreenRenderState.java @@ -14,19 +14,16 @@ import javax.annotation.Nullable; import java.util.HashSet; import java.util.Iterator; +import java.util.Objects; import java.util.Set; public class GlassScreenRenderState implements ClientMonitor.RenderState{ - @GuardedBy("allMonitors") private static final Set allMonitors = new HashSet(); public long lastRenderFrame = -1L; @Nullable public BlockPos lastRenderPos = null; - public int tboBuffer; - public int tboTexture; - public int tboUniform; @Nullable public DirectVertexBuffer backgroundBuffer; @Nullable @@ -38,56 +35,23 @@ public GlassScreenRenderState() { } public boolean createBuffer(MonitorRenderer renderer) { - switch (renderer) { - case TBO: - if (this.tboBuffer != 0) { - return false; - } - - this.deleteBuffers(); - this.tboBuffer = DirectBuffers.createBuffer(); - DirectBuffers.setEmptyBufferData(35882, this.tboBuffer, 35044); - this.tboTexture = GlStateManager._genTexture(); - GL11.glBindTexture(35882, this.tboTexture); - GL31.glTexBuffer(35882, 33330, this.tboBuffer); - GL11.glBindTexture(35882, 0); - this.tboUniform = DirectBuffers.createBuffer(); - DirectBuffers.setEmptyBufferData(35345, this.tboUniform, 35044); - this.addMonitor(); - return true; - case VBO: - if (this.backgroundBuffer != null) { - return false; - } - - this.deleteBuffers(); - this.backgroundBuffer = new DirectVertexBuffer(); - this.foregroundBuffer = new DirectVertexBuffer(); - this.foregroundNegBuffer = new DirectVertexBuffer(); - this.addMonitor(); - return true; - default: + if (Objects.requireNonNull(renderer) == MonitorRenderer.VBO) { + if (this.backgroundBuffer != null) { return false; + } + + this.deleteBuffers(); + this.backgroundBuffer = new DirectVertexBuffer(); + this.foregroundBuffer = new DirectVertexBuffer(); + this.foregroundNegBuffer = new DirectVertexBuffer(); + this.addMonitor(); + return true; } + return false; } private void deleteBuffers() { - if (this.tboBuffer != 0) { - DirectBuffers.deleteBuffer(35882, this.tboBuffer); - this.tboBuffer = 0; - } - - if (this.tboTexture != 0) { - GlStateManager._deleteTexture(this.tboTexture); - this.tboTexture = 0; - } - - if (this.tboUniform != 0) { - DirectBuffers.deleteBuffer(35345, this.tboUniform); - this.tboUniform = 0; - } - if (this.backgroundBuffer != null) { this.backgroundBuffer.close(); this.backgroundBuffer = null; @@ -112,14 +76,13 @@ private void addMonitor() { @Override public void close() { - if (this.tboBuffer != 0 || this.backgroundBuffer != null) { + if (this.backgroundBuffer != null) { synchronized(allMonitors) { allMonitors.remove(this); } this.deleteBuffers(); } - } public static void destroyAll() { diff --git a/src/main/java/com/dfdyz/void_power/client/renderer/tileentities/glass_screen/ScreenRenderUtils.java b/src/main/java/com/dfdyz/void_power/client/renderer/tileentities/glass_screen/ScreenRenderUtils.java index be54167..92f97d2 100644 --- a/src/main/java/com/dfdyz/void_power/client/renderer/tileentities/glass_screen/ScreenRenderUtils.java +++ b/src/main/java/com/dfdyz/void_power/client/renderer/tileentities/glass_screen/ScreenRenderUtils.java @@ -112,13 +112,13 @@ public static void drawTerminalForegroundNeg(DirectFixedWidthFontRenderer.QuadEm } private static void drawBackground(DirectFixedWidthFontRenderer.QuadEmitter emitter, float x, float y, TextBuffer backgroundColour, TextBuffer foregroundColor, Palette palette, float leftMarginSize, float rightMarginSize, float height, char noBG_colourIdx) { - if (leftMarginSize > 0.0F) { + /* if (leftMarginSize > 0.0F) { drawQuad(emitter, x - leftMarginSize, y, leftMarginSize, height, palette, backgroundColour.charAt(0), noBG_colourIdx); } if (rightMarginSize > 0.0F) { drawQuad(emitter, x + (float)(backgroundColour.length() * 6), y, rightMarginSize, height, palette, backgroundColour.charAt(backgroundColour.length() - 1), noBG_colourIdx); - } + }*/ int blockStart = 0; char blockColour = 0; @@ -167,7 +167,6 @@ public static void drawCursor(DirectFixedWidthFontRenderer.QuadEmitter emitter, int colour = terminal.getPalette().getRenderColours(15 - terminal.getTextColour()); drawChar(emitter, x + (float) (terminal.getCursorX() * 6), y + (float) (terminal.getCursorY() * 9), 95, colour); } - } public static int getVertexCount(Terminal terminal) { @@ -178,7 +177,7 @@ private static void quad(DirectFixedWidthFontRenderer.QuadEmitter buffer, float buffer.quad(x1, y1, x2, y2, z, rgba, u1, v1, u2, v2); } - + /* static void quad(ByteBuffer buffer, float x1, float y1, float x2, float y2, float z, byte[] rgba, float u1, float v1, float u2, float v2) { int position = buffer.position(); long addr = MemoryUtil.memAddress(buffer); @@ -237,7 +236,7 @@ static void quad(ByteBuffer buffer, float x1, float y1, float x2, float y2, floa } else { throw new IndexOutOfBoundsException(); } - } + }*/ // Empty Terminal private static void quad(FixedWidthFontRenderer.QuadEmitter c, float x1, float y1, float x2, float y2, float z, byte[] rgba, float u1, float v1, float u2, float v2, int light) { diff --git a/src/main/java/com/dfdyz/void_power/client/renderer/tileentities/glass_screen/ScreenRenderer.java b/src/main/java/com/dfdyz/void_power/client/renderer/tileentities/glass_screen/ScreenRenderer.java index c9b7d13..9c8005f 100644 --- a/src/main/java/com/dfdyz/void_power/client/renderer/tileentities/glass_screen/ScreenRenderer.java +++ b/src/main/java/com/dfdyz/void_power/client/renderer/tileentities/glass_screen/ScreenRenderer.java @@ -50,7 +50,8 @@ public ScreenRenderer(BlockEntityRendererProvider.Context context){ } @Override - protected void renderSafe(GlassScreenTE monitor, float partialTicks, PoseStack transform, MultiBufferSource bufferSource, int light, int overlay) { + protected void renderSafe(GlassScreenTE monitor, float partialTicks, PoseStack transform, MultiBufferSource bufferSource, + int light, int overlay) { var originTerminal = monitor.getOriginClientMonitor(); var originTE = ((IMonitorTEAccessor) monitor).Invoke_getOrigin(); if (originTerminal == null || originTE == null) return; @@ -147,6 +148,7 @@ private static void renderTerminal( var backgroundBuffer = assertNonNull(renderState.backgroundBuffer); var foregroundBuffer = assertNonNull(renderState.foregroundBuffer); var foregroundNegBuffer = assertNonNull(renderState.foregroundNegBuffer); + if (redraw) { var size = ScreenRenderUtils.getVertexCount(terminal); @@ -157,32 +159,29 @@ private static void renderTerminal( //System.out.println("enableTransparent: " + enableTransparent); // m = peripheral.wrap("left") - renderToBuffer(backgroundBuffer, size, sink -> - ScreenRenderUtils.drawTerminalBackground(sink, 0, 0, terminal, yMargin, yMargin, xMargin, xMargin, enableTransparent ? noBG_color : 'z')); - - // - renderToBuffer(foregroundBuffer, size, sink -> { - ScreenRenderUtils.drawTerminalForeground(sink, 0, 0, terminal, enableTransparent ? noBG_color : 'z'); - // If the cursor is visible, we append it to the end of our buffer. When rendering, we can either - // render n or n+1 quads and so toggle the cursor on and off. - ScreenRenderUtils.drawCursor(sink, 0, 0, terminal); + renderToBuffer(backgroundBuffer, size, sink -> { + ScreenRenderUtils.drawTerminalBackground(sink, 0, 0, terminal, yMargin, yMargin, xMargin, xMargin, + enableTransparent ? noBG_color : 'z'); }); - renderToBuffer(foregroundNegBuffer, size, sink -> { - ScreenRenderUtils.drawTerminalForegroundNeg(sink, 0, 0, terminal, enableTransparent ? noBG_color : 'z'); + ScreenRenderUtils.drawTerminalForegroundNeg(sink, 0, 0, terminal, + enableTransparent ? noBG_color : 'z'); + }); + + renderToBuffer(foregroundBuffer, size, sink -> { + ScreenRenderUtils.drawTerminalForeground(sink, 0, 0, terminal, + enableTransparent ? noBG_color : 'z'); + ScreenRenderUtils.drawCursor(sink, 0, 0, terminal); }); } - // Our VBO doesn't transform its vertices with the provided pose stack, which means that the inverse view - // rotation matrix gives entirely wrong numbers for fog distances. We just set it to the identity which - // gives a good enough approximation. var oldInverseRotation = RenderSystem.getInverseViewRotationMatrix(); RenderSystem.setInverseViewRotationMatrix(IDENTITY_NORMAL); RenderSystem.disableCull(); VPRenderTypes.TERMINAL.setupRenderState(); - // Render background geometry + backgroundBuffer.bind(); backgroundBuffer.drawWithShader(matrix, RenderSystem.getProjectionMatrix(), VPRenderTypes.text()); @@ -195,8 +194,9 @@ private static void renderTerminal( matrix, RenderSystem.getProjectionMatrix(), VPRenderTypes.text(), // As mentioned in the above comment, render the extra cursor quad if it is visible this frame. Each // // quad has an index count of 6. - FixedWidthFontRenderer.isCursorVisible(terminal) && FrameInfo.getGlobalCursorBlink() - ? foregroundBuffer.getIndexCount() + 6 : foregroundBuffer.getIndexCount() + FixedWidthFontRenderer.isCursorVisible(terminal) && !FrameInfo.getGlobalCursorBlink() + ? foregroundBuffer.getIndexCount() - RenderTypes.TERMINAL.mode().indexCount(4) + : foregroundBuffer.getIndexCount() ); RenderTypes.TERMINAL.clearRenderState(); @@ -204,18 +204,18 @@ private static void renderTerminal( VPRenderTypes.TERMINAL_NEG.setupRenderState(); foregroundNegBuffer.bind(); foregroundNegBuffer.drawWithShader( - matrix, RenderSystem.getProjectionMatrix(), VPRenderTypes.text(), - // As mentioned in the above comment, render the extra cursor quad if it is visible this frame. Each - // // quad has an index count of 6. + matrix, RenderSystem.getProjectionMatrix(), VPRenderTypes.text()/*, FixedWidthFontRenderer.isCursorVisible(terminal) && FrameInfo.getGlobalCursorBlink() - ? foregroundNegBuffer.getIndexCount() + 6 : foregroundNegBuffer.getIndexCount() + ? foregroundNegBuffer.getIndexCount() + 6 : foregroundNegBuffer.getIndexCount()*/ ); // Clear state RenderSystem.polygonOffset(0.0f, -0.0f); RenderSystem.disablePolygonOffset(); + VPRenderTypes.TERMINAL_NEG.clearRenderState(); VertexBuffer.unbind(); + RenderSystem.enableCull(); RenderSystem.setInverseViewRotationMatrix(oldInverseRotation); } diff --git a/src/main/java/com/dfdyz/void_power/client/renderer/tileentities/hologram/HologramInstance.java b/src/main/java/com/dfdyz/void_power/client/renderer/tileentities/hologram/HologramInstance.java index 154afb5..6bc5eec 100644 --- a/src/main/java/com/dfdyz/void_power/client/renderer/tileentities/hologram/HologramInstance.java +++ b/src/main/java/com/dfdyz/void_power/client/renderer/tileentities/hologram/HologramInstance.java @@ -1,16 +1,33 @@ package com.dfdyz.void_power.client.renderer.tileentities.hologram; +import com.dfdyz.void_power.client.renderer.tileentities.SimpleBlockVisual; import com.dfdyz.void_power.world.blocks.hologram.HologramTE; -import com.jozufozu.flywheel.api.MaterialManager; -import com.jozufozu.flywheel.backend.instancing.blockentity.BlockEntityInstance; +import dev.engine_room.flywheel.api.instance.Instance; +import dev.engine_room.flywheel.api.visualization.VisualizationContext; +import org.jetbrains.annotations.Nullable; + +import java.util.function.Consumer; + +public class HologramInstance extends SimpleBlockVisual { + + + public HologramInstance(VisualizationContext context, HologramTE blockEntity, float partialTick) { + super(context, blockEntity, partialTick); + } + + + @Override + public void collectCrumblingInstances(Consumer<@Nullable Instance> consumer) { + + } + + @Override + public void update(float v) { -public class HologramInstance extends BlockEntityInstance { - public HologramInstance(MaterialManager materialManager, HologramTE blockEntity) { - super(materialManager, blockEntity); } @Override - protected void remove() { + public void delete() { } } diff --git a/src/main/java/com/dfdyz/void_power/client/renderer/tileentities/void_engine/VoidEngineTEInstance.java b/src/main/java/com/dfdyz/void_power/client/renderer/tileentities/void_engine/VoidEngineTEInstance.java index 69362fa..da3c298 100644 --- a/src/main/java/com/dfdyz/void_power/client/renderer/tileentities/void_engine/VoidEngineTEInstance.java +++ b/src/main/java/com/dfdyz/void_power/client/renderer/tileentities/void_engine/VoidEngineTEInstance.java @@ -1,26 +1,54 @@ package com.dfdyz.void_power.client.renderer.tileentities.void_engine; import com.dfdyz.void_power.world.blocks.void_engine.VoidEngineTE; -import com.jozufozu.flywheel.api.MaterialManager; + import com.simibubi.create.AllPartialModels; -import com.simibubi.create.content.kinetics.base.KineticBlockEntityInstance; -import com.simibubi.create.content.kinetics.base.flwdata.RotatingData; +import com.simibubi.create.content.kinetics.base.KineticBlockEntityVisual; +import com.simibubi.create.content.kinetics.base.RotatingInstance; +import com.simibubi.create.foundation.render.AllInstanceTypes; +import dev.engine_room.flywheel.api.instance.Instance; +import dev.engine_room.flywheel.api.visualization.VisualizationContext; +import dev.engine_room.flywheel.lib.model.Models; import net.minecraft.core.Direction; import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import org.jetbrains.annotations.Nullable; + +import java.util.function.Consumer; -public class VoidEngineTEInstance extends KineticBlockEntityInstance { - protected final RotatingData shaft; +public class VoidEngineTEInstance extends KineticBlockEntityVisual { + protected final RotatingInstance shaft; final Direction direction; final Direction opposite; - public VoidEngineTEInstance(MaterialManager materialManager, VoidEngineTE blockEntity) { + + private double rotation; + private double previousRotation; + + public VoidEngineTEInstance(VisualizationContext context, VoidEngineTE blockEntity, float partialTick) { + super(context, blockEntity, partialTick); + + direction = blockState.getValue(BlockStateProperties.HORIZONTAL_FACING); + opposite = direction.getOpposite(); + + shaft = visualizationContext.instancerProvider().instancer(AllInstanceTypes.ROTATING, + Models.partial(AllPartialModels.SHAFT_HALF)) + .createInstance(); + + shaft.setup(blockEntity) + .setPosition(getVisualPosition()) + .rotateToFace(Direction.SOUTH, opposite) + .setChanged(); + } + + + /* public VoidEngineTEInstance(MaterialManager materialManager, VoidEngineTE blockEntity) { super(materialManager, blockEntity); direction = blockState.getValue(BlockStateProperties.HORIZONTAL_FACING); opposite = direction.getOpposite(); shaft = getRotatingMaterial().getModel(AllPartialModels.SHAFT_HALF, blockState, opposite).createInstance(); setup(shaft); - } + }*/ - @Override + /* @Override protected void remove() { shaft.delete(); } @@ -33,5 +61,26 @@ public void updateLight() { @Override public void update() { updateRotation(shaft); + }*/ + + @Override + public void update(float partialTick) { + shaft.setup(blockEntity) + .setChanged(); + } + + @Override + public void collectCrumblingInstances(Consumer<@Nullable Instance> consumer) { + consumer.accept(shaft); + } + + @Override + public void updateLight(float v) { + relight(pos, shaft); + } + + @Override + protected void _delete() { + shaft.delete(); } } diff --git a/src/main/java/com/dfdyz/void_power/client/renderer/tileentities/void_engine/VoidEngineTERenderer.java b/src/main/java/com/dfdyz/void_power/client/renderer/tileentities/void_engine/VoidEngineTERenderer.java index 6080d91..ac57195 100644 --- a/src/main/java/com/dfdyz/void_power/client/renderer/tileentities/void_engine/VoidEngineTERenderer.java +++ b/src/main/java/com/dfdyz/void_power/client/renderer/tileentities/void_engine/VoidEngineTERenderer.java @@ -2,13 +2,15 @@ import com.dfdyz.void_power.world.blocks.void_engine.VoidEngineBlock; import com.dfdyz.void_power.world.blocks.void_engine.VoidEngineTE; -import com.jozufozu.flywheel.backend.Backend; + import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; import com.simibubi.create.AllPartialModels; import com.simibubi.create.content.kinetics.base.KineticBlockEntityRenderer; -import com.simibubi.create.foundation.render.CachedBufferer; -import com.simibubi.create.foundation.render.SuperByteBuffer; + +import dev.engine_room.flywheel.api.visualization.VisualizationManager; +import net.createmod.catnip.render.CachedBuffers; +import net.createmod.catnip.render.SuperByteBuffer; import net.minecraft.client.renderer.LevelRenderer; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.RenderType; @@ -24,22 +26,18 @@ public VoidEngineTERenderer(BlockEntityRendererProvider.Context context) { @Override protected void renderSafe(VoidEngineTE be, float partialTicks, PoseStack ms, MultiBufferSource buffer, int light, int overlay) { - if (Backend.canUseInstancing(be.getLevel())) return; + if (VisualizationManager.supportsVisualization(be.getLevel())) return; Direction direction = be.getBlockState() .getValue(VoidEngineBlock.HORIZONTAL_FACING); VertexConsumer vb = buffer.getBuffer(RenderType.cutoutMipped()); int lightBehind = LevelRenderer.getLightColor(be.getLevel(), be.getBlockPos().relative(direction.getOpposite())); - //int lightInFront = LevelRenderer.getLightColor(be.getLevel(), be.getBlockPos().relative(direction)); SuperByteBuffer shaftHalf = - CachedBufferer.partialFacing(AllPartialModels.SHAFT_HALF, be.getBlockState(), direction.getOpposite()); - //SuperByteBuffer fanInner = - // CachedBufferer.partialFacing(AllPartialModels.ENCASED_FAN_INNER, be.getBlockState(), direction.getOpposite()); + CachedBuffers.partialFacing(AllPartialModels.SHAFT_HALF, be.getBlockState(), direction.getOpposite()); standardKineticRotationTransform(shaftHalf, be, lightBehind).renderInto(ms, vb); - //kineticRotationTransform(fanInner, be, direction.getAxis(), angle, lightInFront).renderInto(ms, vb); } diff --git a/src/main/java/com/dfdyz/void_power/compat/cct/lua/LuaPhysShip.java b/src/main/java/com/dfdyz/void_power/compat/cct/lua/LuaPhysShip.java index 89724cd..2ef1b94 100644 --- a/src/main/java/com/dfdyz/void_power/compat/cct/lua/LuaPhysShip.java +++ b/src/main/java/com/dfdyz/void_power/compat/cct/lua/LuaPhysShip.java @@ -1,28 +1,22 @@ package com.dfdyz.void_power.compat.cct.lua; -import com.dfdyz.void_power.utils.CCUtils; -import com.dfdyz.void_power.utils.VSUtils; -import com.dfdyz.void_power.world.blocks.engine_controller.EngineControllerBlock; +/*import com.dfdyz.void_power.utils.CCUtils; import com.dfdyz.void_power.world.blocks.engine_controller.EngineControllerTE; -import com.dfdyz.void_power.world.blocks.hologram.HologramTE; import dan200.computercraft.api.lua.LuaFunction; import net.minecraft.core.Direction; -import net.minecraft.util.Mth; import net.minecraft.world.level.block.HorizontalDirectionalBlock; import org.joml.*; -import org.valkyrienskies.core.impl.game.ships.PhysInertia; import org.valkyrienskies.core.impl.game.ships.PhysShipImpl; -import org.valkyrienskies.physics_api.PoseVel; import java.lang.Math; import java.util.List; -import java.util.Map; +import java.util.Map;*/ public class LuaPhysShip { - private final PhysShipImpl physShip; + /* private final PhysShipImpl physShip; private final ShipPhysStateSnapshot shipSnapshot; //private final Quaternionf rot; //private final double[][] ctrl_rotation; @@ -88,11 +82,11 @@ public final List> getControllerRotationMat(){ public static ShipPhysStateSnapshot createSnapshot(PhysShipImpl ship, EngineControllerTE te){ - PoseVel poseVel = ship.getPoseVel(); - PhysInertia inertia = ship.getInertia(); + var transform = ship.getTransform(); + var inertia = ship.get_inertia(); double[][] ctrl_rotation; - Matrix3d rm = poseVel.getRot().get(new Matrix3d()); + Matrix3d rm = transform.getShipToWorldRotation().get(new Matrix3d()); Direction face = te.getBlockState().getValue(HorizontalDirectionalBlock.FACING); if(face.equals(Direction.NORTH)){ @@ -124,11 +118,13 @@ else if(face == Direction.EAST) { }; } + var pv = ship.getPoseVel(); + return new ShipPhysStateSnapshot( - new Vector3d(poseVel.getVel()), - new Vector3d(poseVel.getOmega()), - new Vector3d(poseVel.getPos()), - new Quaterniond(poseVel.getRot()), + new Vector3d(pv.getVel()), + new Vector3d(pv.getOmega()), + new Vector3d(transform.getPositionInWorld()), + new Quaterniond(transform.getShipToWorldRotation()), ctrl_rotation, new Matrix3d(inertia.getMomentOfInertiaTensor()), inertia.getShipMass() @@ -148,5 +144,5 @@ public final boolean isStatic(){ @LuaFunction public final boolean doFluidDrag() { return this.physShip.getDoFluidDrag(); - } + }*/ } diff --git a/src/main/java/com/dfdyz/void_power/compat/cct/peripherals/P_EngineController.java b/src/main/java/com/dfdyz/void_power/compat/cct/peripherals/P_EngineController.java index 3a64f97..bbfa744 100644 --- a/src/main/java/com/dfdyz/void_power/compat/cct/peripherals/P_EngineController.java +++ b/src/main/java/com/dfdyz/void_power/compat/cct/peripherals/P_EngineController.java @@ -1,6 +1,6 @@ package com.dfdyz.void_power.compat.cct.peripherals; -import com.dfdyz.void_power.compat.cct.lua.LuaPhysShip; +/*import com.dfdyz.void_power.compat.cct.lua.LuaPhysShip; import com.dfdyz.void_power.compat.vs.ship.QueuedForceApplier; import com.dfdyz.void_power.utils.CCUtils; import com.dfdyz.void_power.utils.VSUtils; @@ -21,10 +21,10 @@ import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; +import java.util.Set;*/ -public class P_EngineController implements IPeripheral { - private final EngineControllerTE te; +public class P_EngineController /*implements IPeripheral*/ { + /* private final EngineControllerTE te; public P_EngineController(EngineControllerTE te){ this.te = te; } @@ -220,9 +220,9 @@ public double getMassCanDrive(){ return 0; } - /*** + *//*** * power API - */ + *//* @LuaFunction public void applyInvariantForce(double x, double y, double z) { QueuedForceApplier applier = te.getApplier(); @@ -312,6 +312,6 @@ public Map getShipCenter(){ //getShipyardPosition } return null; } - +*/ } diff --git a/src/main/java/com/dfdyz/void_power/compat/cct/peripherals/P_KeyBoardPeripheral.java b/src/main/java/com/dfdyz/void_power/compat/cct/peripherals/P_KeyBoardPeripheral.java new file mode 100644 index 0000000..8c1671a --- /dev/null +++ b/src/main/java/com/dfdyz/void_power/compat/cct/peripherals/P_KeyBoardPeripheral.java @@ -0,0 +1,46 @@ +package com.dfdyz.void_power.compat.cct.peripherals; + +import com.dfdyz.void_power.world.blocks.key_board.KeyBoardTE; +import com.google.common.collect.Sets; +import dan200.computercraft.api.lua.LuaFunction; +import dan200.computercraft.api.peripheral.IComputerAccess; +import dan200.computercraft.api.peripheral.IPeripheral; +import org.jetbrains.annotations.Nullable; + +import java.util.Set; + +public class P_KeyBoardPeripheral implements IPeripheral { + final Set computers = Sets.newConcurrentHashSet(); + + final KeyBoardTE te; + public P_KeyBoardPeripheral(KeyBoardTE te){ + this.te = te; + } + + @LuaFunction + @Override + public String getType() { + return "keyboard"; + } + + @Override + public void attach(IComputerAccess computer) { + computers.add(computer); + } + + @Override + public void detach(IComputerAccess computer) { + computers.remove(computer); + } + + public void PushEvent(String event, Object... data){ + computers.forEach((computer) ->{ + computer.queueEvent(event, data); + }); + } + + @Override + public boolean equals(@Nullable IPeripheral iPeripheral) { + return iPeripheral == this; + } +} diff --git a/src/main/java/com/dfdyz/void_power/compat/cct/peripherals/P_RSRouter.java b/src/main/java/com/dfdyz/void_power/compat/cct/peripherals/P_RSRouter.java index 326fe6a..b676fce 100644 --- a/src/main/java/com/dfdyz/void_power/compat/cct/peripherals/P_RSRouter.java +++ b/src/main/java/com/dfdyz/void_power/compat/cct/peripherals/P_RSRouter.java @@ -30,17 +30,17 @@ public void closePort(int port_id) throws LuaException { } @LuaFunction - public int getPortMode(int port_id){ + public int getPortMode(int port_id) throws LuaException { return te.getPortMode(port_id); } @LuaFunction - public int getPower(int port_id){ + public int getPower(int port_id) throws LuaException { return te.getPower(port_id); } @LuaFunction - public boolean setPower(int port_id, int power){ + public boolean setPower(int port_id, int power) throws LuaException { return te.setPower(port_id, power); } @@ -49,6 +49,11 @@ public void process(){ te.process(); } + @LuaFunction + public int getPortCount(){ + return RSRouterTE.maxChannels; + } + @Override public String getType() { return "redstone_router"; diff --git a/src/main/java/com/dfdyz/void_power/compat/vs/ship/EngineController.java b/src/main/java/com/dfdyz/void_power/compat/vs/ship/EngineController.java index 5ee7c88..9cc7bfd 100644 --- a/src/main/java/com/dfdyz/void_power/compat/vs/ship/EngineController.java +++ b/src/main/java/com/dfdyz/void_power/compat/vs/ship/EngineController.java @@ -1,5 +1,5 @@ package com.dfdyz.void_power.compat.vs.ship; - +/* import com.dfdyz.void_power.world.blocks.engine_controller.EngineControllerTE; import com.dfdyz.void_power.world.blocks.void_engine.VoidEngineTE; import com.fasterxml.jackson.annotation.JsonAutoDetect; @@ -22,13 +22,13 @@ isGetterVisibility = JsonAutoDetect.Visibility.NONE, setterVisibility = JsonAutoDetect.Visibility.NONE ) -@JsonIgnoreProperties(ignoreUnknown = true) -public class EngineController implements ShipForcesInducer { +@JsonIgnoreProperties(ignoreUnknown = true)*/ +public class EngineController /*implements ShipForcesInducer*/ { //@JsonIgnore //ServerShip ship; //@JsonIgnore //QueuedForceApplier applier; - @JsonIgnore + /* @JsonIgnore Set controller = Sets.newConcurrentHashSet(); @JsonIgnore Set engine = Sets.newConcurrentHashSet(); @@ -85,7 +85,9 @@ public void removeEngine(VoidEngineTE te){ @Override public void applyForces(@NotNull PhysShip physShip) { - // System.out.println("AAAAAAAA"); + var ship = ((PhysShipImpl)physShip); + var inertia = ship.getInertia(); + this.controller.removeIf((e) -> { return e.isRemoved(); }); @@ -98,7 +100,7 @@ public void applyForces(@NotNull PhysShip physShip) { return e.isRemoved(); }); - mass = ((PhysShipImpl) physShip).getInertia().getShipMass(); + mass = inertia.getShipMass(); AtomicReference mass_driver = new AtomicReference<>((double) 0); this.engine.forEach((e) -> { @@ -128,10 +130,9 @@ public void disableIdle(boolean b){ private void IDLE(PhysShipImpl physShip){ Vector3d omega = physShip.getPoseVel().getOmega().negate(new Vector3d()).mul(10); - Vector3d force = physShip.getPoseVel().getVel().negate(new Vector3d()).mul(mass*1.5).add(0,mass * 10,0); - Vector3d torque = physShip.getInertia().getMomentOfInertiaTensor().transform(omega); + Vector3d torque = physShip.get_inertia().getMomentOfInertiaTensor().transform(omega); physShip.applyInvariantForce(force); physShip.applyInvariantTorque(torque); @@ -143,5 +144,5 @@ public boolean canDrive(){ public double massCanDrive(){ return massCanDrive; - } + }*/ } diff --git a/src/main/java/com/dfdyz/void_power/compat/vs/ship/QueuedForceApplier.java b/src/main/java/com/dfdyz/void_power/compat/vs/ship/QueuedForceApplier.java index 959ce35..98f5d3b 100644 --- a/src/main/java/com/dfdyz/void_power/compat/vs/ship/QueuedForceApplier.java +++ b/src/main/java/com/dfdyz/void_power/compat/vs/ship/QueuedForceApplier.java @@ -1,6 +1,6 @@ package com.dfdyz.void_power.compat.vs.ship; -import com.fasterxml.jackson.annotation.JsonAutoDetect; +/*import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.google.common.collect.Queues; @@ -25,9 +25,9 @@ isGetterVisibility = JsonAutoDetect.Visibility.NONE, setterVisibility = JsonAutoDetect.Visibility.NONE ) -@JsonIgnoreProperties(ignoreUnknown = true) -public class QueuedForceApplier implements ShipForcesInducer { - //@JsonIgnore ServerShip ship; +@JsonIgnoreProperties(ignoreUnknown = true)*/ +public class QueuedForceApplier /*implements ShipForcesInducer*/ { + /* //@JsonIgnore ServerShip ship; @JsonIgnore private final Queue invForces = Queues.newConcurrentLinkedQueue(); @JsonIgnore private final Queue invTorques = Queues.newConcurrentLinkedQueue(); @JsonIgnore private final Queue rotForces = Queues.newConcurrentLinkedQueue(); @@ -56,9 +56,11 @@ public static QueuedForceApplier getOrCreate(@NotNull ServerShip ship){ @JsonIgnore Vector3d omega = new Vector3d(); @Override public void applyForces(@NotNull PhysShip physShip) { - Mass = ((PhysShipImpl)physShip).getInertia().getShipMass(); + var ship = ((PhysShipImpl)physShip); + var inertia = ship.getInertia(); + var pv = ship.getPoseVel(); + Mass = inertia.getShipMass(); this.physShip = physShip; - PoseVel pv = ((PhysShipImpl) physShip).getPoseVel(); velocity.set(pv.getVel()); omega.set(pv.getOmega()); if(!Enabled) { @@ -82,7 +84,6 @@ public void applyForces(@NotNull PhysShip physShip) { public boolean _checkVelocity(Vector3dc f){ return velocity.lengthSquared() > maxValue || !f.isFinite(); } - public boolean _checkOmega(Vector3dc f){ return omega.lengthSquared() > maxValue || !f.isFinite(); } @@ -168,5 +169,5 @@ public void applyRotDependentForceToPos(Vector3dc force, Vector3dc pos) { } private record ForceAtPos(Vector3dc force, Vector3dc pos){ - } + }*/ } diff --git a/src/main/java/com/dfdyz/void_power/events/RenderEvent.java b/src/main/java/com/dfdyz/void_power/events/RenderEvent.java index 6674326..1f59523 100644 --- a/src/main/java/com/dfdyz/void_power/events/RenderEvent.java +++ b/src/main/java/com/dfdyz/void_power/events/RenderEvent.java @@ -3,23 +3,13 @@ import com.dfdyz.void_power.VoidPowerMod; import com.dfdyz.void_power.client.renderer.hud.VRGlassesHUDRenderer; -import com.mojang.blaze3d.systems.RenderSystem; -import com.mojang.blaze3d.vertex.BufferBuilder; -import com.mojang.blaze3d.vertex.DefaultVertexFormat; -import com.mojang.blaze3d.vertex.Tesselator; -import com.mojang.blaze3d.vertex.VertexFormat; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.player.LocalPlayer; -import net.minecraft.client.renderer.GameRenderer; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.client.event.RenderGuiEvent; -import net.minecraftforge.client.event.RenderLevelStageEvent; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.loading.FMLEnvironment; -import org.valkyrienskies.core.impl.shadow.M; @Mod.EventBusSubscriber( @@ -39,6 +29,4 @@ public static void OnPlayerRightClick(RenderGuiEvent.Pre event){ VRGlassesHUDRenderer.render(player, gg, pt); } - - } diff --git a/src/main/java/com/dfdyz/void_power/menu/ChannelModifierMenu.java b/src/main/java/com/dfdyz/void_power/menu/ChannelModifierMenu.java index 351a80f..0c517a0 100644 --- a/src/main/java/com/dfdyz/void_power/menu/ChannelModifierMenu.java +++ b/src/main/java/com/dfdyz/void_power/menu/ChannelModifierMenu.java @@ -5,7 +5,6 @@ import com.dfdyz.void_power.registry.VPItems; import com.dfdyz.void_power.registry.VPTileEntities; import com.dfdyz.void_power.world.redstone.ChannelNetworkHandler; -import com.ethlo.time.internal.EthloITU; import com.simibubi.create.foundation.gui.menu.MenuBase; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.FriendlyByteBuf; diff --git a/src/main/java/com/dfdyz/void_power/menu/HologramMenu.java b/src/main/java/com/dfdyz/void_power/menu/HologramMenu.java deleted file mode 100644 index 503a85b..0000000 --- a/src/main/java/com/dfdyz/void_power/menu/HologramMenu.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.dfdyz.void_power.menu; - -import com.dfdyz.void_power.registry.VPTileEntities; -import com.dfdyz.void_power.world.blocks.hologram.HologramTE; -import net.minecraft.client.Minecraft; -import net.minecraft.client.multiplayer.ClientLevel; -import net.minecraft.core.BlockPos; -import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.inventory.MenuType; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.block.entity.BlockEntity; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nullable; -import java.util.logging.Level; - -public class HologramMenu extends AbstractContainerMenu { - - public final HologramTE te; - - // crate on client - public HologramMenu(MenuType type, int windowId, Inventory inv, @Nullable FriendlyByteBuf buffer) { - super(VPTileEntities.HOLOGRAM_GUI.get(), windowId); - te = getTe(buffer); - } - - HologramTE getTe(FriendlyByteBuf buf){ - if(buf == null) return null; - BlockPos bp = buf.readBlockPos(); - ClientLevel level = Minecraft.getInstance().level; - - BlockEntity blockEntity = level.getBlockEntity(bp); - if(blockEntity instanceof HologramTE te){ - return te; - } - return null; - } - - public HologramMenu(int windowId, HologramTE te){ - super(VPTileEntities.HOLOGRAM_GUI.get(), windowId); - this.te = te; - } - - @Override - public @NotNull ItemStack quickMoveStack(@NotNull Player player, int i) { - return ItemStack.EMPTY; - } - - @Override - public boolean stillValid(@NotNull Player player) { - return te != null && - te.getLevel() != null && - te.getLevel().getBlockEntity(te.getBlockPos()) == te - && !te.isRemoved(); - } -} diff --git a/src/main/java/com/dfdyz/void_power/mixin/MixinBugFixUtils_Kt.java b/src/main/java/com/dfdyz/void_power/mixin/MixinBugFixUtils_Kt.java index 46b3014..e191a3a 100644 --- a/src/main/java/com/dfdyz/void_power/mixin/MixinBugFixUtils_Kt.java +++ b/src/main/java/com/dfdyz/void_power/mixin/MixinBugFixUtils_Kt.java @@ -1,5 +1,6 @@ package com.dfdyz.void_power.mixin; +/* import net.minecraft.world.phys.AABB; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; @@ -9,6 +10,7 @@ import java.util.Arrays; import java.util.Map; +*/ //@Mixin(value = BugFixUtil.class, remap = false) public abstract class MixinBugFixUtils_Kt { diff --git a/src/main/java/com/dfdyz/void_power/mixin/MixinComputerTE.java b/src/main/java/com/dfdyz/void_power/mixin/MixinComputerTE.java index 84d3906..d268819 100644 --- a/src/main/java/com/dfdyz/void_power/mixin/MixinComputerTE.java +++ b/src/main/java/com/dfdyz/void_power/mixin/MixinComputerTE.java @@ -1,6 +1,6 @@ package com.dfdyz.void_power.mixin; -import dan200.computercraft.shared.computer.blocks.ComputerBlockEntity; +/*import dan200.computercraft.shared.computer.blocks.ComputerBlockEntity; import dan200.computercraft.shared.computer.core.ServerComputer; import net.minecraft.core.BlockPos; import net.minecraft.server.level.ServerLevel; @@ -9,7 +9,7 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import org.valkyrienskies.core.api.ships.ServerShip; -import org.valkyrienskies.mod.common.VSGameUtilsKt; +import org.valkyrienskies.mod.common.VSGameUtilsKt;*/ //@Mixin(ComputerBlockEntity.class) public abstract class MixinComputerTE { diff --git a/src/main/java/com/dfdyz/void_power/mixin/MixinMonitorRenderState.java b/src/main/java/com/dfdyz/void_power/mixin/MixinMonitorRenderState.java new file mode 100644 index 0000000..92ca377 --- /dev/null +++ b/src/main/java/com/dfdyz/void_power/mixin/MixinMonitorRenderState.java @@ -0,0 +1,19 @@ +package com.dfdyz.void_power.mixin; + + +import com.dfdyz.void_power.client.renderer.tileentities.glass_screen.GlassScreenRenderState; +import dan200.computercraft.client.render.monitor.MonitorRenderState; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(value = MonitorRenderState.class, remap = false) +public abstract class MixinMonitorRenderState { + + @Inject(method = "destroyAll", at = @At("TAIL")) + private static void DestroyAllPatch(CallbackInfo ci){ + GlassScreenRenderState.destroyAll(); + } + +} diff --git a/src/main/java/com/dfdyz/void_power/mixin/MixinMouseHandler.java b/src/main/java/com/dfdyz/void_power/mixin/MixinMouseHandler.java new file mode 100644 index 0000000..7e76b0b --- /dev/null +++ b/src/main/java/com/dfdyz/void_power/mixin/MixinMouseHandler.java @@ -0,0 +1,61 @@ +package com.dfdyz.void_power.mixin; + +import com.dfdyz.void_power.client.gui.IMouseHandlerExtension; +import com.mojang.blaze3d.platform.InputConstants; +import net.minecraft.client.Minecraft; +import net.minecraft.client.MouseHandler; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; + +@Mixin(MouseHandler.class) +public abstract class MixinMouseHandler implements IMouseHandlerExtension { + + + @Final + @Shadow + private Minecraft minecraft; + + @Shadow + private boolean mouseGrabbed; + + @Shadow + private boolean ignoreFirstMove; + + @Shadow + private double xpos; + + @Shadow + private double ypos; + + + @Override + public void void_power$releaseMouseOnScreen() { + if (this.mouseGrabbed) { + this.mouseGrabbed = false; + this.xpos = (double) this.minecraft.getWindow().getScreenWidth() / 2; + this.ypos = (double) this.minecraft.getWindow().getScreenHeight() / 2; + //InputConstants.grabOrReleaseMouse(this.minecraft.getWindow().getWindow(), 212993, this.xpos, this.ypos); + } + } + + @Override + public void void_power$grabMouseOnScreen() { + if (this.minecraft.isWindowActive() && !this.mouseGrabbed) { + /*if (!Minecraft.ON_OSX) { + KeyMapping.setAll(); + }*/ + + this.mouseGrabbed = true; + this.xpos = (double) this.minecraft.getWindow().getScreenWidth() / 2; + this.ypos = (double) this.minecraft.getWindow().getScreenHeight() / 2; + InputConstants.grabOrReleaseMouse(this.minecraft.getWindow().getWindow(), 212995, this.xpos, this.ypos); + //this.minecraft.setScreen(null); + this.minecraft.missTime = 10000; + this.ignoreFirstMove = true; + } + } + + + +} diff --git a/src/main/java/com/dfdyz/void_power/mixin/MixinNetworkTerminal.java b/src/main/java/com/dfdyz/void_power/mixin/MixinNetworkTerminal.java index ef5c2a8..5cafb04 100644 --- a/src/main/java/com/dfdyz/void_power/mixin/MixinNetworkTerminal.java +++ b/src/main/java/com/dfdyz/void_power/mixin/MixinNetworkTerminal.java @@ -2,7 +2,9 @@ import com.dfdyz.void_power.patched.IPatchedNetTermAccessor; import com.dfdyz.void_power.patched.IPatchedTermAccessor; +import com.dfdyz.void_power.patched.IPatchedTerminalState; import dan200.computercraft.shared.computer.terminal.NetworkedTerminal; +import dan200.computercraft.shared.computer.terminal.TerminalState; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.FriendlyByteBuf; import org.spongepowered.asm.mixin.Mixin; @@ -16,17 +18,22 @@ public class MixinNetworkTerminal implements IPatchedNetTermAccessor { @Inject(method = "write", at = @At("RETURN")) - public void patchWrite(FriendlyByteBuf buffer, CallbackInfo ci){ - IPatchedTermAccessor accessor = (IPatchedTermAccessor)this; - buffer.writeBoolean(accessor.void_power$GetTransMode()); - buffer.writeChar(accessor.void_power$GetTransColor()); + public void patchWrite(CallbackInfoReturnable cir){ + var state = cir.getReturnValue(); + if(state instanceof IPatchedTerminalState ipts){ + IPatchedTermAccessor accessor = (IPatchedTermAccessor)this; + ipts.void_power$SetTransMode(accessor.void_power$GetTransMode()); + ipts.void_power$SetTransColor(accessor.void_power$GetTransColor()); + } } @Inject(method = "read", at = @At("RETURN")) - public void patchRead(FriendlyByteBuf buffer, CallbackInfo ci){ - IPatchedTermAccessor accessor = (IPatchedTermAccessor)this; - accessor.void_power$SetTransMode(buffer.readBoolean()); - accessor.void_power$SetTransColor(buffer.readChar()); + public void patchRead(TerminalState state, CallbackInfo ci){ + if(state instanceof IPatchedTerminalState ipts){ + IPatchedTermAccessor accessor = (IPatchedTermAccessor)this; + accessor.void_power$SetTransMode(ipts.void_power$GetTransMode()); + accessor.void_power$SetTransColor(ipts.void_power$GetTransColor()); + } } @Inject(method = "writeToNBT", at = @At("RETURN")) @@ -46,7 +53,7 @@ public void patchWriteNBT(CompoundTag nbt, CallbackInfo ci){ public void void_power$SetTransMode2(boolean m) { IPatchedTermAccessor accessor = (IPatchedTermAccessor)this; accessor.void_power$SetTransMode(m); - System.out.println("set m"); + //System.out.println("set m"); this.void_power$setChanged2(); } @@ -54,7 +61,7 @@ public void patchWriteNBT(CompoundTag nbt, CallbackInfo ci){ public void void_power$SetTransColor2(char c) { IPatchedTermAccessor accessor = (IPatchedTermAccessor)this; accessor.void_power$SetTransColor(c); - System.out.println("set c"); + //System.out.println("set c"); this.void_power$setChanged2(); } diff --git a/src/main/java/com/dfdyz/void_power/mixin/MixinTerminal.java b/src/main/java/com/dfdyz/void_power/mixin/MixinTerminal.java index b469b53..6b6bee7 100644 --- a/src/main/java/com/dfdyz/void_power/mixin/MixinTerminal.java +++ b/src/main/java/com/dfdyz/void_power/mixin/MixinTerminal.java @@ -8,28 +8,28 @@ @Mixin(value = Terminal.class, remap = false) public class MixinTerminal implements IPatchedTermAccessor { @Unique - private boolean TransMode = true; + private boolean void_power$TransMode = true; @Unique - private char TransColor = 'f'; + private char void_power$TransColor = 'f'; @Override public boolean void_power$GetTransMode() { - return TransMode; + return void_power$TransMode; } @Override public char void_power$GetTransColor() { - return TransColor; + return void_power$TransColor; } @Override public void void_power$SetTransMode(boolean m) { - TransMode = m; + void_power$TransMode = m; } @Override public void void_power$SetTransColor(char c) { - TransColor = c; + void_power$TransColor = c; } } diff --git a/src/main/java/com/dfdyz/void_power/mixin/MixinTerminalState.java b/src/main/java/com/dfdyz/void_power/mixin/MixinTerminalState.java new file mode 100644 index 0000000..925755f --- /dev/null +++ b/src/main/java/com/dfdyz/void_power/mixin/MixinTerminalState.java @@ -0,0 +1,54 @@ +package com.dfdyz.void_power.mixin; + + +import com.dfdyz.void_power.patched.IPatchedTerminalState; +import dan200.computercraft.shared.computer.terminal.TerminalState; +import net.minecraft.network.FriendlyByteBuf; +import org.checkerframework.checker.units.qual.A; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(value = TerminalState.class, remap = false) +public abstract class MixinTerminalState implements IPatchedTerminalState { + + @Unique + private boolean void_power$TransMode = true; + + @Unique + private char void_power$TransColor = 'f'; + + @Override + public boolean void_power$GetTransMode() { + return void_power$TransMode; + } + + @Override + public char void_power$GetTransColor() { + return void_power$TransColor; + } + + @Override + public void void_power$SetTransMode(boolean m) { + void_power$TransMode = m; + } + + @Override + public void void_power$SetTransColor(char c) { + void_power$TransColor = c; + } + + @Inject(method = "(Lnet/minecraft/network/FriendlyByteBuf;)V", at = @At("TAIL")) + public void patchedInit(FriendlyByteBuf buf, CallbackInfo ci){ + void_power$TransMode = buf.readBoolean(); + void_power$TransColor = buf.readChar(); + } + + @Inject(method = "write", at = @At("TAIL")) + public void patchedWrite(FriendlyByteBuf buf, CallbackInfo ci){ + buf.writeBoolean(void_power$TransMode); + buf.writeChar(void_power$TransColor); + } +} diff --git a/src/main/java/com/dfdyz/void_power/network/CP/CP_KeyBoardInputEvent.java b/src/main/java/com/dfdyz/void_power/network/CP/CP_KeyBoardInputEvent.java new file mode 100644 index 0000000..b5effca --- /dev/null +++ b/src/main/java/com/dfdyz/void_power/network/CP/CP_KeyBoardInputEvent.java @@ -0,0 +1,127 @@ +package com.dfdyz.void_power.network.CP; + + +import com.dfdyz.void_power.world.blocks.hologram.HologramTE; +import com.dfdyz.void_power.world.blocks.key_board.KeyBoardTE; +import net.minecraft.core.BlockPos; +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraftforge.network.NetworkEvent; + +import java.util.function.Supplier; + +import static com.dfdyz.void_power.utils.ByteUtils.decodeString; +import static com.dfdyz.void_power.utils.ByteUtils.encodeString; + +public class CP_KeyBoardInputEvent { + public BlockPos te; + public String name; + public Object[] param; + + public CP_KeyBoardInputEvent(){ + + } + + public CP_KeyBoardInputEvent(KeyBoardTE te, String event, Object... param){ + this.te = te.getBlockPos(); + this.name = event; + this.param = param; + } + + public static CP_KeyBoardInputEvent decode(FriendlyByteBuf buf) { + //System.out.println("Received_DEC"); + CP_KeyBoardInputEvent data = new CP_KeyBoardInputEvent(); + data.te = buf.readBlockPos(); + + data.name = decodeString(buf); + data.param = new Object[buf.readShort()]; + + Object obj; + char type; + for(int i = 0; i < data.param.length; ++i){ + type = buf.readChar(); + if(type == 'i'){ + obj = buf.readInt(); + } + else if(type == 'd'){ + obj = buf.readDouble(); + } + else if(type == 'f'){ + obj = buf.readFloat(); + } + else if(type == 's'){ + obj = decodeString(buf); + } + else if(type == 'b'){ + obj = buf.readBoolean(); + } + else if(type == 'c'){ + obj = ""+buf.readChar(); + } + else{ + obj = null; + } + + data.param[i] = obj; + } + + //System.out.println("ClientMsg"); + + /* + for (int i = 0; i < data.param.length; i++) { + System.out.println(data.param[i]); + }*/ + + return data; + } + + public void encode(FriendlyByteBuf buf) { + buf.writeBlockPos(te); + + encodeString(buf, name); + buf.writeShort(param.length); + + Object obj; + for (int i = 0; i < param.length; i++) { + obj = param[i]; + if(obj instanceof Integer _int){ + buf.writeChar('i'); + buf.writeInt(_int); + } + else if(obj instanceof Double _double){ + buf.writeChar('d'); + buf.writeDouble(_double); + } + else if(obj instanceof Float _float){ + buf.writeChar('f'); + buf.writeDouble(_float); + } + else if(obj instanceof String str){ + buf.writeChar('s'); + encodeString(buf, str); + } + else if(obj instanceof Boolean bool){ + buf.writeChar('b'); + buf.writeBoolean(bool); + } + else if(obj instanceof Character ch){ + buf.writeChar('c'); + buf.writeChar(ch); + } + else { + throw new RuntimeException("Unsupport type: " + obj.getClass()); + } + } + } + + public static void handler(CP_KeyBoardInputEvent msg, Supplier context){ + NetworkEvent.Context ctx = context.get(); + ctx.setPacketHandled(true); + ctx.enqueueWork(() -> { + BlockEntity be = context.get().getSender().level().getExistingBlockEntity(msg.te); + if(be instanceof KeyBoardTE te){ + te.PushEvent(msg.name, msg.param); + } + }); + } +} diff --git a/src/main/java/com/dfdyz/void_power/network/PacketManager.java b/src/main/java/com/dfdyz/void_power/network/PacketManager.java index b40a77e..ed36171 100644 --- a/src/main/java/com/dfdyz/void_power/network/PacketManager.java +++ b/src/main/java/com/dfdyz/void_power/network/PacketManager.java @@ -1,10 +1,7 @@ package com.dfdyz.void_power.network; import com.dfdyz.void_power.VoidPowerMod; -import com.dfdyz.void_power.network.CP.CP_HologramInputEvent; -import com.dfdyz.void_power.network.CP.CP_HologramRename; -import com.dfdyz.void_power.network.CP.CP_HologramUpdateRequest; -import com.dfdyz.void_power.network.CP.CP_RSI_ChannelModify; +import com.dfdyz.void_power.network.CP.*; import com.dfdyz.void_power.network.SP.*; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerPlayer; @@ -98,6 +95,11 @@ public static void Init(){ CHANNEL.registerMessage(index++, CP_RSI_ChannelModify.class, CP_RSI_ChannelModify::encode, CP_RSI_ChannelModify::decode, CP_RSI_ChannelModify::handler, Optional.of(NetworkDirection.PLAY_TO_SERVER)); + + CHANNEL.registerMessage(index++, CP_KeyBoardInputEvent.class, + CP_KeyBoardInputEvent::encode, CP_KeyBoardInputEvent::decode, + CP_KeyBoardInputEvent::handler, Optional.of(NetworkDirection.PLAY_TO_SERVER)); + //CHANNEL.registerMessage(index++, SP_UpdateAnimatedPiano.class, SP_UpdateAnimatedPiano::encode, SP_UpdateAnimatedPiano::decode, SP_UpdateAnimatedPiano::onClientMessageReceived, Optional.of(NetworkDirection.PLAY_TO_CLIENT)); //CHANNEL.registerMessage(index++, CP_UpdateLampColor.class, CP_UpdateLampColor::encode, CP_UpdateLampColor::decode, CP_UpdateLampColor::onServerMessageReceived, Optional.of(NetworkDirection.PLAY_TO_SERVER)); //CHANNEL.registerMessage(index++, SP_UpdateLampColor.class, SP_UpdateLampColor::encode, SP_UpdateLampColor::decode, SP_UpdateLampColor::onClientMessageReceived, Optional.of(NetworkDirection.PLAY_TO_CLIENT)); diff --git a/src/main/java/com/dfdyz/void_power/patched/IPatchedTerminalState.java b/src/main/java/com/dfdyz/void_power/patched/IPatchedTerminalState.java new file mode 100644 index 0000000..278fe80 --- /dev/null +++ b/src/main/java/com/dfdyz/void_power/patched/IPatchedTerminalState.java @@ -0,0 +1,9 @@ +package com.dfdyz.void_power.patched; + +public interface IPatchedTerminalState { + boolean void_power$GetTransMode(); + char void_power$GetTransColor(); + + void void_power$SetTransMode(boolean m); + void void_power$SetTransColor(char c); +} diff --git a/src/main/java/com/dfdyz/void_power/registry/VPBlocks.java b/src/main/java/com/dfdyz/void_power/registry/VPBlocks.java index 5381f2a..c3ccdfa 100644 --- a/src/main/java/com/dfdyz/void_power/registry/VPBlocks.java +++ b/src/main/java/com/dfdyz/void_power/registry/VPBlocks.java @@ -3,6 +3,7 @@ import com.dfdyz.void_power.world.blocks.engine_controller.EngineControllerBlock; import com.dfdyz.void_power.world.blocks.glass_screen.GlassScreenBlock; import com.dfdyz.void_power.world.blocks.hologram.HologramBlock; +import com.dfdyz.void_power.world.blocks.key_board.KeyBoardBlock; import com.dfdyz.void_power.world.blocks.redstone_link.RSBroadcasterBlock; import com.dfdyz.void_power.world.blocks.redstone_link.RSReceiverBlock; import com.dfdyz.void_power.world.blocks.redstone_link.RSRouterBlock; @@ -23,7 +24,7 @@ public class VPBlocks { REGISTRATE.setCreativeTab(VPCreativeTabs.TAB); } - public static final BlockEntry VOID_ENGINE = REGISTRATE.block(VoidEngineBlock.ID, VoidEngineBlock::new) + /* public static final BlockEntry VOID_ENGINE = REGISTRATE.block(VoidEngineBlock.ID, VoidEngineBlock::new) .initialProperties(SharedProperties::stone) .transform(TagGen.axeOrPickaxe()) .blockstate(BlockStateGen.horizontalBlockProvider(true)) @@ -31,11 +32,11 @@ public class VPBlocks { //.transform(BlockStressDefaults.setImpact(8.0)) .item() .transform(customItemModel()) - .register(); + .register();*/ //Blocks.GLASS - public static final BlockEntry ENGINE_CONTROLLER_BLOCK = REGISTRATE.block(EngineControllerBlock.ID, EngineControllerBlock::new) + /* public static final BlockEntry ENGINE_CONTROLLER_BLOCK = REGISTRATE.block(EngineControllerBlock.ID, EngineControllerBlock::new) .initialProperties(SharedProperties::stone) .transform(TagGen.axeOrPickaxe()) .blockstate(BlockStateGen.horizontalBlockProvider(true)) @@ -44,7 +45,17 @@ public class VPBlocks { .item() .transform(customItemModel()) .register(); - +*/ + public static final BlockEntry KEYBOARD_BLOCK = REGISTRATE.block( + KeyBoardBlock.ID, KeyBoardBlock::new) + .initialProperties(SharedProperties::stone) + .transform(TagGen.axeOrPickaxe()) + .blockstate(BlockStateGen.horizontalBlockProvider(true)) + //.addLayer(() -> RenderType::translucent) + //.transform(BlockStressDefaults.setImpact(8.0)) + .item() + .transform(customItemModel()) + .register(); public static final BlockEntry GLASS_SCREEN_BLOCK = REGISTRATE.block(GlassScreenBlock.ID, GlassScreenBlock::new) .initialProperties(SharedProperties::stone) diff --git a/src/main/java/com/dfdyz/void_power/registry/VPCreativeTabs.java b/src/main/java/com/dfdyz/void_power/registry/VPCreativeTabs.java index 383ab10..4ac5e9a 100644 --- a/src/main/java/com/dfdyz/void_power/registry/VPCreativeTabs.java +++ b/src/main/java/com/dfdyz/void_power/registry/VPCreativeTabs.java @@ -2,8 +2,8 @@ import com.dfdyz.void_power.VoidPowerMod; import com.simibubi.create.AllCreativeModeTabs; -import com.simibubi.create.foundation.utility.Components; import net.minecraft.core.registries.Registries; +import net.minecraft.network.chat.Component; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; @@ -19,7 +19,7 @@ public class VPCreativeTabs { public static final RegistryObject TAB = REGISTER.register("tab", () -> CreativeModeTab.builder() - .title(Components.translatable("itemGroup."+ VoidPowerMod.MODID +".main")) + .title(Component.translatable("itemGroup."+ VoidPowerMod.MODID +".main")) .withTabsBefore(AllCreativeModeTabs.BASE_CREATIVE_TAB.getKey()) .icon(() -> { return new ItemStack(Items.STICK); diff --git a/src/main/java/com/dfdyz/void_power/registry/VPShapes.java b/src/main/java/com/dfdyz/void_power/registry/VPShapes.java index c074c16..045e9af 100644 --- a/src/main/java/com/dfdyz/void_power/registry/VPShapes.java +++ b/src/main/java/com/dfdyz/void_power/registry/VPShapes.java @@ -3,11 +3,13 @@ import com.dfdyz.void_power.world.blocks.engine_controller.EngineControllerBlock; import com.dfdyz.void_power.world.blocks.glass_screen.GlassScreenBlock; import com.dfdyz.void_power.world.blocks.hologram.HologramBlock; +import com.dfdyz.void_power.world.blocks.key_board.KeyBoardBlock; import com.dfdyz.void_power.world.blocks.void_engine.VoidEngineBlock; import com.google.common.collect.Maps; import com.simibubi.create.AllShapes; -import com.simibubi.create.foundation.utility.VoxelShaper; + import dan200.computercraft.shared.peripheral.monitor.MonitorEdgeState; +import net.createmod.catnip.math.VoxelShaper; import net.minecraft.core.Direction; import net.minecraft.world.phys.shapes.BooleanOp; import net.minecraft.world.phys.shapes.Shapes; @@ -21,11 +23,12 @@ public class VPShapes { public static final VoxelShaper - VOID_ENGINE = new AllShapes.Builder(VoidEngineBlock.Shape()).forHorizontal(Direction.NORTH), - ENGINE_CONTROLLER = new AllShapes.Builder(EngineControllerBlock.Shape()).forHorizontal(Direction.NORTH), + //VOID_ENGINE = new AllShapes.Builder(VoidEngineBlock.Shape()).forHorizontal(Direction.NORTH), + //ENGINE_CONTROLLER = new AllShapes.Builder(EngineControllerBlock.Shape()).forHorizontal(Direction.NORTH), HOLOGRAM = new AllShapes.Builder(HologramBlock.Shape()).forHorizontal(Direction.NORTH), //FULL_BLOCK = new AllShapes.Builder(HologramBlock.Shape()).forHorizontal(Direction.NORTH), - GLASS_SCREEN_O = new AllShapes.Builder(GlassScreenBlock.ShapeO()).forHorizontal(Direction.NORTH) + GLASS_SCREEN_O = new AllShapes.Builder(GlassScreenBlock.ShapeO()).forHorizontal(Direction.NORTH), + KEYBOARD = new AllShapes.Builder(KeyBoardBlock.Shape()).forHorizontal(Direction.NORTH) ; public static class ScreenShaper{ diff --git a/src/main/java/com/dfdyz/void_power/registry/VPTileEntities.java b/src/main/java/com/dfdyz/void_power/registry/VPTileEntities.java index 95119e7..0d85dab 100644 --- a/src/main/java/com/dfdyz/void_power/registry/VPTileEntities.java +++ b/src/main/java/com/dfdyz/void_power/registry/VPTileEntities.java @@ -1,24 +1,18 @@ package com.dfdyz.void_power.registry; import com.dfdyz.void_power.client.gui.ChannelModifierGUI; -import com.dfdyz.void_power.client.gui.HologramGUI; import com.dfdyz.void_power.menu.ChannelModifierMenu; -import com.dfdyz.void_power.menu.HologramMenu; import com.dfdyz.void_power.client.renderer.tileentities.glass_screen.GlassScreenInstance; import com.dfdyz.void_power.client.renderer.tileentities.glass_screen.ScreenRenderer; import com.dfdyz.void_power.client.renderer.tileentities.hologram.HologramInstance; import com.dfdyz.void_power.client.renderer.tileentities.hologram.HologramRenderer; -import com.dfdyz.void_power.world.blocks.engine_controller.EngineControllerBlock; -import com.dfdyz.void_power.world.blocks.engine_controller.EngineControllerTE; import com.dfdyz.void_power.world.blocks.glass_screen.GlassScreenBlock; import com.dfdyz.void_power.world.blocks.glass_screen.GlassScreenTE; import com.dfdyz.void_power.world.blocks.hologram.HologramBlock; import com.dfdyz.void_power.world.blocks.hologram.HologramTE; +import com.dfdyz.void_power.world.blocks.key_board.KeyBoardBlock; +import com.dfdyz.void_power.world.blocks.key_board.KeyBoardTE; import com.dfdyz.void_power.world.blocks.redstone_link.*; -import com.dfdyz.void_power.world.blocks.void_engine.VoidEngineBlock; -import com.dfdyz.void_power.world.blocks.void_engine.VoidEngineTE; -import com.dfdyz.void_power.client.renderer.tileentities.void_engine.VoidEngineTEInstance; -import com.dfdyz.void_power.client.renderer.tileentities.void_engine.VoidEngineTERenderer; import com.dfdyz.void_power.world.items.ChannelModifierItem; import com.tterrag.registrate.util.entry.BlockEntityEntry; import com.tterrag.registrate.util.entry.MenuEntry; @@ -28,32 +22,37 @@ public class VPTileEntities { - public static final BlockEntityEntry VOID_ENGINE_TE = REGISTRATE + /* public static final BlockEntityEntry VOID_ENGINE_TE = REGISTRATE .blockEntity(VoidEngineBlock.ID, VoidEngineTE::new) - .instance(() -> VoidEngineTEInstance::new, false) + .visual(() -> VoidEngineTEInstance::new, false) .validBlock(VPBlocks.VOID_ENGINE) .renderer(() -> VoidEngineTERenderer::new) - .register(); + .register();*/ - public static final BlockEntityEntry ENGINE_CONTROLLER_TE = REGISTRATE + /*public static final BlockEntityEntry ENGINE_CONTROLLER_TE = REGISTRATE .blockEntity(EngineControllerBlock.ID, EngineControllerTE::new) .validBlock(VPBlocks.ENGINE_CONTROLLER_BLOCK) - .register(); + .register();*/ public static final BlockEntityEntry GLASS_SCREEN_TE = REGISTRATE .blockEntity(GlassScreenBlock.ID, GlassScreenTE::new) - .instance(() -> GlassScreenInstance::new, true) + .visual(() -> GlassScreenInstance::new, true) .validBlock(VPBlocks.GLASS_SCREEN_BLOCK) .renderer(() -> ScreenRenderer::new) .register(); public static final BlockEntityEntry HOLOGRAM_TE = REGISTRATE .blockEntity(HologramBlock.ID, HologramTE::new) - .instance(() -> HologramInstance::new, true) + .visual(() -> HologramInstance::new, true) .validBlock(VPBlocks.HOLOGRAM_BLOCK) .renderer(() -> HologramRenderer::new) .register(); + public static final BlockEntityEntry KEYBOARD_TE = REGISTRATE + .blockEntity(KeyBoardBlock.ID, KeyBoardTE::new) + .validBlock(VPBlocks.KEYBOARD_BLOCK) + .register(); + public static final BlockEntityEntry RS_BROADCASTER_TE = REGISTRATE .blockEntity(RSBroadcasterBlock.ID, RSBroadcasterTE::new) @@ -77,9 +76,6 @@ public class VPTileEntities { //.renderer(() -> HologramRenderer::new) .register(); - public static final MenuEntry HOLOGRAM_GUI = REGISTRATE - .menu(HologramBlock.ID, HologramMenu::new, () -> HologramGUI::new).register(); - public static final MenuEntry CHANNEL_MODIFIER_GUI = REGISTRATE .menu(ChannelModifierItem.ID, ChannelModifierMenu::new, () -> ChannelModifierGUI::new).register(); diff --git a/src/main/java/com/dfdyz/void_power/utils/CCUtils.java b/src/main/java/com/dfdyz/void_power/utils/CCUtils.java index f6c4126..d00847c 100644 --- a/src/main/java/com/dfdyz/void_power/utils/CCUtils.java +++ b/src/main/java/com/dfdyz/void_power/utils/CCUtils.java @@ -8,7 +8,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.server.MinecraftServer; import org.joml.*; -import org.valkyrienskies.core.api.ships.properties.ShipInertiaData; + import java.util.ArrayList; import java.util.HashMap; diff --git a/src/main/java/com/dfdyz/void_power/utils/VSUtils.java b/src/main/java/com/dfdyz/void_power/utils/VSUtils.java index 863170d..4e5470b 100644 --- a/src/main/java/com/dfdyz/void_power/utils/VSUtils.java +++ b/src/main/java/com/dfdyz/void_power/utils/VSUtils.java @@ -1,6 +1,6 @@ package com.dfdyz.void_power.utils; -import net.minecraft.core.BlockPos; +/*import net.minecraft.core.BlockPos; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.phys.Vec3; import org.jetbrains.annotations.NotNull; @@ -10,10 +10,10 @@ import org.valkyrienskies.core.api.ships.ServerShip; import org.valkyrienskies.core.impl.game.ships.PhysShipImpl; import org.valkyrienskies.mod.common.VSGameUtilsKt; -import org.valkyrienskies.mod.common.world.RaycastUtilsKt; +import org.valkyrienskies.mod.common.world.RaycastUtilsKt;*/ public class VSUtils { - public static double[][] getRotationMatrixRaw(ServerShip ship) { + /*public static double[][] getRotationMatrixRaw(ServerShip ship) { Matrix4dc transform = ship.getTransform().getShipToWorld(); double[][] matrix = new double[4][4]; for (int i = 0; i < 4; i++) { @@ -75,5 +75,5 @@ public static double GetBlockDistanceSqrBetween(@NotNull ServerLevel serverLevel } else return bp1.distSqr(bp2); - } + }*/ } diff --git a/src/main/java/com/dfdyz/void_power/world/blocks/engine_controller/EngineControllerBlock.java b/src/main/java/com/dfdyz/void_power/world/blocks/engine_controller/EngineControllerBlock.java index 3fe51e1..0629bd8 100644 --- a/src/main/java/com/dfdyz/void_power/world/blocks/engine_controller/EngineControllerBlock.java +++ b/src/main/java/com/dfdyz/void_power/world/blocks/engine_controller/EngineControllerBlock.java @@ -2,7 +2,6 @@ import com.dfdyz.void_power.registry.VPShapes; import com.dfdyz.void_power.registry.VPTileEntities; -import com.dfdyz.void_power.world.blocks.void_engine.VoidEngineTE; import com.simibubi.create.foundation.block.IBE; import net.minecraft.core.BlockPos; import net.minecraft.world.item.context.BlockPlaceContext; @@ -17,16 +16,15 @@ import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.valkyrienskies.core.impl.shadow.F; -public class EngineControllerBlock extends HorizontalDirectionalBlock implements IBE { - public static final String ID = "engine_controller"; +public class EngineControllerBlock /*extends HorizontalDirectionalBlock implements IBE*/ { + /*public static final String ID = "engine_controller"; public EngineControllerBlock(Properties properties) { super(properties); } + public static VoxelShape Shape() { VoxelShape shape = Shapes.empty(); shape = Shapes.join(shape, Shapes.box(0.0001, 0.0001, 0.0001, 0.9999, 0.9999, 0.9999), BooleanOp.OR); @@ -63,5 +61,6 @@ public BlockState getStateForPlacement(BlockPlaceContext context) { .setValue(FACING, context.getHorizontalDirection()); } +*/ } diff --git a/src/main/java/com/dfdyz/void_power/world/blocks/engine_controller/EngineControllerTE.java b/src/main/java/com/dfdyz/void_power/world/blocks/engine_controller/EngineControllerTE.java index bd9e40d..6bfe64c 100644 --- a/src/main/java/com/dfdyz/void_power/world/blocks/engine_controller/EngineControllerTE.java +++ b/src/main/java/com/dfdyz/void_power/world/blocks/engine_controller/EngineControllerTE.java @@ -1,5 +1,5 @@ package com.dfdyz.void_power.world.blocks.engine_controller; - +/* import com.dfdyz.void_power.compat.cct.peripherals.P_EngineController; import com.dfdyz.void_power.compat.vs.ship.EngineController; import com.dfdyz.void_power.compat.vs.ship.QueuedForceApplier; @@ -20,13 +20,13 @@ import org.joml.Vector3d; import org.valkyrienskies.core.api.ships.ServerShip; import org.valkyrienskies.core.impl.game.ships.PhysShipImpl; -import org.valkyrienskies.mod.common.VSGameUtilsKt; +import org.valkyrienskies.mod.common.VSGameUtilsKt;*/ import java.util.List; -public class EngineControllerTE extends SmartBlockEntity { - private P_EngineController peripheral; +public class EngineControllerTE/* extends SmartBlockEntity */{ + /* private P_EngineController peripheral; private LazyOptional peripheralCap; private ServerShip ship; @@ -155,5 +155,5 @@ public void PushCCEvent(PhysShipImpl physShip){ public ServerShip getShip(){ return this.ship; - } + }*/ } diff --git a/src/main/java/com/dfdyz/void_power/world/blocks/glass_screen/GlassScreenBlock.java b/src/main/java/com/dfdyz/void_power/world/blocks/glass_screen/GlassScreenBlock.java index f2a7517..4a20aa9 100644 --- a/src/main/java/com/dfdyz/void_power/world/blocks/glass_screen/GlassScreenBlock.java +++ b/src/main/java/com/dfdyz/void_power/world/blocks/glass_screen/GlassScreenBlock.java @@ -2,10 +2,10 @@ import com.dfdyz.void_power.registry.VPShapes; import com.dfdyz.void_power.registry.VPTileEntities; -import com.simibubi.create.foundation.utility.VoxelShaper; import dan200.computercraft.shared.ModRegistry; import dan200.computercraft.shared.peripheral.monitor.MonitorBlock; import dan200.computercraft.shared.peripheral.monitor.MonitorEdgeState; +import net.createmod.catnip.math.VoxelShaper; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.level.BlockGetter; diff --git a/src/main/java/com/dfdyz/void_power/world/blocks/hologram/HologramBlock.java b/src/main/java/com/dfdyz/void_power/world/blocks/hologram/HologramBlock.java index f1c457f..a597ebb 100644 --- a/src/main/java/com/dfdyz/void_power/world/blocks/hologram/HologramBlock.java +++ b/src/main/java/com/dfdyz/void_power/world/blocks/hologram/HologramBlock.java @@ -1,11 +1,13 @@ package com.dfdyz.void_power.world.blocks.hologram; import com.dfdyz.void_power.client.gui.HologramGUI; +import com.dfdyz.void_power.client.gui.KeyBoardGUI; import com.dfdyz.void_power.registry.VPShapes; import com.simibubi.create.foundation.block.IBE; import net.minecraft.client.Minecraft; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.network.chat.Component; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; @@ -80,7 +82,7 @@ public InteractionResult use(@NotNull BlockState state, @NotNull Level level, if(!level.isClientSide && !player.isShiftKeyDown()){ if(level.getBlockEntity(pos) instanceof HologramTE te){ //Minecraft.getInstance().setScreen(new HologramGUI(te)); - NetworkHooks.openScreen((ServerPlayer) player, te, te.getBlockPos()); + Minecraft.getInstance().setScreen(new HologramGUI(Component.literal(""), te)); return InteractionResult.SUCCESS; //level.getEntities(EntityTypeTest.forClass(LivingEntity.class), new AABB(/*范围自己设置*/), LivingEntity::isAlive); diff --git a/src/main/java/com/dfdyz/void_power/world/blocks/hologram/HologramTE.java b/src/main/java/com/dfdyz/void_power/world/blocks/hologram/HologramTE.java index 8d64236..449541c 100644 --- a/src/main/java/com/dfdyz/void_power/world/blocks/hologram/HologramTE.java +++ b/src/main/java/com/dfdyz/void_power/world/blocks/hologram/HologramTE.java @@ -4,7 +4,6 @@ import com.dfdyz.void_power.Config; import com.dfdyz.void_power.client.screen_cache.IScreenCache; import com.dfdyz.void_power.compat.cct.peripherals.P_HologramPeripheral; -import com.dfdyz.void_power.menu.HologramMenu; import com.dfdyz.void_power.network.CP.CP_HologramInputEvent; import com.dfdyz.void_power.network.CP.CP_HologramUpdateRequest; import com.dfdyz.void_power.network.PacketManager; @@ -16,7 +15,6 @@ import com.dfdyz.void_power.utils.IntBuffer; import com.dfdyz.void_power.utils.ParamUtils; import com.dfdyz.void_power.utils.SyncLocker; -import com.google.errorprone.annotations.concurrent.GuardedBy; import com.simibubi.create.foundation.blockEntity.SmartBlockEntity; import com.simibubi.create.foundation.blockEntity.behaviour.BehaviourType; import com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour; @@ -46,7 +44,7 @@ import static com.dfdyz.void_power.utils.ByteUtils.maxLengthPerPack; -public class HologramTE extends SmartBlockEntity implements MenuProvider, IFrameBuffer{ +public class HologramTE extends SmartBlockEntity implements IFrameBuffer{ public Behavior behavior; @Override @@ -504,17 +502,6 @@ public void Rename(String str){ } } - @Override - public @NotNull Component getDisplayName() { - return Component.literal("Hologram"); - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @NotNull Inventory inventory, @NotNull Player player) { - return VPTileEntities.HOLOGRAM_GUI.create(i, inventory); - } - @Override public int[] getBuffer() { return buffer; diff --git a/src/main/java/com/dfdyz/void_power/world/blocks/key_board/KeyBoardBlock.java b/src/main/java/com/dfdyz/void_power/world/blocks/key_board/KeyBoardBlock.java new file mode 100644 index 0000000..4a9da68 --- /dev/null +++ b/src/main/java/com/dfdyz/void_power/world/blocks/key_board/KeyBoardBlock.java @@ -0,0 +1,95 @@ +package com.dfdyz.void_power.world.blocks.key_board; + +import com.dfdyz.void_power.client.gui.KeyBoardGUI; +import com.dfdyz.void_power.registry.VPShapes; +import com.dfdyz.void_power.registry.VPTileEntities; +import com.google.common.collect.ImmutableMap; +import com.simibubi.create.foundation.block.IBE; +import net.minecraft.client.Minecraft; +import net.minecraft.core.BlockPos; +import net.minecraft.network.chat.Component; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.InteractionResult; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.context.BlockPlaceContext; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.DirectionalBlock; +import net.minecraft.world.level.block.HorizontalDirectionalBlock; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.block.state.properties.Property; +import net.minecraft.world.phys.BlockHitResult; +import net.minecraft.world.phys.shapes.BooleanOp; +import net.minecraft.world.phys.shapes.CollisionContext; +import net.minecraft.world.phys.shapes.Shapes; +import net.minecraft.world.phys.shapes.VoxelShape; +import net.minecraftforge.network.NetworkHooks; +import org.jetbrains.annotations.NotNull; + +import java.util.function.Function; + +public class KeyBoardBlock extends HorizontalDirectionalBlock implements IBE { + public static final String ID = "key_board"; + public KeyBoardBlock(Properties properties) { + super(properties); + } + + @Override + protected void createBlockStateDefinition(StateDefinition.Builder builder) { + builder.add(FACING); + super.createBlockStateDefinition(builder); + } + + public static VoxelShape Shape() { + VoxelShape shape = Shapes.empty(); + shape = Shapes.join(shape, + Shapes.box( + 0.0001, 0.0001, 0.0001, + 0.9999, 0.9999 / 8, 0.9999), + BooleanOp.OR); + return shape; + } + + @Override + public BlockState getStateForPlacement(BlockPlaceContext context) { + return this.defaultBlockState().setValue(FACING, context.getHorizontalDirection()); + } + + @Override + protected ImmutableMap getShapeForEachState(Function p_152459_) { + return super.getShapeForEachState(p_152459_); + } + + @SuppressWarnings("deprecation") + @Override + public VoxelShape getShape(BlockState state, BlockGetter blockReader, BlockPos pos, CollisionContext context) { + return VPShapes.KEYBOARD.get(state.getValue(FACING)); + } + + @Override + public InteractionResult use(@NotNull BlockState state, @NotNull Level level, + @NotNull BlockPos pos, @NotNull Player player, + @NotNull InteractionHand hand, @NotNull BlockHitResult blockHitResult) { + if(level.isClientSide && !player.isShiftKeyDown()){ + if(level.getBlockEntity(pos) instanceof KeyBoardTE te){ + Minecraft.getInstance().setScreen(new KeyBoardGUI(Component.literal(""), te)); + return InteractionResult.SUCCESS; + } + } + return InteractionResult.SUCCESS; + } + + @Override + public Class getBlockEntityClass() { + return KeyBoardTE.class; + } + + @Override + public BlockEntityType getBlockEntityType() { + return VPTileEntities.KEYBOARD_TE.get(); + } +} diff --git a/src/main/java/com/dfdyz/void_power/world/blocks/key_board/KeyBoardTE.java b/src/main/java/com/dfdyz/void_power/world/blocks/key_board/KeyBoardTE.java new file mode 100644 index 0000000..a17f5d5 --- /dev/null +++ b/src/main/java/com/dfdyz/void_power/world/blocks/key_board/KeyBoardTE.java @@ -0,0 +1,71 @@ +package com.dfdyz.void_power.world.blocks.key_board; + +import com.dfdyz.void_power.compat.cct.peripherals.P_KeyBoardPeripheral; +import com.simibubi.create.foundation.blockEntity.SmartBlockEntity; +import com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour; +import dan200.computercraft.api.peripheral.IPeripheral; +import dan200.computercraft.shared.Capabilities; +import dan200.computercraft.shared.peripheral.monitor.MonitorBlockEntity; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.util.LazyOptional; +import org.jetbrains.annotations.NotNull; + +import java.util.List; + +public class KeyBoardTE extends SmartBlockEntity { + + public KeyBoardTE(BlockEntityType type, BlockPos pos, BlockState state) { + super(type, pos, state); + } + + public P_KeyBoardPeripheral peripheral; + protected LazyOptional peripheralCap; + + MonitorBlockEntity monitor_proxy; + + public P_KeyBoardPeripheral getPeripheral(){ + if(peripheral == null){ + peripheral = new P_KeyBoardPeripheral(this); + } + return peripheral; + } + + @Override + public @NotNull LazyOptional getCapability(@NotNull Capability cap, Direction direction) { + if(cap == Capabilities.CAPABILITY_PERIPHERAL){ + if(peripheralCap == null || !peripheralCap.isPresent()) + peripheralCap = LazyOptional.of(this::getPeripheral); + return peripheralCap.cast(); + } + return super.getCapability(cap, direction); + } + + @Override + public void addBehaviours(List list) { + + } + + @Override + public void tick() { + super.tick(); + + if(monitor_proxy == null || monitor_proxy.isRemoved()) { + monitor_proxy = null; + return; + } + + // todo: use monitor as a hub + //if(monitor_proxy.) + + } + + public void PushEvent(String event, Object... data){ + if (peripheral != null){ + peripheral.PushEvent(event, data); + } + } +} diff --git a/src/main/java/com/dfdyz/void_power/world/blocks/redstone_link/RSBroadcasterBlock.java b/src/main/java/com/dfdyz/void_power/world/blocks/redstone_link/RSBroadcasterBlock.java index a3f9016..f398f4a 100644 --- a/src/main/java/com/dfdyz/void_power/world/blocks/redstone_link/RSBroadcasterBlock.java +++ b/src/main/java/com/dfdyz/void_power/world/blocks/redstone_link/RSBroadcasterBlock.java @@ -4,7 +4,7 @@ import com.dfdyz.void_power.registry.VPTileEntities; import com.dfdyz.void_power.world.redstone.ChannelNetworkHandler; import com.simibubi.create.foundation.block.IBE; -import com.simibubi.create.foundation.utility.Iterate; +import net.createmod.catnip.data.Iterate; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.network.chat.Component; diff --git a/src/main/java/com/dfdyz/void_power/world/blocks/redstone_link/RSRouterTE.java b/src/main/java/com/dfdyz/void_power/world/blocks/redstone_link/RSRouterTE.java index dd8a942..d718c59 100644 --- a/src/main/java/com/dfdyz/void_power/world/blocks/redstone_link/RSRouterTE.java +++ b/src/main/java/com/dfdyz/void_power/world/blocks/redstone_link/RSRouterTE.java @@ -35,7 +35,7 @@ public class RSRouterTE extends SmartBlockEntity { public final ITickableHolder[] holders; - static final int maxChannels = 16; + public static final int maxChannels = 16; public final SyncLocker dirty = new SyncLocker<>(true); final int[] powers = new int[maxChannels]; @@ -65,7 +65,8 @@ public void addBehaviours(List behaviours) {} return super.getCapability(cap, side); } - public int getPortMode(int i){ + public int getPortMode(int i) throws LuaException { + if(i< 0 || i >= maxChannels) throw new LuaException("Port id out of range. max is 0-"+ (maxChannels-1)); ITickableHolder h = holders[i]; if(h == null){ return 0; // closed @@ -78,7 +79,8 @@ else if(h instanceof ISignalReceiver){ } } - public boolean openPort(int i, ResourceLocation channel, boolean mode){ + public boolean openPort(int i, ResourceLocation channel, boolean mode) throws LuaException { + if(i< 0 || i >= maxChannels) throw new LuaException("Port id out of range. max is 0-"+ (maxChannels-1)); if(holders[i] != null){ return false; } @@ -102,11 +104,12 @@ public boolean openPort(int i, ResourceLocation channel, boolean mode){ } public void closePort(int i) throws LuaException { - if(i >= maxChannels) throw new LuaException("Port id out of range. max is "+maxChannels); + if(i< 0 || i >= maxChannels) throw new LuaException("Port id out of range. max is 0-"+ (maxChannels-1)); channels[i] = ChannelNetworkHandler.NULL_CHANNEL; } - public int getPower(int p){ + public int getPower(int p) throws LuaException { + if(p< 0 || p >= maxChannels) throw new LuaException("Port id out of range. max is 0-"+ (maxChannels-1)); ITickableHolder h = holders[p]; if(h != null){ return h.getPower(); @@ -120,7 +123,9 @@ public void process(){ } } - public boolean setPower(int port, int power){ + public boolean setPower(int port, int power) throws LuaException { + if(port< 0 || port >= maxChannels) throw new LuaException("Port id out of range 0-"+ (maxChannels-1)); + if(power < 0 || power > 15) throw new LuaException("Power out of range 0-15"); ITickableHolder h = holders[port]; if(h instanceof RouterSender s){ s.setPower(power); diff --git a/src/main/java/com/dfdyz/void_power/world/blocks/void_engine/VoidEngineBlock.java b/src/main/java/com/dfdyz/void_power/world/blocks/void_engine/VoidEngineBlock.java index 30fcc92..2249ab2 100644 --- a/src/main/java/com/dfdyz/void_power/world/blocks/void_engine/VoidEngineBlock.java +++ b/src/main/java/com/dfdyz/void_power/world/blocks/void_engine/VoidEngineBlock.java @@ -9,14 +9,12 @@ import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.LevelReader; -import net.minecraft.world.level.block.RenderShape; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.shapes.BooleanOp; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -import net.minecraftforge.energy.IEnergyStorage; public class VoidEngineBlock extends HorizontalKineticBlock implements IBE { @@ -39,7 +37,8 @@ public boolean skipRendering(BlockState p_60532_, BlockState p_60533_, Direction @Override public VoxelShape getShape(BlockState state, BlockGetter blockReader, BlockPos pos, CollisionContext context) { - return VPShapes.VOID_ENGINE.get(state.getValue(HORIZONTAL_FACING)); + //return VPShapes.VOID_ENGINE.get(state.getValue(HORIZONTAL_FACING)); + return null; } @Override @@ -68,7 +67,8 @@ public Class getBlockEntityClass() { @Override public BlockEntityType getBlockEntityType() { - return VPTileEntities.VOID_ENGINE_TE.get(); + //return VPTileEntities.VOID_ENGINE_TE.get(); + return null; } diff --git a/src/main/java/com/dfdyz/void_power/world/blocks/void_engine/VoidEngineTE.java b/src/main/java/com/dfdyz/void_power/world/blocks/void_engine/VoidEngineTE.java index d3dd06e..db6d067 100644 --- a/src/main/java/com/dfdyz/void_power/world/blocks/void_engine/VoidEngineTE.java +++ b/src/main/java/com/dfdyz/void_power/world/blocks/void_engine/VoidEngineTE.java @@ -8,8 +8,8 @@ import net.minecraft.util.Mth; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import org.valkyrienskies.core.api.ships.ServerShip; -import org.valkyrienskies.mod.common.VSGameUtilsKt; +/*import org.valkyrienskies.core.api.ships.ServerShip; +import org.valkyrienskies.mod.common.VSGameUtilsKt;*/ public class VoidEngineTE extends KineticBlockEntity{ @@ -17,7 +17,7 @@ public VoidEngineTE(BlockEntityType typeIn, BlockPos pos, BlockState state) { super(typeIn, pos, state); } - private ServerShip ship; + /* private ServerShip ship; @Override public void onSpeedChanged(float previousSpeed) { @@ -74,5 +74,5 @@ public void remove() { EngineController ec = EngineController.getOrCreate(ship); ec.removeEngine(this); } - } + }*/ } diff --git a/src/main/java/com/dfdyz/void_power/world/items/VRGlassesItem.java b/src/main/java/com/dfdyz/void_power/world/items/VRGlassesItem.java index 63f67cb..daf59dc 100644 --- a/src/main/java/com/dfdyz/void_power/world/items/VRGlassesItem.java +++ b/src/main/java/com/dfdyz/void_power/world/items/VRGlassesItem.java @@ -66,7 +66,6 @@ public static ResourceLocation getDim(ItemStack item){ CompoundTag nbt = uoc.getItemInHand().getOrCreateTag(); nbt.put(T_VR_HUB, NBTUtils.NBT(bp)); nbt.putString(T_VR_DIM, uoc.getLevel().dimension().location().toString()); - System.out.println("Bind."); } return super.useOn(uoc); } diff --git a/src/main/java/com/dfdyz/void_power/world/physics/HologramClickManager.java b/src/main/java/com/dfdyz/void_power/world/physics/HologramClickManager.java index 0294fdb..83442fb 100644 --- a/src/main/java/com/dfdyz/void_power/world/physics/HologramClickManager.java +++ b/src/main/java/com/dfdyz/void_power/world/physics/HologramClickManager.java @@ -1,5 +1,5 @@ package com.dfdyz.void_power.world.physics; - +/* import com.dfdyz.void_power.world.blocks.hologram.HologramTE; import com.google.common.collect.Lists; import com.google.common.collect.Maps; @@ -22,7 +22,7 @@ import java.util.List; import java.util.Map; import java.util.Set; -import java.util.concurrent.atomic.AtomicReference; +import java.util.concurrent.atomic.AtomicReference;*/ public class HologramClickManager { diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg index c43cf01..8675ced 100644 --- a/src/main/resources/META-INF/accesstransformer.cfg +++ b/src/main/resources/META-INF/accesstransformer.cfg @@ -5,3 +5,5 @@ public net.minecraft.client.renderer.RenderStateShard f_110154_ #OVERLAY public net.minecraft.client.renderer.RenderStateShard f_110155_ #NO_OVERLAY public net.minecraft.client.renderer.RenderStateShard f_110135_ #ADDITIVE_TRANSPARENCY public com.mojang.blaze3d.platform.NativeImage f_84964_ #pixels + +public net.minecraft.client.Minecraft f_91078_ #missTime \ No newline at end of file diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 2a157fa..48d04f7 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -51,7 +51,7 @@ description='''${mod_description}''' # An ordering relationship for the dependency - BEFORE or AFTER required if the dependency is not mandatory # BEFORE - This mod is loaded BEFORE the dependency # AFTER - This mod is loaded AFTER the dependency - ordering="NONE" + ordering="AFTER" # Side this dependency is applied on - BOTH, CLIENT, or SERVER side="BOTH" # Here's another dependency @@ -60,14 +60,14 @@ description='''${mod_description}''' mandatory=true # This version range declares a minimum of the current minecraft version up to but not including the next major version versionRange="${minecraft_version_range}" - ordering="NONE" + ordering="AFTER" side="BOTH" [[dependencies.${mod_id}]] modId="create" mandatory=true # This version range declares a minimum of the current minecraft version up to but not including the next major version -versionRange="[0.5.1,)" +versionRange="[6.0.6,6.1.0)" ordering="AFTER" side="BOTH" @@ -75,10 +75,18 @@ side="BOTH" modId="computercraft" mandatory=true # This version range declares a minimum of the current minecraft version up to but not including the next major version -versionRange="[1.113.1,)" +versionRange="[1.116.1,)" ordering="AFTER" side="BOTH" +# wait for vs update to compat create 6 +# [[dependencies.${mod_id}]] +# modId="valkyrienskies" +# mandatory=true +# This version range declares a minimum of the current minecraft version up to but not including the next major version +# versionRange="[2.1.3,)" +# ordering="AFTER" +# side="BOTH" diff --git a/src/main/resources/assets/minecraft/shaders/core/void_power/rendertype_text.fsh b/src/main/resources/assets/minecraft/shaders/core/void_power/rendertype_text.fsh index 3fe4601..19f3a1e 100644 --- a/src/main/resources/assets/minecraft/shaders/core/void_power/rendertype_text.fsh +++ b/src/main/resources/assets/minecraft/shaders/core/void_power/rendertype_text.fsh @@ -9,7 +9,7 @@ uniform float FogStart; uniform float FogEnd; uniform vec4 FogColor; -in float vertexDistance; +//in float vertexDistance; in vec4 vertexColor; in vec2 texCoord0; @@ -20,5 +20,5 @@ void main() { if (color.a < 0.1) { discard; } - fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor); + fragColor = linear_fog(color, 1, FogStart, FogEnd, FogColor); } diff --git a/src/main/resources/assets/minecraft/shaders/core/void_power/rendertype_text.vsh b/src/main/resources/assets/minecraft/shaders/core/void_power/rendertype_text.vsh index 9d1df1a..b157eed 100644 --- a/src/main/resources/assets/minecraft/shaders/core/void_power/rendertype_text.vsh +++ b/src/main/resources/assets/minecraft/shaders/core/void_power/rendertype_text.vsh @@ -14,13 +14,13 @@ uniform mat4 ProjMat; uniform mat3 IViewRotMat; uniform int FogShape; -out float vertexDistance; +//out float vertexDistance; out vec4 vertexColor; out vec2 texCoord0; void main() { gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0); - vertexDistance = fog_distance(ModelViewMat, IViewRotMat * Position, FogShape); + //vertexDistance = fog_distance(ModelViewMat, IViewRotMat * Position, FogShape); vertexColor = Color * texelFetch(Sampler2, UV2 / 16, 0); texCoord0 = UV0; } diff --git a/src/main/resources/assets/void_power/blockstates/key_board.json b/src/main/resources/assets/void_power/blockstates/key_board.json new file mode 100644 index 0000000..01dca2c --- /dev/null +++ b/src/main/resources/assets/void_power/blockstates/key_board.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=east": { + "model": "void_power:block/key_board/block", + "y": 90 + }, + "facing=north": { + "model": "void_power:block/key_board/block" + }, + "facing=south": { + "model": "void_power:block/key_board/block", + "y": 180 + }, + "facing=west": { + "model": "void_power:block/key_board/block", + "y": 270 + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/void_power/lang/backup/en_us.json b/src/main/resources/assets/void_power/lang/backup/en_us.json index 7f4626d..37a0871 100644 --- a/src/main/resources/assets/void_power/lang/backup/en_us.json +++ b/src/main/resources/assets/void_power/lang/backup/en_us.json @@ -9,5 +9,8 @@ "itemGroup.void_power.main": "Void Power", - "key_bind.vr_glasses": "Toggle VR Glasses" + "key_bind.vr_glasses": "Toggle VR Glasses", + + "gui.void_power.key_board.actived": "&3[Using Keyboard]" + } \ No newline at end of file diff --git a/src/main/resources/assets/void_power/lang/backup/zh_cn.json b/src/main/resources/assets/void_power/lang/backup/zh_cn.json index 4c91dba..4f3335c 100644 --- a/src/main/resources/assets/void_power/lang/backup/zh_cn.json +++ b/src/main/resources/assets/void_power/lang/backup/zh_cn.json @@ -6,5 +6,8 @@ "item.void_power.vr_glasses": "VR眼镜(需绑定全息显示器)", "item.void_power.channel_modifier": "信道修改器", "itemGroup.void_power.main": "虚空动力", - "key_bind.vr_glasses": "开关VR研究" + "key_bind.vr_glasses": "开关VR眼镜", + + "gui.void_power.key_board.actived": "&3[正在使用键盘]" + } \ No newline at end of file diff --git a/src/main/resources/assets/void_power/models/block/cube.json b/src/main/resources/assets/void_power/models/block/cube.json index 945d52a..6b55ae6 100644 --- a/src/main/resources/assets/void_power/models/block/cube.json +++ b/src/main/resources/assets/void_power/models/block/cube.json @@ -1,48 +1,73 @@ { - "elements": [ - { "from": [ 0, 0, 0 ], - "to": [ 16, 16, 16 ], - "faces": { - "down": { "texture": "#down", "cullface": "down" }, - "up": { "texture": "#up", "cullface": "up" }, - "north": { "texture": "#north", "cullface": "north" }, - "south": { "texture": "#south", "cullface": "south" }, - "west": { "texture": "#west", "cullface": "west" }, - "east": { "texture": "#east", "cullface": "east" } - } - } - ], - "gui_light": "side", - "display": { - "gui": { - "rotation": [ 30, 225, 0 ], - "translation": [ 0, 0, 0], - "scale":[ 0.625, 0.625, 0.625 ] - }, - "ground": { - "rotation": [ 0, 0, 0 ], - "translation": [ 0, 3, 0], - "scale":[ 0.25, 0.25, 0.25 ] - }, - "fixed": { - "rotation": [ 0, 0, 0 ], - "translation": [ 0, 0, 0], - "scale":[ 0.5, 0.5, 0.5 ] - }, - "thirdperson_righthand": { - "rotation": [ 75, 45, 0 ], - "translation": [ 0, 2.5, 0], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "firstperson_righthand": { - "rotation": [ 0, 45, 0 ], - "translation": [ 0, 0, 0 ], - "scale": [ 0.40, 0.40, 0.40 ] - }, - "firstperson_lefthand": { - "rotation": [ 0, 225, 0 ], - "translation": [ 0, 0, 0 ], - "scale": [ 0.40, 0.40, 0.40 ] - } - } -} + "credit": "Made with Blockbench", + "textures": { + "0": "block/texture", + "particle": "block/texture" + }, + "elements": [ + { + "from": [7, 0, 7], + "to": [9, 2, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 0, 7]}, + "faces": { + "north": {"uv": [2, 4, 4, 6], "texture": "#0"}, + "east": {"uv": [4, 2, 6, 4], "texture": "#0"}, + "south": {"uv": [4, 4, 6, 6], "texture": "#0"}, + "west": {"uv": [0, 6, 2, 8], "texture": "#0"}, + "up": {"uv": [8, 2, 6, 0], "texture": "#0"}, + "down": {"uv": [4, 6, 2, 8], "texture": "#0"} + } + }, + { + "from": [6, -1, 10], + "to": [10, 3, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 0, 10]}, + "faces": { + "north": {"uv": [0, 0, 2, 2], "texture": "#0"} + } + }, + { + "from": [4, -1, 6], + "to": [6, 3, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [5, 1, 8]}, + "faces": { + "east": {"uv": [0, 0, 2, 2], "texture": "#0"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [75, 45, 0], + "translation": [0, 2.5, 0], + "scale": [0.375, 0.375, 0.375] + }, + "firstperson_righthand": { + "rotation": [0, 45, 0], + "scale": [0.4, 0.4, 0.4] + }, + "firstperson_lefthand": { + "rotation": [0, 225, 0], + "scale": [0.4, 0.4, 0.4] + }, + "ground": { + "translation": [0, 3, 0], + "scale": [0.25, 0.25, 0.25] + }, + "gui": { + "rotation": [30, 225, 0], + "scale": [0.625, 0.625, 0.625] + }, + "fixed": { + "scale": [0.5, 0.5, 0.5] + } + }, + "groups": [ + 0, + { + "name": "group", + "origin": [7, 0, 10], + "color": 0, + "children": [1, 2] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/void_power/models/block/key_board/block.json b/src/main/resources/assets/void_power/models/block/key_board/block.json new file mode 100644 index 0000000..98d0029 --- /dev/null +++ b/src/main/resources/assets/void_power/models/block/key_board/block.json @@ -0,0 +1,1182 @@ +{ + "format_version": "1.9.0", + "credit": "Made with Blockbench", + "texture_size": [64, 64], + "textures": { + "0": "void_power:block/kb_texture", + "particle": "void_power:block/kb_texture" + }, + "elements": [ + { + "name": "panel", + "from": [-2, 0, 3], + "to": [18, 1, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 1]}, + "faces": { + "north": {"uv": [0, 5, 5, 5.25], "texture": "#0"}, + "east": {"uv": [5, 0.25, 7.5, 0.5], "texture": "#0"}, + "south": {"uv": [5, 0, 10, 0.25], "texture": "#0"}, + "west": {"uv": [5, 0.5, 7.5, 0.75], "texture": "#0"}, + "up": {"uv": [5, 2.5, 0, 0], "texture": "#0"}, + "down": {"uv": [5, 2.5, 0, 5], "texture": "#0"} + } + }, + { + "name": "key", + "from": [3.5, 0.5, 11], + "to": [11, 1.5, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [11.25, -0.5, 11]}, + "faces": { + "north": {"uv": [5, 0.75, 6.875, 1], "texture": "#0"}, + "east": {"uv": [5.75, 3.75, 6, 4], "texture": "#0"}, + "south": {"uv": [5, 1, 6.875, 1.25], "texture": "#0"}, + "west": {"uv": [4, 5.75, 4.25, 6], "texture": "#0"}, + "up": {"uv": [6.875, 1.5, 5, 1.25], "texture": "#0"}, + "down": {"uv": [6.875, 1.5, 5, 1.75], "texture": "#0"} + } + }, + { + "name": "key", + "from": [2.75, 0.5, 9.75], + "to": [3.75, 1.5, 10.75], + "rotation": {"angle": 0, "axis": "y", "origin": [10.75, -0.5, 9.75]}, + "faces": { + "north": {"uv": [5.75, 4, 6, 4.25], "texture": "#0"}, + "east": {"uv": [4.25, 5.75, 4.5, 6], "texture": "#0"}, + "south": {"uv": [5.75, 4.25, 6, 4.5], "texture": "#0"}, + "west": {"uv": [4.5, 5.75, 4.75, 6], "texture": "#0"}, + "up": {"uv": [6, 4.75, 5.75, 4.5], "texture": "#0"}, + "down": {"uv": [5, 5.75, 4.75, 6], "texture": "#0"} + } + }, + { + "name": "key", + "from": [1.5, 0.5, 9.75], + "to": [2.5, 1.5, 10.75], + "rotation": {"angle": 0, "axis": "y", "origin": [9.5, -0.5, 9.75]}, + "faces": { + "north": {"uv": [5, 5.75, 5.25, 6], "texture": "#0"}, + "east": {"uv": [5.25, 5.75, 5.5, 6], "texture": "#0"}, + "south": {"uv": [5.5, 5.75, 5.75, 6], "texture": "#0"}, + "west": {"uv": [5.75, 5.75, 6, 6], "texture": "#0"}, + "up": {"uv": [0.25, 6.25, 0, 6], "texture": "#0"}, + "down": {"uv": [0.5, 6, 0.25, 6.25], "texture": "#0"} + } + }, + { + "name": "key", + "from": [13, 0.5, 7.25], + "to": [14, 1.5, 8.25], + "rotation": {"angle": 0, "axis": "y", "origin": [21, -0.5, 7.25]}, + "faces": { + "north": {"uv": [0.5, 6, 0.75, 6.25], "texture": "#0"}, + "east": {"uv": [0.75, 6, 1, 6.25], "texture": "#0"}, + "south": {"uv": [1, 6, 1.25, 6.25], "texture": "#0"}, + "west": {"uv": [1.25, 6, 1.5, 6.25], "texture": "#0"}, + "up": {"uv": [1.75, 6.25, 1.5, 6], "texture": "#0"}, + "down": {"uv": [2, 6, 1.75, 6.25], "texture": "#0"} + } + }, + { + "name": "key", + "from": [14.25, 0.5, 7.25], + "to": [15.25, 1.5, 8.25], + "rotation": {"angle": 0, "axis": "y", "origin": [22.25, -0.5, 7.25]}, + "faces": { + "north": {"uv": [2, 6, 2.25, 6.25], "texture": "#0"}, + "east": {"uv": [2.25, 6, 2.5, 6.25], "texture": "#0"}, + "south": {"uv": [2.5, 6, 2.75, 6.25], "texture": "#0"}, + "west": {"uv": [2.75, 6, 3, 6.25], "texture": "#0"}, + "up": {"uv": [3.25, 6.25, 3, 6], "texture": "#0"}, + "down": {"uv": [3.5, 6, 3.25, 6.25], "texture": "#0"} + } + }, + { + "name": "key", + "from": [15.5, 0.5, 7.25], + "to": [17, 1.5, 8.25], + "rotation": {"angle": 0, "axis": "y", "origin": [24, -0.5, 7.25]}, + "faces": { + "north": {"uv": [3, 5.25, 3.375, 5.5], "texture": "#0"}, + "east": {"uv": [3.5, 6, 3.75, 6.25], "texture": "#0"}, + "south": {"uv": [3.5, 5.25, 3.875, 5.5], "texture": "#0"}, + "west": {"uv": [3.75, 6, 4, 6.25], "texture": "#0"}, + "up": {"uv": [4.375, 5.5, 4, 5.25], "texture": "#0"}, + "down": {"uv": [4.875, 5.25, 4.5, 5.5], "texture": "#0"} + } + }, + { + "name": "key", + "from": [-1, 0.5, 6], + "to": [0, 1.5, 7], + "rotation": {"angle": 0, "axis": "y", "origin": [7, -0.5, 6]}, + "faces": { + "north": {"uv": [6, 3.75, 6.25, 4], "texture": "#0"}, + "east": {"uv": [4, 6, 4.25, 6.25], "texture": "#0"}, + "south": {"uv": [6, 4, 6.25, 4.25], "texture": "#0"}, + "west": {"uv": [4.25, 6, 4.5, 6.25], "texture": "#0"}, + "up": {"uv": [6.25, 4.5, 6, 4.25], "texture": "#0"}, + "down": {"uv": [4.75, 6, 4.5, 6.25], "texture": "#0"} + } + }, + { + "name": "key", + "from": [0.25, 0.5, 6], + "to": [1.25, 1.5, 7], + "rotation": {"angle": 0, "axis": "y", "origin": [8.25, -0.5, 6]}, + "faces": { + "north": {"uv": [6, 4.5, 6.25, 4.75], "texture": "#0"}, + "east": {"uv": [4.75, 6, 5, 6.25], "texture": "#0"}, + "south": {"uv": [6, 4.75, 6.25, 5], "texture": "#0"}, + "west": {"uv": [5, 6, 5.25, 6.25], "texture": "#0"}, + "up": {"uv": [6.25, 5.25, 6, 5], "texture": "#0"}, + "down": {"uv": [5.5, 6, 5.25, 6.25], "texture": "#0"} + } + }, + { + "name": "key", + "from": [1.5, 0.5, 6], + "to": [2.5, 1.5, 7], + "rotation": {"angle": 0, "axis": "y", "origin": [9.5, -0.5, 6]}, + "faces": { + "north": {"uv": [6, 5.25, 6.25, 5.5], "texture": "#0"}, + "east": {"uv": [5.5, 6, 5.75, 6.25], "texture": "#0"}, + "south": {"uv": [6, 5.5, 6.25, 5.75], "texture": "#0"}, + "west": {"uv": [5.75, 6, 6, 6.25], "texture": "#0"}, + "up": {"uv": [6.25, 6, 6, 5.75], "texture": "#0"}, + "down": {"uv": [6.25, 6, 6, 6.25], "texture": "#0"} + } + }, + { + "name": "key", + "from": [0.75, 0.5, 4], + "to": [1.75, 1.5, 5], + "rotation": {"angle": 0, "axis": "y", "origin": [8.75, -0.5, 4]}, + "faces": { + "north": {"uv": [0, 6.25, 0.25, 6.5], "texture": "#0"}, + "east": {"uv": [0.25, 6.25, 0.5, 6.5], "texture": "#0"}, + "south": {"uv": [0.5, 6.25, 0.75, 6.5], "texture": "#0"}, + "west": {"uv": [0.75, 6.25, 1, 6.5], "texture": "#0"}, + "up": {"uv": [1.25, 6.5, 1, 6.25], "texture": "#0"}, + "down": {"uv": [1.5, 6.25, 1.25, 6.5], "texture": "#0"} + } + }, + { + "name": "key", + "from": [-1, 0.5, 4], + "to": [0, 1.5, 5], + "rotation": {"angle": 0, "axis": "y", "origin": [7, -0.5, 4]}, + "faces": { + "north": {"uv": [1.5, 6.25, 1.75, 6.5], "texture": "#0"}, + "east": {"uv": [1.75, 6.25, 2, 6.5], "texture": "#0"}, + "south": {"uv": [6.25, 1.75, 6.5, 2], "texture": "#0"}, + "west": {"uv": [2, 6.25, 2.25, 6.5], "texture": "#0"}, + "up": {"uv": [6.5, 2.25, 6.25, 2], "texture": "#0"}, + "down": {"uv": [2.5, 6.25, 2.25, 6.5], "texture": "#0"} + } + }, + { + "name": "key", + "from": [16, 0.5, 4], + "to": [17, 1.5, 5], + "rotation": {"angle": 0, "axis": "y", "origin": [24, -0.5, 4]}, + "faces": { + "north": {"uv": [6.25, 2.25, 6.5, 2.5], "texture": "#0"}, + "east": {"uv": [2.5, 6.25, 2.75, 6.5], "texture": "#0"}, + "south": {"uv": [6.25, 2.5, 6.5, 2.75], "texture": "#0"}, + "west": {"uv": [2.75, 6.25, 3, 6.5], "texture": "#0"}, + "up": {"uv": [6.5, 3, 6.25, 2.75], "texture": "#0"}, + "down": {"uv": [3.25, 6.25, 3, 6.5], "texture": "#0"} + } + }, + { + "name": "key", + "from": [14.75, 0.5, 4], + "to": [15.75, 1.5, 5], + "rotation": {"angle": 0, "axis": "y", "origin": [22.75, -0.5, 4]}, + "faces": { + "north": {"uv": [6.25, 3, 6.5, 3.25], "texture": "#0"}, + "east": {"uv": [3.25, 6.25, 3.5, 6.5], "texture": "#0"}, + "south": {"uv": [6.25, 3.25, 6.5, 3.5], "texture": "#0"}, + "west": {"uv": [3.5, 6.25, 3.75, 6.5], "texture": "#0"}, + "up": {"uv": [6.5, 3.75, 6.25, 3.5], "texture": "#0"}, + "down": {"uv": [4, 6.25, 3.75, 6.5], "texture": "#0"} + } + }, + { + "name": "key", + "from": [13.5, 0.5, 4], + "to": [14.5, 1.5, 5], + "rotation": {"angle": 0, "axis": "y", "origin": [21.5, -0.5, 4]}, + "faces": { + "north": {"uv": [6.25, 3.75, 6.5, 4], "texture": "#0"}, + "east": {"uv": [4, 6.25, 4.25, 6.5], "texture": "#0"}, + "south": {"uv": [6.25, 4, 6.5, 4.25], "texture": "#0"}, + "west": {"uv": [4.25, 6.25, 4.5, 6.5], "texture": "#0"}, + "up": {"uv": [6.5, 4.5, 6.25, 4.25], "texture": "#0"}, + "down": {"uv": [4.75, 6.25, 4.5, 6.5], "texture": "#0"} + } + }, + { + "name": "key", + "from": [12.25, 0.5, 4], + "to": [13.25, 1.5, 5], + "rotation": {"angle": 0, "axis": "y", "origin": [20.25, -0.5, 4]}, + "faces": { + "north": {"uv": [6.25, 4.5, 6.5, 4.75], "texture": "#0"}, + "east": {"uv": [4.75, 6.25, 5, 6.5], "texture": "#0"}, + "south": {"uv": [6.25, 4.75, 6.5, 5], "texture": "#0"}, + "west": {"uv": [5, 6.25, 5.25, 6.5], "texture": "#0"}, + "up": {"uv": [6.5, 5.25, 6.25, 5], "texture": "#0"}, + "down": {"uv": [5.5, 6.25, 5.25, 6.5], "texture": "#0"} + } + }, + { + "name": "key", + "from": [10.25, 0.5, 4], + "to": [11.25, 1.5, 5], + "rotation": {"angle": 0, "axis": "y", "origin": [18.25, -0.5, 4]}, + "faces": { + "north": {"uv": [6.25, 5.25, 6.5, 5.5], "texture": "#0"}, + "east": {"uv": [5.5, 6.25, 5.75, 6.5], "texture": "#0"}, + "south": {"uv": [6.25, 5.5, 6.5, 5.75], "texture": "#0"}, + "west": {"uv": [5.75, 6.25, 6, 6.5], "texture": "#0"}, + "up": {"uv": [6.5, 6, 6.25, 5.75], "texture": "#0"}, + "down": {"uv": [6.25, 6.25, 6, 6.5], "texture": "#0"} + } + }, + { + "name": "key", + "from": [9, 0.5, 4], + "to": [10, 1.5, 5], + "rotation": {"angle": 0, "axis": "y", "origin": [17, -0.5, 4]}, + "faces": { + "north": {"uv": [6.25, 6, 6.5, 6.25], "texture": "#0"}, + "east": {"uv": [6.25, 6.25, 6.5, 6.5], "texture": "#0"}, + "south": {"uv": [0, 6.5, 0.25, 6.75], "texture": "#0"}, + "west": {"uv": [0.25, 6.5, 0.5, 6.75], "texture": "#0"}, + "up": {"uv": [0.75, 6.75, 0.5, 6.5], "texture": "#0"}, + "down": {"uv": [1, 6.5, 0.75, 6.75], "texture": "#0"} + } + }, + { + "name": "key", + "from": [7.75, 0.5, 4], + "to": [8.75, 1.5, 5], + "rotation": {"angle": 0, "axis": "y", "origin": [15.75, -0.5, 4]}, + "faces": { + "north": {"uv": [1, 6.5, 1.25, 6.75], "texture": "#0"}, + "east": {"uv": [1.25, 6.5, 1.5, 6.75], "texture": "#0"}, + "south": {"uv": [1.5, 6.5, 1.75, 6.75], "texture": "#0"}, + "west": {"uv": [1.75, 6.5, 2, 6.75], "texture": "#0"}, + "up": {"uv": [6.75, 2, 6.5, 1.75], "texture": "#0"}, + "down": {"uv": [2.25, 6.5, 2, 6.75], "texture": "#0"} + } + }, + { + "name": "key", + "from": [6.5, 0.5, 4], + "to": [7.5, 1.5, 5], + "rotation": {"angle": 0, "axis": "y", "origin": [14.5, -0.5, 4]}, + "faces": { + "north": {"uv": [6.5, 2, 6.75, 2.25], "texture": "#0"}, + "east": {"uv": [2.25, 6.5, 2.5, 6.75], "texture": "#0"}, + "south": {"uv": [6.5, 2.25, 6.75, 2.5], "texture": "#0"}, + "west": {"uv": [2.5, 6.5, 2.75, 6.75], "texture": "#0"}, + "up": {"uv": [6.75, 2.75, 6.5, 2.5], "texture": "#0"}, + "down": {"uv": [3, 6.5, 2.75, 6.75], "texture": "#0"} + } + }, + { + "name": "key", + "from": [4.5, 0.5, 4], + "to": [5.5, 1.5, 5], + "rotation": {"angle": 0, "axis": "y", "origin": [12.5, -0.5, 4]}, + "faces": { + "north": {"uv": [6.5, 2.75, 6.75, 3], "texture": "#0"}, + "east": {"uv": [3, 6.5, 3.25, 6.75], "texture": "#0"}, + "south": {"uv": [6.5, 3, 6.75, 3.25], "texture": "#0"}, + "west": {"uv": [3.25, 6.5, 3.5, 6.75], "texture": "#0"}, + "up": {"uv": [6.75, 3.5, 6.5, 3.25], "texture": "#0"}, + "down": {"uv": [3.75, 6.5, 3.5, 6.75], "texture": "#0"} + } + }, + { + "name": "key", + "from": [3.25, 0.5, 4], + "to": [4.25, 1.5, 5], + "rotation": {"angle": 0, "axis": "y", "origin": [11.25, -0.5, 4]}, + "faces": { + "north": {"uv": [6.5, 3.5, 6.75, 3.75], "texture": "#0"}, + "east": {"uv": [3.75, 6.5, 4, 6.75], "texture": "#0"}, + "south": {"uv": [6.5, 3.75, 6.75, 4], "texture": "#0"}, + "west": {"uv": [4, 6.5, 4.25, 6.75], "texture": "#0"}, + "up": {"uv": [6.75, 4.25, 6.5, 4], "texture": "#0"}, + "down": {"uv": [4.5, 6.5, 4.25, 6.75], "texture": "#0"} + } + }, + { + "name": "key", + "from": [2, 0.5, 4], + "to": [3, 1.5, 5], + "rotation": {"angle": 0, "axis": "y", "origin": [10, -0.5, 4]}, + "faces": { + "north": {"uv": [6.5, 4.25, 6.75, 4.5], "texture": "#0"}, + "east": {"uv": [4.5, 6.5, 4.75, 6.75], "texture": "#0"}, + "south": {"uv": [6.5, 4.5, 6.75, 4.75], "texture": "#0"}, + "west": {"uv": [4.75, 6.5, 5, 6.75], "texture": "#0"}, + "up": {"uv": [6.75, 5, 6.5, 4.75], "texture": "#0"}, + "down": {"uv": [5.25, 6.5, 5, 6.75], "texture": "#0"} + } + }, + { + "name": "key", + "from": [2.75, 0.5, 6], + "to": [3.75, 1.5, 7], + "rotation": {"angle": 0, "axis": "y", "origin": [10.75, -0.5, 6]}, + "faces": { + "north": {"uv": [6.5, 5, 6.75, 5.25], "texture": "#0"}, + "east": {"uv": [5.25, 6.5, 5.5, 6.75], "texture": "#0"}, + "south": {"uv": [6.5, 5.25, 6.75, 5.5], "texture": "#0"}, + "west": {"uv": [5.5, 6.5, 5.75, 6.75], "texture": "#0"}, + "up": {"uv": [6.75, 5.75, 6.5, 5.5], "texture": "#0"}, + "down": {"uv": [6, 6.5, 5.75, 6.75], "texture": "#0"} + } + }, + { + "name": "key", + "from": [4, 0.5, 6], + "to": [5, 1.5, 7], + "rotation": {"angle": 0, "axis": "y", "origin": [12, -0.5, 6]}, + "faces": { + "north": {"uv": [6.5, 5.75, 6.75, 6], "texture": "#0"}, + "east": {"uv": [6, 6.5, 6.25, 6.75], "texture": "#0"}, + "south": {"uv": [6.5, 6, 6.75, 6.25], "texture": "#0"}, + "west": {"uv": [6.25, 6.5, 6.5, 6.75], "texture": "#0"}, + "up": {"uv": [6.75, 6.5, 6.5, 6.25], "texture": "#0"}, + "down": {"uv": [6.75, 6.5, 6.5, 6.75], "texture": "#0"} + } + }, + { + "name": "key", + "from": [5.25, 0.5, 6], + "to": [6.25, 1.5, 7], + "rotation": {"angle": 0, "axis": "y", "origin": [13.25, -0.5, 6]}, + "faces": { + "north": {"uv": [0, 6.75, 0.25, 7], "texture": "#0"}, + "east": {"uv": [0.25, 6.75, 0.5, 7], "texture": "#0"}, + "south": {"uv": [0.5, 6.75, 0.75, 7], "texture": "#0"}, + "west": {"uv": [0.75, 6.75, 1, 7], "texture": "#0"}, + "up": {"uv": [1.25, 7, 1, 6.75], "texture": "#0"}, + "down": {"uv": [1.5, 6.75, 1.25, 7], "texture": "#0"} + } + }, + { + "name": "key", + "from": [6.5, 0.5, 6], + "to": [7.5, 1.5, 7], + "rotation": {"angle": 0, "axis": "y", "origin": [14.5, -0.5, 6]}, + "faces": { + "north": {"uv": [1.5, 6.75, 1.75, 7], "texture": "#0"}, + "east": {"uv": [1.75, 6.75, 2, 7], "texture": "#0"}, + "south": {"uv": [6.75, 1.75, 7, 2], "texture": "#0"}, + "west": {"uv": [2, 6.75, 2.25, 7], "texture": "#0"}, + "up": {"uv": [7, 2.25, 6.75, 2], "texture": "#0"}, + "down": {"uv": [2.5, 6.75, 2.25, 7], "texture": "#0"} + } + }, + { + "name": "key", + "from": [7.75, 0.5, 6], + "to": [8.75, 1.5, 7], + "rotation": {"angle": 0, "axis": "y", "origin": [15.75, -0.5, 6]}, + "faces": { + "north": {"uv": [6.75, 2.25, 7, 2.5], "texture": "#0"}, + "east": {"uv": [2.5, 6.75, 2.75, 7], "texture": "#0"}, + "south": {"uv": [6.75, 2.5, 7, 2.75], "texture": "#0"}, + "west": {"uv": [2.75, 6.75, 3, 7], "texture": "#0"}, + "up": {"uv": [7, 3, 6.75, 2.75], "texture": "#0"}, + "down": {"uv": [3.25, 6.75, 3, 7], "texture": "#0"} + } + }, + { + "name": "key", + "from": [9, 0.5, 6], + "to": [10, 1.5, 7], + "rotation": {"angle": 0, "axis": "y", "origin": [17, -0.5, 6]}, + "faces": { + "north": {"uv": [6.75, 3, 7, 3.25], "texture": "#0"}, + "east": {"uv": [3.25, 6.75, 3.5, 7], "texture": "#0"}, + "south": {"uv": [6.75, 3.25, 7, 3.5], "texture": "#0"}, + "west": {"uv": [3.5, 6.75, 3.75, 7], "texture": "#0"}, + "up": {"uv": [7, 3.75, 6.75, 3.5], "texture": "#0"}, + "down": {"uv": [4, 6.75, 3.75, 7], "texture": "#0"} + } + }, + { + "name": "key", + "from": [10.25, 0.5, 6], + "to": [11.25, 1.5, 7], + "rotation": {"angle": 0, "axis": "y", "origin": [18.25, -0.5, 6]}, + "faces": { + "north": {"uv": [6.75, 3.75, 7, 4], "texture": "#0"}, + "east": {"uv": [4, 6.75, 4.25, 7], "texture": "#0"}, + "south": {"uv": [6.75, 4, 7, 4.25], "texture": "#0"}, + "west": {"uv": [4.25, 6.75, 4.5, 7], "texture": "#0"}, + "up": {"uv": [7, 4.5, 6.75, 4.25], "texture": "#0"}, + "down": {"uv": [4.75, 6.75, 4.5, 7], "texture": "#0"} + } + }, + { + "name": "key", + "from": [11.5, 0.5, 6], + "to": [12.5, 1.5, 7], + "rotation": {"angle": 0, "axis": "y", "origin": [19.5, -0.5, 6]}, + "faces": { + "north": {"uv": [6.75, 4.5, 7, 4.75], "texture": "#0"}, + "east": {"uv": [4.75, 6.75, 5, 7], "texture": "#0"}, + "south": {"uv": [6.75, 4.75, 7, 5], "texture": "#0"}, + "west": {"uv": [5, 6.75, 5.25, 7], "texture": "#0"}, + "up": {"uv": [7, 5.25, 6.75, 5], "texture": "#0"}, + "down": {"uv": [5.5, 6.75, 5.25, 7], "texture": "#0"} + } + }, + { + "name": "key", + "from": [12.75, 0.5, 6], + "to": [13.75, 1.5, 7], + "rotation": {"angle": 0, "axis": "y", "origin": [20.75, -0.5, 6]}, + "faces": { + "north": {"uv": [6.75, 5.25, 7, 5.5], "texture": "#0"}, + "east": {"uv": [5.5, 6.75, 5.75, 7], "texture": "#0"}, + "south": {"uv": [6.75, 5.5, 7, 5.75], "texture": "#0"}, + "west": {"uv": [5.75, 6.75, 6, 7], "texture": "#0"}, + "up": {"uv": [7, 6, 6.75, 5.75], "texture": "#0"}, + "down": {"uv": [6.25, 6.75, 6, 7], "texture": "#0"} + } + }, + { + "name": "key", + "from": [14, 0.5, 6], + "to": [15, 1.5, 7], + "rotation": {"angle": 0, "axis": "y", "origin": [22, -0.5, 6]}, + "faces": { + "north": {"uv": [6.75, 6, 7, 6.25], "texture": "#0"}, + "east": {"uv": [6.25, 6.75, 6.5, 7], "texture": "#0"}, + "south": {"uv": [6.75, 6.25, 7, 6.5], "texture": "#0"}, + "west": {"uv": [6.5, 6.75, 6.75, 7], "texture": "#0"}, + "up": {"uv": [7, 6.75, 6.75, 6.5], "texture": "#0"}, + "down": {"uv": [7, 6.75, 6.75, 7], "texture": "#0"} + } + }, + { + "name": "key", + "from": [15.25, 0.5, 6], + "to": [17, 1.5, 7], + "rotation": {"angle": 0, "axis": "y", "origin": [23.25, -0.5, 6]}, + "faces": { + "north": {"uv": [5, 4.75, 5.5, 5], "texture": "#0"}, + "east": {"uv": [0, 7, 0.25, 7.25], "texture": "#0"}, + "south": {"uv": [5, 5, 5.5, 5.25], "texture": "#0"}, + "west": {"uv": [0.25, 7, 0.5, 7.25], "texture": "#0"}, + "up": {"uv": [0.5, 5.5, 0, 5.25], "texture": "#0"}, + "down": {"uv": [1, 5.25, 0.5, 5.5], "texture": "#0"} + } + }, + { + "name": "key", + "from": [11.75, 0.5, 7.25], + "to": [12.75, 1.5, 8.25], + "rotation": {"angle": 0, "axis": "y", "origin": [19.75, -0.5, 7.25]}, + "faces": { + "north": {"uv": [0.5, 7, 0.75, 7.25], "texture": "#0"}, + "east": {"uv": [0.75, 7, 1, 7.25], "texture": "#0"}, + "south": {"uv": [7, 0.75, 7.25, 1], "texture": "#0"}, + "west": {"uv": [1, 7, 1.25, 7.25], "texture": "#0"}, + "up": {"uv": [7.25, 1.25, 7, 1], "texture": "#0"}, + "down": {"uv": [1.5, 7, 1.25, 7.25], "texture": "#0"} + } + }, + { + "name": "key", + "from": [10.5, 0.5, 7.25], + "to": [11.5, 1.5, 8.25], + "rotation": {"angle": 0, "axis": "y", "origin": [18.5, -0.5, 7.25]}, + "faces": { + "north": {"uv": [7, 1.25, 7.25, 1.5], "texture": "#0"}, + "east": {"uv": [1.5, 7, 1.75, 7.25], "texture": "#0"}, + "south": {"uv": [7, 1.5, 7.25, 1.75], "texture": "#0"}, + "west": {"uv": [1.75, 7, 2, 7.25], "texture": "#0"}, + "up": {"uv": [7.25, 2, 7, 1.75], "texture": "#0"}, + "down": {"uv": [2.25, 7, 2, 7.25], "texture": "#0"} + } + }, + { + "name": "key", + "from": [9.25, 0.5, 7.25], + "to": [10.25, 1.5, 8.25], + "rotation": {"angle": 0, "axis": "y", "origin": [17.25, -0.5, 7.25]}, + "faces": { + "north": {"uv": [7, 2, 7.25, 2.25], "texture": "#0"}, + "east": {"uv": [2.25, 7, 2.5, 7.25], "texture": "#0"}, + "south": {"uv": [7, 2.25, 7.25, 2.5], "texture": "#0"}, + "west": {"uv": [2.5, 7, 2.75, 7.25], "texture": "#0"}, + "up": {"uv": [7.25, 2.75, 7, 2.5], "texture": "#0"}, + "down": {"uv": [3, 7, 2.75, 7.25], "texture": "#0"} + } + }, + { + "name": "key", + "from": [8, 0.5, 7.25], + "to": [9, 1.5, 8.25], + "rotation": {"angle": 0, "axis": "y", "origin": [16, -0.5, 7.25]}, + "faces": { + "north": {"uv": [7, 2.75, 7.25, 3], "texture": "#0"}, + "east": {"uv": [3, 7, 3.25, 7.25], "texture": "#0"}, + "south": {"uv": [7, 3, 7.25, 3.25], "texture": "#0"}, + "west": {"uv": [3.25, 7, 3.5, 7.25], "texture": "#0"}, + "up": {"uv": [7.25, 3.5, 7, 3.25], "texture": "#0"}, + "down": {"uv": [3.75, 7, 3.5, 7.25], "texture": "#0"} + } + }, + { + "name": "key", + "from": [6.75, 0.5, 7.25], + "to": [7.75, 1.5, 8.25], + "rotation": {"angle": 0, "axis": "y", "origin": [14.75, -0.5, 7.25]}, + "faces": { + "north": {"uv": [7, 3.5, 7.25, 3.75], "texture": "#0"}, + "east": {"uv": [3.75, 7, 4, 7.25], "texture": "#0"}, + "south": {"uv": [7, 3.75, 7.25, 4], "texture": "#0"}, + "west": {"uv": [4, 7, 4.25, 7.25], "texture": "#0"}, + "up": {"uv": [7.25, 4.25, 7, 4], "texture": "#0"}, + "down": {"uv": [4.5, 7, 4.25, 7.25], "texture": "#0"} + } + }, + { + "name": "key", + "from": [5.5, 0.5, 7.25], + "to": [6.5, 1.5, 8.25], + "rotation": {"angle": 0, "axis": "y", "origin": [13.5, -0.5, 7.25]}, + "faces": { + "north": {"uv": [7, 4.25, 7.25, 4.5], "texture": "#0"}, + "east": {"uv": [4.5, 7, 4.75, 7.25], "texture": "#0"}, + "south": {"uv": [7, 4.5, 7.25, 4.75], "texture": "#0"}, + "west": {"uv": [4.75, 7, 5, 7.25], "texture": "#0"}, + "up": {"uv": [7.25, 5, 7, 4.75], "texture": "#0"}, + "down": {"uv": [5.25, 7, 5, 7.25], "texture": "#0"} + } + }, + { + "name": "key", + "from": [4.25, 0.5, 7.25], + "to": [5.25, 1.5, 8.25], + "rotation": {"angle": 0, "axis": "y", "origin": [12.25, -0.5, 7.25]}, + "faces": { + "north": {"uv": [7, 5, 7.25, 5.25], "texture": "#0"}, + "east": {"uv": [5.25, 7, 5.5, 7.25], "texture": "#0"}, + "south": {"uv": [7, 5.25, 7.25, 5.5], "texture": "#0"}, + "west": {"uv": [5.5, 7, 5.75, 7.25], "texture": "#0"}, + "up": {"uv": [7.25, 5.75, 7, 5.5], "texture": "#0"}, + "down": {"uv": [6, 7, 5.75, 7.25], "texture": "#0"} + } + }, + { + "name": "key", + "from": [3, 0.5, 7.25], + "to": [4, 1.5, 8.25], + "rotation": {"angle": 0, "axis": "y", "origin": [11, -0.5, 7.25]}, + "faces": { + "north": {"uv": [7, 5.75, 7.25, 6], "texture": "#0"}, + "east": {"uv": [6, 7, 6.25, 7.25], "texture": "#0"}, + "south": {"uv": [7, 6, 7.25, 6.25], "texture": "#0"}, + "west": {"uv": [6.25, 7, 6.5, 7.25], "texture": "#0"}, + "up": {"uv": [7.25, 6.5, 7, 6.25], "texture": "#0"}, + "down": {"uv": [6.75, 7, 6.5, 7.25], "texture": "#0"} + } + }, + { + "name": "key", + "from": [1.75, 0.5, 7.25], + "to": [2.75, 1.5, 8.25], + "rotation": {"angle": 0, "axis": "y", "origin": [9.75, -0.5, 7.25]}, + "faces": { + "north": {"uv": [7, 6.5, 7.25, 6.75], "texture": "#0"}, + "east": {"uv": [6.75, 7, 7, 7.25], "texture": "#0"}, + "south": {"uv": [7, 6.75, 7.25, 7], "texture": "#0"}, + "west": {"uv": [7, 7, 7.25, 7.25], "texture": "#0"}, + "up": {"uv": [0.25, 7.5, 0, 7.25], "texture": "#0"}, + "down": {"uv": [0.5, 7.25, 0.25, 7.5], "texture": "#0"} + } + }, + { + "name": "key", + "from": [0.5, 0.5, 7.25], + "to": [1.5, 1.5, 8.25], + "rotation": {"angle": 0, "axis": "y", "origin": [8.5, -0.5, 7.25]}, + "faces": { + "north": {"uv": [0.5, 7.25, 0.75, 7.5], "texture": "#0"}, + "east": {"uv": [0.75, 7.25, 1, 7.5], "texture": "#0"}, + "south": {"uv": [7.25, 0.75, 7.5, 1], "texture": "#0"}, + "west": {"uv": [1, 7.25, 1.25, 7.5], "texture": "#0"}, + "up": {"uv": [7.5, 1.25, 7.25, 1], "texture": "#0"}, + "down": {"uv": [1.5, 7.25, 1.25, 7.5], "texture": "#0"} + } + }, + { + "name": "key", + "from": [12.25, 0.5, 8.5], + "to": [13.25, 1.5, 9.5], + "rotation": {"angle": 0, "axis": "y", "origin": [20.25, -0.5, 8.5]}, + "faces": { + "north": {"uv": [7.25, 1.25, 7.5, 1.5], "texture": "#0"}, + "east": {"uv": [1.5, 7.25, 1.75, 7.5], "texture": "#0"}, + "south": {"uv": [7.25, 1.5, 7.5, 1.75], "texture": "#0"}, + "west": {"uv": [1.75, 7.25, 2, 7.5], "texture": "#0"}, + "up": {"uv": [7.5, 2, 7.25, 1.75], "texture": "#0"}, + "down": {"uv": [2.25, 7.25, 2, 7.5], "texture": "#0"} + } + }, + { + "name": "key", + "from": [13.5, 0.5, 8.5], + "to": [14.5, 1.5, 9.5], + "rotation": {"angle": 0, "axis": "y", "origin": [21.5, -0.5, 8.5]}, + "faces": { + "north": {"uv": [7.25, 2, 7.5, 2.25], "texture": "#0"}, + "east": {"uv": [2.25, 7.25, 2.5, 7.5], "texture": "#0"}, + "south": {"uv": [7.25, 2.25, 7.5, 2.5], "texture": "#0"}, + "west": {"uv": [2.5, 7.25, 2.75, 7.5], "texture": "#0"}, + "up": {"uv": [7.5, 2.75, 7.25, 2.5], "texture": "#0"}, + "down": {"uv": [3, 7.25, 2.75, 7.5], "texture": "#0"} + } + }, + { + "name": "key", + "from": [14.75, 0.5, 8.5], + "to": [17, 1.5, 9.5], + "rotation": {"angle": 0, "axis": "y", "origin": [22.75, -0.5, 8.5]}, + "faces": { + "north": {"uv": [5, 2.75, 5.625, 3], "texture": "#0"}, + "east": {"uv": [7.25, 2.75, 7.5, 3], "texture": "#0"}, + "south": {"uv": [5, 3, 5.625, 3.25], "texture": "#0"}, + "west": {"uv": [3, 7.25, 3.25, 7.5], "texture": "#0"}, + "up": {"uv": [5.625, 3.5, 5, 3.25], "texture": "#0"}, + "down": {"uv": [5.625, 3.5, 5, 3.75], "texture": "#0"} + } + }, + { + "name": "key", + "from": [11, 0.5, 8.5], + "to": [12, 1.5, 9.5], + "rotation": {"angle": 0, "axis": "y", "origin": [19, -0.5, 8.5]}, + "faces": { + "north": {"uv": [7.25, 3, 7.5, 3.25], "texture": "#0"}, + "east": {"uv": [3.25, 7.25, 3.5, 7.5], "texture": "#0"}, + "south": {"uv": [7.25, 3.25, 7.5, 3.5], "texture": "#0"}, + "west": {"uv": [3.5, 7.25, 3.75, 7.5], "texture": "#0"}, + "up": {"uv": [7.5, 3.75, 7.25, 3.5], "texture": "#0"}, + "down": {"uv": [4, 7.25, 3.75, 7.5], "texture": "#0"} + } + }, + { + "name": "key", + "from": [9.75, 0.5, 8.5], + "to": [10.75, 1.5, 9.5], + "rotation": {"angle": 0, "axis": "y", "origin": [17.75, -0.5, 8.5]}, + "faces": { + "north": {"uv": [7.25, 3.75, 7.5, 4], "texture": "#0"}, + "east": {"uv": [4, 7.25, 4.25, 7.5], "texture": "#0"}, + "south": {"uv": [7.25, 4, 7.5, 4.25], "texture": "#0"}, + "west": {"uv": [4.25, 7.25, 4.5, 7.5], "texture": "#0"}, + "up": {"uv": [7.5, 4.5, 7.25, 4.25], "texture": "#0"}, + "down": {"uv": [4.75, 7.25, 4.5, 7.5], "texture": "#0"} + } + }, + { + "name": "key", + "from": [8.5, 0.5, 8.5], + "to": [9.5, 1.5, 9.5], + "rotation": {"angle": 0, "axis": "y", "origin": [16.5, -0.5, 8.5]}, + "faces": { + "north": {"uv": [7.25, 4.5, 7.5, 4.75], "texture": "#0"}, + "east": {"uv": [4.75, 7.25, 5, 7.5], "texture": "#0"}, + "south": {"uv": [7.25, 4.75, 7.5, 5], "texture": "#0"}, + "west": {"uv": [5, 7.25, 5.25, 7.5], "texture": "#0"}, + "up": {"uv": [7.5, 5.25, 7.25, 5], "texture": "#0"}, + "down": {"uv": [5.5, 7.25, 5.25, 7.5], "texture": "#0"} + } + }, + { + "name": "key", + "from": [7.25, 0.5, 8.5], + "to": [8.25, 1.5, 9.5], + "rotation": {"angle": 0, "axis": "y", "origin": [15.25, -0.5, 8.5]}, + "faces": { + "north": {"uv": [7.25, 5.25, 7.5, 5.5], "texture": "#0"}, + "east": {"uv": [5.5, 7.25, 5.75, 7.5], "texture": "#0"}, + "south": {"uv": [7.25, 5.5, 7.5, 5.75], "texture": "#0"}, + "west": {"uv": [5.75, 7.25, 6, 7.5], "texture": "#0"}, + "up": {"uv": [7.5, 6, 7.25, 5.75], "texture": "#0"}, + "down": {"uv": [6.25, 7.25, 6, 7.5], "texture": "#0"} + } + }, + { + "name": "key", + "from": [6, 0.5, 8.5], + "to": [7, 1.5, 9.5], + "rotation": {"angle": 0, "axis": "y", "origin": [14, -0.5, 8.5]}, + "faces": { + "north": {"uv": [7.25, 6, 7.5, 6.25], "texture": "#0"}, + "east": {"uv": [6.25, 7.25, 6.5, 7.5], "texture": "#0"}, + "south": {"uv": [7.25, 6.25, 7.5, 6.5], "texture": "#0"}, + "west": {"uv": [6.5, 7.25, 6.75, 7.5], "texture": "#0"}, + "up": {"uv": [7.5, 6.75, 7.25, 6.5], "texture": "#0"}, + "down": {"uv": [7, 7.25, 6.75, 7.5], "texture": "#0"} + } + }, + { + "name": "key", + "from": [4.75, 0.5, 8.5], + "to": [5.75, 1.5, 9.5], + "rotation": {"angle": 0, "axis": "y", "origin": [12.75, -0.5, 8.5]}, + "faces": { + "north": {"uv": [7.25, 6.75, 7.5, 7], "texture": "#0"}, + "east": {"uv": [7, 7.25, 7.25, 7.5], "texture": "#0"}, + "south": {"uv": [7.25, 7, 7.5, 7.25], "texture": "#0"}, + "west": {"uv": [7.25, 7.25, 7.5, 7.5], "texture": "#0"}, + "up": {"uv": [0.25, 7.75, 0, 7.5], "texture": "#0"}, + "down": {"uv": [0.5, 7.5, 0.25, 7.75], "texture": "#0"} + } + }, + { + "name": "key", + "from": [3.5, 0.5, 8.5], + "to": [4.5, 1.5, 9.5], + "rotation": {"angle": 0, "axis": "y", "origin": [11.5, -0.5, 8.5]}, + "faces": { + "north": {"uv": [7.5, 0.25, 7.75, 0.5], "texture": "#0"}, + "east": {"uv": [0.5, 7.5, 0.75, 7.75], "texture": "#0"}, + "south": {"uv": [7.5, 0.5, 7.75, 0.75], "texture": "#0"}, + "west": {"uv": [0.75, 7.5, 1, 7.75], "texture": "#0"}, + "up": {"uv": [7.75, 1, 7.5, 0.75], "texture": "#0"}, + "down": {"uv": [1.25, 7.5, 1, 7.75], "texture": "#0"} + } + }, + { + "name": "key", + "from": [2.25, 0.5, 8.5], + "to": [3.25, 1.5, 9.5], + "rotation": {"angle": 0, "axis": "y", "origin": [10.25, -0.5, 8.5]}, + "faces": { + "north": {"uv": [7.5, 1, 7.75, 1.25], "texture": "#0"}, + "east": {"uv": [1.25, 7.5, 1.5, 7.75], "texture": "#0"}, + "south": {"uv": [7.5, 1.25, 7.75, 1.5], "texture": "#0"}, + "west": {"uv": [1.5, 7.5, 1.75, 7.75], "texture": "#0"}, + "up": {"uv": [7.75, 1.75, 7.5, 1.5], "texture": "#0"}, + "down": {"uv": [2, 7.5, 1.75, 7.75], "texture": "#0"} + } + }, + { + "name": "key", + "from": [1, 0.5, 8.5], + "to": [2, 1.5, 9.5], + "rotation": {"angle": 0, "axis": "y", "origin": [9, -0.5, 8.5]}, + "faces": { + "north": {"uv": [7.5, 1.75, 7.75, 2], "texture": "#0"}, + "east": {"uv": [2, 7.5, 2.25, 7.75], "texture": "#0"}, + "south": {"uv": [7.5, 2, 7.75, 2.25], "texture": "#0"}, + "west": {"uv": [2.25, 7.5, 2.5, 7.75], "texture": "#0"}, + "up": {"uv": [7.75, 2.5, 7.5, 2.25], "texture": "#0"}, + "down": {"uv": [2.75, 7.5, 2.5, 7.75], "texture": "#0"} + } + }, + { + "name": "key", + "from": [-1, 0.5, 8.5], + "to": [0.75, 1.5, 9.5], + "rotation": {"angle": 0, "axis": "y", "origin": [7, -0.5, 8.5]}, + "faces": { + "north": {"uv": [1, 5.25, 1.5, 5.5], "texture": "#0"}, + "east": {"uv": [7.5, 2.5, 7.75, 2.75], "texture": "#0"}, + "south": {"uv": [1.5, 5.25, 2, 5.5], "texture": "#0"}, + "west": {"uv": [2.75, 7.5, 3, 7.75], "texture": "#0"}, + "up": {"uv": [2.5, 5.5, 2, 5.25], "texture": "#0"}, + "down": {"uv": [3, 5.25, 2.5, 5.5], "texture": "#0"} + } + }, + { + "name": "key", + "from": [-1, 0.5, 9.75], + "to": [1.25, 1.5, 10.75], + "rotation": {"angle": 0, "axis": "y", "origin": [8.25, -0.5, 9.75]}, + "faces": { + "north": {"uv": [5, 3.75, 5.625, 4], "texture": "#0"}, + "east": {"uv": [7.5, 2.75, 7.75, 3], "texture": "#0"}, + "south": {"uv": [5, 4, 5.625, 4.25], "texture": "#0"}, + "west": {"uv": [3, 7.5, 3.25, 7.75], "texture": "#0"}, + "up": {"uv": [5.625, 4.5, 5, 4.25], "texture": "#0"}, + "down": {"uv": [5.625, 4.5, 5, 4.75], "texture": "#0"} + } + }, + { + "name": "key", + "from": [11.25, 0.5, 11], + "to": [12.5, 1.5, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [19.25, -0.5, 11]}, + "faces": { + "north": {"uv": [5, 5.25, 5.375, 5.5], "texture": "#0"}, + "east": {"uv": [7.5, 3, 7.75, 3.25], "texture": "#0"}, + "south": {"uv": [0, 5.5, 0.375, 5.75], "texture": "#0"}, + "west": {"uv": [3.25, 7.5, 3.5, 7.75], "texture": "#0"}, + "up": {"uv": [0.875, 5.75, 0.5, 5.5], "texture": "#0"}, + "down": {"uv": [1.375, 5.5, 1, 5.75], "texture": "#0"} + } + }, + { + "name": "key", + "from": [2, 0.5, 11], + "to": [3.25, 1.5, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [10, -0.5, 11]}, + "faces": { + "north": {"uv": [1.5, 5.5, 1.875, 5.75], "texture": "#0"}, + "east": {"uv": [7.5, 3.25, 7.75, 3.5], "texture": "#0"}, + "south": {"uv": [2, 5.5, 2.375, 5.75], "texture": "#0"}, + "west": {"uv": [3.5, 7.5, 3.75, 7.75], "texture": "#0"}, + "up": {"uv": [2.875, 5.75, 2.5, 5.5], "texture": "#0"}, + "down": {"uv": [3.375, 5.5, 3, 5.75], "texture": "#0"} + } + }, + { + "name": "key", + "from": [0.5, 0.5, 11], + "to": [1.75, 1.5, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [8.5, -0.5, 11]}, + "faces": { + "north": {"uv": [3.5, 5.5, 3.875, 5.75], "texture": "#0"}, + "east": {"uv": [7.5, 3.5, 7.75, 3.75], "texture": "#0"}, + "south": {"uv": [4, 5.5, 4.375, 5.75], "texture": "#0"}, + "west": {"uv": [3.75, 7.5, 4, 7.75], "texture": "#0"}, + "up": {"uv": [4.875, 5.75, 4.5, 5.5], "texture": "#0"}, + "down": {"uv": [5.875, 4.75, 5.5, 5], "texture": "#0"} + } + }, + { + "name": "key", + "from": [-1, 0.5, 11], + "to": [0.25, 1.5, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [7, -0.5, 11]}, + "faces": { + "north": {"uv": [5, 5.5, 5.375, 5.75], "texture": "#0"}, + "east": {"uv": [7.5, 3.75, 7.75, 4], "texture": "#0"}, + "south": {"uv": [5.5, 5, 5.875, 5.25], "texture": "#0"}, + "west": {"uv": [4, 7.5, 4.25, 7.75], "texture": "#0"}, + "up": {"uv": [5.875, 5.5, 5.5, 5.25], "texture": "#0"}, + "down": {"uv": [5.875, 5.5, 5.5, 5.75], "texture": "#0"} + } + }, + { + "name": "key", + "from": [-1, 0.5, 7.25], + "to": [0.25, 1.5, 8.25], + "rotation": {"angle": 0, "axis": "y", "origin": [7, -0.5, 7.25]}, + "faces": { + "north": {"uv": [0, 5.75, 0.375, 6], "texture": "#0"}, + "east": {"uv": [7.5, 4, 7.75, 4.25], "texture": "#0"}, + "south": {"uv": [0.5, 5.75, 0.875, 6], "texture": "#0"}, + "west": {"uv": [4.25, 7.5, 4.5, 7.75], "texture": "#0"}, + "up": {"uv": [1.375, 6, 1, 5.75], "texture": "#0"}, + "down": {"uv": [1.875, 5.75, 1.5, 6], "texture": "#0"} + } + }, + { + "name": "key", + "from": [12.75, 0.5, 11], + "to": [14, 1.5, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [20.75, -0.5, 11]}, + "faces": { + "north": {"uv": [5.75, 1.75, 6.125, 2], "texture": "#0"}, + "east": {"uv": [7.5, 4.25, 7.75, 4.5], "texture": "#0"}, + "south": {"uv": [2, 5.75, 2.375, 6], "texture": "#0"}, + "west": {"uv": [4.5, 7.5, 4.75, 7.75], "texture": "#0"}, + "up": {"uv": [6.125, 2.25, 5.75, 2], "texture": "#0"}, + "down": {"uv": [6.125, 2.25, 5.75, 2.5], "texture": "#0"} + } + }, + { + "name": "key", + "from": [14.25, 0.5, 11], + "to": [15.5, 1.5, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [22.25, -0.5, 11]}, + "faces": { + "north": {"uv": [2.5, 5.75, 2.875, 6], "texture": "#0"}, + "east": {"uv": [7.5, 4.5, 7.75, 4.75], "texture": "#0"}, + "south": {"uv": [5.75, 2.5, 6.125, 2.75], "texture": "#0"}, + "west": {"uv": [4.75, 7.5, 5, 7.75], "texture": "#0"}, + "up": {"uv": [6.125, 3, 5.75, 2.75], "texture": "#0"}, + "down": {"uv": [3.375, 5.75, 3, 6], "texture": "#0"} + } + }, + { + "name": "key", + "from": [15.75, 0.5, 11], + "to": [17, 1.5, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [23.75, -0.5, 11]}, + "faces": { + "north": {"uv": [5.75, 3, 6.125, 3.25], "texture": "#0"}, + "east": {"uv": [7.5, 4.75, 7.75, 5], "texture": "#0"}, + "south": {"uv": [5.75, 3.25, 6.125, 3.5], "texture": "#0"}, + "west": {"uv": [5, 7.5, 5.25, 7.75], "texture": "#0"}, + "up": {"uv": [3.875, 6, 3.5, 5.75], "texture": "#0"}, + "down": {"uv": [6.125, 3.5, 5.75, 3.75], "texture": "#0"} + } + }, + { + "name": "key", + "from": [4, 0.5, 9.75], + "to": [5, 1.5, 10.75], + "rotation": {"angle": 0, "axis": "y", "origin": [12, -0.5, 9.75]}, + "faces": { + "north": {"uv": [7.5, 5, 7.75, 5.25], "texture": "#0"}, + "east": {"uv": [5.25, 7.5, 5.5, 7.75], "texture": "#0"}, + "south": {"uv": [7.5, 5.25, 7.75, 5.5], "texture": "#0"}, + "west": {"uv": [5.5, 7.5, 5.75, 7.75], "texture": "#0"}, + "up": {"uv": [7.75, 5.75, 7.5, 5.5], "texture": "#0"}, + "down": {"uv": [6, 7.5, 5.75, 7.75], "texture": "#0"} + } + }, + { + "name": "key", + "from": [5.25, 0.5, 9.75], + "to": [6.25, 1.5, 10.75], + "rotation": {"angle": 0, "axis": "y", "origin": [13.25, -0.5, 9.75]}, + "faces": { + "north": {"uv": [7.5, 5.75, 7.75, 6], "texture": "#0"}, + "east": {"uv": [6, 7.5, 6.25, 7.75], "texture": "#0"}, + "south": {"uv": [7.5, 6, 7.75, 6.25], "texture": "#0"}, + "west": {"uv": [6.25, 7.5, 6.5, 7.75], "texture": "#0"}, + "up": {"uv": [7.75, 6.5, 7.5, 6.25], "texture": "#0"}, + "down": {"uv": [6.75, 7.5, 6.5, 7.75], "texture": "#0"} + } + }, + { + "name": "key", + "from": [6.5, 0.5, 9.75], + "to": [7.5, 1.5, 10.75], + "rotation": {"angle": 0, "axis": "y", "origin": [14.5, -0.5, 9.75]}, + "faces": { + "north": {"uv": [7.5, 6.5, 7.75, 6.75], "texture": "#0"}, + "east": {"uv": [6.75, 7.5, 7, 7.75], "texture": "#0"}, + "south": {"uv": [7.5, 6.75, 7.75, 7], "texture": "#0"}, + "west": {"uv": [7, 7.5, 7.25, 7.75], "texture": "#0"}, + "up": {"uv": [7.75, 7.25, 7.5, 7], "texture": "#0"}, + "down": {"uv": [7.5, 7.5, 7.25, 7.75], "texture": "#0"} + } + }, + { + "name": "key", + "from": [7.75, 0.5, 9.75], + "to": [8.75, 1.5, 10.75], + "rotation": {"angle": 0, "axis": "y", "origin": [15.75, -0.5, 9.75]}, + "faces": { + "north": {"uv": [7.5, 7.25, 7.75, 7.5], "texture": "#0"}, + "east": {"uv": [7.5, 7.5, 7.75, 7.75], "texture": "#0"}, + "south": {"uv": [0, 7.75, 0.25, 8], "texture": "#0"}, + "west": {"uv": [0.25, 7.75, 0.5, 8], "texture": "#0"}, + "up": {"uv": [8, 0.5, 7.75, 0.25], "texture": "#0"}, + "down": {"uv": [0.75, 7.75, 0.5, 8], "texture": "#0"} + } + }, + { + "name": "key", + "from": [9, 0.5, 9.75], + "to": [10, 1.5, 10.75], + "rotation": {"angle": 0, "axis": "y", "origin": [17, -0.5, 9.75]}, + "faces": { + "north": {"uv": [7.75, 0.5, 8, 0.75], "texture": "#0"}, + "east": {"uv": [0.75, 7.75, 1, 8], "texture": "#0"}, + "south": {"uv": [7.75, 0.75, 8, 1], "texture": "#0"}, + "west": {"uv": [1, 7.75, 1.25, 8], "texture": "#0"}, + "up": {"uv": [8, 1.25, 7.75, 1], "texture": "#0"}, + "down": {"uv": [1.5, 7.75, 1.25, 8], "texture": "#0"} + } + }, + { + "name": "key", + "from": [10.25, 0.5, 9.75], + "to": [11.25, 1.5, 10.75], + "rotation": {"angle": 0, "axis": "y", "origin": [18.25, -0.5, 9.75]}, + "faces": { + "north": {"uv": [7.75, 1.25, 8, 1.5], "texture": "#0"}, + "east": {"uv": [1.5, 7.75, 1.75, 8], "texture": "#0"}, + "south": {"uv": [7.75, 1.5, 8, 1.75], "texture": "#0"}, + "west": {"uv": [1.75, 7.75, 2, 8], "texture": "#0"}, + "up": {"uv": [8, 2, 7.75, 1.75], "texture": "#0"}, + "down": {"uv": [2.25, 7.75, 2, 8], "texture": "#0"} + } + }, + { + "name": "key", + "from": [11.5, 0.5, 9.75], + "to": [12.5, 1.5, 10.75], + "rotation": {"angle": 0, "axis": "y", "origin": [19.5, -0.5, 9.75]}, + "faces": { + "north": {"uv": [7.75, 2, 8, 2.25], "texture": "#0"}, + "east": {"uv": [2.25, 7.75, 2.5, 8], "texture": "#0"}, + "south": {"uv": [7.75, 2.25, 8, 2.5], "texture": "#0"}, + "west": {"uv": [2.5, 7.75, 2.75, 8], "texture": "#0"}, + "up": {"uv": [8, 2.75, 7.75, 2.5], "texture": "#0"}, + "down": {"uv": [3, 7.75, 2.75, 8], "texture": "#0"} + } + }, + { + "name": "key", + "from": [12.75, 0.5, 9.75], + "to": [13.75, 1.5, 10.75], + "rotation": {"angle": 0, "axis": "y", "origin": [20.75, -0.5, 9.75]}, + "faces": { + "north": {"uv": [7.75, 2.75, 8, 3], "texture": "#0"}, + "east": {"uv": [3, 7.75, 3.25, 8], "texture": "#0"}, + "south": {"uv": [7.75, 3, 8, 3.25], "texture": "#0"}, + "west": {"uv": [3.25, 7.75, 3.5, 8], "texture": "#0"}, + "up": {"uv": [8, 3.5, 7.75, 3.25], "texture": "#0"}, + "down": {"uv": [3.75, 7.75, 3.5, 8], "texture": "#0"} + } + }, + { + "name": "key", + "from": [14, 0.5, 9.75], + "to": [17, 1.5, 10.75], + "rotation": {"angle": 0, "axis": "y", "origin": [22, -0.5, 9.75]}, + "faces": { + "north": {"uv": [5, 1.75, 5.75, 2], "texture": "#0"}, + "east": {"uv": [7.75, 3.5, 8, 3.75], "texture": "#0"}, + "south": {"uv": [5, 2, 5.75, 2.25], "texture": "#0"}, + "west": {"uv": [3.75, 7.75, 4, 8], "texture": "#0"}, + "up": {"uv": [5.75, 2.5, 5, 2.25], "texture": "#0"}, + "down": {"uv": [5.75, 2.5, 5, 2.75], "texture": "#0"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [58, 0, 0], + "translation": [0, 4, 2.25], + "scale": [0.5, 0.5, 0.5] + }, + "thirdperson_lefthand": { + "rotation": [58, 0, 0], + "translation": [0, 4, 2.25], + "scale": [0.5, 0.5, 0.5] + }, + "firstperson_righthand": { + "rotation": [58, 0, 0], + "translation": [-9, 4, 2.25], + "scale": [0.5, 0.5, 0.5] + }, + "firstperson_lefthand": { + "rotation": [58, 0, 0], + "translation": [-9, 4, 2.25], + "scale": [0.5, 0.5, 0.5] + }, + "ground": { + "translation": [0, 6, 0] + }, + "gui": { + "rotation": [63, 29, -19], + "translation": [2, 3, -9], + "scale": [0.7, 0.7, 0.7] + }, + "head": { + "translation": [0, 14.75, 0] + }, + "fixed": { + "rotation": [90, 0, -180], + "translation": [0, 0, -9] + } + }, + "groups": [ + 0, + { + "name": "keys", + "origin": [11, -0.5, 11], + "color": 0, + "children": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74 + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/void_power/models/item/key_board.json b/src/main/resources/assets/void_power/models/item/key_board.json new file mode 100644 index 0000000..1e946b5 --- /dev/null +++ b/src/main/resources/assets/void_power/models/item/key_board.json @@ -0,0 +1,3 @@ +{ + "parent": "void_power:block/key_board/block" +} diff --git a/src/main/resources/assets/void_power/textures/block/kb_texture.png b/src/main/resources/assets/void_power/textures/block/kb_texture.png new file mode 100644 index 0000000..e892dd6 Binary files /dev/null and b/src/main/resources/assets/void_power/textures/block/kb_texture.png differ diff --git a/src/main/resources/assets/void_power/textures/block/key_board_texture.png b/src/main/resources/assets/void_power/textures/block/key_board_texture.png new file mode 100644 index 0000000..bccc7b0 Binary files /dev/null and b/src/main/resources/assets/void_power/textures/block/key_board_texture.png differ diff --git a/src/main/resources/data/void_power/recipes/crafting/engine_controller.json b/src/main/resources/data/void_power/_backup/engine_controller.json similarity index 100% rename from src/main/resources/data/void_power/recipes/crafting/engine_controller.json rename to src/main/resources/data/void_power/_backup/engine_controller.json diff --git a/src/main/resources/data/void_power/_backup/void_engine.json b/src/main/resources/data/void_power/_backup/void_engine.json new file mode 100644 index 0000000..87ef441 --- /dev/null +++ b/src/main/resources/data/void_power/_backup/void_engine.json @@ -0,0 +1,35 @@ +{ + "type": "create:mechanical_crafting", + "acceptMirrored": false, + "key": { + "R": { + "item": "create:rotation_speed_controller" + }, + "S": { + "item": "create:sequenced_gearshift" + }, + "F": { + "item": "create:flywheel" + }, + "C": { + "item": "create:andesite_casing" + }, + "E": { + "item": "minecraft:ender_pearl" + }, + "P": { + "item": "create:precision_mechanism" + } + }, + "pattern": [ + "CCCCC", + "CPEEC", + "SRFFC", + "CPEEC", + "CCCCC" + ], + "result": { + "count": 1, + "item": "void_power:void_engine" + } +} \ No newline at end of file diff --git a/src/main/resources/data/void_power/recipes/crafting/void_engine.json b/src/main/resources/data/void_power/recipes/crafting/void_engine.json deleted file mode 100644 index 376f569..0000000 --- a/src/main/resources/data/void_power/recipes/crafting/void_engine.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "CAC", - "EMP", - "CAC" - ], - "key": { - "E": { - "item": "create:electron_tube" - }, - "A": { - "item": "minecraft:ender_pearl" - }, - "P": { - "item": "create:precision_mechanism" - }, - "C": { - "item": "create:andesite_casing" - }, - "M": { - "item": "create:mechanical_bearing" - } - }, - "result": { - "item": "void_power:void_engine" - } -} \ No newline at end of file diff --git a/src/main/resources/mixins.void_power.json b/src/main/resources/mixins.void_power.json index 318f43a..4ed1b15 100644 --- a/src/main/resources/mixins.void_power.json +++ b/src/main/resources/mixins.void_power.json @@ -9,14 +9,17 @@ "INetTermWrapper", "MixinComputerRegistry", "MixinComputerThread", + "MixinMonitorRenderState", "MixinNetworkTerminal", "MixinPeripheralProxyTE_Kt", "MixinTerminal", + "MixinTerminalState", "MixinTweakedControllerTE" ], "client": [ "MixinCCMonitorRender", - "MixinMonitorHighlightRenderer" + "MixinMonitorHighlightRenderer", + "MixinMouseHandler" ], "package": "com.dfdyz.void_power.mixin", "plugin": "com.dfdyz.void_power.mixin.MixinPlugin",