Skip to content

Commit afb31e9

Browse files
Merge pull request #473 from IPECTER/main
Update to 1.20.4(3)
2 parents 1aac5f1 + 6aca20f commit afb31e9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+349
-227
lines changed

build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ plugins {
2323
id "de.undercouch.download" version "5.0.1"
2424
}
2525

26-
version '1.14.0-1.20.2'
27-
def nmsVersion = "1.20.2" //[NMS]
26+
version '1.14.0-1.20.4'
27+
def nmsVersion = "1.20.4" //[NMS]
2828
def apiVersion = '1.20'
2929
def specialSourceVersion = '1.11.0' //[NMS]
30-
def spigotJarVersion = '1.20.2-R0.1-SNAPSHOT' //[NMS]
30+
def spigotJarVersion = '1.20.4-R0.1-SNAPSHOT' //[NMS]
3131
def name = getRootProject().getName() // Defined in settings.gradle
3232
def main = 'com.volmit.adapt.Adapt'
3333
def manifoldVersion = '2023.1.29'
@@ -124,8 +124,8 @@ dependencies {
124124
// Provided or Classpath
125125
compileOnly 'org.projectlombok:lombok:1.18.24'
126126
annotationProcessor 'org.projectlombok:lombok:1.18.24'
127-
implementation 'org.spigotmc:spigot-api:1.20.2-R0.1-SNAPSHOT' //[NMS]
128-
implementation 'org.bukkit:craftbukkit:1.20.2-R0.1-SNAPSHOT' //[NMS]
127+
implementation 'org.spigotmc:spigot-api:1.20.4-R0.1-SNAPSHOT' //[NMS]
128+
implementation 'org.bukkit:craftbukkit:1.20.4-R0.1-SNAPSHOT' //[NMS]
129129

130130
// Cancer
131131
implementation 'art.arcane:Amulet:22.7.18'

libs/CrazyAdvancementsAPI-2.1.17.jar

97.5 KB
Binary file not shown.

libs/CrazyAdvancementsAPI.jar

-174 KB
Binary file not shown.

src/main/java/com/volmit/adapt/api/Component.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,9 @@ default void damageHand(Player p, int damage) {
799799

800800
if (dm.getDamage() > is.getType().getMaxDurability()) {
801801
p.getInventory().setItemInMainHand(new ItemStack(Material.AIR));
802-
p.getWorld().playSound(p.getLocation(), Sound.ENTITY_ITEM_BREAK, 1f, 1f);
802+
for (Player players : p.getWorld().getPlayers()) {
803+
players.playSound(p.getLocation(), Sound.ENTITY_ITEM_BREAK, 1f, 1f);
804+
}
803805
return;
804806
}
805807

@@ -824,7 +826,9 @@ default void damageOffHand(Player p, int damage) {
824826

825827
if (dm.getDamage() > is.getType().getMaxDurability()) {
826828
p.getInventory().setItemInOffHand(new ItemStack(Material.AIR));
827-
p.getWorld().playSound(p.getLocation(), Sound.ENTITY_ITEM_BREAK, 1f, 1f);
829+
for (Player players : p.getWorld().getPlayers()) {
830+
players.playSound(p.getLocation(), Sound.ENTITY_ITEM_BREAK, 1f, 1f);
831+
}
828832
return;
829833
}
830834

src/main/java/com/volmit/adapt/api/adaptation/Adaptation.java

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,11 @@ default boolean openGui(Player player, boolean checkPermissions) {
384384
}
385385

386386
default void openGui(Player player) {
387-
player.getWorld().playSound(player.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 1.1f, 1.255f);
388-
player.getWorld().playSound(player.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 0.7f, 0.655f);
389-
player.getWorld().playSound(player.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 0.3f, 0.855f);
387+
for (Player players : player.getWorld().getPlayers()) {
388+
players.playSound(player.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 1.1f, 1.255f);
389+
players.playSound(player.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 0.7f, 0.655f);
390+
players.playSound(player.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 0.3f, 0.855f);
391+
}
390392
Window w = new UIWindow(player);
391393
w.setTag("skill/" + getSkill().getName() + "/" + getName());
392394
w.setDecorator((window, position, row) -> new UIElement("bg").setName(" ").setMaterial(new MaterialBlock(Material.BLACK_STAINED_GLASS_PANE)));
@@ -433,12 +435,16 @@ default void openGui(Player player) {
433435
if (mylevel >= lvl) {
434436
unlearn(player, lvl, false);
435437

436-
player.getWorld().playSound(player.getLocation(), Sound.BLOCK_NETHER_GOLD_ORE_PLACE, 0.7f, 1.355f);
437-
player.getWorld().playSound(player.getLocation(), Sound.BLOCK_BEACON_DEACTIVATE, 0.4f, 0.755f);
438+
for (Player players : player.getWorld().getPlayers()) {
439+
players.playSound(player.getLocation(), Sound.BLOCK_NETHER_GOLD_ORE_PLACE, 0.7f, 1.355f);
440+
players.playSound(player.getLocation(), Sound.BLOCK_BEACON_DEACTIVATE, 0.4f, 0.755f);
441+
}
438442
w.close();
439443
if (AdaptConfig.get().getLearnUnlearnButtonDelayTicks() != 0) {
440444
if (isPermanent()) {
441-
player.getWorld().playSound(player.getLocation(), Sound.ENTITY_BLAZE_DEATH, 0.5f, 1.355f);
445+
for (Player players : player.getWorld().getPlayers()) {
446+
players.playSound(player.getLocation(), Sound.ENTITY_BLAZE_DEATH, 0.5f, 1.355f);
447+
}
442448
player.sendTitle(" ", C.RED + "" + C.BOLD + Localizer.dLocalize("snippets", "adaptmenu", "maynotunlearn") + " " + getDisplayName(mylevel), 1, 10, 11);
443449
} else {
444450
player.sendTitle(" ", C.GRAY + Localizer.dLocalize("snippets", "adaptmenu", "unlearned") + " " + getDisplayName(mylevel), 1, 10, 11);
@@ -451,24 +457,30 @@ default void openGui(Player player) {
451457
if (k >= c && getPlayer(player).getData().hasPowerAvailable(pc)) {
452458
if (getPlayer(player).getData().getSkillLine(getSkill().getName()).spendKnowledge(c)) {
453459
getPlayer(player).getData().getSkillLine(getSkill().getName()).setAdaptation(this, lvl);
454-
player.getWorld().playSound(player.getLocation(), Sound.BLOCK_NETHER_GOLD_ORE_PLACE, 0.9f, 1.355f);
455-
player.getWorld().playSound(player.getLocation(), Sound.BLOCK_ENCHANTMENT_TABLE_USE, 1.7f, 0.355f);
456-
player.getWorld().playSound(player.getLocation(), Sound.BLOCK_BEACON_POWER_SELECT, 0.4f, 0.155f);
457-
player.getWorld().playSound(player.getLocation(), Sound.BLOCK_BEACON_ACTIVATE, 0.2f, 1.455f);
458-
if (isPermanent()) {
459-
player.getWorld().playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 0.7f, 1.355f);
460-
player.getWorld().playSound(player.getLocation(), Sound.ITEM_GOAT_HORN_SOUND_1, 0.7f, 1.355f);
460+
for (Player players : player.getWorld().getPlayers()) {
461+
players.playSound(player.getLocation(), Sound.BLOCK_NETHER_GOLD_ORE_PLACE, 0.9f, 1.355f);
462+
players.playSound(player.getLocation(), Sound.BLOCK_ENCHANTMENT_TABLE_USE, 1.7f, 0.355f);
463+
players.playSound(player.getLocation(), Sound.BLOCK_BEACON_POWER_SELECT, 0.4f, 0.155f);
464+
players.playSound(player.getLocation(), Sound.BLOCK_BEACON_ACTIVATE, 0.2f, 1.455f);
465+
if (isPermanent()) {
466+
players.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 0.7f, 1.355f);
467+
players.playSound(player.getLocation(), Sound.ITEM_GOAT_HORN_SOUND_1, 0.7f, 1.355f);
468+
}
461469
}
462470
w.close();
463471
if (AdaptConfig.get().getLearnUnlearnButtonDelayTicks() != 0) {
464472
player.sendTitle(" ", C.GRAY + Localizer.dLocalize("snippets", "adaptmenu", "learned") + " " + getDisplayName(lvl), 1, 5, 11);
465473
}
466474
J.s(() -> openGui(player), AdaptConfig.get().getLearnUnlearnButtonDelayTicks());
467475
} else {
468-
player.getWorld().playSound(player.getLocation(), Sound.BLOCK_BAMBOO_HIT, 0.7f, 1.855f);
476+
for (Player players : player.getWorld().getPlayers()) {
477+
players.playSound(player.getLocation(), Sound.BLOCK_BAMBOO_HIT, 0.7f, 1.855f);
478+
}
469479
}
470480
} else {
471-
player.getWorld().playSound(player.getLocation(), Sound.BLOCK_BAMBOO_HIT, 0.7f, 1.855f);
481+
for (Player players : player.getWorld().getPlayers()) {
482+
players.playSound(player.getLocation(), Sound.BLOCK_BAMBOO_HIT, 0.7f, 1.855f);
483+
}
472484
}
473485
});
474486
de.addLore(" ");
@@ -496,9 +508,11 @@ default void openGui(Player player) {
496508
}
497509

498510
private void onGuiClose(Player player, boolean openPrevGui) {
499-
player.getWorld().playSound(player.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 1.1f, 1.255f);
500-
player.getWorld().playSound(player.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 0.7f, 0.655f);
501-
player.getWorld().playSound(player.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 0.3f, 0.855f);
511+
for (Player players : player.getWorld().getPlayers()) {
512+
players.playSound(player.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 1.1f, 1.255f);
513+
players.playSound(player.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 0.7f, 0.655f);
514+
players.playSound(player.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 0.3f, 0.855f);
515+
}
502516
if (openPrevGui) {
503517
getSkill().openGui(player);
504518
}

src/main/java/com/volmit/adapt/api/skill/Skill.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,11 @@ default void openGui(Player player) {
202202
if (!player.getClass().getSimpleName().equals("CraftPlayer")) {
203203
return;
204204
}
205-
player.getWorld().playSound(player.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 1.1f, 1.255f);
206-
player.getWorld().playSound(player.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 0.7f, 1.455f);
207-
player.getWorld().playSound(player.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 0.3f, 1.855f);
205+
for (Player players : player.getWorld().getPlayers()) {
206+
players.playSound(player.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 1.1f, 1.255f);
207+
players.playSound(player.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 0.7f, 1.455f);
208+
player.playSound(player.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 0.3f, 1.855f);
209+
}
208210
Window w = new UIWindow(player);
209211
w.setTag("skill/" + getName());
210212
w.setDecorator((window, position, row) -> new UIElement("bg").setName(" ").setMaterial(new MaterialBlock(Material.BLACK_STAINED_GLASS_PANE)));
@@ -252,9 +254,11 @@ default void openGui(Player player) {
252254
}
253255

254256
private void onGuiClose(Player player, boolean openPrevGui) {
255-
player.getWorld().playSound(player.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 1.1f, 1.255f);
256-
player.getWorld().playSound(player.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 0.7f, 1.455f);
257-
player.getWorld().playSound(player.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 0.3f, 1.855f);
257+
for (Player players : player.getWorld().getPlayers()) {
258+
players.playSound(player.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 1.1f, 1.255f);
259+
players.playSound(player.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 0.7f, 1.455f);
260+
player.playSound(player.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 0.3f, 1.855f);
261+
}
258262
if (openPrevGui) {
259263
SkillsGui.open(player);
260264
}

src/main/java/com/volmit/adapt/api/skill/SkillRegistry.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,10 @@ && canInteract(p, e.getClickedBlock().getLocation())
104104
(p.getInventory().getItemInOffHand().getType().equals(Material.AIR) || !p.getInventory().getItemInOffHand().getType().isBlock());
105105

106106
if (isAdaptActivator) {
107-
e.getClickedBlock().getWorld().playSound(e.getClickedBlock().getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 0.5f, 0.72f);
108-
e.getClickedBlock().getWorld().playSound(e.getClickedBlock().getLocation(), Sound.BLOCK_ENCHANTMENT_TABLE_USE, 0.35f, 0.755f);
107+
for (Player players : e.getClickedBlock().getWorld().getPlayers()) {
108+
players.playSound(e.getClickedBlock().getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 0.5f, 0.72f);
109+
players.playSound(e.getClickedBlock().getLocation(), Sound.BLOCK_ENCHANTMENT_TABLE_USE, 0.35f, 0.755f);
110+
}
109111
SkillsGui.open(p);
110112
e.setCancelled(true);
111113
p.getWorld().spawnParticle(Particle.CRIT_MAGIC, e.getClickedBlock().getLocation().clone().add(0.5, 1, 0.5), 25, 0, 0, 0, 1.1);

src/main/java/com/volmit/adapt/content/Enchantments.java

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -19,57 +19,5 @@
1919
package com.volmit.adapt.content;
2020

2121

22-
import com.volmit.adapt.Adapt;
23-
import org.bukkit.NamespacedKey;
24-
import org.bukkit.enchantments.Enchantment;
25-
import org.bukkit.enchantments.EnchantmentTarget;
26-
import org.bukkit.inventory.ItemStack;
27-
import org.jetbrains.annotations.NotNull;
28-
2922
public class Enchantments {
30-
public static final Enchantment BOUND = new Enchantment(new NamespacedKey(Adapt.instance, "bound")) {
31-
@NotNull
32-
@Override
33-
public String getName() {
34-
return "Bound";
35-
}
36-
37-
@Override
38-
public int getMaxLevel() {
39-
return 0;
40-
}
41-
42-
@Override
43-
public int getStartLevel() {
44-
return 0;
45-
}
46-
47-
@NotNull
48-
@Override
49-
public EnchantmentTarget getItemTarget() {
50-
return EnchantmentTarget.ALL;
51-
}
52-
53-
@Override
54-
public boolean isTreasure() {
55-
return false;
56-
}
57-
58-
@Override
59-
public boolean isCursed() {
60-
return false;
61-
}
62-
63-
@Override
64-
public boolean conflictsWith(@NotNull Enchantment other) { // ignore
65-
return false;
66-
}
67-
68-
@Override
69-
public boolean canEnchantItem(@NotNull ItemStack item) {
70-
return false;
71-
}
72-
};
73-
74-
7523
}

src/main/java/com/volmit/adapt/content/adaptation/agility/AgilitySuperJump.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,10 @@ public void on(PlayerMoveEvent e) {
114114
lastJump.remove(p);
115115
}
116116
if (p.getLocation().getBlock().getType() != Material.LADDER && velocity.getY() > jumpVelocity && p.isOnline()) {
117-
p.getWorld().playSound(p.getLocation(), Sound.ITEM_ARMOR_EQUIP_LEATHER, 1.25f, 0.7f);
118-
p.getWorld().playSound(p.getLocation(), Sound.ITEM_ARMOR_EQUIP_LEATHER, 1.25f, 1.7f);
117+
for (Player players : p.getWorld().getPlayers()) {
118+
players.playSound(p.getLocation(), Sound.ITEM_ARMOR_EQUIP_LEATHER, 1.25f, 0.7f);
119+
players.playSound(p.getLocation(), Sound.ITEM_ARMOR_EQUIP_LEATHER, 1.25f, 1.7f);
120+
}
119121
if (getConfig().showParticles) {
120122
p.getWorld().spawnParticle(Particle.BLOCK_CRACK, p.getLocation().clone().add(0, 0.3, 0), 15, 0.1, 0.8, 0.1, 0.1, p.getLocation().getBlock().getRelative(BlockFace.DOWN).getBlockData());
121123
}

src/main/java/com/volmit/adapt/content/adaptation/agility/AgilityWallJump.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,19 @@ public void onTick() {
131131

132132
if (!jumped && !p.hasGravity()) {
133133
p.setGravity(true);
134-
p.getLocation().getWorld().playSound(p.getLocation(), Sound.ITEM_ARMOR_EQUIP_LEATHER, 1f, 0.439f);
134+
for (Player players : p.getWorld().getPlayers()) {
135+
players.playSound(p.getLocation(), Sound.ITEM_ARMOR_EQUIP_LEATHER, 1f, 0.439f);
136+
}
135137
}
136138
continue;
137139
}
138140

139141
if (canStick(p)) {
140142
if (p.hasGravity()) {
141-
p.getLocation().getWorld().playSound(p.getLocation(), Sound.ITEM_ARMOR_EQUIP_LEATHER, 1f, 0.89f);
142-
p.getLocation().getWorld().playSound(p.getLocation(), Sound.ITEM_ARMOR_EQUIP_CHAIN, 1f, 1.39f);
143+
for (Player players : p.getWorld().getPlayers()) {
144+
players.playSound(p.getLocation(), Sound.ITEM_ARMOR_EQUIP_LEATHER, 1f, 0.89f);
145+
players.playSound(p.getLocation(), Sound.ITEM_ARMOR_EQUIP_CHAIN, 1f, 1.39f);
146+
}
143147
if (getConfig().showParticles && getStick(p) != null) {
144148
p.getWorld().spawnParticle(Particle.BLOCK_CRACK, p.getLocation().clone().add(0, 0.3, 0), 15, 0.1, 0.2, 0.1, 0.1, getStick(p).getBlockData());
145149
}

0 commit comments

Comments
 (0)