Code Monkey home page Code Monkey logo

immersive-mc's People

Contributors

hammy275 avatar yaosiqian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

immersive-mc's Issues

A Bit of Reorganization

A lot of stuff in common is meant only to run on the logical side, so we should move that stuff into the server package.

Block Break Handling

When a block with immersive-ness is broken, the immersive aspect sticks around.

Since the BlockEvent.BreakEvent event is only fired server-side, it'll need to send a packet to the client to remove an immersion.

It's perfect to do this now, since most upcoming immersions will have their items stored server-side.

Crafting Improvements

  • After a crafting operation, remove all items you don't have enough of. For example, if you have 15 planks and craft a chest, remove all the planks from the crafting table.
  • Replace the client-side representation of crafting from a fake CraftingInventory to a 3x3 array. This should make manipulation of it a lot easier, including for the above improvement

Logo

Needed for Curseforge lol

Ender Chest Immersive

Probably will use a majority of the code from ChestImmersive, or build on top of it.

Reword README

ImmersiveMC isn't just about minimizing GUI usage, but about making Minecraft as a whole more immersive, mainly through the use of removing GUIs. The README should be adjusted to account for this.

We can softly depend on #23 here, as it would be a great GIF to add to the README to demonstrate this

Immersive Campfire

You can hold an item above a campfire. After 15 secs (probably a configurable amount of time), it's cooked

Jukebox [VR Only]

You should basically be able to put a disc into the Jukebox physically to play the disc.

Nothing to really enhance out of VR, so this is VR-only

Tutorial

There should be two videos for a tutorial, in VR and out of VR.

Both should be pretty well edited, and have very good timestamps.

Also caption them

To be made with 1.0.0 release

GUI Config

You should be able to configure the client from within the GUI. Unlike what this mod intends to do, this is planned to be a bog-standard settings UI.

If you have OP permission level 4, there should also be an exposed option to configure the server's settings, too.

Anvil/Smithing Table

Should track contents server-side, taking the items when you put them in. Items are stored by the block position, not the player. Once a second, if a player is looking at an anvil or smithing table, it sends a ping packet. The server sees the ping, gets the anvil/smithing table the player is looking at, and resets a cooldown. If the cooldown reaches 0, the items inside drop back to the ground.

Crafting Improvements

  • Make it so a preview of the item appears above the crafting table. Grab it with trigger + hand there. Hold trigger and it will create more of the item. Same thing with right click for non-vr players
  • Remove punching thingy since the above replaces it

Initialize Hitboxes and Positions Once

For most immersives, the hitboxes and positions don't ever change. For these ones, we should use a init() function in the immersive (not the info) to initialize them, so we don't re-create them every tick.

Stack Merging

You currently can't grab items from a furnace, brewing stand, or chest if you're holding that same item in your hand, even if it would make sense to merge the two stacks together! This should be fixed, and have the following behavior:

  • Furnace and brewing input slots should have the item in the hand merged into the slot
  • The furnace output slot should have the item in the slot merged into the hand
  • Chests should merge items into the slot

Retrieve Items from Server

e35b883 fixed an issue with reaching across logical sides.

HOWEVER, as a consequence of this, we no longer have access to items for all of the immersives (besides crafting). This is obviously extremely bad!

For tracking these, whenever we look at a compatible block client side, we'll initialize like we usually do EXCEPT FOR THE ITEMS!

  • Add a check to our readyToRender() function that checks that we have the items
  • Remove all item setting by anything that extends AbstractImmersiveInfo
  • When looking at a block, ask the server for its items. The server should send them back, after usual anticheating stuff is taken care of. Once we receive them, look across our immersives to figure out which immersive said items match with, and put them there.*
  • Since swaps take place entirely server-side, we don't need to worry about changing anything there.

*: For now, I'm okay with the side effect for this that an immersive won't update until looked at. So if another player changes items around, it won't reflect for us until we look at it.

Chest Improvements

  • Allow opening/closing outside of VR, and allow using right-click in VR instead of hand motions
  • Fix open/close bugginess (maybe we need to open/close client-side too?)

Remove RNG Syncing

