Diff
checker
Texto
Texto
Imágenes
Documentos
Excel
Carpetas
Legal
Enterprise
Aplicación de escritorio
Precios
Iniciar sesión
Descargar Diffchecker Desktop
Comparar texto
Encuentra la diferencia entre dos archivos de texto
Herramientas
Historial
Editor live
Ocultar sin cambios
Sin ajuste de línea
Vista
Dividido
Unificado
Nivel de detalle
Inteligente
Palabra
Letra
Resaltado de sintaxis
Elegir sintaxis
Ignorar
Transformar texto
Ir al primer cambio
Editar entrada
Diffchecker Desktop
La forma más segura de usar Diffchecker. ¡Obtén la app de Diffchecker Desktop: tus diffs nunca salen de tu computadora!
Obtener Desktop
Untitled diff
Creado
hace 9 años
El diff nunca expira
Borrar
Exportar
Compartir
Explicar
3 eliminaciones
Líneas
Total
Eliminado
Caracteres
Total
Eliminado
Para continuar usando esta función, actualice a
Diff
checker
Pro
Ver precios
27 líneas
Copiar todo
9 adiciones
Líneas
Total
Añadido
Caracteres
Total
Añadido
Para continuar usando esta función, actualice a
Diff
checker
Pro
Ver precios
34 líneas
Copiar todo
Copiar
Copiado
Copiar
Copiado
//There's some missing variables in this code, created in the new code so it'd work
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
if(cmd.getName().equalsIgnoreCase("crmake")) {
if(cmd.getName().equalsIgnoreCase("crmake")) {
Copiar
Copiado
Copiar
Copiado
if(!(sender instanceof Player)) {
sender.sendMessage("Can't add a chest if you don't have a body...");
return true;
}
Player p = (Player) sender;
Block b = p.getTargetBlock((Set<Material>)null, 100);
Location loc = b.getLocation();
if(b.getType() != Material.CHEST) {
if(b.getType() != Material.CHEST) {
p.sendMessage(ChatColor.RED + "ChestRefill >> You should be looking directly at a Chest!");
p.sendMessage(ChatColor.RED + "ChestRefill >> You should be looking directly at a Chest!");
} else {
} else {
try {
try {
Copiar
Copiado
Copiar
Copiado
int t =
0;
int t =
-1; //just in case we have no chests in the section, it'll start at chest #0.
if(ch.getConfigurationSection("Chests") == null) ch.createSection("Chests");
for(String s : ch.getConfigurationSection("Chests").getKeys(false)) {
for(String s : ch.getConfigurationSection("Chests").getKeys(false)) {
int i = Integer.parseInt(s); // if it's potato, it'll fail here
int i = Integer.parseInt(s); // if it's potato, it'll fail here
if(i > t) t = i;
if(i > t) t = i;
}
}
String w = loc.getWorld().getName();
String w = loc.getWorld().getName();
int locx = loc.getBlockX();
int locx = loc.getBlockX();
int locy = loc.getBlockY();
int locy = loc.getBlockY();
int locz = loc.getBlockZ();
int locz = loc.getBlockZ();
ch.set("Chests." + String.valueOf(t+1) + ".location", w+"|"+locx+"|"+locy+"|"+locz);
ch.set("Chests." + String.valueOf(t+1) + ".location", w+"|"+locx+"|"+locy+"|"+locz);
Copiar
Copiado
Copiar
Copiado
ch.save(new File(
main.
getDataFolder(), "Chests.yml"));
ch.save(new File(
getDataFolder(), "Chests.yml"));
p.sendMessage(ChatColor.DARK_GREEN + "ChestRefill >> Chest saved successfully!");
p.sendMessage(ChatColor.DARK_GREEN + "ChestRefill >> Chest saved successfully!");
} catch (Exception e) {
} catch (Exception e) {
p.sendMessage(ChatColor.DARK_RED + "ChestRefill >> Failed to save chest!");
p.sendMessage(ChatColor.DARK_RED + "ChestRefill >> Failed to save chest!");
e.printStackTrace();
e.printStackTrace();
}
}
}
}
}
}
return false;
return false;
}
}
Diferencias guardadas
Texto original
Abrir archivo
//There's some missing variables in this code, created in the new code so it'd work public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) { if(cmd.getName().equalsIgnoreCase("crmake")) { if(b.getType() != Material.CHEST) { p.sendMessage(ChatColor.RED + "ChestRefill >> You should be looking directly at a Chest!"); } else { try { int t = 0; for(String s : ch.getConfigurationSection("Chests").getKeys(false)) { int i = Integer.parseInt(s); // if it's potato, it'll fail here if(i > t) t = i; } String w = loc.getWorld().getName(); int locx = loc.getBlockX(); int locy = loc.getBlockY(); int locz = loc.getBlockZ(); ch.set("Chests." + String.valueOf(t+1) + ".location", w+"|"+locx+"|"+locy+"|"+locz); ch.save(new File(main.getDataFolder(), "Chests.yml")); p.sendMessage(ChatColor.DARK_GREEN + "ChestRefill >> Chest saved successfully!"); } catch (Exception e) { p.sendMessage(ChatColor.DARK_RED + "ChestRefill >> Failed to save chest!"); e.printStackTrace(); } } } return false; }
Texto modificado
Abrir archivo
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) { if(cmd.getName().equalsIgnoreCase("crmake")) { if(!(sender instanceof Player)) { sender.sendMessage("Can't add a chest if you don't have a body..."); return true; } Player p = (Player) sender; Block b = p.getTargetBlock((Set<Material>)null, 100); Location loc = b.getLocation(); if(b.getType() != Material.CHEST) { p.sendMessage(ChatColor.RED + "ChestRefill >> You should be looking directly at a Chest!"); } else { try { int t = -1; //just in case we have no chests in the section, it'll start at chest #0. if(ch.getConfigurationSection("Chests") == null) ch.createSection("Chests"); for(String s : ch.getConfigurationSection("Chests").getKeys(false)) { int i = Integer.parseInt(s); // if it's potato, it'll fail here if(i > t) t = i; } String w = loc.getWorld().getName(); int locx = loc.getBlockX(); int locy = loc.getBlockY(); int locz = loc.getBlockZ(); ch.set("Chests." + String.valueOf(t+1) + ".location", w+"|"+locx+"|"+locy+"|"+locz); ch.save(new File(getDataFolder(), "Chests.yml")); p.sendMessage(ChatColor.DARK_GREEN + "ChestRefill >> Chest saved successfully!"); } catch (Exception e) { p.sendMessage(ChatColor.DARK_RED + "ChestRefill >> Failed to save chest!"); e.printStackTrace(); } } } return false; }
Encontrar la diferencia