Giter Site home page Giter Site logo

samb440 / forcepack Goto Github PK

View Code? Open in Web Editor NEW
44.0 44.0 17.0 3.22 MB

Spigot/Velocity plugin to aid resource pack deployment and enforcement, among other utilities.

Home Page: https://fortitude.islandearth.net/category/forcepack

License: GNU General Public License v3.0

Java 100.00%
bukkit hacktoberfest minecraft minecraft-plugin paper spigot spigot-plugin

forcepack's People

Stargazers

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

Watchers

 avatar  avatar

forcepack's Issues

Ability to make the player choose between multiple packs. [Suggestion]

Idk if this is 100% possible but here this goes.

Why i want this feature to be added is mainly due to people's internet connections.

Technically, when a player joins the server with a RP and that user hasn't downloaded the latest pack, It does it automatically or prompts them to accept or decline the resource pack and would download the pack with little waiting (No big surprise here you made this work).

However for users that have poor connections this could take a long time for the pack to download depending on how big the RP is, this is why the most popular servers that host custom resource packs such as MCCI, Origin Realms and Hideaway don't take advantage of the Server RP limits set my Mojang themselves. These servers want to keep their pack size as small as possible in order to let as many people play on their server. Let alone a pack with 10MB or greater in size is already enough to start to cause problems for some. This could lead to servers taking compromises to get the pack size as low as they can, this could potentially affect the experience in the process depending on what the server would do to reduce the pack size.

A Solution to this would be to provide a large pack that contains many resources for the maximum experience while also providing a smaller variant of the pack containing minimal resources that everyone can download at the same time and let the player choose from there. Keep in mind you can't have supplementary resource packs (for example a core RP and one with extra content) on the server due to how the system works for server resource packs.

I can provide more details if needed.

User is null error

Hi, from some reason, I receive this error:

[02:45:44] [Server thread/WARN]: [ForcePack] Task #49448 for ForcePack v1.3.3 generated an exception
java.lang.NullPointerException: Cannot invoke "com.convallyria.forcepack.spigot.libs.pe-api.protocol.player.User.getChannel()" because "user" is null
	at com.convallyria.forcepack.spigot.util.ProtocolUtil.sendPacketBypassingVia(ProtocolUtil.java:26) ~[ForcePack-1.3.3.jar:?]
	at com.convallyria.forcepack.spigot.resourcepack.SpigotResourcePack.runSetResourcePack(SpigotResourcePack.java:52) ~[ForcePack-1.3.3.jar:?]
	at com.convallyria.forcepack.spigot.resourcepack.SpigotResourcePack.setResourcePack(SpigotResourcePack.java:36) ~[ForcePack-1.3.3.jar:?]
	at com.convallyria.forcepack.spigot.listener.ResourcePackListener.lambda$runSetPackTask$7(ResourcePackListener.java:251) ~[ForcePack-1.3.3.jar:?]
	at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[purpur-1.20.1.jar:git-Purpur-2062]
	at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:480) ~[purpur-1.20.1.jar:git-Purpur-2062]
	at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1506) ~[purpur-1.20.1.jar:git-Purpur-2062]
	at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:486) ~[purpur-1.20.1.jar:git-Purpur-2062]
	at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1420) ~[purpur-1.20.1.jar:git-Purpur-2062]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1191) ~[purpur-1.20.1.jar:git-Purpur-2062]
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:322) ~[purpur-1.20.1.jar:git-Purpur-2062]
	at java.lang.Thread.run(Thread.java:840) ~[?:?]

can it be fixed, please?

Error on join

when I try to enter the mode it gives me this error:

image

Need help with Server Resource Pack must set to Prompt in server edit in order to join

Hi, i get this error in the console that says:

[12:25:46 INFO]:[ForcePack] Using 1.18 method
[12:25:46 INFO]: [ForcePack] Xyio24_'s exemptions: geyser, false. permission, false.
[12:25:46 INFO]: [ForcePack] Xyio24_ sent status: ACCEPTED
[12:25:46 INFO]: [ForcePack] Kicked player Xyio24_ because they are sending fake resource pack statuses (accepted sent twice).

The problem is if the texturepack is enabled, then the player will get kicked. however if it is set to prompt then the player can enter the server normally. Sorry for bad english

