This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
ComputerCraftFan11's profile picture

Modmaker

Started by ComputerCraftFan11, 06 April 2012 - 06:55 AM
ComputerCraftFan11 #1
Posted 06 April 2012 - 08:55 AM
This is a program that i'm currently developing.

You put minecraft coder pack in "mcp" (folder in same directory as program)

If the program detects mcp is installed. It will give you options to make a mod
Some examples are block making.

When making a block, it will give you some options and stuff

So basically, this is a program that lets you make mods in a mod :)/>/>

Download

*coming soon*

Images

Spoiler*coming soon too*

Installation

Drag this program and the "mcp" folder into /saves/yourworld/computers/computerid/ (if you can't see "mcp", make it) then drag the minecraft coder pack into "mcp". If it says:

MCP not installed! Pleased decompile MCP and put it in the mcp folder.
Then you didn't put mcp in the right place or you forgot to decompile it

How it works

The way this program works is simple. You put your minecraft coder pack inside mcp and the program will write files in "mcp/src/minecraft/net/minecraft/src" to do whatever you want. Blocks will generate pre-defined chunks of code into a newly made mod/block file.
ComputerCraftFan11 #2
Posted 06 April 2012 - 07:52 PM
I need some testers
Ian-Moone #3
Posted 06 April 2012 - 08:01 PM
im in
this sounds epic
Wolvan #4
Posted 06 April 2012 - 08:23 PM
I help!
ComputerCraftFan11 #5
Posted 06 April 2012 - 08:54 PM
K, this is the current code:


local path = "mcp/src/minecraft/net/minecraft/src";
local modname = ""
local start = [[
package net.minecraft.src;


public class mod_jBox extends BaseMod
{



public void load()
{

}

public void getVersion()
{
return "1.2.4"
}

}
]]

function top()
shell.run("clear")
print("Welcome to xXm0dzXx's Mod Maker!")
print("--------------------------------")
end

function blockmaker()
top()
write("Choose a block name: ")
blockclass = read()
write("Choose a block ID: ")
blockid = tonumber(read())
if blockid > 256 then
print("Block ID too high!")
sleep(3)
blockmaker()
else
end
end

function base()
top()
write("Enter mod name: mod_")
input = read()
modname = "mod_" ..input.. ".java"
if fs.exists(path.."/"..modname) then
print(modname.. " already exists! Would you like to modify that [y/n]?")
input = read()
if input == "y" then
menu()
else
shell.run("clear")
end
else
file = io.open(path.."/"..modname, "w")
file:write(start)
file:close()
print(modname.. " created!")
sleep(1)
menu()
end
end

function menu()
top()
if modname == "" then
print("[1] Create Base Files")
else
print("[1] Delete Base Files")
end
if modname == "" then
print("[2] Make New Block (CREATE BASE FILES FIRST)")
print("[X] Patch Mod (CREATE BASE FILES FIRST)")
print("[V] Custom Editor (CREATE BASE FILES FIRST)")
else
print("[2] Make New Block")
print("[X] Patch Mod (Run to make the mod work)")
print("[V] Custom Editor")
end
print("")
write("Selection: ")
input = read()
if input == "1" then
if modname == "" then
base()
else
fs.delete(path.. "/" ..modname)
top()
print("Deleted!")
end
elseif input == "2" then
if modname == "" then
menu()
else
blockmaker()
end
elseif input == "X" then
if modname == "" then
menu()
else
error("not done")
end
elseif input == "V" then
if modname == "" then
menu()
else
shell.run("edit", path.. "/" ..modname)
end
else
menu()
end
end




if fs.exists("mcp/src") then
menu()
else
print("MCP not installed! Pleased decompile MCP and put it in the mcp folder.")
end


I'm working on the block maker (don't use the patcher, its not done)
Ian-Moone #6
Posted 06 April 2012 - 09:12 PM
thanks
Wolvan #7
Posted 07 April 2012 - 12:49 AM
Is this a LUA CC Script?!? Epic! Stupid me! Sure it's an CC Script else it wouldn't be in the cc forums :P/>/>
''t
libraryaddict #8
Posted 07 April 2012 - 11:26 PM
Is this a LUA CC Script?!? Epic! Stupid me! Sure it's an CC Script else it wouldn't be in the cc forums :P/>/>
''t

