Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore display message #505

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c568365
fix wrong update link
YuanYuanOwO Mar 29, 2022
4aa440f
update link
YuanYuanOwO Mar 29, 2022
dbce33c
Merge branch 'PotatoCraft-Studio:master' into master
YuanYuanOwO Mar 30, 2022
dd24df4
update link
YuanYuanOwO Mar 31, 2022
c95d51b
Merge branch 'PotatoCraft-Studio:master' into master
YuanYuanOwO Feb 12, 2023
7f93bcf
Update MCBBS Link
YuanYuanOwO Feb 12, 2023
3910ceb
Merge branch 'PotatoCraft-Studio:master' into master
YuanYuanOwO Feb 25, 2023
ab04742
Update EnvironmentChecker.java
ka0un Apr 20, 2023
076205e
Update EnvironmentChecker.java
ka0un Apr 20, 2023
c72c6e8
Update README.md
ka0un Apr 21, 2023
cb11eb7
Merge pull request #1 from ka0un/master
YuanYuanOwO Aug 4, 2023
6fa0abd
Update README.md
YuanYuanOwO Aug 4, 2023
546c871
Merge branch 'PotatoCraft-Studio:master' into master
YuanYuanOwO Aug 4, 2023
4a6eb49
[ci skip]Rename sync-crowdinota.yml to 。
YuanYuanOwO Aug 5, 2023
8ad6429
[ci skip]Rename crowdin.yml to 1
YuanYuanOwO Aug 5, 2023
2879213
Add 1.20.3 and 1.20.4 support
galacticwarrior9 Feb 18, 2024
be60871
Fix https://github.com/PotatoCraft-Studio/QuickShop-Reremake/issues/455
galacticwarrior9 Mar 24, 2024
31bafc1
Merge branch 'PotatoCraft-Studio:master' into master
YuanYuanOwO May 4, 2024
691f22b
Merge pull request #2 from galacticwarrior9/1.20.4
YuanYuanOwO May 4, 2024
86869ab
Update maven.yml
YuanYuanOwO May 4, 2024
220f788
Update maven.yml
YuanYuanOwO May 4, 2024
9aa704d
Update maven.yml
YuanYuanOwO May 4, 2024
956540a
Update maven.yml
YuanYuanOwO May 4, 2024
872ace6
Update README.md
YuanYuanOwO May 4, 2024
95549f9
[ci skip]Update README.md
YuanYuanOwO May 14, 2024
61e2cac
[ci skip]update
YuanYuanOwO Jun 7, 2024
42a03ff
Update README.md
YuanYuanOwO Jun 8, 2024
75a807c
[ci skip]Update README.md
YuanYuanOwO Jun 10, 2024
9f8d024
更新 README.md
YuanYuanOwO Jul 14, 2024
1e1f0c2
试试合并一个来自 Hikari 的 commit
YuanYuanOwO Nov 17, 2024
75ce255
Update maven.yml
YuanYuanOwO Nov 17, 2024
f72fe3c
Update maven.yml
YuanYuanOwO Nov 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
33 changes: 18 additions & 15 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

name: Maven Test
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Java CI with Maven