Server version: git-Purpur-1976 (MC: 1.19.4)*
Java 18
ForcePack versin 1.2.9 #

Resource Pack Occasionally Doesn't Load At All

Sometimes, a player will join and they will not even be promoted to accept the resource pack. This also affects players that have already accepted the pack as the pack just doesn't load for them.

Migrate Velocity to Configurate

Use Configurate as it's probably better than night-config. Someone on Debian was reporting issues. No point to use night-config when Configurate is bundled as well.

Really live reloading

User case:
We utilize S3 storage to store our resource pack. This pack is loaded from our CI/CD pipelines, ensuring that any changes on the servers (such as Velocity) are ignored.

What if?
ForcePack automatically check headers of the http request, for example:
HEAD https://eu.amazonaws.com/textures/test.zip
Response Header is:

Name Value
Date Sat, 02 Mar 2024 07:17:37 GMT
Last-Modified Sat, 02 Mar 2024 07:17:37 GMT

The plugin can dynamically check these parameters and manage the update hash accordingly. I'm not referring to the /vforcepack reload command, as it can lead to a subpar user experience. (The user forcibly receives the resourcepack)

Instead, the plugin updates the hash automatically, ensuring that the player receives the updated resource pack during the next loading process. This streamlined approach enhances user experience by eliminating the need for manual intervention.

Resource pack groups

groups:
  group1:
    exact-match: true
    list: # will only apply to servers with EXACT name: hub01, hub02, spawn01
    - hub01
    - hub02
    - spawn01
    # .. add ur ForcePack plugin pack url, hashes, and stuff here
  group2:
    exact-match: false
    list: # will apply to ALL servers with name CONTAINING keywords: hub or spawn (example: hub01, spawn03, spawn100000, hub10000)
    - hub
    - spawn
    # .. add ur ForcePack plugin pack url, hashes, and stuff here

Players can play without sending a resource pack response

The plugin version is 1.2.6 and here is my config.

Most players on my server accept the resource pack normally:

[10:46:11] [Server thread/INFO]: → Pandakiraly
[10:46:11] [Server thread/INFO]: [ForcePack] Pandakiraly's exemptions: geyser, false. permission, false.
[10:46:11] [Server thread/INFO]: [ForcePack] Pandakiraly sent status: ACCEPTED
[10:46:14] [Server thread/INFO]: [ForcePack] Pandakiraly's exemptions: geyser, false. permission, false.
[10:46:14] [Server thread/INFO]: [ForcePack] Pandakiraly sent status: SUCCESSFULLY_LOADED

But there are some players who are sent the pack and never send a status back:

[14:56:59] [Paper Async Command Builder Thread Pool - 143/INFO]: [Essentials] Created a User for TheLocalChair (ed006616-e57c-3787-ad77-95baebb155d6) for non Bukkit type: org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer
[14:56:59] [Server thread/INFO]: [ForcePack] TheLocalChair's exemptions: geyser, false. permission, false.
[14:56:59] [Server thread/INFO]: [ForcePack] Sent resource pack to player
[14:56:59] [Server thread/INFO]: [ForcePack] Using 1.18 method

And that's it: there is no response. They can play due to not being kicked and do not take damage:

[14:57:20] [Server thread/INFO]: [ForcePack] Cancelled damage for player 'TheLocalChair' due to resource pack not applied.

I am running a Pufferfish 1.19.2 server. I only began to notice this after updating to ViaVersion 4.5.0 to allow 1.19.3 players to connect, but I am not sure whether that's the cause or just me being more vigilant after updating.

