Giter VIP home page Giter VIP logo

perfectdreams / protocolsupportstuff Goto Github PK

View Code? Open in Web Editor NEW
14.0 4.0 8.0 5.15 MB

🌟 A plugin that does... stuff, I guess. Disable Minecraft versions (even the current server version!), remap blocks/items for older versions, allow pre-1.9 PvP for pre-1.9 clients in your 1.9+ server and much more!

License: GNU Affero General Public License v3.0

Kotlin 100.00%
minecraft bukkit spigot glowstone plugin protocolsupport sparklypower

protocolsupportstuff's Introduction


🌟 ProtocolSupportStuff 🌟

A plugin that does... stuff, I guess. Disable Minecraft versions (even the current server version!), remap blocks/items for older versions, allow pre-1.9 PvP for pre-1.9 clients in your 1.9+ server and much more!

💁 Como Ajudar?

Existem vários repositórios na nossa organização de várias partes do PerfectDreams, caso você queria contribuir em outras partes do PerfectDreams, siga as instruções no README.md de cada repositório!

💵 Como Doar?

Mesmo que você não saiba programar, você pode ajudar no desenvolvimento do PerfectDreams comprando vantagens em nossos servidores! https://perfectdreams.net/loja

Você também pode doar para a Loritta, a mascote do PerfectDreams! 😊

🙌 Como Usar?

👨‍💻 Como Compilar?

Você também pode usar este projeto e usar em outros lugares, mas lembrando...

  • Nós deixamos o código-fonte de nossos projetos para que outras pessoas possam se inspirar e aprender com nossos projetos, o objetivo é que pessoas que são fãs do PerfectDreams aprendam como o servidor funciona e, caso queiram, podem ajudar o servidor com bug fixes e novas funcionalidades.
  • Eu não irei dar suporte caso você queria usar o nosso projeto no seu servidor sem dar nada em troca para o PerfectDreams, lembre-se, a licença do projeto é AGPL v3, você é obrigado a deixar todas as suas alterações no projeto públicas!
  • Eu não irei ficar explicando como arrumar problemas no seu projeto se você apenas quer pegar o código-fonte para outra coisa não relacionada com o PerfectDreams, você está por sua conta e risco.
  • Lembrando que nossos projetos precisam de setups e workflows específicos, você não irá conseguir usar nossos projetos apenas compilando e usando!
  • Existem várias coisas "hard coded" no projeto, ou seja, você terá que editar o código-fonte dela e recompilar, afinal, o projeto foi criado apenas para ser utilizado no PerfectDreams então você terá que fazer algumas modificações no código-fonte dela para funcionar. 😉
  • Caso você irá usar a sua versão em um lugar que não seja no PerfectDreams ou em seu servidor de desenvolvimento, você não poderá utilizar o nome "PerfectDreams", o nome do projeto ou "Loritta".

Mas se você quiser mesmo compilar o projeto, siga os seguintes passos:

  1. Tenha o MongoDB instalado na sua máquina.
  2. Tenha o JDK 8 (ou superior) na sua máquina.
  3. Tenha o Git Bash instalado na sua máquina.
  4. Tenha o Maven instalado na sua máquina com o PATH configurado corretamente. (para que você possa usar mvn install em qualquer pasta e o JAVA_HOME, para que o mvn install funcione)
  5. Tenha o IntelliJ IDEA instalado na sua máquina.
  6. Tenha um servidor de Minecraft rodando Paper na última versão disponível, para transformar sonhos em realidade, nossos projetos sempre utilizam a última versão disponível no momento que o projeto foi criado.
  7. Faça git clone https://github.com/PerfectDreams/ProtocolSupportStuff.git em alguma pasta no seu computador.
  8. Agora, usando o PowerShell (ou o próprio Git Bash), entre na pasta criada e utilize mvn install
  9. Após terminar de compilar, vá na pasta target e pegue a JAR do projeto.
  10. Pronto, agora é só utilizar o projeto e se divertir! 🎉

🔀 Pull Requests

No seu Pull Request, você deverá seguir o meu estilo de código bonitinho que eu faço, é recomendado que você coloque comentários nas partes do seu código para que seja mais fácil na hora da leitura.

