Skip to content

Commit

Permalink
Merge branch 'shixinzia:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
muguagua3 authored Jun 17, 2024
2 parents 2eaca70 + 6c0c368 commit da3e58c
Show file tree
Hide file tree
Showing 86 changed files with 8,334 additions and 441 deletions.
2 changes: 0 additions & 2 deletions .github/FUNDING.yml

This file was deleted.

33 changes: 7 additions & 26 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ body:
value: |
## 欢迎来到 SlimefunGuguProject 的问题追踪器
你正在反馈 Networks 汉化版出现的 Bug。
任何意见,建议请前往[QQ群](https://ybw0014.net/go/sf-qgroup)进行反馈。
任何意见,建议请前往[QQ群](https://50l.cc/gugu-qgroup)进行反馈。
建议先阅读[这篇文章](https://slimefun-wiki.guizhanss.cn/How-to-report-bugs)了解如何正确地汇报Bug。
<strong><i>你必须填写标注为星号(*)的表单项</i></strong>
Expand All @@ -20,13 +20,11 @@ body:
label: 检查项目
description: 在汇报之前,你需要确认
options:
- label: 你使用的是从构建站下载的版本 (https://builds.guizhanss.net)
- label: 你使用的是从构建站下载的版本
required: true
- label: 你已经检验过下载的文件的校验和,确认已完整下载文件 (暂未推出)
required: false
- label: 你没有对下载的文件内容进行任何更改
- label: 你已经检验过下载的文件的校验和,确认已完整下载文件
required: true
- label: 你没有安装`CS-CoreLib`
- label: 你没有对下载的文件内容进行任何更改
required: true
- label: 你已经寻找过[已知问题列表](https://github.com/SlimefunGuguProject/Networks/issues),且没有找到相同的问题
required: true
Expand Down Expand Up @@ -102,30 +100,14 @@ body:
validations:
required: true

- type: dropdown
- type: input
id: minecraft-version
attributes:
label: Minecraft 版本
description: 请选择你的 Minecraft 版本
options:
- 1.19.x
- 1.18.x
- 1.17.x
- 本插件不支持旧版本
description: 请填写你的 Minecraft 版本
validations:
required: true

- type: checkboxes
id: cscorelib-version
attributes:
label: CS-CoreLib 版本
description: |
从2021年1月30日起,Slimefun以及其附属插件都不再需要安装CS-CoreLib。
保留CS-CoreLib可能导致一些未知的问题。
options:
- label: 我没有安装CS-CoreLib
required: true

- type: textarea
id: slimefun-version
attributes:
Expand All @@ -143,7 +125,6 @@ body:
label: 插件版本
description: |
请填写插件版本
只需填写Build后面的数字版本即可
(`Build 7 zh-CN(ybw0014) (git 9ef7fee)`只需填写`7`即可)
(例如 Build 1 (git x114514))
validations:
required: true
11 changes: 1 addition & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,7 @@

## 下载

点击这里下载 Networks: [下载 Networks](https://builds.guizhanss.net/ybw0014/Networks-CN/master)

<p align="center">
<a href="https://github.com/ybw0014/Networks-CN/actions/workflows/maven.yml">
<img src="https://github.com/ybw0014/Networks-CN/actions/workflows/maven.yml/badge.svg" alt="Java CI"/>
</a>
<a href="https://builds.guizhanss.net/ybw0014/Networks-CN/master">
<img src="https://builds.guizhanss.net/f/ybw0014/Networks-CN/master/badge.svg" alt="Build status"/>
</a>
</p>
[![构建状态](https://builds.guizhanss.com/api/badge/SlimefunGuguProject/Networks/master/latest)](https://builds.guizhanss.com/SlimefunGuguProject/Networks/master)

## Wiki / 文档

Expand Down
47 changes: 32 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@

<modelVersion>4.0.0</modelVersion>
<groupId>io.github.sefiraat</groupId>
<artifactId>Networks-Changed</artifactId>
<version>1.2.0</version>
<artifactId>Networks</artifactId>
<version>MODIFIED_1.2.0</version>

<distributionManagement>
<repository>
<id>central</id>
<name>sefi-central</name>
<url>https://sefiraat.jfrog.io/artifactory/default-maven-local</url>
</repository>

<snapshotRepository>
<id>snapshots</id>
<name>sefi-snapshot</name>
Expand Down Expand Up @@ -66,6 +67,12 @@
<pattern>org.bstats</pattern>
<shadedPattern>io.github.sefiraat.networks.bstats</shadedPattern>
</relocation>

<relocation>
<pattern>io.papermc.lib</pattern>
<shadedPattern>dev.sefiraat.cultivation.paperlib</shadedPattern>
</relocation>

</relocations>
<filters>
<filter>
Expand Down Expand Up @@ -123,28 +130,27 @@
<id>bg-repo</id>
<url>https://repo.bg-software.com/repository/api/</url>
</repository>
<repository>
<id>papermc</id>
<url>https://papermc.io/repo/repository/maven-public/</url>
</repository>
</repositories>

<dependencies>
<!-- Core -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.StarWishsama</groupId>
<artifactId>Slimefun4</artifactId>
<version>f30bdf27be</version>
<version>2024.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>dev.sefiraat</groupId>
<artifactId>SefiLib</artifactId>
<version>0.2.6</version>
<scope>compile</scope>
</dependency>


<!-- Tools etc. -->
<dependency>
Expand All @@ -171,7 +177,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.28</version>
<version>1.18.30</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -183,9 +189,9 @@

<!-- Supported Plugins -->
<dependency>
<groupId>io.github.mooy1</groupId>
<groupId>com.github.SlimefunGuguProject</groupId>
<artifactId>InfinityExpansion</artifactId>
<version>90e11bc</version>
<version>3c5db3650a</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -206,12 +212,23 @@
<version>2.1.221</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>io.papermc</groupId>
<artifactId>paperlib</artifactId>
<version>1.0.7</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>dev.sefiraat</groupId>
<artifactId>SefiLib</artifactId>
<version>0.2.6</version>
<scope>compile</scope>
</dependency>
<!-- 汉化库 -->
<dependency>
<groupId>net.guizhanss</groupId>
<artifactId>GuizhanLibPlugin</artifactId>
<version>1.3.0</version>
<version>1.7.6</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import io.github.sefiraat.networks.network.stackcaches.QuantumCache;
import io.github.sefiraat.networks.slimefun.NetworkSlimefunItems;
import io.github.sefiraat.networks.slimefun.network.NetworkQuantumStorage;
import io.github.sefiraat.networks.slimefun.yitoudaidai.ExpansionSlimefunitems;
import io.github.sefiraat.networks.utils.Keys;
import io.github.sefiraat.networks.utils.Theme;
import io.github.sefiraat.networks.utils.datatypes.DataTypeMethods;
Expand All @@ -25,6 +26,9 @@ public class NetworksMain implements CommandExecutor {
private static final Map<Integer, NetworkQuantumStorage> QUANTUM_REPLACEMENT_MAP = new HashMap<>();

static {
QUANTUM_REPLACEMENT_MAP.put(64, NetworkSlimefunItems.NETWORK_QUANTUM_STORAGE_0);
QUANTUM_REPLACEMENT_MAP.put(256, NetworkSlimefunItems.NETWORK_QUANTUM_STORAGE_9);
QUANTUM_REPLACEMENT_MAP.put(1024, NetworkSlimefunItems.NETWORK_QUANTUM_STORAGE_10);
QUANTUM_REPLACEMENT_MAP.put(4096, NetworkSlimefunItems.NETWORK_QUANTUM_STORAGE_1);
QUANTUM_REPLACEMENT_MAP.put(32768, NetworkSlimefunItems.NETWORK_QUANTUM_STORAGE_2);
QUANTUM_REPLACEMENT_MAP.put(262144, NetworkSlimefunItems.NETWORK_QUANTUM_STORAGE_3);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package io.github.sefiraat.networks.listeners;

import io.github.sefiraat.networks.NetworkStorage;
import io.github.sefiraat.networks.network.NetworkNode;
import io.github.sefiraat.networks.network.NodeDefinition;
import io.github.sefiraat.networks.network.NodeType;
import io.github.sefiraat.networks.slimefun.network.NetworkController;
import org.bukkit.Location;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockPlaceEvent;

public class BlockListener implements Listener {
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onBlockBreak(BlockBreakEvent e) {
removeNetwork(e.getBlock().getLocation());
}

@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBlockPlace(BlockPlaceEvent e) {
removeNetwork(e.getBlock().getLocation());
}

private void removeNetwork(Location location) {
NodeDefinition definition = NetworkStorage.getAllNetworkObjects().get(location);
if (definition == null) return;
if (definition.getNode() == null) return;
NetworkStorage.removeNode(location);

NetworkNode node = definition.getNode();
if (node != null && node.getNodeType() == NodeType.CONTROLLER) {
NetworkController.wipeNetwork(location);
}
NetworkStorage.removeNode(location);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ public void onExplosiveBlockBreak(@Nonnull ExplosiveToolBreakBlocksEvent event)
}
event.getAdditionalBlocks().removeAll(blocksToRemove);
}

}
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package io.github.sefiraat.networks.managers;

import io.github.sefiraat.networks.Networks;
import io.github.sefiraat.networks.listeners.BlockListener;
import io.github.sefiraat.networks.listeners.ExplosiveToolListener;
import org.bukkit.event.Listener;

public class ListenerManager {

public ListenerManager() {
addListener(new ExplosiveToolListener());
addListener(new BlockListener());
}

private void addListener(Listener listener) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,21 @@
import com.xzavier0722.mc.plugin.slimefun4.storage.util.StorageCacheUtils;
import io.github.sefiraat.networks.NetworkStorage;
import io.github.sefiraat.networks.Networks;
import io.github.sefiraat.networks.network.stackcaches.ItemRequest;
import io.github.sefiraat.networks.slimefun.network.NetworkController;
import io.github.sefiraat.networks.slimefun.network.NetworkPowerNode;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.BlockFace;
import org.bukkit.inventory.ItemStack;
import org.bukkit.scheduler.BukkitRunnable;

import javax.annotation.Nonnull;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class NetworkNode {
Expand Down Expand Up @@ -126,6 +130,8 @@ private void killAdditionalController(@Nonnull Location location) {
BukkitRunnable runnable = new BukkitRunnable() {
@Override
public void run() {
//fix #99
NetworkController.wipeNetwork(location);
location.getWorld().dropItemNaturally(location, sfItem.getItem());
location.getBlock().setType(Material.AIR);
}
Expand All @@ -150,4 +156,5 @@ protected long retrieveBlockCharge() {
public long getPower() {
return this.power;
}

}
Loading

0 comments on commit da3e58c

Please sign in to comment.