Worked before, now get errors (haven't add/removed any other plugins)

[10:43:12] [Server thread/ERROR]: Error occurred while enabling ForcePack v1.2.9 (Is it up to date?)
com.convallyria.forcepack.libs.commandframework.bukkit.BukkitCommandManager$BrigadierFailureException: Could not initialize Brigadier mappings. Reason: version too high ()
at com.convallyria.forcepack.libs.commandframework.bukkit.BukkitCommandManager.registerBrigadier(BukkitCommandManager.java:343) ~[?:?]
at com.convallyria.forcepack.libs.commandframework.paper.PaperCommandManager.registerBrigadier(PaperCommandManager.java:125) ~[?:?]
at com.convallyria.forcepack.spigot.command.Commands.(Commands.java:38) ~[?:?]
at com.convallyria.forcepack.spigot.ForcePackSpigot.registerCommands(ForcePackSpigot.java:212) ~[?:?]
at com.convallyria.forcepack.spigot.ForcePackSpigot.onEnable(ForcePackSpigot.java:69) ~[?:?]

[10:43:21] [Server thread/ERROR]: Could not pass event PlayerJoinEvent to ForcePack v1.2.9
org.bukkit.event.EventException: null

Resource pack applied detection not working

I'm having an issue where having the prevent movement and damage options enabled is not allowing players to move or take damage at all even if the resource pack has already been accepted and applied. I thought at first it was bc i had Server Resource Packs to "Enable" Instead of "Prompt" in the game config, but even after setting it to Prompt and accepting the prompt, after the pack is applied it continues to prevent movement and damage. I de-op'd myself too to make sure that wasn't causing any issues, and the server.properties file has no configs on the resource pack options. I have a plugin that plays a sound everytime a player joins (ConditionalEvents) but that shouldn't be the issue since it doesn't teleport, the prompt shows up and the pack applies with no issues. Debug after accepting the prompt shows a message saying "Using 1.18 method", and then it only shows the "Cancelled movement for player 'player' due to resource pack not applied." message, doesn't show anything abt the pack being accepted, applied, nothing.
Plus, i started getting an issue where every time i exit the server, i get an "Resource reload failed" error which de-applies all my personally set resource packs, which wasn't happening at all until now.

I'm playing on 1.18.2, any way to fix it and keep the options enabled or is it better to just disable them?

Sponge support?

I've been getting back into other modding APIs and I don't think it'd be unreasonable to add Sponge support for API 11. A long time ago there even used to be a separate forcepack sponge, it's still up on Ore I believe.

Imposible to connect in server without Viarewind

I have been observing and it is impossible to enter the server without having the viarewind plugin. According to indications it is necessary to have Viaversion, but not viarewind.

Every time I try to log in to the server it always says: Failed to download the resourcepack.

Pugin version: 1.2.2
Minecraft server version: 1.18.2

Velocity translations

As per the discussion on #13, translations for velocity need to be added somehow.

Best idea is probably to have a language file with translation keys such as servers.example-server.resourcepack.prompt="<yellow>Please accept our resource pack to improve your experience.".

Legacy: ESC bypass prevention causes multiple resource pack loads

We are currently resending the resource pack to open the prompt screen constantly.

But if the player accepts, they could then receive another resource pack packet, which will cause it to load twice, or even worse fail download as it's sent whilst the player is already loading a resource pack.

I thought this was working fine for the past few years. I'm not sure why it doesn't work now - we do use packets instead of API methods, but esc out doesn't tell the server when it does so, and I don't think Spigot would be doing anything anyway, so this must have always been a bug.

I don't know how to fix this. I do wonder how FRP (https://www.spigotmc.org/resources/force-resourcepacks.10499/) handles this.

Server fails to download pack

[INFO]: [Not Secure] [Server] --- accepted the resource pack!
[INFO]: [Not Secure] [Server] --- accepted the resource pack!
[INFO]: [Not Secure] [Server] --- failed to download the resource pack!
[ERROR]: Could not pass event PlayerResourcePackStatusEvent to ForcePack v1.2.5
java.lang.NullPointerException: Cannot invoke "java.lang.Long.longValue()" because the return value of "java.util.Map.remove(Object)" is null
        at com.convallyria.forcepack.spigot.listener.ResourcePackListener.tryValidateHacks(ResourcePackListener.java:100) ~[ForcePack-1.2.5.jar:?]
        at com.convallyria.forcepack.spigot.listener.ResourcePackListener.onStatus(ResourcePackListener.java:56) ~[ForcePack-1.2.5.jar:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor69.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:75) ~[purpur-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[purpur-api-1.19.2-R0.1-SNAPSHOT.jar:git-Purpur-1835]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[purpur-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:678) ~[purpur-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.handleResourcePackResponse(ServerGamePacketListenerImpl.java:2178) ~[?:?]
        at net.minecraft.network.protocol.game.ServerboundResourcePackPacket.handle(ServerboundResourcePackPacket.java:24) ~[?:?]
        at net.minecraft.network.protocol.game.ServerboundResourcePackPacket.handle(ServerboundResourcePackPacket.java:10) ~[?:?]
        at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$0(PacketUtils.java:51) ~[?:?]
        at net.minecraft.server.TickTask.run(TickTask.java:18) ~[purpur-1.19.2.jar:git-Purpur-1835]
        at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?]
        at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
        at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1368) ~[purpur-1.19.2.jar:git-Purpur-1835]
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:185) ~[purpur-1.19.2.jar:git-Purpur-1835]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1345) ~[purpur-1.19.2.jar:git-Purpur-1835]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1338) ~[purpur-1.19.2.jar:git-Purpur-1835]
        at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1316) ~[purpur-1.19.2.jar:git-Purpur-1835]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1204) ~[purpur-1.19.2.jar:git-Purpur-1835]
        at net.minecraft.server.MinecraftServer.lambda$spin$1(MinecraftServer.java:310) ~[purpur-1.19.2.jar:git-Purpur-1835]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]

