minecraft

Setting Block Data from Schematic in Bukkit?

别说谁变了你拦得住时间么 提交于 2019-12-06 07:26:39
问题 I am trying to load and paste a .schematic file (without hooking the MCEdit API) in bukkit. Below is the function/method i use to paste the schematic. While pasting, i keep getting a NullPointerException in the pasting process. When i logged what items were getting placed, i see grass blocks, stone, but not my chests, anything in the chests, or beacons (Maybe even more blocks). The error occurs on this line: block.setData(blockData[index], true); I think this has to do something with the

Redirect non-HTTP traffic to a port, based on a subdomain

流过昼夜 提交于 2019-12-06 03:59:41
问题 I'm working on making my two Minecraft servers easier to access. I've attempted a few solutions, but so far, none have worked effectively. I have a normal vanilla Minecraft server listening on mysite.com:25560, and a Tekkit Minecraft server listening on mysite.com:25570. That is, both Minecraft servers are running on the same machine. They work properly when users directly connect to the server with the port specified. The vanilla server was initially listening on mysite.com:25565, the

Python Recursive Data Reading

南楼画角 提交于 2019-12-05 10:47:06
The following will make more sense if you have ever played minecraft. Since many of you have not, I will try to explain it as best as I can I am trying to write a recursive function that can find the steps to craft any minecraft item from a flatfile of minecraft recipes. This one has me really stumped. The flatfile is kinda long so I included it in this gist. def getRecipeChain(item, quantity=1): #magic recursive stuffs go here So basically I need to look up the first recipe then look up the recipes for all the components of that first recipe and so on till you get to items with no recipes.

How to terminate Lua script?

拜拜、爱过 提交于 2019-12-05 01:22:20
How would I terminate a Lua script? Right now I'm having problems with exit(), and I don't know why. (This is more of a Minecraft ComputerCraft question, since it uses the APIs included.) Here is my code: while true do if turtle.detect() then if turtle.getItemCount(16) == 64 then exit() --here is where I get problems end turtle.dig() --digs block in front of it end end As prapin's answer states, in Lua the function os.exit([code]) will terminate the execution of the host program. This, however, may not be what you're looking for, because calling os.exit will terminate not only your script, but

Twisted Python + spawnProcess. Getting output from a command

╄→尐↘猪︶ㄣ 提交于 2019-12-04 14:44:31
问题 I'm working to wrap the Minecraft server application with a Twisted Python server that has a RESTful API for getting the list of currently connected players. The Twisted app starts the minecraft server via reactor.spawnProcess(), then communicates via a ProcessTransport, which writes to stdin. Reading stdout and stdin is handled by a separate protocol.ProcessProtocol class. Given that I want to get the results of a very specific command (the 'list' command, which returns something like this:

Sending Login Packet to Minecraft Server in Python Not Working

只愿长相守 提交于 2019-12-04 12:27:13
I have the following script in Python. What it does is tries to connect to a MineCraft server, first by sending a 'handshake', then sending a login request. The protocol specs can be found here: http://wiki.vg/Protocol Anyway, the python script works fine, and there are no errors. However, I'm fairly use I encoded the second packet wrong, as when it is sent, nothing appears on the server console. The player isn't connected or anything. It just eventually times out and closes the connection due to the 'client' not logging in in time. Basically, anyway who has experience with struct.pack()

Python NameError from contents of a variable

江枫思渺然 提交于 2019-12-04 05:25:30
问题 I've been making a mod for the Raspberry Pi version of Minecraft and I'm getting a very frustrating error every time I enter one of the commands in my program. Here's my code: import minecraft.minecraft as minecraft import minecraft.block as block import time mc = minecraft.Minecraft.create(); print('newBlock - Change ID of block to spawn') print('blockType - Change subID of block to spawn') print('pos1') print('pos2') print('fill - fill specified area') print('clear - clear specified area')

How do I reference instances using an instance?

北慕城南 提交于 2019-12-04 05:09:33
问题 I'm trying to minimize how much I create an instance, as I am not particularly skilled in Java. Currently I have a set of instances of other classes in my Main, a quick example... public final class ClassName extends JavaPlugin { AntiSwear antiSwear = new AntiSwear(); Spam spam = new Spam(); @Override public void onEnable() { // Plugin startup logic } @Override public void onDisable() { // Plugin shutdown logic } } And instead of making more and more instances, I just want to make an instance

How is a 3d perlin noise function used to generate terrain?

心不动则不痛 提交于 2019-12-03 23:41:40
I can wrap my head around using a 2D Perlin noise function to generate the height value but I don't understand why a 3D Perlin noise function would be used. In Notch's blog , he mentioned using a 3D Perlin noise function for the terrain generation on Minecraft. Does anyone know how that would be done and why it would be useful? If you are passing x , y , and z values doesn't that imply you already have the height? Marcel Jackwerth Well, Minecraft is about Mines. So, what Notch tried to solve was: "How do I get holes / overhangs in my world?" Since 2D perlin noise generates nice/smooth looking

How does Minecraft perform lighting?

孤者浪人 提交于 2019-12-03 16:03:02
问题 The only model I'm familiar with is diffuse lighting but this look way more complicated than that. 回答1: Each square has a light level from 15 to 0. Each level is 20% less than the level above it. If a square contains a light source it gets the luminosity of that light source, otherwise it gets one less than the brightest neighbor. Sunlight is special, it suffers no vertical attenuation. 回答2: While the answer by Loren is mostly correct, I’d like to add that the minecraftwiki has further