minecraft

Print value from a lua table if pattern matches

◇◆丶佛笑我妖孽 提交于 2020-01-04 14:21:24
问题 Okay, so I just recently got into lua and find myself stuck with the following: I have the function peripheral.getNames() (which is a custom function) it will return a table with the structure key,value, whereas key is always a number and starts from 1 and value will be what the function finds (it searches for devices connected to it) In my example it creates a table which looks like this 1 herp 2 derp 3 monitor_1 4 morederp I can print the values with the following local pgn = peripherals

Sending packets to Minecraft server: Objective c

梦想的初衷 提交于 2020-01-04 06:38:10
问题 I've been trying to send packets to a minecraft server from my custom Cocoa application (written in objective-c of course). I am a little confused as how to do that though. I did it in Java. That was very easy. Doing this is objective-c though is proving to be a bit more challenging. This is the code that I am using: - (void)handshake { PacketHandshake *packet = [PacketHandshake packetString:[NSString stringWithFormat:@"%@;%@:%i", username, IP, PORT]]; [packet writeData:dataOut]; } Which

Python urllib2 login to minecraft.net

你。 提交于 2020-01-03 17:24:28
问题 I got a problem. I am writing a simple script to login to minecraft.net, and then list all classic servers. But when I run my script, it just redirects me back to minecraft.net/login. Here is what I have so far: import urllib2 import urllib import re url = "https://www.minecraft.net/login" page = urllib2.urlopen(url) data = page.read() page.close() authToken = re.search('name="authenticityToken"[\s]+value="(.+)"', data).group(1) data_dict = { "username": "USERNAME", "password": "PASSWORD",

How to terminate Lua script?

你离开我真会死。 提交于 2020-01-02 00:53:14
问题 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 回答1: As prapin's answer states, in Lua the function os.exit([code]) will terminate the execution of the host program. This,

NoClassDefFoundError ClassLoader

别说谁变了你拦得住时间么 提交于 2019-12-25 19:02:02
问题 Im currently getting an error on thie line loadedClass = classLoader.loadClass("scripts.Compass"); Somehow the file compiles fine but when I try to load the class it wont work because it says its missing the class com/deft/core/scripts/DeftScript Compiling & Instantiating: File script = new File("./plugins/Deft-Core/scripts/Compass.java"); DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<JavaFileObject>(); JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();

Calling the method on an instance rather than the class not working with static type

那年仲夏 提交于 2019-12-25 10:01:38
问题 I am currently trying t create a plugin and I have can across an error that wont let me call a method because it needs to be static for something that happens in the method. I sort of fixed this problem by using: package.Main main = new package.Main(); . Now, the problem I am left with is that when I actually call the method, using main.method(); it says that the code above needs to be static however when I do this, it then returns this error in console. org.bukkit.command.CommandException:

SWT - Use Text or StyledText as output for a Process

我只是一个虾纸丫 提交于 2019-12-25 06:54:59
问题 I have a class that extends OutputStream and is used to make the output of said OutputStream into a Text or StyledText. The class works great, however it introduces a problem. I am working on an SWT application that includes a fake console. I'm not using it to run sytem commands, but rather a few different Minecraft servers that I use for slightly different development environments/purposes. From what I've read about ProcessBuilder, inheritIO() is supposed to make the resulting Process' IO

How to get an offline player by UUID?

我们两清 提交于 2019-12-25 06:29:23
问题 How to get an offline player by UUID? I can get an online player by UUID by iterating through all online players and return when an UUID matches, but I don't know how to do this for offline players. 回答1: Beta build of CraftBukkit (1.7.9-R0.1) has the method you need in org.bukkit.Server interface: /** * Gets the player by the given UUID, regardless if they are offline or * online. * <p> * This will return an object even if the player does not exist. To this * method, all players will exist. *

Reading arguments as Integer for a Bounty in a Bukkit plugin

我们两清 提交于 2019-12-24 17:00:01
问题 This is just the start of the plugin and there will be more. This is what I want to have: For /bounty <name> <amount> I want to be able to read what is read on the amount to make a variable like int a = args[1] , but I don't know how to do that. I have tried and it gave me some errors. I also want it so it can only be a number on the command. I am using bukkit version: craftbukkit-1.7.10-R0.1-20140804.183445-7 Here is my code: public class Main extends JavaPlugin { public void onEnable() {

Block textures and block names not loading minecraft forge

牧云@^-^@ 提交于 2019-12-24 16:48:44
问题 I am making a mod for minecraft but I can't get the textures to load: Also the names dont show up correctly (tile.Yarrite Ore.Name instead of Yarrite Ore): here is the code I used to Create the block(YarriteOre.java): package com.NoNameYetMod.common; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; public class YarriteOre extends Block{ public YarriteOre