When I join the server, the pack doesn't download and the client sometimes gets kicked out, this time it didn't kick but this error was on the console

Any help is appreciated!

Enable geyser:true in config can't use ForcePack

version:paper1.19.2

Could not pass event PlayerJoinEvent to ForcePack v1.2.7
java.lang.NoClassDefFoundError: org/geysermc/floodgate/api/FloodgateApi
at com.convallyria.forcepack.api.utils.GeyserUtil.isBedrockPlayer(GeyserUtil.java:10) ~[ForcePack-1.2.7.jar:?]
at com.convallyria.forcepack.spigot.listener.ResourcePackListener.onPlayerJoin(ResourcePackListener.java:116) ~[ForcePack-1.2.7.jar:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor179.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:76) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:git-Paper-"476ef25"]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:670) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at net.minecraft.server.players.PlayerList.postChunkLoadJoin(PlayerList.java:372) ~[paper-1.19.2.jar:git-Paper-"476ef25"]
at net.minecraft.server.players.PlayerList.lambda$placeNewPlayer$0(PlayerList.java:309) ~[paper-1.19.2.jar:git-Paper-"476ef25"]
at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.19.2.jar:git-Paper-"476ef25"]
at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?]
at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1341) ~[paper-1.19.2.jar:git-Paper-"476ef25"]
at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:185) ~[paper-1.19.2.jar:git-Paper-"476ef25"]
at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1318) ~[paper-1.19.2.jar:git-Paper-"476ef25"]
at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1311) ~[paper-1.19.2.jar:git-Paper-"476ef25"]
at net.minecraft.util.thread.BlockableEventLoop.runAllTasks(BlockableEventLoop.java:114) ~[?:?]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1445) ~[paper-1.19.2.jar:git-Paper-"476ef25"]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1173) ~[paper-1.19.2.jar:git-Paper-"476ef25"]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:305) ~[paper-1.19.2.jar:git-Paper-"476ef25"]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.ClassNotFoundException: org.geysermc.floodgate.api.FloodgateApi
... 22 more

Investigate 1.20.2

Whilst I am unable to test 1.20.2 at this time, as Velocity does not work and I have no server updated to it yet, this issue will be used to track problems with the new version.

  • Will Bungeecord finally get an API?
  • It appears that a resource pack is no longer, ever, kept when switching servers. Mojang in their delightful wisdom has also decided this is a "feature request". No, Mojang, you broke something which servers have used for years and will have a negative impact on user experience by removing. https://bugs.mojang.com/browse/MC-265463 https://bugs.mojang.com/browse/MC-265673
  • Check client resource pack handling changes for bypasses or bug fixes.

Error "You must accept the resource pack"

Hello,

I am currently trying to use Force Pack on my 1.18.2 Paper Server. However, all players are always kicked from the server because the resource pack was allegedly not accepted. I always get the following message in the console.

image

In Minecraft I always get the following message.

image

The settings for server resource packs in my client are also set to enabled.

I am also attaching my config.yml here once again. I have already successfully tested the URL and the hash. Everything should be correct here.

image

Distribution on non-Spigot sites