Caso o seu código possua texto, você é obrigado a utilizar o sistema de localização da Loritta, para que o seu Pull Request possa ser traduzido para outras linguagens, ou seja, após criar o seu Pull Request, crie um Pull Request no repositório de linguagens da Loritta com as keys necessárias.

O seu código não pode ser algo "gambiarra", meu código pode ter algumas gambiarras mas isto não significa que você também deve encher o PerfectDreams com mais gambiarras no seu Pull Request.

Você precisa pensar "será que alguém iria utilizar isto?", se você criar um comando que só seja útil para você, provavelmente eu irei negar o seu Pull Request.

📦 Dependências

Nós utilizamos várias dependências no código-fonte deste projeto, obrigado a todos os mantenedores das dependências! Sem vocês, talvez nosso projeto não iria existir (ou teria várias funcionalidades reduzidas ou talvez até inexistentes!)

Nome Mantenedor
Kotlin JetBrains
Paper Mojang (Minecraft Vanilla), SpigotMC (Spigot), Paper
DreamCore MrPowerGamerBR

📄 Licença

O código-fonte deste projeto está licenciado sob a GNU Affero General Public License v3.0

PerfectDreams é © MrPowerGamerBR — Todos os direitos reservados

A personagem Loritta é © MrPowerGamerBR & PerfectDreams — Todos os direitos reservados

Ao utilizar o projeto você aceita os termos de uso da Loritta e os termos de uso do PerfectDreams.

protocolsupportstuff's People

Contributors

mrpowergamerbr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

protocolsupportstuff's Issues

Item Remap

Nice idea but a lot of bugs, when you configure an item (blocks work fine) the older versions have the godd item, lore and name, but if a 1.12.2 player give a totem to an 1.8 player even the 1.12.2 player see the totem in an armor_stand, and the totem don't work anymore...

Feature Request ability to remap enchants

Currently on my 1.13.2 server as soon as you apply unbreakable to a pickaxe if you're on 1.8.9 and below it turns item in hand into a black and purple block that is unusable I want to make it switch to maybe something like wooden pickaxe with lore that says "you need to play on later version of mc to use this" on it when that happens. Can you please add this feature. Thank You.

Error with Maven Build

@MrPowerGamerBR

9:03:05 PM [ERROR] Error occurred while enabling ProtocolSupportStuff v1.0.2 (Is it up to date?)
9:03:05 PM java.lang.NoClassDefFoundError: kotlin/TypeCastException
9:03:05 PM at net.pocketdreams.protocolsupportstuff.ProtocolSupportStuff.onEnable(ProtocolSupportStuff.kt:91) ~[?:?]
9:03:05 PM at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[PaperSpigot-latest.jar:git-Paper-1167]
9:03:05 PM at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:316) [PaperSpigot-latest.jar:git-Paper-1167]
9:03:05 PM at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:404) [PaperSpigot-latest.jar:git-Paper-1167]
9:03:05 PM at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugin(CraftServer.java:376) [PaperSpigot-latest.jar:git-Paper-1167]
9:03:05 PM at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugins(CraftServer.java:325) [PaperSpigot-latest.jar:git-Paper-1167]
9:03:05 PM at net.minecraft.server.v1_12_R1.MinecraftServer.t(MinecraftServer.java:441) [PaperSpigot-latest.jar:git-Paper-1167]
9:03:05 PM at net.minecraft.server.v1_12_R1.MinecraftServer.l(MinecraftServer.java:402) [PaperSpigot-latest.jar:git-Paper-1167]
9:03:05 PM at net.minecraft.server.v1_12_R1.MinecraftServer.a(MinecraftServer.java:340) [PaperSpigot-latest.jar:git-Paper-1167]
9:03:05 PM at net.minecraft.server.v1_12_R1.DedicatedServer.init(DedicatedServer.java:290) [PaperSpigot-latest.jar:git-Paper-1167]
9:03:05 PM at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:615) [PaperSpigot-latest.jar:git-Paper-1167]
9:03:05 PM at java.lang.Thread.run(Thread.java:748) [?:1.8.0_144]
9:03:05 PM Caused by: java.lang.ClassNotFoundException: kotlin.TypeCastException
9:03:05 PM at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_144]
9:03:05 PM at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:102) ~[PaperSpigot-latest.jar:git-Paper-1167]
9:03:05 PM at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:87) ~[PaperSpigot-latest.jar:git-Paper-1167]
9:03:05 PM at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_144]
9:03:05 PM at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_144]
9:03:05 PM ... 12 more

