Code Monkey home page Code Monkey logo

guardianbeam's Introduction

Hi there ๐Ÿ‘‹

  • ๐Ÿ”ญ Iโ€™m working on a medical robotic research project in Python. I also create Java plugins for Minecraft servers and personal projects in C# and OCaml.
  • ๐ŸŒฑ Iโ€™m currently learning advanced OCaml and C++.
  • ๐Ÿ’ฌ Ask me about Java questions.
  • ๐Ÿ“ซ How to reach me: [email protected], my Discord server.
  • ๐Ÿ˜„ Pronouns: He/him
  • ๐Ÿ“š Studying computer engineering at INSA Rennes, I am responsible for the network team for InsaLan!
  • ๐Ÿ’ป Typst enthusiast!

guardianbeam's People

Contributors

chrisgdt avatar skytasul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

guardianbeam's Issues

Laser stop moving after first move

Hey.

I tried to make something like gobo, but when I firstly move laser's end it reach end location but isn't moving to another end location...

The Laser Beam API is disabled. An error has occured during initialization.

The Laser Beam API is disabled. An error has occured during initialization.

I get this error. Any idea how I can solve it?

I'm using 1.16.5

[20:54:38 WARN]: java.lang.IllegalStateException: The Laser Beam API is disabled. An error has occured during initialization.
[20:54:38 WARN]: at me.arnaumas.altres.Laser.(Laser.java:61)
[20:54:38 WARN]: at me.arnaumas.altres.Laser$GuardianLaser.(Laser.java:309)
[20:54:38 WARN]: at me.arnaumas.commands.RaycastCommand.torre(RaycastCommand.java:85)
[20:54:38 WARN]: at me.arnaumas.events.EventsFacade.onMoures(EventsFacade.java:222)
[20:54:38 WARN]: at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor123.execute(Unknown Source)
[20:54:38 WARN]: at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69)
[20:54:38 WARN]: at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80)
[20:54:38 WARN]: at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70)
[20:54:38 WARN]: at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:624)
[20:54:38 WARN]: at net.minecraft.server.v1_16_R3.PlayerConnection.a(PlayerConnection.java:1424)
[20:54:38 WARN]: at net.minecraft.server.v1_16_R3.PacketPlayInFlying.a(SourceFile:122)
[20:54:38 WARN]: at net.minecraft.server.v1_16_R3.PacketPlayInFlying$PacketPlayInPosition.a(SourceFile:56)
[20:54:38 WARN]: at net.minecraft.server.v1_16_R3.PlayerConnectionUtils.lambda$ensureMainThread$1(PlayerConnectionUtils.java:35)
[20:54:38 WARN]: at net.minecraft.server.v1_16_R3.TickTask.run(SourceFile:18)
[20:54:38 WARN]: at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136)
[20:54:38 WARN]: at net.minecraft.server.v1_16_R3.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23)
[20:54:38 WARN]: at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109)
[20:54:38 WARN]: at net.minecraft.server.v1_16_R3.MinecraftServer.bb(MinecraftServer.java:1266)
[20:54:38 WARN]: at net.minecraft.server.v1_16_R3.MinecraftServer.executeNext(MinecraftServer.java:1259)
[20:54:38 WARN]: at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119)
[20:54:38 WARN]: at net.minecraft.server.v1_16_R3.MinecraftServer.sleepForTick(MinecraftServer.java:1220)
[20:54:38 WARN]: at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1134)
[20:54:38 WARN]: at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291)
[20:54:38 WARN]: at java.lang.Thread.run(Unknown Source)

Lasers can not be re-started after being stopped for the first time.

This bug has caused me very much headache as I need to constantly create new GuardianLaser instances every time I want a laser to turn back on from being stopped. Example code is below. In very rapid succession of stops and starts, this causes a very bad race condition for me EVEN AFTER USING A ReentrantLock AND the synchronized keyword!

`import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;

public class TestCommand implements CommandExecutor {
Laser.GuardianLaser lsr;

@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
    if(sender instanceof Player) {
        if (args[0].equals("new")) {
            try {
                lsr = new Laser.GuardianLaser(((Player) sender).getLocation(),((Player) sender).getLocation().add(0,5,0),-1,128);
            } catch (ReflectiveOperationException e) {
                e.printStackTrace();
            }
        } else if (args[0].equals("on")) {
            if(!lsr.isStarted()) lsr.start(// ADD PLUGIN HERE!);
        } else if (args[0].equals("off")) {
            if (lsr.isStarted()) lsr.stop();
        }
        return true;
    }
    return false;
}

}`
You can try this out for yourself by doing /test new, /test on, /test off, /test on. Nothing happens after the laser is turned off for the first time. This bug also affects the CrystalLasers.

Environment: 1.17.1, java 16, PaperMC server, no other related plugins that could cause issues. Latest 2.0.0 version of this resource.

Runnable for the duration of the laser

If exists a better form but if i wanna make tasks during the beam i need make a parallel task, can be good a method like a runnable every second of the duration of laser.

Laser endpoints extend out slightly farther than they should

2021-09-01_01 40 43
In the screenshot, you can see the end point of a laser sticking out farther than it should, since in code the location the beam is pointing at is at the exact intersection between these two beams. (One has their starting point at the intersection, one has their end point)
2021-09-01_01 42 46
In this screenshot you see the same issue, all these beams have their end points pointing at the exact same location (I have verified this!) yet they extend out slightly farther than they should.

"team already exists" error appear on bungeecoord when using Laser

