Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

Problem z dodatkiem do skript.


miglowy

Rekomendowane odpowiedzi

Opublikowano

Cześć, ostatnio próbuję napisać jakiś dodatek do pluginu skript.

 

Nakręciło mnie to, aby dodać, by zamieniało pierwszą literę na wielką, więc wdrążyłem plan w życie i kompletnie nie umiem tego pisać :D

 

Napisałem ze wzorów innych dodatków (znam się trochę na Javie)

 

Gdy już odpaliłem skrypt z moim dodatkiem konsola wywaliła błędy:

 

 

[22:33:13] [Server thread/ERROR]: #!#! 
[22:33:13] [Server thread/ERROR]: #!#! [Skript] Severe Error:
[22:33:13] [Server thread/ERROR]: #!#! Could not load mob.sk
[22:33:13] [Server thread/ERROR]: #!#! 
[22:33:13] [Server thread/ERROR]: #!#! If you're developing an add-on for Skript this likely means that you have done something wrong.
[22:33:13] [Server thread/ERROR]: #!#! If you're a server admin however please go to http://dev.bukkit.org/server-mods/skript/tickets/
[22:33:13] [Server thread/ERROR]: #!#! and check whether this error has already been reported.
[22:33:13] [Server thread/ERROR]: #!#! If not please create a new ticket with a meaningful title, copy & paste this whole error into it,
[22:33:13] [Server thread/ERROR]: #!#! and describe what you did before it happened and/or what you think caused the error.
[22:33:13] [Server thread/ERROR]: #!#! If you think that it's a trigger that's causing the error please post the trigger as well.
[22:33:13] [Server thread/ERROR]: #!#! By following this guide fixing the error should be easy and done fast.
[22:33:13] [Server thread/ERROR]: #!#! 
[22:33:13] [Server thread/ERROR]: #!#! Stack trace:
[22:33:13] [Server thread/ERROR]: #!#! ch.njol.skript.SkriptAPIException: No class info found for text
[22:33:13] [Server thread/ERROR]: #!#!     at ch.njol.skript.registrations.Classes.getClassInfo(Classes.java:242)
[22:33:13] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.getExprInfo(SkriptParser.java:1247)
[22:33:13] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:969)
[22:33:13] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:915)
[22:33:13] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:915)
[22:33:13] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:209)
[22:33:13] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:164)
[22:33:13] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.Statement.parse(Statement.java:42)
[22:33:13] [Server thread/ERROR]: #!#!     at ch.njol.skript.ScriptLoader.loadItems(ScriptLoader.java:615)
[22:33:13] [Server thread/ERROR]: #!#!     at ch.njol.skript.command.Commands.loadCommand(Commands.java:449)
[22:33:13] [Server thread/ERROR]: #!#!     at ch.njol.skript.ScriptLoader.loadScript(ScriptLoader.java:462)
[22:33:13] [Server thread/ERROR]: #!#!     at ch.njol.skript.ScriptLoader.loadScripts(ScriptLoader.java:239)
[22:33:13] [Server thread/ERROR]: #!#!     at ch.njol.skript.ScriptLoader.loadScripts(ScriptLoader.java:193)
[22:33:13] [Server thread/ERROR]: #!#!     at ch.njol.skript.Skript$2.run(Skript.java:378)
[22:33:13] [Server thread/ERROR]: #!#!     at org.bukkit.craftbukkit.v1_7_R1.scheduler.CraftTask.run(CraftTask.java:53)
[22:33:13] [Server thread/ERROR]: #!#!     at org.bukkit.craftbukkit.v1_7_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:345)
[22:33:13] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_7_R1.MinecraftServer.u(MinecraftServer.java:587)
[22:33:13] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_7_R1.DedicatedServer.u(DedicatedServer.java:250)
[22:33:13] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_7_R1.MinecraftServer.t(MinecraftServer.java:545)
[22:33:13] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:457)
[22:33:13] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617)
[22:33:13] [Server thread/ERROR]: #!#! 
[22:33:13] [Server thread/ERROR]: #!#! Version Information:
[22:33:13] [Server thread/ERROR]: #!#!   Skript: 2.1.2
[22:33:13] [Server thread/ERROR]: #!#!   Bukkit: 1.7.2-R0.3
[22:33:13] [Server thread/ERROR]: #!#!   Minecraft: 1.7.2
[22:33:13] [Server thread/ERROR]: #!#!   Java: 1.7.0_79
[22:33:13] [Server thread/ERROR]: #!#! 
[22:33:13] [Server thread/ERROR]: #!#! Running CraftBukkit: false
[22:33:13] [Server thread/ERROR]: #!#! 
[22:33:13] [Server thread/ERROR]: #!#! Current node: upcase {_a} (mob.sk, line 46)
[22:33:13] [Server thread/ERROR]: #!#! Current item: null
[22:33:13] [Server thread/ERROR]: #!#! 
[22:33:13] [Server thread/ERROR]: #!#! Thread: Server thread
[22:33:13] [Server thread/ERROR]: #!#! 
[22:33:13] [Server thread/ERROR]: #!#! End of Error.
[22:33:13] [Server thread/ERROR]: #!#! 

 

 

Tu kodzik effectu:

 

 

package pl.ct8.miglowy.effects;

import org.bukkit.event.Event;

import ch.njol.skript.lang.Effect;
import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser;
import ch.njol.util.Kleenean;

public class EffUpcase extends Effect{
	
	private Expression<?> text;
	protected void execute(Event event){
		String s = (String) this.text.getSingle(event);
		if(s == null) return;
		s=s.substring(0).toUpperCase();
	}
	public String toString(Event event, boolean 
	{
		return "Uppercase";
	}
	
	public boolean init(Expression<?>[] expressions, int i, Kleenean kleenean, SkriptParser.ParseResult parseResult){
		this.text = expressions[0];
		return true;
	}
	
}

 

 

I main:

 

 

package pl.ct8.miglowy;

import org.bukkit.plugin.java.JavaPlugin;

import pl.ct8.miglowy.effects.EffUpcase;
import ch.njol.skript.Skript;

public class AddonMain extends JavaPlugin{
	public void onEnable(){
		Skript.registerEffect(EffUpcase.class, new String[] { "up[ ]case [first character in] %text% "});
	}
}
 

 

 

 

I jak mam napisać, by mi zamieniło tą pierwszą literkę na wielką ?

Opublikowano

­;c

713582.gif         Liczba postów zebranych na koncie:
                                       25 50 75  100 125 150 175 200 250 500 1000 2000+
   
                                                                                                                                 [Jeżeli pomogłem daj +]
                                                                  
                                                       [nic na tym nie tracisz]
                                                                                          
                                                                                                                
                                                               
Opublikowano

Witam,


prawdopodobnie spowodowane to jest tym, że masz spacje zamiast TAB'a w configu pliku.


Polecam sprawdzić :)


Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...