on:
push:
branches: [ master ]
branches: [ "master", "ignore-display-messages" ]
pull_request:
branches: [ master ]
branches: [ "master", "ignore-display-messages" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'
# - name: Build JsonConfiguration
# run: |
# git clone https://github.com/sandtechnology/JsonConfiguration.git
# mvn -B install --file JsonConfiguration/pom.xml
# - name: Build Integration
# run: mvn -B install --file src/integration/plotsquared/5/pom.xml
distribution: 'temurin'
cache: 'maven'
- name: Build with Maven
run: mvn -B test --file pom.xml -Pdebug
run: mvn package --batch-mode --update-snapshots -T 1.5C -f pom.xml -P github
- uses: actions/upload-artifact@v3
with:
name: QuickShop
path: |
**/target/*.jar
File renamed without changes.
111 changes: 14 additions & 97 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,102 +1,19 @@
# QuickShop-Reremake
## Recommended Migration to QuickShop-Hikari(EN)

[![Codacy Badge](https://app.codacy.com/project/badge/Grade/e33e2fafe3ac4d4eb9048d154bbd874e)](https://www.codacy.com/gh/PotatoCraft-Studio/QuickShop-Reremake/dashboard?utm_source=github.com&utm_medium=referral&utm_content=PotatoCraft-Studio/QuickShop-Reremake&utm_campaign=Badge_Grade)
[![CodeFactor](https://www.codefactor.io/repository/github/potatocraft-studio/quickshop-reremake/badge)](https://www.codefactor.io/repository/github/potatocraft-studio/quickshop-reremake)
![BuildStatus](https://ci.codemc.io/job/PotatoCraft-Studio/job/QuickShop-Reremake/21/badge/icon)
![TestsPassed](https://img.shields.io/jenkins/tests?compact_message&jobUrl=https://ci.codemc.io/job/PotatoCraft-Studio/job/QuickShop-Reremake)
![Contributors](https://img.shields.io/github/contributors/potatocraft-studio/QuickShop-Reremake)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FPotatoCraft-Studio%2FQuickShop-Reremake.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FPotatoCraft-Studio%2FQuickShop-Reremake?ref=badge_shield)
---
QuickShop-Reremake (v5.1.2.5) is broken in Paper 1.20.5+ Server
You can download the support version from Github releases and then [migrate to QuickShop-Hikari(CLICK ME)](https://quickshop-community.github.io/QuickShop-Hikari-Documents/docs/addon/reremake-migrator)
I strongly do not recommend this version of QuickShop-Reremake for use on the server
Because there are many bugs and broken features in Paper 1.20.5+ Server.
I **only recommend you use this version to migrate to QuickShop-Hikari**

![Java](https://img.shields.io/badge/java-version%208%2B%20(currently%20is%208--16)-orange)
![MC](https://img.shields.io/badge/minecraft-java%20edition%201.15%2B-blueviolet)
![Ver](https://img.shields.io/spiget/version/62575?label=version)
![Downloads](https://img.shields.io/spiget/downloads/62575?label=downloads)
![Rating](https://img.shields.io/spiget/rating/62575?label=rating)
---
**This is a 3rd-party build**

QuickShop is a **FREE** shop plugin that allows players to easily sell/buy any items from a chest without any commands. In fact,
none of the commands that QuickShop provides are ever needed by a player. QuickShop-Reremake is a **FREE** fork of QuickShop
NotLikeMe with more features, bug fixes and other improvements.
QuickShop-Reremake is made by PotatoCraft Studio
from [KaiKikuchi's QuickShop upstream repository](https://github.com/KaiKikuchi/QuickShop).
## 推荐转换到 QuickShop-Hikari(CN)

## Support
QuickShop-Reremake (v5.1.2.5) 在 Paper 1.20.5+ 的服务器运行存在BUG
你可以在 Github Releases 下载支持在 Paper 1.20.5+ 服务器运行的 QuickShop-Reremake 第三方修改构建,然后[转换到QuickShop-Hikari(点击我)](https://quickshop-community.github.io/QuickShop-Hikari-Documents/docs/addon/reremake-migrator)
我强烈不建议你使用该版本的 QuickShop-Reremake 在服务器中
因为在 Paper 1.20.5+ 服务器中,该版本有许多BUG
我 **只建议你使用这个版本来转换到QuickShop-Hikari**

| <a href="https://discord.gg/bfefw2E"/> <img src="/.github/icons/Discord.svg" width="100" height="100" />| <a href="https://github.com/PotatoCraft-Studio/QuickShop-Reremake/issues"><img src="/.github/icons/Github.png" width="100" height="100" />|
| :---: | :---: |
| [**Discord**](https://discord.gg/bfefw2E) | [**Github Issues**](https://github.com/PotatoCraft-Studio/QuickShop-Reremake/issues) |

## Features

- Easy to use
- Toggleable Display Item on top of the chest
- NBT Data, Enchantment, Tool Damage, Potion, and Mob Egg support
- Unlimited chest support
- Blacklist support & bypass permissions
- Shops that buy and sell items at the same time (Using double chests)
- Customisable permission checks
- UUID support
- Better shop protection [Reremake]
- Item display name i18n [Reremake]
- Enchantment display name i18n [Reremake]
- A cool item preview [Reremake]
- World/region protection plugins support [Reremake]
- ProtocolLib based Virtual DisplayItem support [Reremake]
- Powerful API [Reremake]
- Optimized performance [Reremake]

## Downloads

| <a href="https://www.spigotmc.org/resources/62575/"><img src="/.github/icons/Spigot.png" width="100" height="90" /></a> | <a href="https://dev.bukkit.org/projects/quickshop-reremake"><img src="/.github/icons/Bukkit.png" width="100" height="100" /></a></a> | <a href="https://www.mcbbs.net/thread-1426607-1-1.html"><img src="/.github/icons/MCBBS.png" width="100" height="100" /></a> | <a href="https://ci.codemc.io/job/PotatoCraft-Studio/job/QuickShop-Reremake-SNAPSHOT/"><img src="/.github/icons/Jenkins.svg" width="85" height="100" /></a>
| :---: | :---: | :---: | :---: |
| **Spigot** | **BukkitDev** | **MCBBS** | **Jenkins** |

## Contribute

If you're a developer, you can contribute to the QuickShop code! Just make a fork and install the Lombok plugin,
then make a pull request when you're done! Please try to
follow [Google Java Style](https://google.github.io/styleguide/javaguide.html). Also do not increase the plugin version
number. Thank you very much!

To compile the QuickShop and debug it by yourself, please follow these steps:

0. Make sure you're using Java16 JDK in your PATH.
1. Compile main-project without signature by using debug profile: `mvn install -Pdebug`
2. Start your server with extra flag to skip the QuickShop signature
checks: `-Dorg.maxgamer.quickshop.util.envcheck.skip.SIGNATURE_VERIFY`

## Maven

```XML

<repository>
<id>quickshop-repo</id>
<url>https://repo.codemc.io/repository/maven-public/</url>
</repository>

<dependency>
<groupId>org.maxgamer</groupId>
<artifactId>QuickShop</artifactId>
<version>{VERSION}</version>
<scope>provided</scope>
</dependency>
```

## Bstats

[![BigImage](https://bstats.org/signatures/bukkit/QuickShop-Reremake.svg)](https://bstats.org/plugin/bukkit/QuickShop-Reremake/3320)

## License

[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FPotatoCraft-Studio%2FQuickShop-Reremake.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FPotatoCraft-Studio%2FQuickShop-Reremake?ref=badge_large)

## Developer API

```java
Plugin plugin = Bukkit.getPluginManager().getPlugin("QuickShop");
if(plugin != null){
QuickShopAPI api = (QuickShopAPI)plugin;
api.xxxx;
}
```
**这是第三方修改构建**
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.20.2-R0.1-SNAPSHOT</version>
<version>1.20.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/org/maxgamer/quickshop/economy/Trader.java
Original file line number Diff line number Diff line change
Expand Up @@ -245,4 +245,16 @@ public boolean isOp() {
public void setOp(boolean value) {
offlinePlayer.setOp(value);
}

@Nullable
@Override
public Location getLocation() {
return offlinePlayer.getLocation();
}

@Nullable
@Override
public Location getRespawnLocation() {
return offlinePlayer.getRespawnLocation();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
public class ContainerShop implements Shop {
@EqualsAndHashCode.Exclude
@Deprecated
private static final String SHOP_SIGN_PREFIX = "§d§o §r";
private static final String SHOP_SIGN_PREFIX = "§d§o §0";
@NotNull
private final Location location;
private final YamlConfiguration extra;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/maxgamer/quickshop/util/GameVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public enum GameVersion {
v1_19_R3(true, false, true, true, true, true),
v1_20_R1(true, false, true, true, true, true),
v1_20_R2(true, false, true, true, true, true),
v1_20_R3(true, false, true, true, true, true),

UNKNOWN(true, false, false, true, true, true);
/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/maxgamer/quickshop/util/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,7 @@ public static String parseColours(@Nullable String text) {
parser.reset();

//A hack for saving reset character
text = text.replace("&r", "&l&r").replace("§r", "§l§r");
text = text.replace("&r", "&l&r").replace("§f", "§l§f");
return toLegacyText(parser.enable(MineDownParser.Option.LEGACY_COLORS).enable(MineDownParser.Option.APPEND_COLORS_TO_EMPTY_STRING).backwardsCompatibility(true).parse(text).create());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,11 @@
import org.maxgamer.quickshop.api.shop.DisplayType;
import org.maxgamer.quickshop.shop.VirtualDisplayItem;
import org.maxgamer.quickshop.util.GameVersion;
import org.maxgamer.quickshop.util.JsonUtil;
import org.maxgamer.quickshop.util.MsgUtil;
import org.maxgamer.quickshop.util.ReflectFactory;
import org.maxgamer.quickshop.util.Util;
import org.maxgamer.quickshop.util.security.JarVerifyTool;

import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Method;
import java.net.URLDecoder;
import java.util.ArrayList;
Expand All @@ -46,8 +43,6 @@
import java.util.Locale;
import java.util.Map;
import java.util.Properties;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.logging.Level;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
Expand Down Expand Up @@ -192,108 +187,6 @@ public boolean isOutdatedJvm() {
}
}

@SneakyThrows
@EnvCheckEntry(name = "Signature Verify", priority = 0, stage = {EnvCheckEntry.Stage.ON_LOAD, EnvCheckEntry.Stage.ON_ENABLE})
public ResultContainer securityVerify() {
JarVerifyTool tool = new JarVerifyTool();
JarFile jarFile = null;
try {
ClassLoader loader = this.getClass().getClassLoader();
try (InputStream stream1 = loader.getResourceAsStream("META-INF/MANIFEST.MF");
InputStream stream2 = loader.getResourceAsStream("META-INF/SELFSIGN.DSA");
InputStream stream3 = loader.getResourceAsStream("META-INF/SELFSIGN.SF")) {
if (stream1 == null || stream2 == null || stream3 == null) {
if(stream1 == null){
this.reportMaker.signatureFileMissing("META-INF/MANIFEST.MF");
}
if(stream2 == null){
this.reportMaker.signatureFileMissing("META-INF/SELFSIGN.DSA");
}
if(stream3 == null){
this.reportMaker.signatureFileMissing("META-INF/SELFSIGN.SF");
}
plugin.getLogger().warning("The signature could not be found! The QuickShop jar has been modified or you're running a custom build.");
return new ResultContainer(CheckResult.KILL_SERVER, "Security risk detected, QuickShop jar has been modified.");
}
}
String jarPath = this.getClass().getProtectionDomain().getCodeSource().getLocation().getFile();
jarPath = URLDecoder.decode(jarPath, "UTF-8");
Util.debugLog("JarPath selected: " + jarPath);
jarFile = new JarFile(jarPath);
List<JarEntry> modifiedEntry = tool.verify(jarFile);
if (modifiedEntry.isEmpty()) {
return new ResultContainer(CheckResult.PASSED, "The jar is valid. No issues detected.");
} else {
modifiedEntry.forEach(jarEntry -> {
this.reportMaker.signatureVerifyFail(jarEntry);
plugin.getLogger().warning(">> Modified Class Detected <<");
plugin.getLogger().warning("Name: " + jarEntry.getName());
plugin.getLogger().warning("CRC: " + jarEntry.getCrc());
plugin.getLogger().warning(JsonUtil.getGson().toJson(jarEntry));
});
plugin.getLogger().severe("QuickShop detected that the jar has been modified! This is usually caused by the file being corrupted or virus infected.");
plugin.getLogger().severe("To prevent severe server failure, QuickShop has been disabled.");
plugin.getLogger().severe("For further information, Please join our support Discord server: https://discord.com/invite/bfefw2E.");
return new ResultContainer(CheckResult.KILL_SERVER, "Security risk detected, QuickShop jar has been modified.");
}
} catch (Exception ioException) {
plugin.getLogger().log(Level.WARNING, "ALERT: QuickShop cannot validate itself. This may be caused by you having deleted QuickShop's jar while the server is running.", ioException);
return new ResultContainer(CheckResult.KILL_SERVER, "Failed to validate digital signature! Security may be compromised!");
} finally {
if (jarFile != null) {
try {
jarFile.close();
} catch (IOException ignored) {
}
}
}
}


@EnvCheckEntry(name = "Plugin Manifest Check", priority = 1, stage = {EnvCheckEntry.Stage.ON_LOAD, EnvCheckEntry.Stage.ON_ENABLE})
public ResultContainer manifestCheck() {
String mainClass = plugin.getDescription().getMain();
if(!mainClass.equals("org.maxgamer.quickshop.QuickShop")){
this.reportMaker.manifestModified(plugin.getDescription());
plugin.getLogger().warning("ALERT: Detected main class has been modified!");
plugin.getLogger().warning("Should be: org.maxgamer.quickshop.QuickShop");
plugin.getLogger().warning("Actually: "+mainClass);
return new ResultContainer(CheckResult.KILL_SERVER, "Failed to validate main class! Security may be compromised!");

}
return new ResultContainer(CheckResult.PASSED, "Check passed.");
}

@EnvCheckEntry(name = "Potential Infection Characteristics Check", priority = 1, stage = {EnvCheckEntry.Stage.ON_LOAD, EnvCheckEntry.Stage.ON_ENABLE})
public ResultContainer potentialCheck() {
String jarPath = this.getClass().getProtectionDomain().getCodeSource().getLocation().getFile();
try {
jarPath = URLDecoder.decode(jarPath, "UTF-8");
Util.debugLog("JarPath selected: " + jarPath);
ZipFile zipFile = new ZipFile(jarPath);
Enumeration<? extends ZipEntry> zipEntryEnumeration = zipFile.entries();
boolean found = false;
while(zipEntryEnumeration.hasMoreElements()){
ZipEntry entry = zipEntryEnumeration.nextElement();
if(entry.getName().startsWith("javassist") || entry.getName().startsWith(".")){
found = true;
this.reportMaker.potentialInfected(entry);
plugin.getLogger().log(Level.WARNING, "Potential Infection Detected:");
plugin.getLogger().log(Level.WARNING, "File: "+entry.getName());
plugin.getLogger().log(Level.WARNING, "CRC: "+entry.getCrc());
plugin.getLogger().log(Level.WARNING, "Time: "+entry.getTime());
}
}
if(found){
plugin.getLogger().log(Level.WARNING, "ALERT: QuickShop detected Potential Infection, this jar may already infected by malware, stop the server and create full server backup immediately, run virus scan and contact the QuickShop support if you need!");
return new ResultContainer(CheckResult.KILL_SERVER, "Potential Infection detected, Killing server process...");
}
} catch (IOException e) {
plugin.getLogger().log(Level.WARNING, "ALERT: QuickShop cannot validate itself. This may be caused by you having deleted QuickShop's jar while the server is running.", e);
return new ResultContainer(CheckResult.KILL_SERVER, "Failed to validate files in jar! Security may be compromised!");
}
return new ResultContainer(CheckResult.PASSED, "Check passed.");
}


@SneakyThrows
Expand Down Expand Up @@ -418,6 +311,9 @@ public ResultContainer coreSupportTest() {

@EnvCheckEntry(name = "Virtual DisplayItem Support Test", priority = 7)
public ResultContainer virtualDisplaySupportTest() {
if(!plugin.isDisplayEnabled()) {
return new ResultContainer(CheckResult.PASSED, "The setting shop.display-items is disabled.");
}
String nmsVersion = ReflectFactory.getNMSVersion();
GameVersion gameVersion = GameVersion.get(nmsVersion);
Throwable throwable;
Expand Down
Loading