Spigot's website is kinda a PITA to build deploying automations around due to the fact that it only wants you to use it interactively. Could we get distribution on e.g. Modrinth or Hangar? This would make consuming ForcePack in automated environments much easier.

Crash when starting

Hello,

So i tried to load the plugin but there's an error who occurred :

com.convallyria.forcepack.libs.commandframework.bukkit.BukkitCommandManager$BrigadierFailureException: Could not initialize Brigadier mappings. Reason: version too high ()

I don't know how to fix it.

Here's the server config :

  • Plugins :
  1. MCE - SMP plugin ( Created by my self and there no problem with it ).
  2. TCP Shield.
  3. Skin restorer.
  4. Force Pack ( the plugin ).
  • Info :

    Spigot - Bukkit 1.20.1.
    Force Pack version : 1.2.9

Utility commands

Someone requested extra utility commands like a give command for custom model data, imo makes sense to include basic methods for this stuff.

Add ability to pass hash into reload command

Some servers automate pack renewal in CI by sending a forcepack reload command, we can make this more secure and cancel lookups to the URL by adding an argument to the reload command that accepts the hash as a parameter.

Also command to reload pack for specific players?

unable to move when using forcepack on 1.20.2 cracked server

[15:11:21] [Server thread/ERROR]: Could not pass event PlayerResourcePackStatusEvent to ForcePack v1.2.9
java.lang.NullPointerException: Cannot invoke "net.minecraft.server.network.PlayerConnection.b(net.minecraft.network.protocol.Packet)" because "org.bukkit.craftbukkit.v1_20_R2.entity.CraftPlayer.getHandle().c" is null
at org.bukkit.craftbukkit.v1_20_R2.entity.CraftPlayer.sendTitle(CraftPlayer.java:2668) ~[paper-1.20.2.jar:git-Paper-260]
at com.convallyria.forcepack.spigot.listener.ResourcePackListener.onStatus(ResourcePackListener.java:81) ~[ForcePack-1.2.9.jar:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor177.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:81) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:git-Paper-260]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[paper-1.20.2.jar:git-Paper-260]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126) ~[paper-1.20.2.jar:git-Paper-260]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:615) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at net.minecraft.server.network.ServerCommonPacketListenerImpl.handleResourcePackResponse(ServerCommonPacketListenerImpl.java:187) ~[paper-1.20.2.jar:git-Paper-260]
at net.minecraft.server.network.ServerConfigurationPacketListenerImpl.handleResourcePackResponse(ServerConfigurationPacketListenerImpl.java:100) ~[paper-1.20.2.jar:git-Paper-260]
at net.minecraft.network.protocol.common.ServerboundResourcePackPacket.handle(ServerboundResourcePackPacket.java:24) ~[paper-1.20.2.jar:git-Paper-260]
at net.minecraft.network.protocol.common.ServerboundResourcePackPacket.handle(ServerboundResourcePackPacket.java:10) ~[paper-1.20.2.jar:git-Paper-260]
at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$0(PacketUtils.java:53) ~[?:?]
at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.20.2.jar:git-Paper-260]
at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?]
at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1324) ~[paper-1.20.2.jar:git-Paper-260]
at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:193) ~[paper-1.20.2.jar:git-Paper-260]
at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1301) ~[paper-1.20.2.jar:git-Paper-260]
at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1294) ~[paper-1.20.2.jar:git-Paper-260]
at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1272) ~[paper-1.20.2.jar:git-Paper-260]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1160) ~[paper-1.20.2.jar:git-Paper-260]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.20.2.jar:git-Paper-260]
at java.lang.Thread.run(Thread.java:1623) ~[?:?]

Self-host resource pack

With mcpacks recently being buggy, and dropbox not being ideal (as you have to change the URL, and the hash changes after you upload), we should add a way to host the resource pack from the server itself.

console error with player disconnect

