Giter Club home page Giter Club logo

minekhan's Issues

lighting bug on darker light settings

when i set the minimum light to -1 it makes this awesome effect where everything looks richer, and light emitting objects really glow and such
example:
Screenshot 2021-09-07 1 32 35 PM
vs.
Screenshot 2021-09-07 1 29 13 PM

but, the issue is, that when it goes to night time... that really cool effect is lost, any idea how to fix that?

Flora and Fauna

Live animals and Live plants.

An ECO system in minekhan...

MineKhan Modders Wiki ! (MMW)

Here you can post step-by-step instructions on how to add new blocks to MineKhan or new items to MineKhan , how to work around the hundred of lines of code that MineKhan runs on.

Possible Questions:
1.How to add new blocks
2.How to mess round with the lighting / where.
3.How to style buttons in the code or which lines you should look around the edit.
And Plenty More!

Survival mode

When will you add survival? I think it would be a great addition to the game!

Specifications for delays, maximum blocks per command, etc.

I accidentally banned myself by making a script that placed lots (thousands) of blocks, probably too fast, in my world. I set delays, but that didn't seem to work too well, so do you have any recommendations for how long I should make them? I used setTimeout with a 50 ms delay.

Tools

Can you make tools like in Minecraft pi edition? Oh and don't forget about opening doors.

Slabs & stairs

Slabs & stairs and stairs have 2 glitches:

  1. shadows: when placing a slab/stair next to a block, this happens:
    Screenshot 2021-06-02 12 14 38
  2. saves: when loading saves this happens:
    Screenshot 2021-06-02 12 19 28

Anti-griefing measures

The command /ban doesn't work on names that include spaces. Also, it might be a good idea to add longer-lasting bans and the ability to give world admin privileges to trusted players. Several times, I've been AFK when a griefer was on, and the legitimate players were unable to do anything about it.

Mobile Support

Add a device-recognition function, a couple of buttons, and a different set of mouse recognition features, and it should work on mobile. You can even do that on KhanAcad, no?

Vertical slabs

My friend multibuilder just asked me to request this :D

MineKhan Server's .

In my opinion server should be fixed since after the host logs out of the server the server just shuts down willard should create a seperate site where all the server are linked and you can join one

Lava + icon for water

I think a lava block with no collisions similar to water (but with a opaque texture) would be useful in MineKhan. Also, I don't know why there isn't an icon for water, but assuming it's not too hard, could you add one (mostly so that less experienced players don't keep asking me how to get it)?

Gaming in MineKhan

is MineKhan actually good for playing ???

NOT in a bad way JUST in a way of the game intriguing audience

Lock multiplayer worlds

can you add either a button to lock a multiplayer world so no more people can get in or multiplayer wolds with passwords? people keep on coming into me and my friend's world and destroying everything.

Ok, this is a request

Hi, me again (probably super annoying) but....... can you add more plants maybe??????? It probably takes a while so I'll be patient.

teleporting

when i use super breaker i start to glitch to the blocks

Physics bugs

So I have something like this:
Screenshot 2021-07-14 at 12 18 31 PM
When I go to it and press w, I go up and down.

If there is a ceiling like this:
Screenshot 2021-07-14 at 12 21 34 PM
And I jump under it, it smoothly teleports me to somewhere else.

I banned myself

So I had bad internet and I was on willard.fun,
I opened a world to public and joined on another device.
And then it said Connection lost so I opened it to public again.
Then I opened the developer tools to see what was going on and it sayed the host banned me.

It shouldn't be banning me because I was the host and I didn't ban anyone.

Biomes!

As Shown on this Modded Ver of your game, it shows the biomes are possible, when i can, i will try to add it my self, but you know your programing better, you may be able to read his , and see how he did it

Optimization and readability

If not, you should open an issue describing what you'd like to change and why so that I can give feedback before you spend the time working on it. I don't like telling people to throw away their code, but I kinda have to when you open PRs unexpectedly.

Originally posted by @Willard21 in #9 (comment)

As requested, I'll create an issue before I do anything from now on.

There are several things that I would like to help remove/update that would significantly reduce the amount of code and simplify the code.

To start, there are plenty of unnecessary lookups across the code, which can be removed, or assigned to a local variable, ex:

MineKhan/Minecwaft.html

Lines 606 to 612 in bc80c21