Doesn't work on Spigot-Server 1.15.1

Hi,

the plugin seems to have a hard dependency on PaperConfig, even though paper was listed as optional dependency on spigotmc.org.


[17:40:43] [Server thread/ERROR]: Error occurred while enabling ProtocolSupportStuff v2.0.0 (Is it up to date?)
java.lang.NoClassDefFoundError: com/destroystokyo/paper/PaperConfig
        at net.perfectdreams.protocolsupportstuff.ProtocolSupportStuff.onEnable(ProtocolSupportStuff.kt:40) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[spigot-1.15.1.jar:git-Spigot-492a779-83af86d]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:352) [spigot-1.15.1.jar:git-Spigot-492a779-83af86d]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:417) [spigot-1.15.1.jar:git-Spigot-492a779-83af86d]
        at org.bukkit.craftbukkit.v1_15_R1.CraftServer.enablePlugin(CraftServer.java:462) [spigot-1.15.1.jar:git-Spigot-492a779-83af86d]
        at org.bukkit.craftbukkit.v1_15_R1.CraftServer.enablePlugins(CraftServer.java:376) [spigot-1.15.1.jar:git-Spigot-492a779-83af86d]
        at net.minecraft.server.v1_15_R1.MinecraftServer.a(MinecraftServer.java:456) [spigot-1.15.1.jar:git-Spigot-492a779-83af86d]
        at net.minecraft.server.v1_15_R1.DedicatedServer.init(DedicatedServer.java:266) [spigot-1.15.1.jar:git-Spigot-492a779-83af86d]
        at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:783) [spigot-1.15.1.jar:git-Spigot-492a779-83af86d]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]
Caused by: java.lang.ClassNotFoundException: com.destroystokyo.paper.PaperConfig
        at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[?:1.8.0_232]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:135) ~[spigot-1.15.1.jar:git-Spigot-492a779-83af86d]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:81) ~[spigot-1.15.1.jar:git-Spigot-492a779-83af86d]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[?:1.8.0_232]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_232]
        ... 10 more

Onloading

I have the latest spigot and protocolsupport and latest protocollib
[20:23:48] [Server thread/ERROR]: Error occurred while enabling ProtocolSupportStuff v2.0.0 (Is it up to date?)
java.lang.NoClassDefFoundError: com/destroystokyo/paper/PaperConfig
at net.perfectdreams.protocolsupportstuff.ProtocolSupportStuff.onEnable(ProtocolSupportStuff.kt:40) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:254) ~[spigot-1.13.2.jar:git-Spigot-2474d93-e693496]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:339) [spigot-1.13.2.jar:git-Spigot-2474d93-e693496]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:403) [spigot-1.13.2.jar:git-Spigot-2474d93-e693496]
at org.bukkit.craftbukkit.v1_13_R2.CraftServer.enablePlugin(CraftServer.java:431) [spigot-1.13.2.jar:git-Spigot-2474d93-e693496]
at org.bukkit.craftbukkit.v1_13_R2.CraftServer.enablePlugins(CraftServer.java:345) [spigot-1.13.2.jar:git-Spigot-2474d93-e693496]
at net.minecraft.server.v1_13_R2.MinecraftServer.l(MinecraftServer.java:584) [spigot-1.13.2.jar:git-Spigot-2474d93-e693496]
at net.minecraft.server.v1_13_R2.MinecraftServer.a(MinecraftServer.java:546) [spigot-1.13.2.jar:git-Spigot-2474d93-e693496]
at net.minecraft.server.v1_13_R2.MinecraftServer.a(MinecraftServer.java:424) [spigot-1.13.2.jar:git-Spigot-2474d93-e693496]
at net.minecraft.server.v1_13_R2.DedicatedServer.init(DedicatedServer.java:294) [spigot-1.13.2.jar:git-Spigot-2474d93-e693496]
at net.minecraft.server.v1_13_R2.MinecraftServer.run(MinecraftServer.java:702) [spigot-1.13.2.jar:git-Spigot-2474d93-e693496]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_191]
Caused by: java.lang.ClassNotFoundException: com.destroystokyo.paper.PaperConfig
at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[?:1.8.0_191]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:154) ~[spigot-1.13.2.jar:git-Spigot-2474d93-e693496]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:100) ~[spigot-1.13.2.jar:git-Spigot-2474d93-e693496]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_191]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_191]
... 12 more

