From b606448c2e7c33e093bcf7e9793e950bc6765853 Mon Sep 17 00:00:00 2001 From: MidnightTale <125941391+MidnightTale@users.noreply.github.com> Date: Wed, 12 Apr 2023 21:14:45 +0700 Subject: [PATCH 1/5] Update README.md --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 8b13789..3738419 100644 --- a/README.md +++ b/README.md @@ -1 +1,19 @@ +# FoliaFlow +FoliaFlow is a Minecraft plugin that allows players to using gravity block duplication glitch + +## Installation + +To install EndBlockPorter, follow these steps: + +1. Download the plugin JAR file from the [releases page](https://github.com/example/endblockporter/releases). +2. Copy the JAR file to the `plugins` folder of your Minecraft server. +3. Restart your server to enable the plugin. + +## Contributing + +If you would like to contribute to EndBlockPorter, feel free to submit a pull request with your changes. All contributions are welcome and appreciated. + +## License + +This plugin is licensed under the MIT license. See LICENSE.md for more information. From 4d420e794ae37e56452650e91ddf330617799ba5 Mon Sep 17 00:00:00 2001 From: MidnightTale <125941391+MidnightTale@users.noreply.github.com> Date: Wed, 12 Apr 2023 21:15:02 +0700 Subject: [PATCH 2/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3738419..f9fa41c 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ FoliaFlow is a Minecraft plugin that allows players to using gravity block dupli To install EndBlockPorter, follow these steps: -1. Download the plugin JAR file from the [releases page](https://github.com/example/endblockporter/releases). +1. Download the plugin JAR file from the [releases page](https://github.com/Hynse/FoliaFlow). 2. Copy the JAR file to the `plugins` folder of your Minecraft server. 3. Restart your server to enable the plugin. From 069b11b237bc8e8ca65cbfc207b0cf64648568b7 Mon Sep 17 00:00:00 2001 From: MidnightTale <125941391+MidnightTale@users.noreply.github.com> Date: Wed, 12 Apr 2023 21:15:39 +0700 Subject: [PATCH 3/5] Create LICENSE.md --- LICENSE.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE.md diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..566d1a0 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Hynse + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. From 5bd9355f6bb9ca1f003321190f03fcd9a5c089b2 Mon Sep 17 00:00:00 2001 From: MidnightTale <125941391+MidnightTale@users.noreply.github.com> Date: Wed, 12 Apr 2023 21:16:10 +0700 Subject: [PATCH 4/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f9fa41c..d7df414 100644 --- a/README.md +++ b/README.md @@ -16,4 +16,4 @@ If you would like to contribute to EndBlockPorter, feel free to submit a pull re ## License -This plugin is licensed under the MIT license. See LICENSE.md for more information. +This plugin is licensed under the MIT license. See [LICENSE.md](https://github.com/Hynse/FoliaFlow/blob/master/LICENSE.md) for more information. From 9ad81e2193e5abcac5919c687c146891d9bd3ec8 Mon Sep 17 00:00:00 2001 From: MidnightTale Date: Wed, 12 Apr 2023 21:52:16 +0700 Subject: [PATCH 5/5] refactor code --- build.gradle | 5 -- .../Bbsdfia.java => foliaflow/FoliaFlow.java} | 49 ++----------------- src/main/resources/plugin.yml | 4 +- 3 files changed, 5 insertions(+), 53 deletions(-) rename src/main/java/xyz/hynse/{bbsdfia/Bbsdfia.java => foliaflow/FoliaFlow.java} (70%) diff --git a/build.gradle b/build.gradle index f47caeb..adfeb39 100644 --- a/build.gradle +++ b/build.gradle @@ -16,15 +16,10 @@ repositories { name = "sonatype" url = "https://oss.sonatype.org/content/groups/public/" } - maven { - name = "devmart-other" - url = "https://nexuslite.gcnt.net/repos/other/" - } } dependencies { compileOnly "dev.folia:folia-api:1.19.4-R0.1-SNAPSHOT" - implementation "com.tcoded:FoliaLib:0.2.0" } def targetJavaVersion = 17 diff --git a/src/main/java/xyz/hynse/bbsdfia/Bbsdfia.java b/src/main/java/xyz/hynse/foliaflow/FoliaFlow.java similarity index 70% rename from src/main/java/xyz/hynse/bbsdfia/Bbsdfia.java rename to src/main/java/xyz/hynse/foliaflow/FoliaFlow.java index 3e4ac69..40f3004 100644 --- a/src/main/java/xyz/hynse/bbsdfia/Bbsdfia.java +++ b/src/main/java/xyz/hynse/foliaflow/FoliaFlow.java @@ -1,6 +1,5 @@ -package xyz.hynse.bbsdfia; +package xyz.hynse.foliaflow; -import com.tcoded.folialib.FoliaLib; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; @@ -15,7 +14,7 @@ import org.bukkit.event.entity.EntityChangeBlockEvent; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.util.Vector; -public class Bbsdfia extends JavaPlugin implements Listener { +public class FoliaFlow extends JavaPlugin implements Listener { private final Vector velocity1 = new Vector(0, 0.5, -1); private final Vector velocity2 = new Vector(-1, 0.5, 0); private final Vector velocity3 = new Vector(0, 0.5, 1); @@ -23,16 +22,7 @@ public class Bbsdfia extends JavaPlugin implements Listener { private final Vector[] velocities = { velocity1, velocity2, velocity3, velocity4 }; private int counter = 0; - FoliaLib foliaLib = new FoliaLib(this); - -/* - @Override - public void onEnable() { - super.onEnable(); - getServer().getPluginManager().registerEvents(this, this); - getServer().getLogger().info("Bbsdfia plugin started"); - }*/ @Override public void onEnable() { super.onEnable(); @@ -47,7 +37,7 @@ public class Bbsdfia extends JavaPlugin implements Listener { } - /*@EventHandler + @EventHandler public void onFallingBlockToBlock(EntityChangeBlockEvent e){ if(e.getEntityType() == EntityType.FALLING_BLOCK){ Entity entity = e.getEntity(); @@ -71,39 +61,11 @@ public class Bbsdfia extends JavaPlugin implements Listener { dummy.setVelocity(dummyVel); } } - }*/ - - @EventHandler - public void onFallingBlockToBlock(EntityChangeBlockEvent e) { - if (e.getEntityType() == EntityType.FALLING_BLOCK) { - Entity entity = e.getEntity(); - Location loc = entity.getLocation(); - Vector vel = entity.getVelocity(); - Block movingTo = getBlockMovingTo(loc, vel); - - if (movingTo != null && movingTo.getType() == Material.END_PORTAL) { - foliaLib.getImpl().runAtLocation(loc, () -> { - Location spawnLoc = movingTo.getLocation(); - spawnLoc.setX(spawnLoc.getX()+0.5); - spawnLoc.setY(spawnLoc.getY()+0.5); - spawnLoc.setZ(spawnLoc.getZ()+0.5); - - // Spawn the first falling block immediately - FallingBlock firstBlock = loc.getWorld().spawnFallingBlock(spawnLoc, ((FallingBlock) entity).getBlockData()); - Vector dummyVel = vel.clone(); - dummyVel.setY(-dummyVel.getY()); - dummyVel.multiply(new Vector(2, 2, 2)); - dummyVel.add(new Vector(0, -0.2, 0)); - firstBlock.setVelocity(dummyVel); - }); - } - } } - @EventHandler public void onEntityChangeBlock(EntityChangeBlockEvent event) { Entity entity = event.getEntity(); @@ -113,9 +75,6 @@ public class Bbsdfia extends JavaPlugin implements Listener { if (entity.getWorld().getEnvironment() != World.Environment.THE_END) { return; } - - // Spawn a new falling block entity with velocity - entity.remove(); Location fuck = new Location(Bukkit.getWorld("world_the_end"), 100, 49 ,0); fuck.getBlock().setType(Material.AIR); @@ -127,10 +86,8 @@ public class Bbsdfia extends JavaPlugin implements Listener { int index = counter % 4; Vector velocity = velocities[index]; counter++; - foliaLib.getImpl().runAtLocation(location, () -> { FallingBlock newFallingBlock = world.spawnFallingBlock(location, material, data); newFallingBlock.setVelocity(velocity); - }); } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index a8489c1..19f50a9 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ -name: bbsdfia +name: FoliaFlow version: '${version}' -main: xyz.hynse.bbsdfia.Bbsdfia +main: xyz.hynse.foliaflow.FoliaFlow api-version: 1.19 folia-supported: true \ No newline at end of file