PrismarineJS / prismarine-viewer

Web based viewer for servers and bots
https://prismarinejs.github.io/prismarine-viewer/
MIT License
251 stars 71 forks source link

How to localy test this package? #99

Closed 3top1a closed 3 years ago

3top1a commented 3 years ago

I wanted to do #57, but I don't know how to test/run the package localy. Any help?

rom1504 commented 3 years ago

You can start any of the example with node

On Wed, Dec 23, 2020, 10:52 3top1a notifications@github.com wrote:

I wanted to do #57 https://github.com/PrismarineJS/prismarine-viewer/issues/57, but I don't know how to test/run the package localy. Any help?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/PrismarineJS/prismarine-viewer/issues/99, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR437XQZLP7S2T3QCC53JLSWG4UVANCNFSM4VGYZJLQ .

3top1a commented 3 years ago

My changes are still not visible, i tried removing the players color in entities.js, I can still se it in red

rom1504 commented 3 years ago

Run webpack again or use webpack serve

On Wed, Dec 23, 2020, 11:24 3top1a notifications@github.com wrote:

My changes are still not visible, i tried removing the players color in entities.js, I can still se it in red

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/PrismarineJS/prismarine-viewer/issues/99#issuecomment-750098331, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR437WI6HG3BQBXGMCZKV3SWHAPXANCNFSM4VGYZJLQ .

3top1a commented 3 years ago

How? (Sorry for my inexperience)

rom1504 commented 3 years ago

node_modules/.bin/webpack

On Wed, Dec 23, 2020, 13:57 3top1a notifications@github.com wrote:

How? (Sorry for my inexperience)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/PrismarineJS/prismarine-viewer/issues/99#issuecomment-750289973, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR437TFM5QDALWTK5CQIQLSWHSMZANCNFSM4VGYZJLQ .

3top1a commented 3 years ago

Still nothing

rom1504 commented 3 years ago

What are you running ?

On Wed, Dec 23, 2020, 14:33 3top1a notifications@github.com wrote:

Still nothing

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/PrismarineJS/prismarine-viewer/issues/99#issuecomment-750302463, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR437X6D75FAANHGT47TCLSWHWSTANCNFSM4VGYZJLQ .

3top1a commented 3 years ago

examples/bot.js

rom1504 commented 3 years ago

What happened after you re-ran webpack ? Did it regenerate the public/ dir ?

On Wed, Dec 23, 2020, 14:39 3top1a notifications@github.com wrote:

examples/bot.js

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/PrismarineJS/prismarine-viewer/issues/99#issuecomment-750304534, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR437U6OLGNG6RTJWEUCLDSWHXJBANCNFSM4VGYZJLQ .

3top1a commented 3 years ago

There is a public/ Log:

ℹ 「wds」: Project is running at http://localhost:8080/
ℹ 「wds」: webpack output is served from undefined
ℹ 「wds」: Content not from webpack is served from /home/not-a-weeb/Documents/mineflayer/prismarine-viewer
ℹ 「wdm」: wait until bundle finished: /
ℹ 「wdm」: asset ./index.js 1.98 MiB [emitted] (name: main)
runtime modules 1010 bytes 5 modules
modules by path ./node_modules/ 1.74 MiB 60 modules
modules by path ./viewer/ 16.9 KiB
  ./viewer/index.js 186 bytes [built] [code generated]
  ./viewer/lib/viewer.js 2.59 KiB [built] [code generated]
  ./viewer/lib/worldView.js 4.18 KiB [built] [code generated]
  ./viewer/lib/simpleUtils.js 1.21 KiB [built] [code generated]
  ./viewer/lib/worldrenderer.js 4.47 KiB [built] [code generated]
  ./viewer/lib/entities.js 1.35 KiB [built] [code generated]
  ./viewer/lib/primitives.js 1.25 KiB [built] [code generated]
  ./viewer/lib/version.js 714 bytes [built] [code generated]
  ./viewer/lib/utils.electron.js 512 bytes [built] [code generated]
  ./viewer/lib/utils.js 512 bytes [built] [code generated]
./lib/index.js 1.86 KiB [built] [code generated]
./public/supportedVersions.json 100 bytes [built] [code generated]
webpack 5.11.0 compiled successfully in 3755 ms