As said bungeecoord kick all players with message team already exists when using Laser.
Actuall first laser works correctly and only the second time I use it it breaks.
The solution of changing "noclip" to something else doesn't work as now the error says that team doesn't exists and gives new name given by me. Also now first time the laser works invisible mob pusheh player around.

Feature Request: Add support for 1.8.8

Hey, I would really appreciate if you at least try to add support for 1.8.8. I have tried to backport the API myself but I could never get it to work. I know there's probably a reason for you not having it work with 1.8.8, but I know it must be possible since there's the other people who have done it (although in a bit of a rough and glitchy way)

The reason it means so much to me is because there's only 1 API I know of that does this in 1.8.8 and that API is laggy, choppy and glitchy and the plugin I'm developing is heavily reliant on the guardian beams.

Edit: Btw I do completely realize the End Crystals Beams wouldn't work in 1.8.8, I only want the Guardian Beams :D

ConcurrentModificationException

Idk know exactly how to reproduce it but when 2 players are getting shot at with 2 lasers at the same time with the laser view distance of 5 if you move back and forward and enter and exit the view distance ConcurrentModificationException happens

full stack trace:
java.util.ConcurrentModificationException: null
at java.util.HashMap$HashIterator.nextNode(HashMap.java:1493) ~[?:?]
at java.util.HashMap$KeyIterator.next(HashMap.java:1516) ~[?:?]
at ir.ciph3r.monstercrystal.utilities.Laser.moveInternal(Laser.java:230) ~[?:?]
at ir.ciph3r.monstercrystal.utilities.Laser.moveStart(Laser.java:171) ~[?:?]
at ir.ciph3r.monstercrystal.utilities.LaserRunnable.run(LaserRunnable.java:33) ~[?:?]
at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:100) ~[patched_1.16.5.jar:git-Purpur-1171]
at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:58) ~[patched_1.16.5.jar:git-Purpur-1171]
at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[patched_1.16.5.jar:git-Purpur-1171]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]

1.20.6/1.21

Is there plans to update this api to 1.20.6 and 1.21??

Add support for 1.20.4 (1.20 R3)

Hello!

It seems like a few changes have been made with the latest protocol update for 1.20.4, and I'd appreciate to have it updated.

Thanks!

Problem after the beam has timed out - solution

Based on your LaserDemo, I created a plugin idea which uses fixed locations for the start and end locations.
The problem I had was that when I used a fixed duration, the 'synchronized void cancel()' did not work!
Leaving the 'lasers.remove(p);' in this function, as not being applied.
I kept getting 'null' errors because the laser existed, but the runnable did not. (When repeating the (toggle) command).

I eventually discovered that instead of using the standard code
this.laser = new CrystalLaser(originLocation, endLocation, 5, 50);
I could use the extended code
this.laser = new CrystalLaser(originLocation, endLocation, 5, 50).executeEnd(() -> Bukkit.broadcastMessage("Laser ended!")).start(plugin);
But, NOT in this format! (NO .start(plugin)
To get around my problem I used
this.laser = (CrystalLaser) new CrystalLaser(originLocation, endLocation, 5, 50).executeEnd(() -> lasers.remove(p));

Perhaps you could adujst the plugin to accomodate something like this.
Or, add this solution to the Wiki guide?

GuardianBeam error when using Advanced Slime World Manager

[17:13:11] [Server thread/INFO]: [GuardianBeam] [GuardianBeam] Found server version 1.20.4
[17:13:11] [Server thread/INFO]: [GuardianBeam] [GuardianBeam] Loaded mappings V1_20
[17:13:11] [Server thread/WARN]: java.lang.NoSuchMethodException: net.minecraft.world.entity.boss.enderdragon.EntityEnderCrystal.(net.minecraft.server.level.WorldServer,double,double,double)
[17:13:11] [Server thread/WARN]: at java.base/java.lang.Class.getConstructor0(Class.java:3585)
[17:13:11] [Server thread/WARN]: at java.base/java.lang.Class.getDeclaredConstructor(Class.java:2754)
[17:13:11] [Server thread/WARN]: at MysteryBoxes-1.20.40-release.jar//com.xericker.mysteryboxes.compiled.Laser$Packets.(Laser.java:795)
[17:13:11] [Server thread/WARN]: at MysteryBoxes-1.20.40-release.jar//com.xericker.mysteryboxes.compiled.Laser.(Laser.java:54)
[17:13:11] [Server thread/WARN]: at MysteryBoxes-1.20.40-release.jar//com.xericker.mysteryboxes.compiled.Laser$GuardianLaser.(Laser.java:311)
[17:13:11] [Server thread/WARN]: at MysteryBoxes-1.20.40-release.jar//com.xericker.mysteryboxes.core.events.opening.themes.executors.UnderwaterTroubleTheme$1.run(UnderwaterTroubleTheme.java:102)
[17:13:11] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_20_R3.scheduler.CraftTask.run(CraftTask.java:101)
[17:13:11] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_20_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:480)
[17:13:11] [Server thread/WARN]: at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1650)
[17:13:11] [Server thread/WARN]: at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:446)
[17:13:11] [Server thread/WARN]: at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1529)
[17:13:11] [Server thread/WARN]: at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1230)
[17:13:11] [Server thread/WARN]: at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319)
[17:13:11] [Server thread/WARN]: at java.base/java.lang.Thread.run(Thread.java:840)
[17:13:11] [Server thread/ERROR]: [GuardianBeam] [GuardianBeam] Laser Beam reflection failed to initialize. The util is disabled. Please ensure your version (org.bukkit.craftbukkit.v1_20_R3) is supported.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.