Welcome to the PufferPanel community forums! If you need help please register an account and post in the Support category.

Mooded Minecraft - Feed the Beast



  • After many chnages of this template, some compromises and huge help by descention. I can say that this template is working as it should. I you have any suggestions or need help to use this, just comment below.

    Kind regards
    Max

    {
    	"pufferd": {
    		"type": "java",
    		"display": "FTB Launcher",
    		"install": {
    			"commands": [
    				{
    					"type": "download",
    					"files": "${link}"
    				},
    				{
    					"commands": [
    					"unzip -u FTB*.zip"
    					],
    					"type": "command"
    				},
    				{
    					"source": "*.zip",
    					"target": "ZIP.zip",
    					"type": "move"
    				},
    				{
    					"commands": [
    						"rm ZIP.zip",
    						"chmod u+x FTBInstall.sh",
    						"chmod u+x ServerStart.sh",
    						"chmod u+x settings.sh",
    						"./FTBInstall.sh"
    					],
    					"type": "command"
    				},
    				{
    					"type": "writefile",
    					"text": "eula=${eula}",
    					"target": "eula.txt"
    				},
    				{
    					"type": "writefile",
    					"text": "export MAX_RAM=\"${memory}M\"",
    					"target": "settings-local.sh"
    				},
    				{
    					"type": "writefile",
    					"text": "server-ip=${ip}\nserver-port=${port}\nmotd=${motd}\n",
    					"target": "server.properties"
    				}
    			]
    		},
    		"run": {
    			"stop": "stop",
    			"pre": [],
    			"post": [],
    			"arguments": [],
    			"program":"./ServerStart.sh",
    			"autostart": false
    		},
    		"environment": {
    			"type": "standard"
    		},
    		"data": {
    			"eula": {
    				"value": "false",
    				"required": true,
    				"desc": "Do you (or the server owner) agree to the <a href='https://account.mojang.com/documents/minecraft_eula'>Minecraft EULA?</a>",
    				"display": "EULA Agreement",
    				"internal": false,
    				"type": "boolean"
    			},
    			"memory": {
    				"value": "3072",
    				"required": true,
    				"desc": "How much memory in MB to allocate to the Java Heap",
    				"display": "Memory (MB)",
    				"internal": false,
    				"type": "integer"
    			},
    			"link": {
    				"value": "",
    				"required": true,
    				"desc": "Get the link for your preferred Modpack in the <a href='https://www.feed-the-beast.com/modpacks' target='_blank'>Modpacklist</a>.",
    				"display": "Link to the [zip] archive.",
    				"internal": false
    			},
    			"ip": {
    				"value": "0.0.0.0",
    				"required": true,
    				"desc": "What IP to bind the server to",
    				"display": "IP",
    				"internal": false
    			},
    			"port": {
    				"value": "25565",
    				"required": true,
    				"desc": "What port to bind the server to",
    				"display": "Port",
    				"internal": false,
    				"type": "integer"
    			},
    			"motd": {
    				"value": "A Minecraft Server hosted on PufferPanel",
    				"required": true,
    				"desc": "This is the message that is displayed in the server list of the client, below the name. The MOTD does support <a href='https://minecraft.gamepedia.com/Formatting_codes' target='_blank'>color and formatting codes</a>.",
    				"display": "MOTD message of the day",
    				"internal": false
    			}
    		}
    	}
    }
    


  • This worked great for me. Thank you



  • @descention No problem



  • @themaxaut I'm adding a port changing command to my install section

    {
      "commands": [
        "sed -i 's/server-port=.*/server-port=${port}/' server.properties"
      ],
      "type": "command"
    }
    

    and port to the data

    "port": {
      "value": "25577",
      "required": true,
      "desc": "What port to bind the server to",
      "display": "Port",
      "internal": false,
      "type": "integer"
    }
    


  • @descention Nice, I hope it is ok for you that I just added this to the script ^^.
    ~Max



  • @themaxaut well, my change didn't work it seems.

     Executing: sed -i 's/server-port=.*/server-port=25578/' server.properties
    sed: -e expression #1, char 1: unknown command: `''
    

    I'm looking into it



  • @descention Ok, I wish you luck :D



  • Did your zip contain a server.properties file? Mine for FTB Beyond doesn't, so using this block from other templates would work once the IP and MOTD data entry things are added.

            {
              "type": "writefile",
              "text": "server-ip=${ip}\nserver-port=${port}\nmotd=${motd}\n",
              "target": "server.properties"
            }
    


  • @descention No the server.properties gets created when you start the FTB for the first time :/



  • @themaxaut my new file is http://termbin.com/tbdm
    This gives the option of setting server ip/port/motd like the other templates. sed didn't work because the file didn't exist, I think, so I just got rid of that.

    Edit: I tested it this time from scratch.



  • @descention I like that. Gonna give you some credit in the main post.
    ~ Max



  • Feedback: I've tested reinstalling, like if you were to do an update, and it'll prompt you for the unzip command to do overwriting and whatnot. If you enter "A" in the command sender, it'll update everything. I wasn't sure if you want to leave it at that or use the "-u" flag on unzip to overwrite newer files automatically.

    Also working on adding that memory option via settings-local.sh



  • @descention Nice to hear that you put so much effort in it. So change it too "unzip -u FTB*.zip".
    ~ Max



  • add the following to your install section to get ram set

            {
              "type": "writefile",
              "text": "export MAX_RAM=\"${memory}M\"",
              "target": "settings-local.sh"
            }
    

    and here's the data section copied from other templates, with the default set to FTB Beyond's default value

          "memory": {
            "value": "3072",
            "required": true,
            "desc": "How much memory in MB to allocate to the Java Heap",
            "display": "Memory (MB)",
            "internal": false,
            "type": "integer"
          }
    


  • Hello,

    Would you be able to submit your template as a pull request to https://github.com/PufferPanel/templates ?

    I could also submit it on your behalf with your permission.

    Thanks!



  • @puffrfish I am very happy that you want that template on github. Feel free to use it!

    But if you credit me, be sure to also credit "descention".

    ~ Max


Log in to reply
 

3
Online

666
Users

708
Topics

3.2k
Posts

Looks like your connection to PufferPanel Community was lost, please wait while we try to reconnect.