[12:20:26 ERROR]: Could not pass event PlayerQuitEvent to StackMob v5.8.2
java.lang.NullPointerException: Cannot invoke "uk.antiperson.stackmob.packets.PlayerWatcher.stopWatching()" because "playerWatcher" is null
at uk.antiperson.stackmob.packets.PlayerManager.stopWatching(PlayerManager.java:37) ~[StackMob-5.8.2.jar:?]
at uk.antiperson.stackmob.listeners.PlayerArmorStandListener.onQuit(PlayerArmorStandListener.java:18) ~[StackMob-5.8.2.jar:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor539.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:75) ~[purpur-api-1.19.1-R0.1-SNAPSHOT.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[purpur-api-1.19.1-R0.1-SNAPSHOT.jar:git-Purpur-1748]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[purpur-api-1.19.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:678) ~[purpur-api-1.19.1-R0.1-SNAPSHOT.jar:?]
at net.minecraft.server.players.PlayerList.remove(PlayerList.java:624) ~[purpur-1.19.1.jar:git-Purpur-1748]
at net.minecraft.server.network.ServerGamePacketListenerImpl.onDisconnect(ServerGamePacketListenerImpl.java:2219) ~[?:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.disconnect(ServerGamePacketListenerImpl.java:572) ~[?:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.disconnect(ServerGamePacketListenerImpl.java:513) ~[?:?]
at org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer.kickPlayer(CraftPlayer.java:525) ~[purpur-1.19.1.jar:git-Purpur-1748]
at com.convallyria.forcepack.spigot.listener.ResourcePackListener.lambda$onStatus$2(ResourcePackListener.java:56) ~[ForcePack-1.2.1.jar:?]
at com.convallyria.forcepack.spigot.listener.ResourcePackListener.ensureMainThread(ResourcePackListener.java:117) ~[ForcePack-1.2.1.jar:?]
at com.convallyria.forcepack.spigot.listener.ResourcePackListener.onStatus(ResourcePackListener.java:56) ~[ForcePack-1.2.1.jar:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor23.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:75) ~[purpur-api-1.19.1-R0.1-SNAPSHOT.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[purpur-api-1.19.1-R0.1-SNAPSHOT.jar:git-Purpur-1748]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[purpur-api-1.19.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:678) ~[purpur-api-1.19.1-R0.1-SNAPSHOT.jar:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.handleResourcePackResponse(ServerGamePacketListenerImpl.java:2178) ~[?:?]
at net.minecraft.network.protocol.game.ServerboundResourcePackPacket.handle(ServerboundResourcePackPacket.java:24) ~[?:?]
at net.minecraft.network.protocol.game.ServerboundResourcePackPacket.handle(ServerboundResourcePackPacket.java:10) ~[?:?]
at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$0(PacketUtils.java:51) ~[?:?]
at net.minecraft.server.TickTask.run(TickTask.java:18) ~[purpur-1.19.1.jar:git-Purpur-1748]
at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?]
at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1386) ~[purpur-1.19.1.jar:git-Purpur-1748]
at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:185) ~[purpur-1.19.1.jar:git-Purpur-1748]
at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1363) ~[purpur-1.19.1.jar:git-Purpur-1748]
at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1356) ~[purpur-1.19.1.jar:git-Purpur-1748]
at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1434) ~[purpur-1.19.1.jar:git-Purpur-1748]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1212) ~[purpur-1.19.1.jar:git-Purpur-1748]
at net.minecraft.server.MinecraftServer.lambda$spin$1(MinecraftServer.java:310) ~[purpur-1.19.1.jar:git-Purpur-1748]
at java.lang.Thread.run(Thread.java:833) ~[?:?]

generate hash command

Add command to auto generate hash to config like /forcepack genhash
this feature is useful for upload resourcepack but same direct url

Does this also force players with Server Spoof in Meteor client?

Meteor client has a feature called Server Spoof which makes server think we accepted the resource pack. Origin Realms somehow won't forward me to the lobby if I use it tho and I am not sure how they detect that I did loaded the resource pack. Does this have the same feature where it will just leave you in the velocity lobby if you're not loading the resource pack but just spoofing the accept?

Per-version support

Need to think about how the config will look for per version support. Things can get complicated fast.

Perhaps do it by datapack version.

Also, clients send the datapack version in their request, so I imagine per version resource packs are possible via webserver.

Kick message

Bonjour j'ai cette raison quand je refuse le pack de texture :

image

Au lieu d'y avoir ce message : "Vous devez accepter le resource pack pour jouer sur notre serveur. Vous ne savez pas comment faire ? Consultez le site &ehttps://samb440.gitlab.io/resourcepack.html."

