Changelog
Fixes
-
Unloading of Screens and Browser Instances no longer just based on the Render class due to issues where if you werent looking in the direction of the screen then it wouldnt unload and close the browser resulting in videos staying playing even out of range! This has been finally fixed enjoy! Screens are limited to rendering only in 30 block radius using 360 degrees in calculation now not limited to a 180 degree calculations. basically now each screen entity now runs its on distance check for the players ontop of the player still utilizing the screenRenderer distance check to really ensure they only render when in distance.
-
Removed Debugging Logs spamming Console Logs sorry about this i forget to remove my logs sometimes lol!
-
Dynamic server url replacement was limited only to /index?streamName urls no longer so extra endpoints from the NodeJS application are possible now such as /getschedule endpoints to potentially display a table list of the current playing stream schedule :D
to utilise this you need to
ensure all your endpoints utilize a
?streamName query parameter in the urls
if they do this will dynamically
replace the server location of the
cloudflare tunnel for the clients
connected to the server to always
keep them in sync with the
tunnels location!
-
Also Please utilize port 30000 for your nodeJS application server!
-
Brought back the onTick in tileEntity to check for rendered screens to fix the issue with screens staying loaded!
New
- Customizable keybind for changing a screens url instead of needing to shift right click with a empty hand!
Note
- This nodeJS express server you may have to make yourself or look up some designs one key concept is the usage of this style routing point for the mod to properly get its location!
- OpenAI Explaination and NodeJs Code Snippet
To set up your first Node.js Express server application for serving a public static website from a public folder, follow these steps. Since you don't have Node.js installed, I'll include steps for that as well:
Step 1: Install Node.js
- Download Node.js from the official website: Node.js Download.
- Run the installer and follow the installation instructions.
Step 2: Create a new directory for your project
Open a terminal and create a new directory for your project:
mkdir my-express-app
cd my-express-app
Step 3: Initialize a new Node.js project
Initialize a new Node.js project using npm:
npm init -y
Step 4: Install required packages
Install the necessary packages for your Express server:
npm install express fs path sqlite3 cors cloudflared
Step 5: Create your Express server file
Create a new file named server.js
in your project directory and paste your existing code into it:
const express = require('express');
const fs = require('fs');
const path = require('path');
const sqlite3 = require('sqlite3').verbose();
const cors = require('cors');
const { tunnel } = require("cloudflared");
const app = express();
const PORT = 30000;
let tunnelLocation = `http://localhost:${PORT}`;
function getTunnelDomain(){
return tunnelLocation;
}
async function main(){
const { url, connections, child, stop } = tunnel({ "--url": 'localhost:30000' });
console.log("LINK:", await url);
tunnelLocation = await url;
const conns = await Promise.all(connections);
console.log("Connections Ready!", conns);
child.on("exit", (code) => {
console.log("tunnel process exited with code", code);
});
}
main();
app.get('/ping', (req, res) => {
res.send(JSON.stringify({ url: getTunnelDomain() }));
})
app.listen(PORT, () => {
console.log(`Server running at http://localhost:${PORT}/`);
});
Step 6: Create a public folder for your static website
Create a new folder named public
in your project directory and place your static website files (HTML, CSS, JS, etc.) inside this folder.
Step 7: Serve the static website files with Express
Modify your server.js
file to serve the static website files from the public
folder:
app.use(express.static(path.join(__dirname, 'public')));
app.get('/ping', (req, res) => {
res.send(JSON.stringify({ url: getTunnelDomain() }));
})
app.listen(PORT, () => {
console.log(`Server running at http://localhost:${PORT}/`);
});
Step 8: Start your Express server
Start your Express server by running the following command in your terminal:
node server.js
Your static website should now be accessible at http://localhost:30000/
.
Example code for a nodeJS express server to properly correlate with this mod!
const express = require('express');
const fs = require('fs');
const path = require('path');
const sqlite3 = require('sqlite3').verbose();
const cors = require('cors');
const { tunnel } = require("cloudflared");
const app = express();
const PORT = 30000;
let tunnelLocation = `http://localhost:${PORT}`;
function getTunnelDomain(){
return tunnelLocation;
}
//This is the main function to start up the cloudflare tunnel to expose this server publicly through a random location!
//Over https!
async function main(){
//This will server over http as cloudflare tunnels will handle the upgrading properly!
const { url, connections, child, stop } = tunnel({ "--url": 'localhost:30000' });
// show the url
console.log("LINK:", await url);
tunnelLocation = await url;
// wait for the all 4 connections to be established
const conns = await Promise.all(connections);
// show the connections
console.log("Connections Ready!", conns);
// stop the tunnel after 15 seconds
//setTimeout(stop, 15_000);
child.on("exit", (code) => {
console.log("tunnel process exited with code", code);
});
}
main();
//This Ping endpoint is very important! as it needs to return a json in the style of { url: "yourServerLocation" }
// For the Mod to properly relay and overwrite the http://%SERVER_LOCATION% placeholder
app.get('/ping', (req, res) => {
res.send(JSON.stringify({ url: getTunnelDomain() }));
})
Dependencies
90% of ad revenue goes to creators
Support creators and Modrinth ad-free with Modrinth+Metadata
Release channel
ReleaseVersion number
2.0.3-1.20.1Loaders
Game versions
1.20.1Downloads
1503Publication date
April 21, 2024 at 6:22 AMPublisher
DBlockbuster
Member