idk..
Ive seen many stupid people..
Noodle #9
Posted 07 April 2012 - 11:53 PM
Reading your code.. Why do you do shell.run("clear") ??
You could term.clear()
Noodle #10
Posted 07 April 2012 - 11:54 PM
Error: modmaker:60: attempt to index ? (a nil value)
Wolvan #11
Posted 08 April 2012 - 01:16 AM
Reading your code.. Why do you do shell.run("clear") ??
You could term.clear()
I think because


shell.run("clear")
is shorter than

term.clear()
term.setCursorPos(1,1)
cant_delete_account #12
Posted 08 April 2012 - 11:27 PM
Reading your code.. Why do you do shell.run("clear") ??
You could term.clear()
Does it really matter? No.
Anyway, cool program, I'll be trying this out when its done!
ComputerCraftFan11 #13
Posted 09 April 2012 - 06:33 AM
public class mod_jBox extends BaseMod

Oops, forgot to make it change mod_name
djblocksaway #14
Posted 09 April 2012 - 09:41 AM
Reading your code.. Why do you do shell.run("clear") ??
You could term.clear()
I think because


shell.run("clear")
is shorter than

term.clear()
term.setCursorPos(1,1)
aha good point :P/>/>
con2000 #15
Posted 11 April 2012 - 11:10 PM
See This. What ComputerCraft Can do! :D/>/> :P/>/>
Xtansia #16
Posted 12 April 2012 - 01:45 AM
See This. What ComputerCraft Can do! :D/>/> :P/>/>

Yeah,
Concatenate strings,
And write it to a file,
[/sarcasm]
con2000 #17
Posted 17 April 2012 - 02:44 AM
Thanks [/sarcasm] JK :)/>/>
Wolvan #18
Posted 17 April 2012 - 08:20 AM
Too much sarcasm
[/sarcasm]
yoskaz01 #19
Posted 17 April 2012 - 08:33 AM
don't want to ruin everyone's fun but what if the purpose of copying the entire Mcp dir to each of

the computer folders?

unless you are actually building the mod using your program why not just create the .Java files along with a .batch (windows) to copy the source to the actual MVP did and then rebuilrd…..
Wolvan #20
Posted 17 April 2012 - 03:31 PM
I created a new version of it that doesn't require MCP to be installed in the folder. It uses a wizard (batch file) that I wrote to copy all files into the MCP dir
Spoiler

