Skip to content

Commit

Permalink
yo patched stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Dueris committed Sep 17, 2023
1 parent 655f4e2 commit c60d3c1
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ private static void runEntity(Entity entity, JSONObject power) {
cmd = power.get("command").toString();
}
if(entity instanceof Player p){
Bukkit.dispatchCommand(p, "execute as $1 run ".replace("$1", p.getName()) + cmd);
Bukkit.dispatchCommand(new OriginCommandSender(), " execute at $1 run execute as $1 run ".replace("$1", p.getName()) + cmd);
}else{
Bukkit.dispatchCommand(new OriginCommandSender(), cmd);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,10 @@ public class FireProjectile extends CraftPower implements Listener {

public static void addCooldownPatch(Player p) {
in_cooldown_patch.add(p);
p.sendMessage("1");
new BukkitRunnable() {
@Override
public void run() {
in_cooldown_patch.remove(p);
p.sendMessage("2");
p.sendMessage(String.valueOf(in_cooldown_patch.contains(p)));
}
}.runTaskLater(GenesisMC.getPlugin(), 5);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import me.dueris.genesismc.utils.PowerContainer;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.Particle;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
Expand Down Expand Up @@ -81,6 +82,7 @@ public void run() {
CooldownStuff.addCooldown(p, origin, power.getTag(), power.getType(), cooldown, key);
setActive(power.getTag(), true);
p.setVelocity(new Vector(p.getVelocity().getX(), speed, p.getVelocity().getZ()));
p.spawnParticle(Particle.CLOUD, p.getLocation(), 100);
this.cancel();
}
}.runTaskTimer(GenesisMC.getPlugin(), 1L, 1L);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,10 @@ public static Map<String, BinaryOperator<Float>> getOperationMappingsFloat() {
}

public static void executeAttributeModify(String operation, Attribute attribute_modifier, double base_value, Player p, Double value) {
p.sendMessage("4");
BinaryOperator mathOperator = getOperationMappingsDouble().get(operation);
if (mathOperator != null) {
double result = (Double) mathOperator.apply(base_value, value);
p.sendMessage("5");
p.getAttribute(Attribute.valueOf(attribute_modifier.toString())).setBaseValue(result);
p.sendMessage("6");
} else {
Bukkit.getLogger().warning(LangConfig.getLocalizedString(p, "powers.errors.attribute"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public void setDescription(String newDescription) {
*/
public Boolean getHidden() {
Object hidden = powerFile.get("hidden");
if (hidden == null) return true;
if (hidden == null) return false;
return (Boolean) hidden;
}

Expand Down

0 comments on commit c60d3c1

Please sign in to comment.