Skip to content

Commit

Permalink
fix(AutoFarmer): 修复能够收获下界自然生成的火的问题
Browse files Browse the repository at this point in the history
perf(DynamicLight): 优化代码
  • Loading branch information
0XPYEX0 committed May 17, 2024
1 parent 3ecad30 commit ec18f96
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import me.xpyex.plugin.xplib.bukkit.util.inventory.ItemUtil;
import me.xpyex.plugin.xplib.bukkit.util.language.LangUtil;
import me.xpyex.plugin.xplib.bukkit.util.strings.MsgUtil;
import me.xpyex.plugin.xplib.bukkit.util.strings.StrUtil;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.block.data.Ageable;
Expand Down Expand Up @@ -41,7 +42,7 @@ public void onRightClick(PlayerInteractEvent event) {

BlockData blockData = event.getClickedBlock().getBlockData();
if (blockData instanceof Ageable && ((Ageable) blockData).getAge() >= ((Ageable) blockData).getMaximumAge()) {
if (event.getClickedBlock().getType().toString().contains("_STEM")) { //西瓜、南瓜的茎
if (StrUtil.endsWithIgnoreCaseOr(event.getClickedBlock().getType().toString(), "_STEM", "FIRE")) { //西瓜、南瓜的茎; 火
return;
}
BlockBreakEvent blockBreakEvent = new BlockBreakEvent(event.getClickedBlock(), event.getPlayer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void run() {
if (projectile.isValid() && projectile.getFireTicks() > 0) {
Bukkit.getOnlinePlayers().forEach(player -> {
if (SettingsUtil.getConfig(player).DynamicLight) {
if (player.getLocation().getWorld().equals(lastLoc.getWorld())) {
if (player.getWorld().equals(lastLoc.getWorld())) {
player.sendBlockChange(lastLoc, lastLoc.getBlock().getBlockData());
lastLoc = projectile.getLocation().clone();
if (ItemType.isAir(lastLoc.getBlock().getType())) {
Expand Down

0 comments on commit ec18f96

Please sign in to comment.