SteamWar/SpigotCore
Archiviert
13
0

Merge pull request 'Supress Recipe Discover popup' (#232) from recipeDiscovery into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Reviewed-on: #232
Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
Lixfel 2023-02-24 18:18:38 +01:00
Commit 72e76d30ac
4 geänderte Dateien mit 93 neuen und 11 gelöschten Zeilen

Datei anzeigen

@ -0,0 +1,30 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2023 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.core;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerRecipeDiscoverEvent;
public class RecipeDiscoverWrapper14 implements RecipeDiscoverWrapper {
@EventHandler
public void onRecipeDiscover(PlayerRecipeDiscoverEvent e) {
e.setCancelled(true);
}
}

Datei anzeigen

@ -0,0 +1,24 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2023 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.core;
public class RecipeDiscoverWrapper8 implements RecipeDiscoverWrapper {
// Event not available pre flattening
}

Datei anzeigen

@ -31,6 +31,7 @@ import de.steamwar.sql.SteamwarUser;
import de.steamwar.sql.internal.Statement;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;
import java.io.BufferedReader;
@ -81,32 +82,33 @@ public class Core extends JavaPlugin{
return tabCompleter.apply(sender, s);
}
});
Bukkit.getScheduler().runTaskTimer(this, TabCompletionCache::invalidateOldEntries, 20, 20);
Bukkit.getPluginManager().registerEvents(new CaseInsensitiveCommandsListener(), this);
Bukkit.getPluginManager().registerEvents(new PlayerJoinedEvent(), this);
Bukkit.getPluginManager().registerEvents(new ChattingEvent(), this);
Bukkit.getPluginManager().registerEvents(new WorldLoadEvent(), this);
if(!Statement.productionDatabase()) {
Bukkit.getPluginManager().registerEvents(LocaleChangeWrapper.impl, this);
for(Listener listener : new Listener[]{new CaseInsensitiveCommandsListener(), new PlayerJoinedEvent(), new ChattingEvent(), new WorldLoadEvent(), RecipeDiscoverWrapper.impl}) {
getServer().getPluginManager().registerEvents(listener, this);
}
if(!Statement.productionDatabase()) {
getServer().getPluginManager().registerEvents(LocaleChangeWrapper.impl, this);
}
getServer().getMessenger().registerIncomingPluginChannel(this, "sw:bridge", new NetworkReceiver());
getServer().getMessenger().registerOutgoingPluginChannel(this, "sw:bridge");
if(Core.getVersion() < 19)
AuthlibInjector.inject();
TinyProtocol.init();
TinyProtocol.init();
new AntiNocom();
if(Core.getVersion() < 17 && Bukkit.getPluginManager().getPlugin("ViaVersion") != null)
new PartialChunkFixer();
Bukkit.getScheduler().runTaskTimer(Core.getInstance(), SteamwarUser::clear, 72000, 72000);
Bukkit.getScheduler().runTaskTimer(Core.getInstance(), SchematicNode::clear, 20L * 30, 20L * 30);
if(Core.getVersion() >= 19)
new ServerDataHandler();
Bukkit.getScheduler().runTaskTimer(this, TabCompletionCache::invalidateOldEntries, 20, 20);
Bukkit.getScheduler().runTaskTimer(Core.getInstance(), SteamwarUser::clear, 72000, 72000);
Bukkit.getScheduler().runTaskTimer(Core.getInstance(), SchematicNode::clear, 20L * 30, 20L * 30);
try {
getLogger().log(Level.INFO, "Running on: " + new BufferedReader(new InputStreamReader(Runtime.getRuntime().exec("hostname").getInputStream())).readLine());
} catch (IOException e) {

Datei anzeigen

@ -0,0 +1,26 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2023 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.core;
import org.bukkit.event.Listener;
public interface RecipeDiscoverWrapper extends Listener {
RecipeDiscoverWrapper impl = VersionDependent.getVersionImpl(Core.getInstance());
}