Block remapping data

It would be nice to add option to remap let's say Bone Block to Quartz Block with data 0 no matter what data the original block had.

SwordBlockingHack Sending an object which is not a packet

Description

Here you send a PacketContainer instead of the underlying packet (event.addPacketAfter(packet.deepClone()) instead of event.addPacketAfter(packet.deepClone().handle)).
This causes problem with our plugin, OldCombatMechanics.

Related issues

kernitus/BukkitOldCombatMechanics#355
ProtocolSupport/ProtocolSupport#1187

Mitigation

I have not looked at your code in-depth enough to tell if the above is correct, but it solves the problem and if I understand what addPacketAfter does correctly, it should be correct.

I will also add a mitigation in OCM that just ignores other classes (maybe silently) to stop OCM from crashing, but the proper fix should be done here, IMHO.

Possibility to remap entities

Is there any possibility to remap entities? Right now a Polar Bear is being replaced by a spider. Wanna change that one :)

Incompatibility with "Pinger" from PAPI

Trying to ping a server with ProtocolSupportStuff by using the PlaceholderAPI expansion "Pinger" throws the following:

[23:16:46 WARN]: [io.netty.channel.DefaultChannelPipeline] An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
java.nio.channels.ClosedChannelException: null
at io.netty.channel.AbstractChannel$AbstractUnsafe.write(...)(Unknown Source) ~[patched_1.15.2.jar:git-Paper-298]

Narrowed it down to this plugin. Also always shows the server as offline.

Can't use multi-lines in lores

Hi,
Because i want explantation in the lore, the lore is really long if it is on 1 line.
Please add multi-line support, like this:
newer-item-text-lore:
- 'line 1'
- 'line 2'

Suggestion: broadcast message

It would be nice if I can somehow give players a message when they join with a lower version.
Example:
Server = 1.15.2
Players can join with 1.14.4 and above.

versions:
  MINECRAFT_1_15_2: true
  MINECRAFT_1_15_1: true
  MINECRAFT_1_15: true
  MINECRAFT_1_14_4: true
  MINECRAFT_1_14_3: false
  ...

Player joins with 1.14.4:
Player receives a message, a few seconds after joining:
Welcome %player%, consider updating to a newer minecraft version to enjoy better gameplay
Player joins with 1.15.x nothing happens
Suggestion for a config section:

message:
- message: "Welcome %player%, consider updating to a newer Minecraft version to enjoy better gameplay"
  before: Minecraft 1.15.0

Log Spam, Unknown Command

I've been testing for a few days and I've come to the conclusion that this Plugin is the cause of this Log Spam

Every 30 minutes exactly, I get this message in my logs:

"Unknown command. Type 'help for help."

errors on spigot 1.12.2