Dernière version de votre plugin, sous Paper 1.18.2, MC 1.18.2.

Merci de votre réponse.

Couldn't pass ProxyInitializeEvent to forcepack

[23:22:27 ERROR]: Couldn't pass ProxyInitializeEvent to forcepack
java.lang.NullPointerException: Cannot invoke "com.convallyria.forcepack.velocity.config.VelocityConfig.getStringList(String)" because "resourcePack" is null
at com.convallyria.forcepack.velocity.ForcePackVelocity.registerResourcePack(ForcePackVelocity.java:251) ~[?:?]
at com.convallyria.forcepack.velocity.ForcePackVelocity.lambda$addResourcePacks$2(ForcePackVelocity.java:246) ~[?:?]
at java.util.HashMap.forEach(HashMap.java:1421) ~[?:?]
at com.convallyria.forcepack.velocity.ForcePackVelocity.addResourcePacks(ForcePackVelocity.java:246) ~[?:?]
at com.convallyria.forcepack.velocity.ForcePackVelocity.loadResourcePacks(ForcePackVelocity.java:214) ~[?:?]
at com.convallyria.forcepack.velocity.ForcePackVelocity.onProxyInitialization(ForcePackVelocity.java:154) ~[?:?]
at com.convallyria.forcepack.velocity.Lmbda$5.execute(Unknown Source) ~[?:?]
at com.velocitypowered.proxy.event.UntargetedEventHandler$VoidHandler.lambda$buildHandler$0(UntargetedEventHandler.java:56) ~[velocity-3.3.0-SNAPSHOT-330.jar:3.3.0-SNAPSHOT (git-0993ce2f-b330)]
at com.velocitypowered.proxy.event.VelocityEventManager.fire(VelocityEventManager.java:597) ~[velocity-3.3.0-SNAPSHOT-330.jar:3.3.0-SNAPSHOT (git-0993ce2f-b330)]
at com.velocitypowered.proxy.event.VelocityEventManager.lambda$fire$5(VelocityEventManager.java:478) ~[velocity-3.3.0-SNAPSHOT-330.jar:3.3.0-SNAPSHOT (git-0993ce2f-b330)]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) [?:?]

Velocity commands don't work

Attempted:
use e.g. /vforcepack reload or even /velocityforcepack help
Expected:
the commands dispatch to the right ones
Result:
they all dispatch to /vforcepack resulting in ForcePack by SamB440... message

1.20.1 multiple support

Hello i see your awesome good project can you maybe add a features for multiple ressources pack but for version 1.20.1 etc

New spoof method detection

There is another method for status spoofing that can be used to detect attempts to bypass the resource pack. Won't be posting it here but this issue serves as a reminder for me.

Couldn't pass ServerPostConnectEvent to forcepack

Getting this error on every connect and the prompt for pack not appearing.

Here is my config