Instead of requesting the state of the tile entity at random intervals, the server should send updates to the client. This actually requires a pretty major refactoring, more specifically by doing the following:

  • Remove all syncing packets from our swap methods
  • Whenever a tile entity that supports immersion changes, send an update packet to all those tracking the chunk.
  • Whenever a client was farther than 20 blocks away but is now closer than 20 blocks away (or whatever range is decided on in #28), they should request a sync to the server We remove immersives further than 20 blocks away

Config

There should be a config allowing one to enable/disable certain immersions.

It will exist both server-side and client-side, with both configs having to be enabled to allow an immersion to take place. This way, a server admin can disable certain immersions, and a player can also disable immersions if they don't want to use them

Minimize Chest Bugginess

  • See if we can fix the chest closing bug (might be a client-server desync issue, idk?)
  • Disable right click interactions with the chest when in VR (after all, you're supposed to use your hands, anyways!)

Auto Center

Makes immersive item slots centered so it looks nicer. It'll be a config option that's off by default and won't be synced from the server. Only planned for furnace and possibly brewing stand, as others either align with the block texture (crafting table and jukebox) or align in an already centered sort of way (chest).

May need to do this for the anvil and/or enchanting table once those are added, though.

Move Redstone Repeater Torches

Idea from Nti on Vivecraft Discord.

Probably place hitboxes above each torch spot, and if your hand is in both the current one and another one, move to that one, then disable the ability to move it back there until either:

  • 20 ticks have passed
  • It's moved to yet another spot.

Aka, if moving from A tick(s) to B tick(s), you can't move it back to A, until you move it to C, then you can't move it to B, etc.

Immersive Chest [VR Only]

It would be really cool if you could physically open a chest and grab the items inside.

Each chest block would have a 3x3 set of items on top from inside the chest, representing the top row. If a chest is opened immersively like this, right clicking it would cycle the row that's presented on the top (the other rows aren't grabbable).

You press left click/trigger over an item to grab it, it would go into your inventory.

VR only since this would probably be a hassle to use outside of VR, and opening the chest would probably be very clunky.

A Bit of Anticheat

Right now, we only continue with handling a SwapPacket if the position our client tells us is loaded https://github.com/hammy3502/immersive-mc/blob/master/src/main/java/net/blf02/immersivemc/common/network/packet/SwapPacket.java#L41 . However, someone could use this to gleam the positions of loaded chunks.

To counter this, we should instead check that both the position is loaded, and that the distanceToSqr() between the player and its position is at most 256 (aka the distance between the player and it is 16 blocks). This way, it's practically impossible to gleam unknown information to a potential hacker.

Replace Network Targets

Right now, a lot of packets related to a given tile entity are sent to everyone tracking the chunk. Instead, we should only send it to those within 16-ish blocks of the tile entity.

Clear Immersives

Immersives should be cleared on exiting a world/disconnecting from multiplayer

Physically Push Buttons

Unlike in Vanilla, while your hand is on the button, it will stay pushed in (creating a redstone signal). The button pops out after the usual amount of time once you take your hand away.

Backpack

I expect this to be iterated on a lot, and have progress made both during and between versions.

Ideas so far:

  • Backpack is "summonable" from a button. By default, the button should be mapped to an extraordinarily rarely used keyboard key so it doesn't conflict with other mods, but can simultaneously be easily bound to the radial menu.
  • Backpack would effectively work like the chest immersive, but requiring left click/trigger to be held to take items out/put items in.
  • Backpacks should hook into the immersive system. The position of the backpack along with the hitboxes of the strap should not be retrievable from getPositions/getHitboxes, which should instead be reserved purely for the items themselves.
  • Taking inspiration from the effectively-scrapped physical inventory from Vivecraft, when summoned, the backpack is "glued" to controller 1's right-hand side. We'll need a config key that allows one to change which hand it's glued to for left-handed folks.
  • Looks-wise, the backpack will probably look close to the bag from the effectively-scrapped physical inventory. We'll make the color of it brown for now, but long term, being able to customize the color would be fun

Check Other Chest Behavior

The method for getting the other chest doesn't chest that the other chest is connected back to the requesting one iirc. We need to check this

LICENSE and README

I kinda prematurely made the repo public. I don't plan to private it again, but we need a LICENSE and README in there ASAP.

Going to stick with GNU GPLv3 as I usually do.

Distanced Pick-Up [VR Only]

Similarly to how Half-Life Alyx does it, picking up items in a similar style would be satisfying, fun, and aid a lot in playing in VR.

Immersive Crafting Table

We'd keep copies of the Crafting Table for each player on the server. Each player would have a "global crafting table" for this storage, that would expire if the server detects the client hasn't been looking at any crafting table for more than a few seconds. On expiration, give the items back.

To confirm the craft, you'd punch the crafting table, and the output would be summoned as an ItemEntity above the crafting table to be picked up.

Break Blocks

Some immersive blocks (mainly chests) can't be broken. We should allow breaking them, at least when they're closed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.