Setting up a Minecraft mod environment in VSCode (It’s easier than you think!)

Hi! This is my documented journey to create a Minecraft Forge mod. It’s been a while since I created one, and I want to see if I still remember how things work.
In addition, I’d like to try to do this using VSCode, instead of the usual IDEs recommended for this. Let’s see how it goes!
First, let’s download Forge. The files can be found at http://files.minecraftforge.net/, and I think I want the MDK, but let’s see if the docs tell us.
Yep, the MDK. Ok, downloading the MDK for 1.12.2 – 14.23.5.2836…
Oh, before we get too far along, I’m planning to track my progress with git commits and this readme. That way, if things get broken or strange, I can use git to backup, and you and I get a nice history we can look back on.
Ok, the MDK is downloaded, let’s unzip it.
The docs say to only copy build.gradle, gradlew.bat, gradlew, and the gradle directory. I’ll leave out gradlew.bat since I’m developing on Linux.
The next step is to run gradlew setupDecompWorkspace. Since this is Linux, the correct command is ./gradlew setupDecompWorkspace, since the working directory isn’t in the path.
Ok, it looks like I don’t have the java compiler (or JDK) installed on this computer. Your instructions to get a JDK installed for likely differ, so I’ll leave this part out. DuckDuckGo is your friend.
OpenJDK 8 installed and ./gradlew setupDecompWorkspace is successful.
The two commands we want for testing are:

./gradlew runClient
./gradlew runServer

Before we do that, we need a mod. Forge comes with a sample mod, but the instructions don’t tell us to copy that. Let’s do that though, so we have a starting place, and we can test this setup works
Copied the src directory from our unzipped MDK directory.
[19:59:27] [Client thread/INFO] [examplemod]: DIRT BLOCK >> minecraft:dirt
Great, it works! At this time, before we commit we probably want to create a `.gitignore and add a couple of things to it.
Before I get too far into modding, I want to know that we can build our mod correctly as well. I’m going to to use MultiMC because it works all 3 major operating systems and makes creating Minecraft instances with the exact versions and mods you want so easy.
Here goes ./gradlew build
[20:08:03] [Client thread/INFO] [examplemod]: DIRT BLOCK >> minecraft:dirt
Perfect! At this point, let’s calls this version 0.1.0
This post was created as part of the README for my Panda’s mod, but given my habit of not completing things I though I’d share this part here in case it helped others. Thoughts and feedback welcome.

Link: https://dev.to/drazisil/setting-up-a-minecraft-mod-enviroment-in-vscode-it-s-easier-than-you-think-5bfc

什麼捕獲冒泡,你是魚嗎? 聊聊瀏覽器 DOM 的事件傳遞

身為一個前端工程師,從以前到現在的工作經驗中,凡是需要與使用者互動的,或是需要由使用者觸發的功能,總是離不開畫面上的事件處理。 這篇就要來聊聊瀏覽器中 DOM 的事件傳遞機制。Continue reading on Medium »

Link: https://medium.com/@schaos/%E4%BB%80%E9%BA%BC%E6%8D%95%E7%8D%B2%E5%86%92%E6%B3%A1-%E4%BD%A0%E6%98%AF%E9%AD%9A%E5%97%8E-%E8%81%8A%E8%81%8A%E7%80%8F%E8%A6%BD%E5%99%A8-dom-%E7%9A%84%E4%BA%8B%E4%BB%B6%E5%82%B3%E9%81%9E-b44454690661?source=rss——javascript-5