Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
StarWishsama committed Dec 1, 2021
2 parents 4049504 + c9c62af commit 5213a32
Show file tree
Hide file tree
Showing 14 changed files with 260 additions and 114 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Table of contents
- [Release Candidate 29 (07 Nov 2021)](#release-candidate-29-06-nov-2021)
- [Release Candidate 30 (TBD)](#release-candidate-30-tbd)
- [Release Candidate 29 (07 Nov 2021)](#release-candidate-29-07-nov-2021)
- [Release Candidate 28 (06 Sep 2021)](#release-candidate-28-06-sep-2021)
- [Release Candidate 27 (03 Sep 2021)](#release-candidate-27-03-sep-2021)
- [Release Candidate 26 (20 Jul 2021)](#release-candidate-26-20-jul-2021)
Expand Down Expand Up @@ -29,6 +30,16 @@
- [Release Candidate 2 (29 Sep 2019)](#release-candidate-2-29-sep-2019)
- [Release Candidate 1 (26 Sep 2019)](#release-candidate-1-26-sep-2019)

## Release Candidate 30 (TBD)

#### Additions

#### Changes

#### Fixes
* Crimson and Warped Pressure Plates are now properly recognized as pressure plates
* Fixed #3336

## Release Candidate 29 (07 Nov 2021)

#### Additions
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,13 @@
<dependency>
<groupId>io.papermc</groupId>
<artifactId>paperlib</artifactId>
<version>1.0.6</version>
<version>1.0.7</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.konghq</groupId>
<artifactId>unirest-java</artifactId>
<version>3.13.3</version>
<version>3.13.4</version>
<scope>compile</scope>

<exclusions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,9 @@ public void postRegister() {
*/
public final void addOfficialWikipage(@Nonnull String page) {
Validate.notNull(page, "Wiki page cannot be null.");
wikiURL = Optional.of("https://github.com/Slimefun/Slimefun4/wiki/" + page);
// 转换链接
page = page.replace("#", "?id=");
wikiURL = Optional.of("https://slimefun.guizhanss.wiki/#/" + page);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,60 +128,60 @@ private static void addHeader(Player p, ChestMenu menu, ItemStack guide) {
// @formatter:off
menu.addItem(6, new CustomItemStack(Material.COMPARATOR,
"&e" + locale.getMessage(p, "guide.title.source"),
"", "&7Last Activity: &a" + NumberUtils.getElapsedTime(github.getLastUpdate()) + " ago",
"", "&7最近活动于: &a" + NumberUtils.getElapsedTime(github.getLastUpdate()) + " ",
"&7Forks: &e" + github.getForks(),
"&7Stars: &e" + github.getStars(),
"",
"&7&oSlimefun 4 is a community project,",
"&7&othe source code is available on GitHub",
"&7&oand if you want to keep this Plugin alive,",
"&7&othen please consider contributing to it",
"&7&oSlimefun 4 是一个由社区参与的项目,",
"&7&o源代码可以在 GitHub 上找到",
"&7&o如果你想让这个项目持续下去",
"&7&o你可以考虑对项目做出贡献",
"",
"&7\u21E8 &eClick to go to GitHub"
"&7\u21E8 &e点击前往汉化版 GitHub 仓库"
));
// @formatter:on

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

// @formatter:off
menu.addItem(8, new CustomItemStack(Material.KNOWLEDGE_BOOK,
"&3" + locale.getMessage(p, "guide.title.wiki"),
"", "&7Do you need help with an Item or machine?",
"&7You cannot figure out what to do?",
"&7Check out our community-maintained Wiki",
"&7and become one of our Editors!",
"", "&7你需要对物品或机器方面的帮助吗?",
"&7你不知道要干什么?",
"&7查看我们的由社区维护的维基",
"&7并考虑成为一名编辑者!",
"",
"&7\u21E8 &eClick to go to the official Slimefun Wiki"
"&7\u21E8 &e点击前往非官方中文 Wiki"
));
// @formatter:on

menu.addMenuClickHandler(8, (pl, slot, item, action) -> {
pl.closeInventory();
ChatUtils.sendURL(pl, "https://github.com/Slimefun/Slimefun4/wiki");
ChatUtils.sendURL(pl, "https://slimefun.guizhanss.wiki/");
return false;
});

// @formatter:off
menu.addItem(47, new CustomItemStack(Material.BOOKSHELF,
"&3" + locale.getMessage(p, "guide.title.addons"),
"",
"&7Slimefun is huge. But its addons are what makes",
"&7this plugin truly shine. Go check them out, some",
"&7of them may be exactly what you were missing out on!",
"&7Slimefun 是一个大型项目,但附属插件的存在",
"&7能让 Slimefun 真正的发光发亮",
"&7看一看它们,也许你要寻找的附属插件就在那里!",
"",
"&7Installed on this Server: &b" + Slimefun.getInstalledAddons().size(),
"&7该服务器已安装附属插件: &b" + Slimefun.getInstalledAddons().size(),
"",
"&7\u21E8 &eClick to see all available addons for Slimefun4"
"&7\u21E8 &e点击查看 Slimefun4 可用的附属插件"
));
// @formatter:on

menu.addMenuClickHandler(47, (pl, slot, item, action) -> {
pl.closeInventory();
ChatUtils.sendURL(pl, "https://github.com/Slimefun/Slimefun4/wiki/Addons");
ChatUtils.sendURL(pl, "https://slimefun.guizhanss.wiki/#/Addons");
return false;
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,8 @@ private SlimefunItems() {
public static final SlimefunItemStack SCROLL_OF_DIMENSIONAL_TELEPOSITION = new SlimefunItemStack("SCROLL_OF_DIMENSIONAL_TELEPOSITION", Material.PAPER, "&6维度传送卷轴", "", "&c这个卷轴可以便携地创建", "&c一个临时的黑洞", "&c将附近的实体都传送至", "&c另一个维度上", "&c所有东西都反转了", "", "&r就是说: 让实体转180°");
public static final SlimefunItemStack TOME_OF_KNOWLEDGE_SHARING = new SlimefunItemStack("TOME_OF_KNOWLEDGE_SHARING", Material.ENCHANTED_BOOK, "&6学识巨著", "&7主人: &bNone", "", "&e右键&7 以绑定你的所有研究", "", "", "&e右键&7 以获得前任主人的所有研究");
public static final SlimefunItemStack HARDENED_GLASS = new SlimefunItemStack("HARDENED_GLASS", Material.LIGHT_GRAY_STAINED_GLASS, "&7钢化玻璃", "", "&r可以抵抗爆炸");
public static final SlimefunItemStack WITHER_PROOF_OBSIDIAN = new SlimefunItemStack("WITHER_PROOF_OBSIDIAN", Material.OBSIDIAN, "&5防凋零黑曜石", "", "&r可以抵抗爆炸和", "&r凋零的攻击");
public static final SlimefunItemStack WITHER_PROOF_GLASS = new SlimefunItemStack("WITHER_PROOF_GLASS", Material.PURPLE_STAINED_GLASS, "&5防凋零玻璃", "", "&r可以抵抗爆炸和", "&r凋零的攻击");
public static final SlimefunItemStack WITHER_PROOF_OBSIDIAN = new SlimefunItemStack("WITHER_PROOF_OBSIDIAN", Material.OBSIDIAN, "&5防凋灵黑曜石", "", "&r可以抵抗爆炸和", "&r凋灵的攻击");
public static final SlimefunItemStack WITHER_PROOF_GLASS = new SlimefunItemStack("WITHER_PROOF_GLASS", Material.PURPLE_STAINED_GLASS, "&5防凋灵玻璃", "", "&r可以抵抗爆炸和", "&r凋灵的攻击");
public static final SlimefunItemStack REINFORCED_PLATE = new SlimefunItemStack("REINFORCED_PLATE", Material.PAPER, "&7钢筋板");
public static final SlimefunItemStack ANCIENT_PEDESTAL = new SlimefunItemStack("ANCIENT_PEDESTAL", Material.DISPENSER, "&d古代基座", "", "&5古代祭坛的一部分");
public static final SlimefunItemStack ANCIENT_ALTAR = new SlimefunItemStack("ANCIENT_ALTAR", Material.ENCHANTING_TABLE, "&d古代祭坛", "", "&5在世界里建造祭坛", "&5并用古老的仪式合成物品");
Expand Down Expand Up @@ -853,7 +853,7 @@ private SlimefunItems() {
public static final SlimefunItemStack ARMOR_AUTO_CRAFTER = new SlimefunItemStack("ARMOR_AUTO_CRAFTER", HeadTexture.ARMOR_AUTO_CRAFTER, "&2自动合成机 &8(盔甲锻造)", "", "&f将机器放在任意能装物品的方块上", "&f就能自动合成盔甲锻造台可以合成的东西", "", LoreBuilder.machine(MachineTier.ADVANCED, MachineType.MACHINE), "&8\u21E8 &e\u26A1 &7合成物品消耗 32 J");

public static final SlimefunItemStack IRON_GOLEM_ASSEMBLER = new SlimefunItemStack("IRON_GOLEM_ASSEMBLER", Material.IRON_BLOCK, "&6铁傀儡装配机", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), "&8\u21E8 &7冷却时间: &b30 秒", LoreBuilder.powerBuffer(4096), "&8\u21E8 &e\u26A1 &72048 J/个铁傀儡");
public static final SlimefunItemStack WITHER_ASSEMBLER = new SlimefunItemStack("WITHER_ASSEMBLER", Material.OBSIDIAN, "&5凋零装配机", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), "&8\u21E8 &7冷却时间: &b30 秒", "&8\u21E8 &e\u26A1 &74096 J 可储存", "&8\u21E8 &e\u26A1 &74096 J/个凋灵");
public static final SlimefunItemStack WITHER_ASSEMBLER = new SlimefunItemStack("WITHER_ASSEMBLER", Material.OBSIDIAN, "&5凋灵装配机", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), "&8\u21E8 &7冷却时间: &b30 秒", "&8\u21E8 &e\u26A1 &74096 J 可储存", "&8\u21E8 &e\u26A1 &74096 J/个凋灵");

public static final SlimefunItemStack TRASH_CAN = new SlimefunItemStack("TRASH_CAN_BLOCK", HeadTexture.TRASH_CAN, "&3垃圾箱", "", "&r可以把不要的物品放进这里");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.github.thebusybiscuit.slimefun4.implementation.items.multiblocks.miner;

import javax.annotation.ParametersAreNonnullByDefault;

import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;

Expand All @@ -21,6 +23,7 @@
*/
public class AdvancedIndustrialMiner extends IndustrialMiner {

@ParametersAreNonnullByDefault
public AdvancedIndustrialMiner(ItemGroup itemGroup, SlimefunItemStack item) {
super(itemGroup, item, Material.DIAMOND_BLOCK, true, 5);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,23 @@ public class IndustrialMiner extends MultiBlockMachine {
protected final Map<Location, MiningTask> activeMiners = new HashMap<>();
protected final List<MachineFuel> fuelTypes = new ArrayList<>();

private final OreDictionary oreDictionary;
private final ItemSetting<Boolean> canMineAncientDebris = new ItemSetting<>(this, "can-mine-ancient-debris", false);
private final ItemSetting<Boolean> canMineDeepslateOres = new ItemSetting<>(this, "can-mine-deepslate-ores", true);
private final boolean silkTouch;
private final int range;

@ParametersAreNonnullByDefault
public IndustrialMiner(ItemGroup itemGroup, SlimefunItemStack item, Material baseMaterial, boolean silkTouch, int range) {
super(itemGroup, item, new ItemStack[] { null, null, null, new CustomItemStack(Material.PISTON, "活塞 (朝上)"), new ItemStack(Material.CHEST), new CustomItemStack(Material.PISTON, "活塞 (朝上)"), new ItemStack(baseMaterial), new ItemStack(Material.BLAST_FURNACE), new ItemStack(baseMaterial) }, BlockFace.UP);

// @formatter:off
super(itemGroup, item, new ItemStack[] {
null, null, null,
new CustomItemStack(Material.PISTON, "Piston (facing up)"), new ItemStack(Material.CHEST), new CustomItemStack(Material.PISTON, "Piston (facing up)"),
new ItemStack(baseMaterial), new ItemStack(Material.BLAST_FURNACE), new ItemStack(baseMaterial)
}, BlockFace.UP);
// @formatter:on

this.oreDictionary = OreDictionary.forVersion(Slimefun.getMinecraftVersion());
this.range = range;
this.silkTouch = silkTouch;

Expand Down Expand Up @@ -114,67 +122,17 @@ protected void registerDefaultFuelTypes() {
/**
* This method returns the outcome that mining certain ores yields.
*
* @param ore
* @param material
* The {@link Material} of the ore that was mined
*
* @return The outcome when mining this ore
*/
public @Nonnull ItemStack getOutcome(@Nonnull Material ore) {
public @Nonnull ItemStack getOutcome(@Nonnull Material material) {
if (hasSilkTouch()) {
return new ItemStack(ore);
}

MinecraftVersion minecraftVersion = Slimefun.getMinecraftVersion();
Random random = ThreadLocalRandom.current();

if (minecraftVersion.isAtLeast(MinecraftVersion.MINECRAFT_1_17)) {
// In 1.17, breaking metal ores should get raw metals. Also support deepslate ores.
switch (ore) {
case DEEPSLATE_COAL_ORE:
return new ItemStack(Material.COAL);
case DEEPSLATE_DIAMOND_ORE:
return new ItemStack(Material.DIAMOND);
case DEEPSLATE_EMERALD_ORE:
return new ItemStack(Material.EMERALD);
case DEEPSLATE_REDSTONE_ORE:
return new ItemStack(Material.REDSTONE, 4 + random.nextInt(2));
case DEEPSLATE_LAPIS_ORE:
return new ItemStack(Material.LAPIS_LAZULI, 4 + random.nextInt(4));
case COPPER_ORE:
case DEEPSLATE_COPPER_ORE:
return new ItemStack(Material.RAW_COPPER);
case IRON_ORE:
case DEEPSLATE_IRON_ORE:
return new ItemStack(Material.RAW_IRON);
case GOLD_ORE:
case DEEPSLATE_GOLD_ORE:
return new ItemStack(Material.RAW_GOLD);
default:
break;
}
}

// In 1.16, breaking nether gold ores should get gold nuggets
if (minecraftVersion.isAtLeast(MinecraftVersion.MINECRAFT_1_16) && ore == Material.NETHER_GOLD_ORE) {
return new ItemStack(Material.GOLD_NUGGET, 2 + random.nextInt(4));
}

switch (ore) {
case COAL_ORE:
return new ItemStack(Material.COAL);
case DIAMOND_ORE:
return new ItemStack(Material.DIAMOND);
case EMERALD_ORE:
return new ItemStack(Material.EMERALD);
case REDSTONE_ORE:
return new ItemStack(Material.REDSTONE, 4 + random.nextInt(2));
case LAPIS_ORE:
return new ItemStack(Material.LAPIS_LAZULI, 4 + random.nextInt(4));
case NETHER_QUARTZ_ORE:
return new ItemStack(Material.QUARTZ);
default:
// This includes Iron and Gold ore (and Ancient Debris)
return new ItemStack(ore);
return new ItemStack(material);
} else {
Random random = ThreadLocalRandom.current();
return oreDictionary.getDrops(material, random);
}
}

Expand Down
Loading

0 comments on commit 5213a32

Please sign in to comment.