local path = "data/MM";
local modname = ""
local batchData = [[
@echo off
color 0F
title ModMaker Copy Tool v1.0 by Wolvan for ComputerCraftFan11's ModMaker
echo Hello and welcome to Wolvan's ModMaker File Copier.
echo This wizard will guide you through the whole copying process.
echo Just close the window to abort the process.
pause
cls
echo Thank you. Now specify the mod's name
set /p ModNameInput="Name: "
set ModName="%CD%dataMMmod_%ModNameInput%.java"
echo Please type in the Path to your MCP Folder.
echo You can drag the folder into this window, too.
set /p MCPdir="Path: "
cp %ModName% %MCPdir%
cls
IF %ERRORLEVEL% NEQ 0 GOTO FAIL
GOTO SUCCESS
:FAIL
echo There was an error. Maybe the modfile doesn't exist. Please try again.
pause
goto ENDE
:SUCCESS
echo The Process was successful and the Copier was deleted.
echo Congratulations! You have created a mod.
echo Now you have to recompile it using MCP!
echo Thank you for using ComputerCraftFan11's ModMaker and Wolvan's MCP Copier.
pause
del "%CD%MCP_Copy.bat"
goto ENDE
:ENDE
]]
local start = [[
package net.minecraft.src;

public class mod_jBox extends BaseMod
{

public void load()
{
}
public void getVersion()
{
return "1.2.4"
}
}
]]
function top()
shell.run("clear")
print("Welcome to xXm0dzXx's Mod Maker!")
print("--------------------------------")
end
function batchWrite()
batch = fs.open("MCP_Copy.bat", "w")
batch:write(batchData)
batch.close()
print("Wrote Copier. Please use "MCP_Copy"nto copy the files to your MCP")
sleep(2)
menu()
end
function blockmaker()
top()
write("Choose a block name: ")
blockclass = read()
write("Choose a block ID: ")
blockid = tonumber(read())
if blockid > 256 then
print("Block ID too high!")
sleep(3)
blockmaker()
else
end
batchWrite()
end
function base()
top()
write("Enter mod name: mod_")
input = read()
modname = "mod_" ..input.. ".java"
if fs.exists(path.."/"..modname) then
print(modname.. " already exists! Would you like to modify that [y/n]?")
input = read()
if input == "y" then
menu()
else
shell.run("clear")
end
else
file = io.open(path.."/"..modname, "w")
file:write(start)
file:close()
print(modname.. " created!")
sleep(1)
menu()
end
end
function menu()
top()
if modname == "" then
print("[1] Create Base Files")
else
print("[1] Delete Base Files")
end
if modname == "" then
print("[2] Make New Block (CREATE BASE FILES FIRST)")
print("[X] Patch Mod (CREATE BASE FILES FIRST)")
print("[V] Custom Editor (CREATE BASE FILES FIRST)")
print("[B] Create the Copy Wizard")
print("[E] Exit the program")
else
print("[2] Make New Block")
print("[X] Patch Mod (Run to make the mod work)")
print("[V] Custom Editor")
print("[B] Create the Copy Wizard")
print("[E] Exit the program")
end
print("")
write("Selection: ")
input = read()
if input == "1" then
if modname == "" then
base()
else
fs.delete(path.. "/" ..modname)
top()
print("Deleted!")
end
elseif input == "2" then
if modname == "" then
menu()
else
blockmaker()
end
elseif input == "X" then
if modname == "" then
menu()
else
error("not done")
end
elseif input == "V" then
if modname == "" then
menu()
else
shell.run("edit", path.. "/" ..modname)
end
elseif input == "B" then
batchWrite()
elseif input == "E" then
os.reboot()
else
print("Input not recognised. Please try againnand use uppercase letters")
sleep(2)
menu()
end
end

if fs.exists(path) then
else
shell.run("mkdir", path)
end
menu()
Hackingroelz #21
Posted 21 April 2012 - 10:50 AM
I have a cool idea! Add the possebility to run minecraft with your mod via the program!
cant_delete_account #22
Posted 21 April 2012 - 06:41 PM
I have a cool idea! Add the possebility to run minecraft with your mod via the program!
That's impossible, you can't mod Minecraft and restart it through Lua / CC. Someone would have to make a batch file you run which recompiles, then runs startclient. So you can't do it inside Minecraft.
Hackingroelz #23
Posted 21 April 2012 - 06:55 PM
I have a cool idea! Add the possebility to run minecraft with your mod via the program!
That's impossible, you can't mod Minecraft and restart it through Lua / CC. Someone would have to make a batch file you run which recompiles, then runs startclient. So you can't do it inside Minecraft.

With only CC you can't, but you could make a peripheral for that.
ComputerCraftFan11 #24
Posted 21 April 2012 - 06:56 PM
Hey everyone

Incase you don't wanna remake a bunch of MCP folders, here's a short program that does it:

local path = "mcp/src/minecraft/net/minecraft/src";
fs.makeDir(path);

