Skip to content

Commit

Permalink
Merge branch 'refs/heads/dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
StarWishsama committed Sep 12, 2024
2 parents dc72b4b + 0f360b3 commit 9fdeb08
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 27 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ body:
感谢你使用 Slimefun 问题反馈系统!
在反馈前, 请确认你已经做了下面这些事情
- 查看 [Releases](https://github.com/StarWishsama/Slimefun4/releases) 中最新版是否已修复你所遇到的问题
- 搜索了已有的 [issues](https://github.com/StarWishsama/Slimefun4/issues) 列表中是否有相似问题
- 查看 [Releases](https://github.com/SlimefunGuguProject/Slimefun4/releases) 中最新版是否已修复你所遇到的问题
- 搜索了已有的 [issues](https://github.com/SlimefunGuguProject/Slimefun4/issues) 列表中是否有相似问题
如果此问题反馈不符合模板,将会被管理员无条件关闭。
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/translation-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ body:
感谢你使用 Slimefun 问题反馈系统!
在反馈前, 请确认你已经做了下面这些事情
- 查看 [Releases](https://github.com/StarWishsama/Slimefun4/releases) 中最新版是否已修复你所遇到的问题
- 搜索了已有的 [issues](https://github.com/StarWishsama/Slimefun4/issues) 列表中是否有相似问题
- 查看 [Releases](https://github.com/SlimefunGuguProject/Slimefun4/releases) 中最新版是否已修复你所遇到的问题
- 搜索了已有的 [issues](https://github.com/SlimefunGuguProject/Slimefun4/issues) 列表中是否有相似问题
如果此问题反馈不符合模板,将会被管理员无条件关闭。
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- 在提交代码前, 你必须阅读 [提交规范](https://github.com/StarWishsama/Slimefun4/blob/master/CONTRIBUTING.md) -->
<!-- 在提交代码前, 你必须阅读 [提交规范](https://github.com/SlimefunGuguProject/Slimefun4/blob/master/CONTRIBUTING.md) -->

## 简介
<!-- 大致解释一下这个提交更改变动了什么. -->
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

Looking for English (or Original) Version? [**Click here**](https://github.com/Slimefun/Slimefun4/)

想要直接下载吗? [**单击此处**](https://github.com/StarWishsama/Slimefun4/blob/master/README.md#floppy_disk-下载-slimefun4)
想要直接下载吗? [**单击此处**](https://github.com/SlimefunGuguProject/Slimefun4/blob/master/README.md#floppy_disk-下载-slimefun4)

欢迎加入 QQ 交流群:807302496

下载 [SlimeGlue(粘液胶)](https://github.com/Xzavier0722/SlimeGlue/) 以保证 Slimefun 与领地保护插件的兼容性
下载 [SlimeGlue(粘液胶)](https://github.com/Xzavier0722/SlimeGlue/) 以保证 Slimefun 与其他保护插件的兼容性

### 订阅计划

Expand All @@ -17,10 +17,10 @@ Looking for English (or Original) Version? [**Click here**](https://github.com/S

了解订阅计划:[订阅计划](https://builds.guizhanss.com/sf-subscription)

![目前版本](https://img.shields.io/github/v/release/StarWishSama/Slimefun4?include_prereleases)
![构建状态](https://builds.guizhanss.com/StarWishsama/Slimefun4/master/badge.svg)
[![Issues](https://img.shields.io/github/issues/StarWishsama/Slimefun4.svg?style=popout)](https://github.com/StarWishsama/Slimefun4/issues)
![下载数](https://img.shields.io/github/downloads/StarWishsama/Slimefun4/total)
![目前版本](https://img.shields.io/github/v/release/SlimefunGuguProject/Slimefun4?include_prereleases)
![构建状态](https://builds.guizhanss.com/SlimefunGuguProject/Slimefun4/master/badge.svg)
[![Issues](https://img.shields.io/github/issues/SlimefunGuguProject/Slimefun4.svg?style=popout)](https://github.com/SlimefunGuguProject/Slimefun4/issues)
![下载数](https://img.shields.io/github/downloads/SlimefunGuguProject/Slimefun4/total)

使用汉化版之后,**禁止**在官方问题追踪器创建新问题!
如果你执意要这么做, 请在反馈时使用**官方**开发版并且使用**英语**提交问题。
Expand All @@ -44,7 +44,7 @@ Slimefun 让每个玩家可以自行决定在魔法或科技方面发展。

* **[下载 Slimefun 4](#floppy_disk-下载-slimefun4)**
* **[Discord 服务器](#discord)**
* **[Bug 反馈](https://github.com/StarWishsama/Slimefun4/issues)**
* **[Bug 反馈](https://github.com/SlimefunGuguProject/Slimefun4/issues)**
* **[官方Wiki](https://github.com/Slimefun/Slimefun4/wiki)**
* **[非官方中文 Wiki](https://slimefun-wiki.guizhanss.cn/)**
* **[FAQ](https://slimefun-wiki.guizhanss.cn/FAQ)**
Expand All @@ -68,7 +68,7 @@ Slimefun 4 可以在[鬼斩构建站](https://builds.guizhanss.com)页面中**
| **Bug 反馈** | :heavy_check_mark: | :x: |
| **在发布前进行测试** | :x: | :heavy_check_mark: |
| **有无更新日志** | :x: | :memo: **[更新日志(英文)](https://github.com/Slimefun/Slimefun4/blob/master/CHANGELOG.md)** |
| **下载链接** | :package: **[下载 最新版](https://builds.guizhanss.com/StarWishsama/Slimefun4/master)** | :package: **[下载 "稳定版"](https://builds.guizhanss.com/StarWishsama/Slimefun4/release)** |
| **下载链接** | :package: **[下载 最新版](https://builds.guizhanss.com/SlimefunGuguProject/Slimefun4/master)** | :package: **[下载 "稳定版"](https://builds.guizhanss.com/SlimefunGuguProject/Slimefun4/release)** |

**! 建议你使用最新的测试版,可以获得最新的内容更新和 Bug 修复!**

Expand Down Expand Up @@ -106,7 +106,7 @@ Slimefun 4 可以在[鬼斩构建站](https://builds.guizhanss.com)页面中**
单击下面的徽标加入 Discord 服务器反馈问题和提出意见,或者讨论关于此插件的内容。
Slimefun 官方经常会举办一些社区活动,加入我们了解更多。
**注意**:Slimefun 官方在 Discord 服务器 ****
接受任何形式的问题反馈,请使用 [问题追踪器](https://github.com/StarWishsama/Slimefun4/issues) 反馈问题!
接受任何形式的问题反馈,请使用 [问题追踪器](https://github.com/SlimefunGuguProject/Slimefun4/issues) 反馈问题!

在加入前请先了解官方 Discord 服务器[重要的规则](https://github.com/Slimefun/Slimefun4/wiki/Discord-Rules)
不遵守以上规则的人可能会被从服务器中踢出甚至封禁。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ private static void addHeader(Player p, ChestMenu menu, ItemStack guide) {

menu.addMenuClickHandler(6, (pl, slot, item, action) -> {
pl.closeInventory();
ChatUtils.sendURL(pl, "https://github.com/StarwishSama/Slimefun4");
ChatUtils.sendURL(pl, "https://github.com/SlimefunGuguProject/Slimefun4");
return false;
});

Expand Down Expand Up @@ -223,7 +223,7 @@ private static void addHeader(Player p, ChestMenu menu, ItemStack guide) {

menu.addMenuClickHandler(49, (pl, slot, item, action) -> {
pl.closeInventory();
ChatUtils.sendURL(pl, "https://github.com/StarWishsama/Slimefun4/issues");
ChatUtils.sendURL(pl, "https://github.com/SlimefunGuguProject/Slimefun4/issues");
return false;
});
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public final class Slimefun extends JavaPlugin implements SlimefunAddon, ICompat
private final CustomItemDataService itemDataService = new CustomItemDataService(this, "slimefun_item");
private final BlockDataService blockDataService = new BlockDataService(this, "slimefun_block");
private final CustomTextureService textureService = new CustomTextureService(new Config(this, "item-models.yml"));
private final GitHubService gitHubService = new GitHubService("StarWishsama/Slimefun4");
private final GitHubService gitHubService = new GitHubService("SlimefunGuguProject/Slimefun4");
private final UpdaterService updaterService =
new UpdaterService(this, getDescription().getVersion(), getFile());
private final MetricsService metricsService = new MetricsService(this);
Expand Down Expand Up @@ -449,7 +449,7 @@ public JavaPlugin getJavaPlugin() {

@Override
public String getBugTrackerURL() {
return "https://github.com/StarWishsama/Slimefun4/issues";
return "https://github.com/SlimefunGuguProject/Slimefun4/issues";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ public static void loadItems() {
sender.sendMessage("");

sender.sendMessage("");
sender.sendMessage(ChatColor.GREEN + " - 源码: https://github.com/StarWishsama/Slimefun4");
sender.sendMessage(ChatColor.GREEN + " - Bug 反馈: https://github.com/StarWishsama/Slimefun4/issues");
sender.sendMessage(ChatColor.GREEN + " - 源码: https://github.com/SlimefunGuguProject/Slimefun4");
sender.sendMessage(ChatColor.GREEN + " - Bug 反馈: https://github.com/SlimefunGuguProject/Slimefun4/issues");

sender.sendMessage("");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class TickerTask implements Runnable {

/**
* This Map holds all currently actively ticking locations.
* The value of this map (Set entries) MUST be thread-safe and mutable.
*/
private final Map<ChunkPosition, Set<Location>> tickingLocations = new ConcurrentHashMap<>();

Expand Down Expand Up @@ -255,7 +256,7 @@ public Map<ChunkPosition, Set<Location>> getLocations() {
public Set<Location> getLocations(@Nonnull Chunk chunk) {
Validate.notNull(chunk, "The Chunk cannot be null!");

Set<Location> locations = tickingLocations.getOrDefault(new ChunkPosition(chunk), new HashSet<>());
Set<Location> locations = tickingLocations.getOrDefault(new ChunkPosition(chunk), Collections.emptySet());
return Collections.unmodifiableSet(locations);
}

Expand All @@ -269,11 +270,26 @@ public void enableTicker(@Nonnull Location l) {
Validate.notNull(l, "Location cannot be null!");

synchronized (tickingLocations) {
tickingLocations
.computeIfAbsent(
new ChunkPosition(l.getWorld(), l.getBlockX() >> 4, l.getBlockZ() >> 4),
k -> new HashSet<>())
.add(l);
ChunkPosition chunk = new ChunkPosition(l.getWorld(), l.getBlockX() >> 4, l.getBlockZ() >> 4);

/*
Note that all the values in #tickingLocations must be thread-safe.
Thus, the choice is between the CHM KeySet or a synchronized set.
The CHM KeySet was chosen since it at least permits multiple concurrent
reads without blocking.
*/
Set<Location> newValue = ConcurrentHashMap.newKeySet();
Set<Location> oldValue = tickingLocations.putIfAbsent(chunk, newValue);

/**
* This is faster than doing computeIfAbsent(...)
* on a ConcurrentHashMap because it won't block the Thread for too long
*/
if (oldValue != null) {
oldValue.add(l);
} else {
newValue.add(l);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
public class AutoUpdateTask implements Runnable {

private static final String GITHUB_USER = "StarWishsama";
private static final String GITHUB_USER = "SlimefunGuguProject";
private static final String GITHUB_REPO = "Slimefun4";
private static final String GITHUB_BRANCH_BETA = "master";
private static final String GITHUB_BRANCH_RELEASE = "release";
Expand Down

0 comments on commit 9fdeb08

Please sign in to comment.