Skip to content

Commit 52d91d5

Browse files
Merge pull request #398 from VolmitSoftware/Development
Development
2 parents 166c03c + 3333e04 commit 52d91d5

File tree

10 files changed

+67
-75
lines changed

10 files changed

+67
-75
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ plugins {
2323
id "de.undercouch.download" version "5.0.1"
2424
}
2525

26-
version '1.6.0-1.19.3'
26+
version '1.6.1-1.19.3'
2727
def nmsVersion = "1.19.3" //[NMS]
2828
def apiVersion = '1.19'
2929
def specialSourceVersion = '1.11.0' //[NMS]

src/main/java/com/volmit/adapt/content/adaptation/axe/AxeWoodVeinminer.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ public void on(BlockBreakEvent e) {
8686
}
8787

8888
if (isLog(new ItemStack(e.getBlock().getType()))) {
89-
Adapt.info("Axe Wood Veinminer: " + p.getName() + " is using " + e.getBlock().getType() + " at " + e.getBlock().getLocation());
9089
Block block = e.getBlock();
9190
Set<Block> blockMap = new HashSet<>();
9291
int blockCount = 0;
@@ -114,7 +113,6 @@ public void on(BlockBreakEvent e) {
114113

115114
J.s(() -> {
116115
for (Block blocks : blockMap) {
117-
Adapt.info("Axe Wood Veinminer: " + p.getName() + " is breaking " + blocks.getType() + " at " + blocks.getLocation());
118116
if (getPlayer(p).getData().getSkillLines().get("axes").getAdaptations().get("axe-drop-to-inventory") != null && getPlayer(p).getData().getSkillLines().get("axes").getAdaptations().get("axe-drop-to-inventory").getLevel() > 0) {
119117
Collection<ItemStack> items = blocks.getDrops();
120118
for (ItemStack item : items) {

src/main/java/com/volmit/adapt/content/adaptation/brewing/BrewingAbsorption.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public BrewingAbsorption() {
5050
.ingredient(Material.QUARTZ)
5151
.basePotion(PotionBuilder.vanilla(PotionBuilder.Type.REGULAR, PotionType.INSTANT_HEAL, false, false))
5252
.result(PotionBuilder.of(PotionBuilder.Type.REGULAR)
53-
.setName("Bottled Haste")
53+
.setName("Bottled Absorption")
5454
.setColor(Color.GRAY)
5555
.addEffect(PotionEffectType.ABSORPTION, 1200, 1, true, true, true)
5656
.build())

src/main/java/com/volmit/adapt/content/adaptation/brewing/BrewingFatigue.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ public BrewingFatigue() {
7171

7272
@Override
7373
public void addStats(int level, Element v) {
74-
v.addLore(C.GREEN + "+ " + Localizer.dLocalize("brewing", "absorption", "lore1"));
75-
v.addLore(C.GREEN + "+ " + Localizer.dLocalize("brewing", "absorption", "lore2"));
74+
v.addLore(C.GREEN + "+ " + Localizer.dLocalize("brewing", "fatigue", "lore1"));
75+
v.addLore(C.GREEN + "+ " + Localizer.dLocalize("brewing", "fatigue", "lore2"));
7676
}
7777

7878

src/main/java/com/volmit/adapt/content/adaptation/brewing/BrewingHunger.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ public BrewingHunger() {
7171

7272
@Override
7373
public void addStats(int level, Element v) {
74-
v.addLore(C.GREEN + "+ " + Localizer.dLocalize("brewing", "absorption", "lore1"));
75-
v.addLore(C.GREEN + "+ " + Localizer.dLocalize("brewing", "absorption", "lore2"));
74+
v.addLore(C.GREEN + "+ " + Localizer.dLocalize("brewing", "hunger", "lore1"));
75+
v.addLore(C.GREEN + "+ " + Localizer.dLocalize("brewing", "hunger", "lore2"));
7676
}
7777

7878

src/main/java/com/volmit/adapt/content/adaptation/rift/RiftAccess.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
import org.bukkit.inventory.InventoryHolder;
4242
import org.bukkit.inventory.InventoryView;
4343
import org.bukkit.inventory.ItemStack;
44-
import org.bukkit.inventory.meta.ItemMeta;
4544
import org.bukkit.potion.PotionEffectType;
4645
import us.lynuxcraft.deadsilenceiv.advancedchests.AdvancedChestsAPI;
4746

@@ -83,7 +82,6 @@ public void addStats(int level, Element v) {
8382
public void on(PlayerInteractEvent e) {
8483
Player p = e.getPlayer();
8584
ItemStack hand = p.getInventory().getItemInMainHand();
86-
ItemMeta handMeta = hand.getItemMeta();
8785
Block block = e.getClickedBlock();
8886

8987
ItemStack offhand = p.getInventory().getItemInOffHand();

src/main/java/com/volmit/adapt/content/adaptation/rift/RiftGate.java

Lines changed: 45 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
package com.volmit.adapt.content.adaptation.rift;
2020

21+
import com.volmit.adapt.Adapt;
2122
import com.volmit.adapt.api.adaptation.SimpleAdaptation;
2223
import com.volmit.adapt.api.recipe.AdaptRecipe;
2324
import com.volmit.adapt.content.item.BoundEyeOfEnder;
@@ -26,19 +27,14 @@
2627
import com.volmit.adapt.util.J;
2728
import com.volmit.adapt.util.Localizer;
2829
import lombok.NoArgsConstructor;
29-
import org.bukkit.Location;
30-
import org.bukkit.Material;
31-
import org.bukkit.Particle;
32-
import org.bukkit.Sound;
30+
import org.bukkit.*;
3331
import org.bukkit.entity.Player;
3432
import org.bukkit.event.EventHandler;
3533
import org.bukkit.event.player.PlayerInteractEvent;
3634
import org.bukkit.event.player.PlayerTeleportEvent;
37-
import org.bukkit.inventory.EquipmentSlot;
3835
import org.bukkit.inventory.ItemStack;
3936
import org.bukkit.potion.PotionEffect;
4037
import org.bukkit.potion.PotionEffectType;
41-
import org.bukkit.util.Vector;
4238

4339

4440
public class RiftGate extends SimpleAdaptation<RiftGate.Config> {
@@ -74,45 +70,44 @@ public void addStats(int level, Element v) {
7470
public void on(PlayerInteractEvent e) {
7571
Player p = e.getPlayer();
7672
ItemStack hand = p.getInventory().getItemInMainHand();
77-
Location location;
73+
Location location = e.getClickedBlock() == null ? p.getLocation() : e.getClickedBlock().getLocation();
7874

79-
ItemStack offhand = p.getInventory().getItemInOffHand();
80-
if (e.getHand() != null && e.getHand().equals(EquipmentSlot.OFF_HAND) && BoundEyeOfEnder.isBindableItem(offhand)) {
81-
e.setCancelled(true);
82-
return;
83-
}
75+
if (p.getInventory().getItemInMainHand().getType().equals(Material.ENDER_EYE)
76+
&& !p.hasCooldown(Material.ENDER_EYE)
77+
&& hasAdaptation(p)
78+
&& BoundEyeOfEnder.isBindableItem(hand)) {
8479

85-
if (BoundEyeOfEnder.isBindableItem(hand) && hasAdaptation(p)) {
8680
e.setCancelled(true);
87-
if (!hasAdaptation(p)) {
88-
return;
89-
}
90-
if (e.getClickedBlock() == null) {
91-
location = p.getLocation();
92-
} else {
93-
location = new Location(e.getClickedBlock().getLocation().getWorld(), e.getClickedBlock().getLocation().getX() + 0.5, e.getClickedBlock().getLocation().getY() + 1, e.getClickedBlock().getLocation().getZ() + 0.5);
94-
}
81+
Adapt.verbose(" - Player Main hand: " + hand.getType());
9582
switch (e.getAction()) {
9683
case LEFT_CLICK_BLOCK -> {
9784
if (p.isSneaking()) {
85+
Adapt.verbose("Linking eye");
9886
linkEye(p, location);
9987
}
10088
}
10189
case LEFT_CLICK_AIR -> {
10290
if (p.isSneaking() && isBound(hand)) {
91+
Adapt.verbose("Unlinking eye");
10392
unlinkEye(p);
10493
} else if (p.isSneaking() && !isBound(hand)) {
94+
Adapt.verbose("Linking eye");
10595
linkEye(p, location);
10696
}
10797
}
10898
case RIGHT_CLICK_AIR, RIGHT_CLICK_BLOCK -> // use
99+
{
100+
if (isBound(hand)) {
109101
openEye(p);
102+
}
103+
}
110104
}
111105
}
112106
}
113107

114108

115109
private void openEye(Player p) {
110+
Adapt.verbose("Using eye");
116111
Location l = BoundEyeOfEnder.getLocation(p.getInventory().getItemInMainHand());
117112
ItemStack hand = p.getInventory().getItemInMainHand();
118113

@@ -126,37 +121,38 @@ private void openEye(Player p) {
126121
}
127122
p.setCooldown(Material.ENDER_EYE, 150);
128123

129-
if (getPlayer(p).getData().getSkillLines().get("rift").getAdaptations().get("rift-resist") != null
130-
&& getPlayer(p).getData().getSkillLines().get("rift").getAdaptations().get("rift-resist").getLevel() > 0) {
124+
if (RiftResist.hasRiftResistPerk(getPlayer(p))) {
131125
RiftResist.riftResistStackAdd(p, 150, 3);
132126
}
127+
133128
p.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 100, 10, true, false, false));
134129
p.addPotionEffect(new PotionEffect(PotionEffectType.LEVITATION, 85, 0, true, false, false));
135130
p.playSound(l, Sound.BLOCK_LODESTONE_PLACE, 1f, 0.1f);
136131
p.playSound(l, Sound.BLOCK_BELL_RESONATE, 1f, 0.1f);
137-
J.a(() -> {
138-
double d = 2;
139-
double pcd = 1000;
140-
double y = 0.1;
141-
while (pcd > 0) {
142132

143-
for (int i = 0; i < 16; i++) {
144-
if (getConfig().showParticles) {
145133

146-
p.getWorld().spawnParticle(Particle.ASH, p.getLocation().clone()
147-
.add(Vector.getRandom().subtract(Vector.getRandom()).setY(y).normalize().multiply(d)), 1, 0, 0, 0, 0);
148-
}
149-
}
150-
pcd = pcd - 20;
151-
d = d - 0.04;
152-
y = y * 1.07;
153-
J.sleep(80);
134+
J.a(() -> {
135+
long dur = 4000; // time in miliseconds
136+
double radius = 2.0;
137+
double adder = 0.0;
138+
Color color = Color.fromBGR(0, 0, 0);
139+
vfxFastRing(p.getLocation(), radius, color);
140+
while (dur > 0) {
141+
dur -= 50;
142+
adder += 0.02;
143+
radius *= 0.9; // reduce the radius by 20%
144+
vfxFastRing(p.getLocation().add(0, adder, 0), radius, color);
145+
J.sleep(50);
154146
}
155-
vfxLevelUp(p);
156-
p.getLocation().getWorld().playSound(p.getLocation(), Sound.BLOCK_ENDER_CHEST_OPEN, 5.35f, 0.1f);
157-
J.s(() -> p.teleport(l, PlayerTeleportEvent.TeleportCause.PLUGIN));
158147
});
159-
}
148+
vfxLevelUp(p);
149+
p.playSound(p.getLocation(), Sound.BLOCK_ENDER_CHEST_OPEN, 5.35f, 0.1f);
150+
J.s(() -> {
151+
p.teleport(l, PlayerTeleportEvent.TeleportCause.PLUGIN);
152+
vfxLevelUp(p);
153+
p.playSound(p.getLocation(), Sound.BLOCK_ENDER_CHEST_OPEN, 5.35f, 0.1f);
154+
},85);
155+
}
160156

161157
private boolean isBound(ItemStack stack) {
162158
return stack.getType().equals(Material.ENDER_EYE) && BoundEyeOfEnder.getLocation(stack) != null;
@@ -202,11 +198,11 @@ public boolean isPermanent() {
202198
return getConfig().permanent;
203199
}
204200

205-
@NoArgsConstructor
206-
protected static class Config {
207-
boolean permanent = false;
208-
boolean enabled = true;
209-
boolean consumeOnUse = true;
210-
boolean showParticles = true;
211-
}
201+
@NoArgsConstructor
202+
protected static class Config {
203+
boolean permanent = false;
204+
boolean enabled = true;
205+
boolean consumeOnUse = true;
206+
boolean showParticles = true;
207+
}
212208
}

src/main/java/com/volmit/adapt/content/adaptation/rift/RiftResist.java

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

2121
import com.volmit.adapt.api.adaptation.SimpleAdaptation;
22+
import com.volmit.adapt.api.world.AdaptPlayer;
2223
import com.volmit.adapt.util.C;
2324
import com.volmit.adapt.util.Element;
2425
import com.volmit.adapt.util.Localizer;
@@ -59,6 +60,10 @@ static void riftResistStackAdd(Player p, int duration, int amplifier) {
5960
p.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, duration, amplifier, true, false, false));
6061
}
6162

63+
public static boolean hasRiftResistPerk(AdaptPlayer p) {
64+
return p.getData().getLevel() > 0;
65+
}
66+
6267
@Override
6368
public void addStats(int level, Element v) {
6469
v.addLore(C.ITALIC + Localizer.dLocalize("rift", "resist", "lore1"));

src/main/java/com/volmit/adapt/content/item/BoundEnderPearl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ public static boolean isBindableItem(ItemStack t) {
6060
}
6161
Adapt.verbose("Checking if item is bindable: " + t.getType().name());
6262
if (t.getItemMeta() == null || t.getItemMeta().getLore() == null) {
63-
Adapt.verbose("Item is not bindable: " + t.getType().name());
63+
Adapt.verbose("Pearl is not bindable: " + t.getType().name());
6464
return false;
6565
}
6666
if (t.getItemMeta().getLore().get(0).contains(Localizer.dLocalize("items", "boundenderperal", "name"))) {
67-
Adapt.verbose("Item is bindable: " + t.getType().name());
67+
Adapt.verbose("Ender Pearl is bindable: " + t.getType().name());
6868
return true;
6969
} else {
7070
Adapt.verbose("Item is not bindable: " + t.getType().name());

src/main/java/com/volmit/adapt/content/item/BoundEyeOfEnder.java

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,16 @@ public static ItemStack withData(Location t) {
5555
}
5656

5757
public static boolean isBindableItem(ItemStack t) {
58-
if (!t.getType().equals(Material.ENDER_EYE)) {
59-
return false;
60-
}
61-
Adapt.verbose("Checking if item is bindable: " + t.getType().name());
62-
if (t.getItemMeta() == null || t.getItemMeta().getLore() == null) {
63-
Adapt.verbose("Item is not bindable: " + t.getType().name());
64-
return false;
65-
}
66-
if (t.getItemMeta().getLore().get(0).contains(Localizer.dLocalize("items", "boundeyeofender", "name"))) {
67-
Adapt.verbose("Item is bindable: " + t.getType().name());
68-
return true;
69-
} else {
70-
Adapt.verbose("Item is not bindable: " + t.getType().name());
71-
return false;
58+
Adapt.verbose("Checking if item is a bindable Endereye: " + t.getType().name());
59+
if (t.getType().equals(Material.ENDER_EYE)) {
60+
if (t.getItemMeta() != null && t.getItemMeta().getLore() != null) {
61+
if (t.getItemMeta().getLore().get(0).contains(Localizer.dLocalize("items", "boundeyeofender", "name"))) {
62+
Adapt.verbose("Eye of ender is bindable: " + t.getType().name());
63+
return true;
64+
}
65+
}
7266
}
67+
return false;
7368
}
7469

7570
@Override

0 commit comments

Comments
 (0)