Then look in the "path" folder for the generated files
ComputerCraftFan11 #25
Posted 21 April 2012 - 06:57 PM
I have a cool idea! Add the possebility to run minecraft with your mod via the program!
That's impossible, you can't mod Minecraft and restart it through Lua / CC. Someone would have to make a batch file you run which recompiles, then runs startclient. So you can't do it inside Minecraft.

I can make it generate all of those together in the same path as the mod maker
ComputerCraftFan11 #26
Posted 21 April 2012 - 07:21 PM
UPDATE:

local path = "mcp/src/minecraft/net/minecraft/src";
local modname = ""
local import = [[
package net.minecraft.src;
]]
local base = [[
{

public void load()
{
}
public void getVersion()
{
return "1.2.4"
}
}
]]
function top()
shell.run("clear")
print("Welcome to xXm0dzXx's Mod Maker!")
print("--------------------------------")
end
function blockmaker()
top()
write("Choose a block name: ")
blockclass = read()
write("Choose a block ID: ")
blockid = tonumber(read())
if blockid > 256 then
print("Block ID too high!")
sleep(3)
blockmaker()
else
end
end
function base()
top()
write("Enter mod name: mod_")
input = read()
modtitle = "mod_" ..input
modname = modtitle.. ".java"
if fs.exists(path.."/"..modname) then
print(modname.. " already exists! Would you like to modify that [y/n]?")
input = read()
if input == "y" then
menu()
else
shell.run("clear")
end
else
file = io.open(path.."/"..modname, "w")
file:write(import)
file:write("public class " ..modtitle.. " extends BaseMod")
file:write(base)
file:close()
print(modname.. " created!")
sleep(1)
menu()
end
end
function menu()
top()
if modname == "" then
print("[1] Create Base Files")
else
print("[1] Delete Base Files")
end
if modname == "" then
print("[2] Make New Block (CREATE BASE FILES FIRST)")
print("[X] Patch Mod (CREATE BASE FILES FIRST)")
print("[V] Custom Editor (CREATE BASE FILES FIRST)")
else
print("[2] Make New Block")
print("[X] Patch Mod (Run to make the mod work)")
print("[V] Custom Editor")
end
print("")
write("Selection: ")
input = read()
if input == "1" then
if modname == "" then
base()
else
fs.delete(path.. "/" ..modname)
top()
print("Deleted!")
end
elseif input == "2" then
if modname == "" then
menu()
else
blockmaker()
end
elseif input == "X" then
if modname == "" then
menu()
else
error("not done")
end
elseif input == "V" then
if modname == "" then
menu()
else
shell.run("edit", path.. "/" ..modname)
end
else
menu()
end
end

if fs.exists("mcp/src") then
menu()
else
print("MCP not installed! Pleased decompile MCP and put it in the mcp folder.")
end

(Not Tested)

I made it so instead of always writing
public class mod_jBox extends BaseMod
to
public class mod_<MOD NAME HERE> extends BaseMod

Now im going to make it read the entire file, find

public void load()
{
And type in the mod stuff after that (like blocks)
Zer0t3ch #27
Posted 22 April 2012 - 07:48 AM
Sounds interesting! PM me after you update the OP with screenshots.
MegaError101 #28
Posted 09 May 2012 - 01:34 AM
i will test it if you want email me the program at demihoxha@aol.com i will tell you if i see errors
ironsmith123 #29
Posted 12 May 2012 - 04:08 AM
You should also add the ability to make custom content packs for Flan's mod from the program since the custom content packs are made with mcp.
MathManiac #30
Posted 17 May 2012 - 04:29 PM
Lol :3 That looks cool! Meh, I made a program on a disk that is an auto-installer. Nice job!
BrettSmith21 #31
Posted 01 July 2012 - 06:18 PM
Are You Still Working On This And Do You Have A 1.2.5 Copy??
and btw cool!!