walterhiggins / ScriptCraft

Write Minecraft Plugins in JavaScript.
MIT License
1.84k stars 379 forks source link

MCP installation mechanism doesn't work #34

Closed samueller closed 10 years ago

samueller commented 11 years ago

I installed MCP as directed. Is this now deprecated? Anyway, I followed the instructions and when recompiling I get errors stating that ScriptCraftEvaluator, ScriptCraftMCP, etc classes are missing. So I copied those over to my mcp726a/src/minecraft/net/minecraft/src directory too. Then recompiling and reobfuscating works fine. I copy the reobfed classes to the minecraft.jar file and the game runs.

Now I try to load the cottage.js file as in the getting started instructions. But I get an error that __folder is undefined. That seems to be the mechanism to load dependent javascript files. So I try a /js var __folder = '' so I can load at least 1 of the javascripts... no luck. I can't seem to load any javascripts even with absolute directory paths. What's with __folder?

I'm on a Mac with Mountain Lion.

I want students to be able to program JavaScript without connecting to a server. That's why I went this route. I guess I can just try out the Bukkit thing and have a server installed locally on their machines?

samueller commented 11 years ago

The scripts also make many references to __self to, for example, get the world object. But __self also appears to be missing/undefined. I checked all the javascript files I copied to my ~/ScriptCraft folder and neither __self nor __folder are defined anywhere as a variable or method. So I'm guessing ScriptCraft was supposed to make these variables available. Is it possible I didn't install ScriptCraft properly?

walterhiggins commented 11 years ago

Hi Sam, The MCP version is no longer supported. For a classroom environment I definitely recommend the craftbukkit version. You only have to install the plugin (it's a drag-and-drop) once on the craftbukkit server, then all your students can connect to the same server and use Javascript (no need to use a recompiled version on each student's computer). You can get craftbukkit here - http://dl.bukkit.org/ To install the ScriptCraft plugin, just grab the latest version from here http://walterhiggins.net/blog/files/scriptcraft/ then copy it to the plugins folder inside your craftbukkit folder.

chrisabrams commented 11 years ago

I can confirm that using the bukkit server it makes it much much easier to maintain vs. recompiling on each machine for each update.

BernardLittau commented 11 years ago

I just spent a long moment getting the MCP version of ScriptCraft 1.4.6 installed. I see two comments ago that the MCP version is no longer supported. Yikes! I am running into a issue where Minecraft responds with "You do not have permission to run this command" when I try /js 1+1. Is this a Windows issue with loading java extensions? Is this why MCP version is not supported?

walterhiggins commented 11 years ago

Hi Bernard,

You need to make yourself an operator to run the /js command . Type /op to give yourself operator permissions. ScriptCraft (for both MCP and CraftBukkit) consists of a bare-bones java plugin and a bunch of javascript which does most of the work. There is just enough java to load javascript, then javascript takes over much of the work done by ScriptCraft. Since moving to bukkit the javascript codebase has changed to such a degree I can't support both the MCP and Bukkit versions. The bukkit version is better and much easier to install.

BernardLittau commented 11 years ago

Thanks for the reply. I should have mentioned I was op’ed. Still no joy with the MCP version.

However, I got the Bukkit version server going in short order. The trouble with that is the latest I can find is a 1.4.5 server version of Bukkit. Took a while to figure out how to fetch an older version of the Minecraft client so I could actually use it :-) Now it works great! Except I’m stuck inside the cottage – don’t know how to open the &%@*% door, don’t want to smash my way out. This is my first time being in a Minecraft world; my son is the avid player. I just run the server :-)

Lesson learned: go the Bukkit route.

The ability to use JavaScript to build things within Minecraft got me interested. Good opportunity to introduce some programming to my son. Thank you for taking the time to put ScriptCraft together.

This is kind of fun…

From: Walter Higgins [mailto:notifications@github.com] Sent: Wednesday, January 23, 2013 11:51 PM To: walterhiggins/ScriptCraft Cc: bernard@littau.org Subject: Re: [ScriptCraft] MCP installation mechanism doesn't work (#34)

Hi Bernard,

You need to make yourself an operator to run the /js command . Type /op to give yourself operator permissions. ScriptCraft (for both MCP and CraftBukkit) consists of a bare-bones java plugin and a bunch of javascript which does most of the work. There is just enough java to load javascript, then javascript takes over much of the work done by ScriptCraft. Since moving to bukkit the javascript codebase has changed to such a degree I can't support both the MCP and Bukkit versions. The bukkit version is better and much easier to install.

— Reply to this email directly or view it on GitHubhttps://github.com/walterhiggins/ScriptCraft/issues/34#issuecomment-12640921.

walterhiggins commented 11 years ago

Hi Bernard, You can grab any of the beta builds for CraftBukkit here http://dl.bukkit.org/downloads/craftbukkit/

There are versions for 1.4.6 and 1.4.7

Walter

samueller commented 11 years ago

@walterhiggins, it was fairly easy getting CraftBukkit and ScriptCraft working. I'm now writing up and recording curriculum for our students to learn JavaScript through Minecraft thanks to you! We'll have kids as young as 5 years old learning JavaScript this way at UCode. Let me know if we can be of any assistance to this project.

Please remove the MCP instructions on this github main page so others aren't confused.

walterhiggins commented 11 years ago

Please remove the MCP instructions on this github main page so others aren't confused.

Fair point Sam. I'll update the readme as soon as I can.

BernardLittau commented 11 years ago

Thanks for the link to the builds. I am back up and active on 1.4.7. So I have a complaint: Where are my trees! :-)

I really liked the idea of cottage_road(); good demonstration of the power of programming to build on the small and then really go nuts. But for really nuts you need oaks(). Seems like oaks() was not working. Playing around with generateTree, I see that BIG_TREE is a tough one to get to work. A couple issues are 1) BIG_TREE needs to be placed on dirt, or on grass, but not on rock or brick or sand. 2) even if you place BIG_TREE on dirt, it is problematic getting it to actually work. A little search-engine digging suggests setting the block location you are targeting to 'air' immediately before the generateTree appears to help the situation immensely.

Naturally, I coded up the changes to make cottage_road() work just a little better. Added a slab of dirt so the trees can grow and the cottages have a floor. Fixed up the length of the slab/road so the last trees can take root. Added the 'air' trick.

How do I get the altered file to you? Hate to just paste it into this thread.

Thanks again for your work on ScriptCraft!

Bernard

walterhiggins commented 11 years ago

Hi @BernardLittau The cottage_road() function is ideally suited to FLAT worlds in minecraft.

SEAPUNK commented 10 years ago

Old issue; I think this should be closed.

walterhiggins commented 10 years ago

Trees methods in Drone class have since been improved.