asset ./worker.js 16 MiB [emitted] (name: main)
416 modules
webpack 5.11.0 compiled successfully in 5903 ms
ℹ 「wdm」: Compiled successfully.
rom1504 commented 3 years ago

Ok what do you run next ? Are you sure your change is doing something ?

On Wed, Dec 23, 2020, 14:48 3top1a notifications@github.com wrote:

There is a public/ Log:

ℹ 「wds」: Project is running at http://localhost:8080/

ℹ 「wds」: webpack output is served from undefined

ℹ 「wds」: Content not from webpack is served from /home/not-a-weeb/Documents/mineflayer/prismarine-viewer

ℹ 「wdm」: wait until bundle finished: /

ℹ 「wdm」: asset ./index.js 1.98 MiB [emitted] (name: main)

runtime modules 1010 bytes 5 modules

modules by path ./node_modules/ 1.74 MiB 60 modules

modules by path ./viewer/ 16.9 KiB

./viewer/index.js 186 bytes [built] [code generated]

./viewer/lib/viewer.js 2.59 KiB [built] [code generated]

./viewer/lib/worldView.js 4.18 KiB [built] [code generated]

./viewer/lib/simpleUtils.js 1.21 KiB [built] [code generated]

./viewer/lib/worldrenderer.js 4.47 KiB [built] [code generated]

./viewer/lib/entities.js 1.35 KiB [built] [code generated]

./viewer/lib/primitives.js 1.25 KiB [built] [code generated]

./viewer/lib/version.js 714 bytes [built] [code generated]

./viewer/lib/utils.electron.js 512 bytes [built] [code generated]

./viewer/lib/utils.js 512 bytes [built] [code generated]

./lib/index.js 1.86 KiB [built] [code generated]

./public/supportedVersions.json 100 bytes [built] [code generated]

webpack 5.11.0 compiled successfully in 3755 ms

asset ./worker.js 16 MiB [emitted] (name: main)

416 modules

webpack 5.11.0 compiled successfully in 5903 ms

ℹ 「wdm」: Compiled successfully.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/PrismarineJS/prismarine-viewer/issues/99#issuecomment-750307704, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR437UGBQA2FANTSNHIGO3SWHYJFANCNFSM4VGYZJLQ .

3top1a commented 3 years ago

node examples/bot.js

Yes, i made the character box have a green color. It still has red

rom1504 commented 3 years ago

It's not magical. Either you didn't change the code enough, either something was not refreshed. Could be webpack, could be you didn't restart the example, could be you didn't refresh in the browser,... Hard to tell from here

On Wed, Dec 23, 2020, 16:01 3top1a notifications@github.com wrote:

node examples/bot.js

Yes, i made the character box have a green color. It still has red

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/PrismarineJS/prismarine-viewer/issues/99#issuecomment-750338512, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR437XFEI535YL6ASARM4TSWIA4NANCNFSM4VGYZJLQ .

Karang commented 3 years ago

How did you change it ?

3top1a commented 3 years ago

Just give me a list of commands to build and test the package, I'll just copy the files

rom1504 commented 3 years ago

I've already gave them above

  1. node_module/.bin/webpack
  2. node examples/bot.js

On Wed, Dec 23, 2020, 18:28 3top1a notifications@github.com wrote:

Just give me a list of commands to build and test the package, I'll just copy the files

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/PrismarineJS/prismarine-viewer/issues/99#issuecomment-750398980, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR437QCOEVPHG6FQ2MDFWLSWISDJANCNFSM4VGYZJLQ .

3top1a commented 3 years ago

For anyone else (me included), just list the steps necesary to extend this module

rom1504 commented 3 years ago

Yes. What are you confused about what I just said ? Maybe you could come to our discord, I guess it would be easier to communicate there.

3top1a commented 3 years ago

By the fact it still doesn't work

extremeheat commented 3 years ago

What doesn’t work? What’s the error? What happens? What have you tried? Can’t help you if you’re not more specific.

3top1a commented 3 years ago

I have made a change in the entity.js file, making the player character green. No matter what I tried, it's still red.

What I tried:

extremeheat commented 3 years ago

Can you join the discord? It may be easier to help there. What changes did you make?

3top1a commented 3 years ago

What room?

Karang commented 3 years ago

If you want to change the bot color you need to edit https://github.com/PrismarineJS/prismarine-viewer/blob/master/lib/index.js#L61

The code in entities.js is for other players. Ultimately this would need to be refactored to share some code.