Update Signs Source!!!

LucGamesHD

Developer
Hey i have found a method to update signs !
for example SurvivalGames signs or other things!
and sorry for my english
:)
Java:
import cn.nukkit.blockentity.BlockEntitySign;
import cn.nukkit.level.Level;
import cn.nukkit.math.Vector3;
import cn.nukkit.scheduler.PluginTask;
import de.lucgameshd.gungame.GunGame;
public class SignUpdate extends PluginTask<GunGame> {
	GunGame pl;
	Level level;
	
	public SignUpdate(GunGame owner, Level level) {
		super(owner);
		this.owner = pl;
		this.level = level;
	}
	
	@Override
	public void onRun(int arg0) {
	if(level instanceof Level){
		int players = level.getPlayers().size();
		
		if(level.getBlockEntity(new Vector3(142, 70, 131)) instanceof BlockEntitySign){
			BlockEntitySign s = (BlockEntitySign) level.getBlockEntity(new Vector3(142, 70, 131));
			if(s.getText()[0].equalsIgnoreCase("[GunGame]")){
				s.setText("[GunGame]", players + "/25");
			}
		}
		
		
	}
		
	
	}

}
 
Top