[17:01:27 ERROR]: [ProtocolSupportStuff] Unhandled exception occured in onPacketSending(PacketEvent) for ProtocolSupportStuff
java.lang.IllegalArgumentException: Cant compare order from different types
at protocolsupport.libs.org.apache.commons.lang3.Validate.isTrue(Validate.java:156) ~[ProtocolSupport.jar:?]
at protocolsupport.api.ProtocolVersion$OrderId.compareTo(ProtocolVersion.java:372) ~[ProtocolSupport.jar:?]
at protocolsupport.api.ProtocolVersion.isBefore(ProtocolVersion.java:137) ~[ProtocolSupport.jar:?]
at net.pocketdreams.protocolsupportstuff.protolib.SwordBlockingPacketAdapter.onPacketSending(SwordBlockingPacketAdapter.kt:39) ~[ProtocolSupportStuff.jar:1.1.3]
at com.comphenix.protocol.injector.SortedPacketListenerList.invokeSendingListener(SortedPacketListenerList.java:195) [ProtocolLib.jar:4.4.0-SNAPSHOT-b389]
at com.comphenix.protocol.injector.SortedPacketListenerList.invokePacketSending(SortedPacketListenerList.java:149) [ProtocolLib.jar:4.4.0-SNAPSHOT-b389]
at com.comphenix.protocol.injector.PacketFilterManager.handlePacket(PacketFilterManager.java:588) [ProtocolLib.jar:4.4.0-SNAPSHOT-b389]
at com.comphenix.protocol.injector.PacketFilterManager.invokePacketSending(PacketFilterManager.java:564) [ProtocolLib.jar:4.4.0-SNAPSHOT-b389]
at com.comphenix.protocol.injector.netty.ProtocolInjector.packetQueued(ProtocolInjector.java:338) [ProtocolLib.jar:4.4.0-SNAPSHOT-b389]
at com.comphenix.protocol.injector.netty.ProtocolInjector.onPacketSending(ProtocolInjector.java:298) [ProtocolLib.jar:4.4.0-SNAPSHOT-b389]
at com.comphenix.protocol.injector.netty.ChannelInjector.processSending(ChannelInjector.java:398) [ProtocolLib.jar:4.4.0-SNAPSHOT-b389]
at com.comphenix.protocol.injector.netty.ChannelInjector.access$500(ChannelInjector.java:78) [ProtocolLib.jar:4.4.0-SNAPSHOT-b389]
at com.comphenix.protocol.injector.netty.ChannelInjector$5.handleScheduled(ChannelInjector.java:364) [ProtocolLib.jar:4.4.0-SNAPSHOT-b389]
at com.comphenix.protocol.injector.netty.ChannelInjector$5.onMessageScheduled(ChannelInjector.java:332) [ProtocolLib.jar:4.4.0-SNAPSHOT-b389]
at com.comphenix.protocol.injector.netty.ChannelProxy$2.schedulingRunnable(ChannelProxy.java:127) [ProtocolLib.jar:4.4.0-SNAPSHOT-b389]
at com.comphenix.protocol.injector.netty.EventLoopProxy.execute(EventLoopProxy.java:95) [ProtocolLib.jar:4.4.0-SNAPSHOT-b389]
at net.minecraft.server.v1_12_R1.NetworkManager.a(NetworkManager.java:194) [spigot-1.12.2.jar:git-Spigot-7754231-94b0980]
at net.minecraft.server.v1_12_R1.NetworkManager.sendPacket(NetworkManager.java:143) [spigot-1.12.2.jar:git-Spigot-7754231-94b0980]
at net.minecraft.server.v1_12_R1.PlayerConnection.sendPacket(PlayerConnection.java:1138) [spigot-1.12.2.jar:git-Spigot-7754231-94b0980]
at protocolsupport.zplatform.impl.spigot.entitytracker.SpigotEntityTrackerEntry.broadcastIncludingSelf(SpigotEntityTrackerEntry.java:320) [ProtocolSupport.jar:?]
at protocolsupport.zplatform.impl.spigot.entitytracker.SpigotEntityTrackerEntry.updateMetadataAndAttributes(SpigotEntityTrackerEntry.java:282) [ProtocolSupport.jar:?]
at protocolsupport.zplatform.impl.spigot.entitytracker.SpigotEntityTrackerEntry.track(SpigotEntityTrackerEntry.java:248) [ProtocolSupport.jar:?]
at net.minecraft.server.v1_12_R1.EntityTracker.updatePlayers(EntityTracker.java:182) [spigot-1.12.2.jar:git-Spigot-7754231-94b0980]
at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:834) [spigot-1.12.2.jar:git-Spigot-7754231-94b0980]
at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:406) [spigot-1.12.2.jar:git-Spigot-7754231-94b0980]
at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:679) [spigot-1.12.2.jar:git-Spigot-7754231-94b0980]
at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:577) [spigot-1.12.2.jar:git-Spigot-7754231-94b0980]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_152-ea]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.