`
geyser = false
verify-resource-packs = true
update-gui = true
update-gui-speed = 1000
force-invalid-size = false
force-constant-download = true
disable-commands-until-loaded = false
exclude-commands = [
"exampleone",
"exampletwo",
]
bypass-permission = false
enable-mc-164316-fix = true
use-new-force-pack-screen = true
try-to-stop-fake-accept-hacks = true
delay-pack-sending-by = 0

debug = false
[web-server]
enabled = false
server-ip = "localhost"
port = 27010

[unload-pack]
enable = false
url = "https://download.mc-packs.net/pack/10beb398d88eee64fda1f1b0227f9159a0153e74.zip"
hash = "10beb398d88eee64fda1f1b0227f9159a0153e74"
generate-hash = false
exclude = [
"exampleserver"
]

[global-pack]
enable = true
url = "https://download.mc-packs.net/pack/10beb398d88eee64fda1f1b0227f9159a0153e74.zip"
hash = "10beb398d88eee64fda1f1b0227f9159a0153e74"
generate-hash = false
resourcepack.prompt = "Please accept our resource pack to improve your experience."
exclude = [
"exampleserver"
]

[global-pack.actions]
    [global-pack.actions.ACCEPTED]
        kick = false
        commands = []
    [global-pack.actions.DECLINED]
        kick = true
        message = "<color:#FF5555>Please accept our resource pack to play on the server!"
        commands = []
    [global-pack.actions.FAILED_DOWNLOAD]
        kick = true
        message = "<color:#FF5555>The resource pack download failed. Please try rejoining."
        commands = []
    [global-pack.actions.FAILED_RELOAD]
        kick = true
        message = "<color:#FF5555>The resource pack reload failed. Please try rejoining."
        commands = []
    [global-pack.actions.SUCCESSFUL]
        kick = false
        commands = []

[groups]
[groups.example-group]
exact-match = true
servers = [
"hub01",
"enviroment01",
"jungleplanet"
]
resourcepack.url = "https://download.mc-packs.net/pack/10beb398d88eee64fda1f1b0227f9159a0153e74.zip"
resourcepack.generate-hash = false
resourcepack.hash = "10beb398d88eee64fda1f1b0227f9159a0153e74"
resourcepack.prompt = "Please accept our resource pack to improve your experience."
[groups.example-group.actions]
[groups.example-group.actions.ACCEPTED]
kick = false
commands = []
[groups.example-group.actions.DECLINED]
kick = true
message = "color:#FF5555Please accept our resource pack to play on the server!"
commands = []
[groups.example-group.actions.FAILED_DOWNLOAD]
kick = true
message = "color:#FF5555The resource pack download failed. Please try rejoining."
commands = []
[groups.example-group.actions.FAILED_RELOAD]
kick = true
message = "color:#FF5555The resource pack reload failed. Please try rejoining."
commands = []
[groups.example-group.actions.SUCCESSFUL]
kick = false
commands = []

[servers]
[servers.example-server]
resourcepack.urls = ["https://www.convallyria.com/files/BlankPack.zip"]
resourcepack.generate-hash = false
resourcepack.hashes = ["118AFFFC54CDCD308702F81BA24E03223F15FE5F"]
resourcepack.prompt = "Please accept our resource pack to improve your experience."
[servers.example-server.actions]
[servers.example-server.actions.ACCEPTED]
kick = false
commands = []
[servers.example-server.actions.DECLINED]
kick = true
message = "color:#FF5555Please accept our resource pack to play on the server!"
commands = []
[servers.example-server.actions.FAILED_DOWNLOAD]
kick = true
message = "color:#FF5555The ResourcePack download failed. Please try rejoining."
commands = []
[servers.example-server.actions.FAILED_RELOAD]
kick = true
message = "color:#FF5555The resource pack reload failed. Please try rejoining."
commands = []
[servers.example-server.actions.SUCCESSFUL]
kick = false
commands = []
`

and here is the error
[07:08:38 ERROR]: Couldn't pass ServerPostConnectEvent to forcepack java.lang.NoSuchFieldError: MINECRAFT_1_20_3 at com.convallyria.forcepack.velocity.handler.PackHandler.lambda$setPack$9(PackHandler.java:98) ~[?:?] at java.util.Optional.ifPresentOrElse(Optional.java:196) ~[?:?] at com.convallyria.forcepack.velocity.handler.PackHandler.setPack(PackHandler.java:96) ~[?:?] at com.convallyria.forcepack.velocity.listener.ResourcePackListener.onJoin(ResourcePackListener.java:174) ~[?:?] at com.convallyria.forcepack.velocity.listener.Lmbda$26.execute(Unknown Source) ~[?:?] at com.velocitypowered.proxy.event.UntargetedEventHandler$VoidHandler.lambda$buildHandler$0(UntargetedEventHandler.java:56) ~[velocity.jar:3.2.0-SNAPSHOT (git-8dcc7ee3-b294)] at com.velocitypowered.proxy.event.VelocityEventManager.fire(VelocityEventManager.java:597) ~[velocity.jar:3.2.0-SNAPSHOT (git-8dcc7ee3-b294)] at com.velocitypowered.proxy.event.VelocityEventManager.lambda$fire$5(VelocityEventManager.java:478) ~[velocity.jar:3.2.0-SNAPSHOT (git-8dcc7ee3-b294)] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?] at java.lang.Thread.run(Thread.java:840) [?:?]

Reduce requests made to URLs

Currently we make around 2-3 requests depending on config options when loading, such as getting url hash then verifying it all. Would be nice if we could only send 1 request, store that, and reuse it.

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.