let texture = data.textures
data.textures = [ texture, texture, texture, texture, texture, texture ]
} else if (data.textures.length === 3) {
data.textures[3] = data.textures[2]
data.textures[4] = data.textures[2]
data.textures[5] = data.textures[2]
} else if (data.textures.length === 2) {

Which might be simpler written as:

	data.textures = new Array(6).fill(data.texture);
} else if (data.textures.length === 3) {
	data.textures[3] =
	data.textures[4] =
	data.textures[5] = data.textures[2];
} else if (data.textures.length === 2) {

Which is shorter and just as readable.

MineKhan/Minecwaft.html

Lines 5225 to 5230 in bc80c21

let blocks = [[7, 4, 1, 7], [7, 4, 2, 7], [7, 4, 3, 7], [7, 4, 4, 7], [7, 5, 1, 7], [7, 5, 2, 7], [7, 5, 3, 7], [6, 4, 0, 7], [6, 4, 1, 7], [6, 4, 2, 7], [6, 4, 3, 7], [6, 4, 4, 7], [6, 5, 0, 7], [6, 5, 1, 7], [6, 5, 2, 7], [6, 5, 3, 7], [6, 5, 4, 7], [6, 6, 3, 7], [6, 6, 4, 7], [6, 7, 3, 7], [5, 0, -1, 1], [5, 0, 0, 1], [5, 0, 1, 1], [5, 0, 2, 1], [5, 1, 2, 29], [5, 2, 2, 29], [5, 3, 2, 29], [5, 4, 2, 29], [5, 5, 2, 29], [5, 6, 2, 29], [5, 4, 0, 7], [5, 4, 1, 7], [5, 4, 3, 7], [5, 4, 4, 7], [5, 5, 0, 7], [5, 5, 1, 7], [5, 5, 3, 7], [5, 5, 4, 7], [5, 6, 1, 7], [5, 6, 3, 7], [5, 7, 1, 7], [5, 7, 2, 7], [5, 7, 3, 7], [4, -1, -1, 1], [4, -1, 0, 1], [4, -1, 1, 1], [4, -1, 2, 1], [4, 0, 3, 1], [4, 0, 4, 1], [4, 0, 5, 1], [4, 0, 6, 1], [4, 0, 7, 1], [4, 0, 8, 1], [4, 0, 9, 1], [4, 0, 10, 1], [4, 4, 0, 7], [4, 4, 1, 7], [4, 4, 2, 7], [4, 4, 3, 7], [4, 4, 4, 7], [4, 5, 0, 7], [4, 5, 1, 7], [4, 5, 2, 7], [4, 5, 3, 7], [4, 5, 4, 7], [4, 6, 1, 7], [4, 6, 2, 7], [4, 6, 3, 7], [4, 7, 4, 7], [3, -1, -1, 1], [3, -1, 0, 1], [3, -1, 1, 1], [3, -1, 2, 1], [3, -1, 3, 1], [3, -1, 4, 1], [3, 0, 5, 1], [3, 0, 6, 1], [3, 0, 7, 1], [3, 0, 8, 1], [3, 0, 9, 1], [3, 0, 10, 1], [3, 4, 1, 7], [3, 4, 2, 7], [3, 4, 3, 7], [3, 4, 4, 7], [3, 5, 1, 7], [3, 5, 2, 7], [3, 5, 3, 7], [2, -1, -1, 1], [2, -1, 0, 1], [2, -1, 1, 1], [2, -1, 2, 1], [2, -1, 3, 1], [2, -1, 4, 1], [2, -1, 5, 1], [2, -1, 6, 1], [2, -1, 7, 1], [2, 0, 8, 1], [2, 0, 9, 1], [2, 0, 10, 1], [1, -2, -1, 1], [1, -2, 0, 1], [1, -2, 1, 1], [1, -2, 2, 1], [1, -2, 3, 1], [1, -1, 4, 1], [1, -1, 5, 1], [1, -1, 6, 1], [1, -1, 7, 1], [1, -1, 8, 1], [1, -1, 9, 1], [1, -1, 10, 1], [0, -2, -1, 1], [0, -2, 0, 1], [0, -2, 1, 1], [0, -2, 2, 1], [0, -2, 3, 1], [0, -2, 4, 1], [0, -2, 5, 1], [0, -1, 6, 1], [0, -1, 7, 1], [0, -1, 8, 1], [0, -1, 9, 1], [0, -1, 10, 1], [-1, -2, -1, 1], [-1, -2, 0, 1], [-1, -2, 1, 1], [-1, -2, 2, 1], [-1, -2, 3, 1], [-1, -2, 4, 1], [-1, -2, 5, 1], [-1, -2, 6, 1], [-1, -2, 7, 1], [-1, -1, 8, 1], [-1, -1, 9, 1], [-1, -1, 10, 1], [-2, -2, -1, 1], [-2, -2, 0, 1], [-2, -2, 1, 1], [-2, -2, 2, 1], [-2, -2, 3, 1], [-2, -2, 4, 1], [-2, -2, 5, 1], [-2, -2, 6, 1], [-2, -2, 7, 1], [-2, -2, 8, 1], [-2, -2, 9, 1], [-2, -1, 10, 1], [-3, -2, -1, 1], [-3, -2, 0, 1], [-3, -2, 1, 1], [-3, -2, 2, 1], [-3, -2, 3, 1], [-3, -2, 4, 1], [-3, -2, 5, 1], [-3, -2, 6, 1], [-3, -2, 7, 1], [-3, -2, 8, 1], [-3, -2, 9, 1], [-3, -2, 10, 1], [-3, -2, 11, 1], [-3, -2, 12, 1], [-4, -2, -1, 1], [-4, -2, 0, 1], [-4, -2, 1, 1], [-4, -2, 2, 1], [-4, -2, 3, 1], [-4, -2, 4, 1], [-4, -2, 5, 1], [-4, -2, 6, 1], [-4, -2, 7, 1], [-4, -2, 8, 1], [-4, -2, 9, 1], [-4, -2, 10, 1], [-4, -2, 11, 1], [-4, -2, 12, 1], [-5, -2, -1, 1], [-5, -2, 0, 1], [-5, -2, 1, 1], [-5, -2, 2, 1], [-5, -2, 3, 1], [-5, -2, 4, 1], [-5, -2, 5, 1], [-5, -2, 6, 1], [-5, -2, 7, 1], [-5, -2, 8, 1], [-5, -2, 9, 1], [-5, -2, 10, 1], [-5, -2, 11, 1], [-5, -2, 12, 1], [-6, -2, -1, 1], [-6, -2, 0, 1], [-6, -2, 1, 1], [-6, -2, 2, 1], [-6, -2, 3, 1], [-6, -2, 4, 1], [-6, -2, 5, 1], [-6, -2, 6, 1], [-6, -2, 7, 1], [-6, -2, 8, 1], [-6, -2, 9, 1], [-6, -2, 10, 1], [-6, -2, 11, 1], [-7, -2, 3, 1], [-7, -2, 4, 1], [-7, -2, 5, 1], [-7, -2, 6, 1], [-7, -2, 7, 1], [-7, -2, 8, 1], [-7, -2, 9, 1], [-8, -2, 2, 1], [-8, -2, 3, 1], [-8, -2, 4, 1], [-8, -2, 5, 1], [-8, -2, 6, 1], [-8, -2, 7, 1], [-8, -2, 8, 1]]
for (let i = 0; i < blocks.length; i += 1) {
block2(blocks[i][0], blocks[i][1], blocks[i][2], blocks[i][3])
}

This is massive, and ugly without proper indentation, I had to run Deno's TS/JS formatter before even looking at this.

Next, this is an array of object references, which are themselves arrays of f64s, and it requires an extra indirection to get a value out of the array, so, how about we change that?

const blocks = Int8Array.of(
	7, 4, 1, 7,
	7, 4, 2, 7,
	7, 4, 3, 7,
	7, 4, 4, 7,
	...,
	-8, -2, 8, 1
);

for (let i = 0; i < blocks.length; i += 4) {
	block2( blocks[i + 0], blocks[i + 1], blocks[i + 2], blocks[i + 3] );
}

Just as readable, much shorter as all brackets would be omitted, and much more optimized, memory-wise and performance-wise.

MineKhan/Minecwaft.html

Lines 191 to 199 in bc80c21

attribute vec3 aVertex;
attribute vec2 aTexture;
attribute float aShadow;
varying vec2 vTexture;
varying float vShadow;
varying float vFog;
uniform mat4 uView;
uniform float uDist;
uniform vec3 uPos;

The GLSL seems to have a bunch of unused global variables, most of them shouldn't be global at all.

MineKhan/Minecwaft.html

Lines 222 to 225 in bc80c21

vec4 fog(vec4 color) {
color.r += (0.33 - color.r) * vFog;
color.g += (0.54 - color.g) * vFog;
color.b += (0.72 - color.b) * vFog;

I'm no GLSL expert, but does WebGL have SIMD or vectorized arithmetic operations?

void main(void) {

Not important at all, since it's really just a stylistic preference, but the single (void) parameter is reminiscent of 30-year old C style. (it can be omitted, the code will still compile fine)

There is heavy use of let where const would be more appropriate.
This code can use some updating:

MineKhan/Minecwaft.html

Lines 281 to 283 in bc80c21

var MathGlob = Math
function MineKhan() {
let Math = MathGlob

MineKhan/Minecwaft.html

Lines 1444 to 1445 in bc80c21

let min = Math.min
let max = Math.max

These could've been:

const { Math } = self;

and

const { min, max } = Math;

respectively.

There's a good amount of code that lacks comments.
There are a large number of (unnecessary) copies done across the code, take this example:

MineKhan/Minecwaft.html

Lines 1714 to 1720 in bc80c21

let indexOrder;
(function() {
let arr = []
for (let i = 0; i < 100000; i++) {
arr.push(0 + i * 4, 1 + i * 4, 2 + i * 4, 0 + i * 4, 2 + i * 4, 3 + i * 4)
}
indexOrder = new Uint32Array(arr)

Code like this leaves me with plenty of questions: why was it an iife, instead of a simple block scope? Why did they use an array and push to it, instead of just make indexOrder const and fill it? Unless I'm mistaken, it could've been directly assigned new Uint32Array(100000 * 6) and worked out from there.

This code heavily deals with arrays, yet I'm seeing plenty of places where normal arrays are used where TypedArrays would fit better.

There were some points in the middle of the code and near the end, that could use more modern constructs, ex: ES6 Maps instead of object literals. (ex: worlds, blockIds, Key)

There are also plenty of miscellaneous things that I would recommend changing, or removing, especially mutating the window object.

Servers Possible But Not Added?

Servers Are Possible With CORS So Why Not Try It ๐Ÿ˜€
Note: I Am The One Who Said The Is 1000 X Better Than 2d benniums Version

willard.fun/login doesn't work

I'm using a chromebook and the login and register buttons don't work.
I looked at the code and I think the "?" is causing it to not work.
Can you fix it?

Wobbly World Far From Origin

Here is a very astonishing glitch I found in minekhan it's a spin-off
https://www.khanacademy.org/computer-programming/minecraft-but-broken/4914589619929088

You may notice that your x, y coordinates are VERY VERY high, meaning that we hundred of thousands of blocks away from spawn which makes the game TOO glitchy

If you are a Minecraft nerd then you might know about the far lands which are basically on the topic of how infinite can you make procedurally generated terrain if you do not know what far lands is here is a summary :

The Far Lands is a terrain bug that appears upon the overflowing of a noise generator, most notably the low and high noise overflow 12,550,821 blocks from the origin of the Minecraft world. There are other parts of Far Lands called Farther Lands and Corner Far Lands.

Lighting Crash

So I was playing minekhan on willard.fun.
Then everything went blank.
Here is a screenshot:
MineKhan - Google Chrome 7_8_2021 8_42_55 PM

Question: browser support

I was checking the source, and it seems to be completely written in outdated practice.
Slapping a "use strict" directive on causes all of the code to fail.

I could have contributed, but was this done for browser support, or were there any other reasons?

Randomly unable to access multiplayer

Sometimes, I can't access multiplayer features; when I try to join or host a server, I get the "Connection lost!" error instantly. However, I see working servers, so others don't have this problem. If needed, I can post a few system specifications.

Sound Effects

Any ideas for how we could implement sound effects into minekhan using while true or something ???

Possible First Ideas
1.A sound gets played when you click buttons.
2.Grass sound effects.
3.Block placing sound effect.

Marketplace In MineKhan

any ideas on when and how we should implement a marketplace in minekhan where you can access hundreds of player made worlds and mods

Multi-Blocks

This would be for mods AND later versions of this program, would it be possible to make capabilities for multiple blocks in a one block space? for example, it would allow for water-logging, placing plants in plant pots, rather than making use of the block above the pot(mods have this, i made them actually...) and for things like fences... they would be much easier to make if i only had to make the post, and the crossbeam, because with that you can just place the beams around the post as needed to get any fence position, rather than having to make a model for every individual state(walls are even harder!)

"Ghost" servers and players

My server is stuck on the server list, even though it got disconnected. At the same time, I was still in the player list of another world, (I checked using /minekhan/worlds), even though I got disconnected from there. Maybe you could fix this by sending an activity check packet every now and then, and remove the server/player if the client doesn't respond?

Maps

i have a custom map and im kinda wanting to share
i thinking like a

Custom maps

Name
Link
pic

Name
Link
pic

in the read me

No License

The Default License for Khan Academy is MIT License. Can you add the MIT License to this program to make it easier to make forked copies of it? Thanks.

Players retained from previous multiplayer sessions

When I leave or close a server and then open one of my worlds to the public, the players from the previous world appear in their last positions, and they don't seem to be linked to the actual players' clients. I can fix it by refreshing/reloading the page, so it probably isn't the most important issue here, but if you have time...

Willard.fun chat hack

Whenever I press T and then Esc in the home menu, the chat opens and closes, and if I press esc a couple more times, I get the Paused menu minus a bunch of buttons. I need to restart the webpage to escape that menu. It also happens in the Worlds menu. I'm a terrible coder, but would something like
if (inWorld && World.multiplayer=true && KeyIsPressed && keyPressed=T) { //chat code here };
work?
I discovered this purely by accident, but it seems strange to me. I'm not sure if the chat messages sent in these menus can be seen by players in other worlds.

Screenshots:
Screenshot 2021-06-10 12 42 17 PM
Screenshot 2021-06-10 12 42 56 PM

ADD

Can you willburt add actually crafting and mining and survival mode

Minor thing

Okay, I'm a bit of a perfectionist here, but when I press Ctrl-U to see the view source for controls (since I always forget) it still says this in the comments at the beginning of the code:
T: Reload textures

I know that T actually accesses chat, could you fix that? It's the most minor thing, so now I feel bad, but I posted this anyway :/

Water Error

<title>Minekhan(with biomes)</title> <style>
	body {
		overflow: hidden; /* Hide scrollbars */
	}
	.world-select {
		width: 99vw;
		min-width: 300px;
		height: calc(100vh - 220px);
		position: absolute;
		bottom: 120px;
		overflow-y: auto;
		background-color: RGBA(0, 0, 0, 0.6);
		justify-content: center;
		margin: 0 auto;
	}
	.world {
		width: 250px;
		height: auto;
		border: 1px solid black;
		font-size: 18px;
  font-family: monospace;
		color: rgb(180, 180, 180);
		margin: 0 auto;
		margin-top: 15px;
		padding: 5px;
		cursor: pointer;
	}
	strong {
		color: white;
	}
	.selected {
		border: 3px solid white;
		padding: 3px;
	}
	input[type=text] {
		background-color: black;
		caret-color: white;
		border: 2px solid gray;
		color: white;
		font-size: 24px;
		padding-left: 12px;
	}
	input[type=text]:focus {
		border: 2px solid lightgray;
	}
	#boxcentertop {
  font-family: Minecraftia;
		z-index: 1;
		width: 80vw;
		max-width: 400px;
		height: 50px;
		position: relative;
		top: 30px;
		display: block;
		margin: 0 auto;
	}
	.hidden {
		display: none !important;
		font-family: monospace;

	}
	#onhover {
		background-color: rgba(0, 0, 0, 0.9);
		color: rgb(200, 200, 200);
		font-family: monospace;
		word-wrap: normal;
		width: auto;
		max-width: 400px;
		position: absolute;
		z-index: 1;
		padding: 10px;
		cursor: default;
	}
	#quota {
  font-family: Minecraftia;
		display: block;
		position: absolute;
		width: 99vw;
		margin: 0 auto;
		bottom: 110px;
		z-index: 1;
		background-color: RGBA(0, 0, 0, 0.6);
		justify-content: center;
		text-align: center;
		color: white;
	}
	#savebox{
		font-family: monospace;
	}
    @keyframes success {

5% {
transform: translate(0px, -7px) rotateY(100deg);
}
30% {
transform: translate(0px, -24px) rotateY(-100deg);
}
55% {
transform: translate(0px, -67px) rotateY(100deg);
}

60% {
transform: rotateY(-100deg) scale(1.1, .9);
}
70% {
transform: rotate(5deg);

CODE ABOVE NEEDS TO BE FIXED FROM FOLLOWING PROJECT

https://www.khanacademy.org/computer-programming/geekypeoplecraft/4805420559319040

Advanced Image Encoder

Those of us who have added other blocks to this, we have probably come across that dreaded bug where if there are to many unique colors in an image, it gets corrupted. So, is it possible, that you could make an encoder that can handle all the colors? say an encoder that can handle 256 colors?(because that's how many pixels there are in the textures) that would be so nice for those of us wanting to add things like fire, nether portal blocks, sea lanterns, prismarine..... yeah, it wouldbe nice if you could do that.

Quick Question

Great stuff you got here! I'm absolutely amazed.

Just a quick question, why is all the code in the same file? Are there any intentions behind this decision?

banned forever lol

Screenshot 2021-06-18 10 54 09

even in the source code:

Screenshot 2021-06-18 10 54 18

on every single page.

this happened because I tried to make an alt account, then I tried to login on my regular account after seeing this (sup6666)

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.