Skip to content

Commit dfbbb39

Browse files
committed
Fixed NSM on CRAFTING TABLE usage at mc 1.8.8
1 parent 96a0c50 commit dfbbb39

File tree

3 files changed

+21
-11
lines changed

3 files changed

+21
-11
lines changed

.github/CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
### 1.4.3 Release (07.2025)
1+
### 1.4.3 Release (10.07.2025)
22
* Added 1.21.6-7 support!
33
* Updated XSeries to 13.3.3
44
* Updated FastBoard to 2.1.5
55
* Updated FastInv to 3.1.2
66
* Fixed NPE on ServerListPing if plugin isn't fully started / arenaregistry not ready
7+
* Fixed NSM on CRAFTING TABLE usage at mc 1.8.8
8+
* Internal Code Cleanup such as prefixes and MiscUtils
9+
* Changed Hex code support to only support 6 digit long hex code!
710

811
### 1.4.2 Release (09.06.2025)
912
* Added BLOCK_IN_GAME_INTERACTIONS option to block interactions whileas ingame

MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/events/Events.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
import plugily.projects.minigamesbox.classic.PluginMain;
4545
import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder;
4646
import plugily.projects.minigamesbox.classic.utils.version.ServerVersion;
47+
import plugily.projects.minigamesbox.classic.utils.version.VersionUtils;
4748
import plugily.projects.minigamesbox.classic.utils.version.events.api.PlugilyPlayerInteractEvent;
4849
import plugily.projects.minigamesbox.classic.utils.version.events.api.PlugilyPlayerSwapHandItemsEvent;
4950

@@ -189,7 +190,7 @@ public void onCraft(PlugilyPlayerInteractEvent event) {
189190
return;
190191
}
191192
if(event.getPlayer().getTargetBlock(null, 7).getType() == XMaterial.CRAFTING_TABLE.parseMaterial()) {
192-
if(event.getAction().isRightClick()) {
193+
if(VersionUtils.isRightClick(event.getAction())) {
193194
event.setCancelled(true);
194195
}
195196
}

MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/utils/version/VersionUtils.java

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import org.bukkit.entity.HumanEntity;
3737
import org.bukkit.entity.LivingEntity;
3838
import org.bukkit.entity.Player;
39+
import org.bukkit.event.block.Action;
3940
import org.bukkit.event.entity.CreatureSpawnEvent;
4041
import org.bukkit.inventory.EquipmentSlot;
4142
import org.bukkit.inventory.ItemStack;
@@ -445,7 +446,6 @@ public static double getMaxHealth(LivingEntity entity) {
445446
}
446447

447448

448-
449449
java.util.Optional<org.bukkit.attribute.AttributeInstance> at = MiscUtils.getEntityAttribute(entity, XAttribute.MAX_HEALTH.get());
450450
return at.map(AttributeInstance::getValue).orElse(20D);
451451
}
@@ -643,16 +643,22 @@ public static Entity spawnEntity(Location location, EntityType entityType) {
643643
}
644644

645645
public static BannerMeta setBaseColor(BannerMeta meta, DyeColor color) {
646-
BlockStateMeta bsm = (BlockStateMeta) meta;
647-
BlockState state = ((BlockStateMeta) meta).getBlockState();
648-
if (state instanceof Banner) {
649-
((Banner) state).setBaseColor(color);
650-
state.update(true);
651-
}
652-
bsm.setBlockState(state);
646+
BlockStateMeta bsm = (BlockStateMeta) meta;
647+
BlockState state = ((BlockStateMeta) meta).getBlockState();
648+
if(state instanceof Banner) {
649+
((Banner) state).setBaseColor(color);
650+
state.update(true);
651+
}
652+
bsm.setBlockState(state);
653653
return meta;
654+
}
654655

656+
public static boolean isLeftClick(Action action) {
657+
return action == Action.LEFT_CLICK_AIR || action == Action.LEFT_CLICK_BLOCK;
658+
}
655659

656-
}
660+
public static boolean isRightClick(Action action) {
661+
return action == Action.RIGHT_CLICK_AIR || action == Action.RIGHT_CLICK_BLOCK;
662+
}
657663

658664
}

0 commit comments

Comments
 (0)