From a9586454382ac29c87f6795ac8b06097d916dd0e Mon Sep 17 00:00:00 2001 From: Matthew Broomfield Date: Sat, 9 Mar 2019 11:31:05 -0800 Subject: [PATCH] Restore most parts of a player on game completion * Create PlayerRestorer to restore a player * Inform p[layers of their death * Add missing headers --- gradle.properties | 2 +- .../survivalgames/SurvivalGamesPlugin.java | 2 +- .../command/executor/RootCommand.java | 1 + .../command/executor/TestCommand.java | 49 ++++++ .../survivalgames/game/PlayerRestorer.java | 140 ++++++++++++++++++ .../survivalgames/game/SurvivalGame.java | 4 +- .../listener/PlayerDeathListener.java | 4 + .../survivalgames/task/CleanStateTask.java | 25 ++++ .../task/player/ReturnPlayerTask.java | 34 ++++- .../task/player/SpawnPlayersTask.java | 3 +- .../task/player/SpawnSpectatorsTask.java | 3 +- .../thread/BlankProgressable.java | 25 ++++ .../survivalgames/thread/ProgressBuilder.java | 25 ++++ .../thread/SetBlocksProgressable.java | 25 ++++ 14 files changed, 332 insertions(+), 10 deletions(-) create mode 100644 src/main/java/io/github/m0pt0pmatt/survivalgames/command/executor/TestCommand.java create mode 100644 src/main/java/io/github/m0pt0pmatt/survivalgames/game/PlayerRestorer.java diff --git a/gradle.properties b/gradle.properties index 6a1cbff1..5c2e1f9f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ pluginGroup=io.github.m0pt0pmatt.survivalgames pluginId=survivalgames -pluginVersion=1.0.9 +pluginVersion=1.0.10 diff --git a/src/main/java/io/github/m0pt0pmatt/survivalgames/SurvivalGamesPlugin.java b/src/main/java/io/github/m0pt0pmatt/survivalgames/SurvivalGamesPlugin.java index f3e40b18..f8c7095c 100644 --- a/src/main/java/io/github/m0pt0pmatt/survivalgames/SurvivalGamesPlugin.java +++ b/src/main/java/io/github/m0pt0pmatt/survivalgames/SurvivalGamesPlugin.java @@ -50,7 +50,7 @@ @Plugin( id = "survival-games", name = "Survival Games", - version = "1.0.9", + version = "1.0.10", description = "Survival Games for Sponge." ) public class SurvivalGamesPlugin { diff --git a/src/main/java/io/github/m0pt0pmatt/survivalgames/command/executor/RootCommand.java b/src/main/java/io/github/m0pt0pmatt/survivalgames/command/executor/RootCommand.java index bb0530fa..5a79c2ff 100644 --- a/src/main/java/io/github/m0pt0pmatt/survivalgames/command/executor/RootCommand.java +++ b/src/main/java/io/github/m0pt0pmatt/survivalgames/command/executor/RootCommand.java @@ -65,6 +65,7 @@ public class RootCommand extends ParentCommand { .put(toEntry(JoinCommand.getInstance())) .put(toEntry(LeaveCommand.getInstance())) .put(toEntry(SpectateCommand.getInstance())) + .put(toEntry(new TestCommand())) .build(); private static final SurvivalGamesCommand INSTANCE = new RootCommand(); diff --git a/src/main/java/io/github/m0pt0pmatt/survivalgames/command/executor/TestCommand.java b/src/main/java/io/github/m0pt0pmatt/survivalgames/command/executor/TestCommand.java new file mode 100644 index 00000000..2e58e307 --- /dev/null +++ b/src/main/java/io/github/m0pt0pmatt/survivalgames/command/executor/TestCommand.java @@ -0,0 +1,49 @@ +package io.github.m0pt0pmatt.survivalgames.command.executor; + +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Sets; +import io.github.m0pt0pmatt.survivalgames.game.PlayerRestorer; +import org.spongepowered.api.command.CommandException; +import org.spongepowered.api.command.CommandResult; +import org.spongepowered.api.command.CommandSource; +import org.spongepowered.api.command.args.CommandContext; +import org.spongepowered.api.command.args.GenericArguments; +import org.spongepowered.api.data.DataContainer; +import org.spongepowered.api.data.DataQuery; +import org.spongepowered.api.data.manipulator.mutable.RepresentedPlayerData; +import org.spongepowered.api.entity.EntitySnapshot; +import org.spongepowered.api.entity.living.player.Player; +import org.spongepowered.api.text.Text; + +import java.util.HashSet; +import java.util.Set; + +public class TestCommand extends LeafCommand { + + boolean which = false; + PlayerRestorer restorer; + + protected TestCommand() { + super(RootCommand.getInstance(), "test", GenericArguments.none()); + } + + @Override + public CommandResult execute(CommandSource src, CommandContext args) throws CommandException { + + if (src instanceof Player) { + + Player player = (Player) src; + + if (which) { + src.sendMessage(Text.of("restore")); + restorer.restore(player); + } else { + src.sendMessage(Text.of("create")); + restorer = new PlayerRestorer(player); + } + which = !which; + } + + return CommandResult.success(); + } +} diff --git a/src/main/java/io/github/m0pt0pmatt/survivalgames/game/PlayerRestorer.java b/src/main/java/io/github/m0pt0pmatt/survivalgames/game/PlayerRestorer.java new file mode 100644 index 00000000..bca38047 --- /dev/null +++ b/src/main/java/io/github/m0pt0pmatt/survivalgames/game/PlayerRestorer.java @@ -0,0 +1,140 @@ +/* + * This file is part of SurvivalGames, licensed under the MIT License (MIT). + * + * Copyright (c) Matthew Broomfield + * Copyright (c) contributors + * + * 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. + */ + +package io.github.m0pt0pmatt.survivalgames.game; + +import com.flowpowered.math.vector.Vector3d; +import org.spongepowered.api.data.key.Keys; +import org.spongepowered.api.data.value.mutable.MutableBoundedValue; +import org.spongepowered.api.data.value.mutable.Value; +import org.spongepowered.api.entity.Entity; +import org.spongepowered.api.entity.living.player.Player; +import org.spongepowered.api.entity.living.player.gamemode.GameMode; +import org.spongepowered.api.item.inventory.Inventory; +import org.spongepowered.api.item.inventory.ItemStack; +import org.spongepowered.api.scoreboard.Scoreboard; +import org.spongepowered.api.text.Text; +import org.spongepowered.api.world.Location; +import org.spongepowered.api.world.World; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; + +public final class PlayerRestorer { + + private final Value displayNameData; + private final List enderChestInventory; + private final Value gameModeData; + private final Scoreboard scoreboard; + + private final MutableBoundedValue foodLevel; + private final MutableBoundedValue exhaustion; + private final MutableBoundedValue saturation; + + private final List inventory; + + private final MutableBoundedValue health; + private final MutableBoundedValue maxHealth; + + private final Vector3d headRotation; + + private final Entity vehicle; + private final List passengers; + private final Vector3d rotation; + private final Vector3d velocity; + + private final Location location; + + public PlayerRestorer(Player player) { + displayNameData = player.getDisplayNameData().displayName().copy(); + enderChestInventory = inventory(player.getEnderChestInventory()); + gameModeData = player.getGameModeData().type().copy(); + scoreboard = player.getScoreboard(); + foodLevel = player.getFoodData().foodLevel(); + exhaustion = player.getFoodData().exhaustion(); + saturation = player.getFoodData().saturation(); + inventory = inventory(player.getInventory()); + health = player.getHealthData().health().copy(); + maxHealth = player.getHealthData().maxHealth().copy(); + headRotation = player.getHeadRotation().clone(); + vehicle = player.getVehicle().orElse(null); + passengers = player.getPassengers(); + rotation = player.getRotation().clone(); + velocity = player.getVelocity().clone(); + location = player.getLocation(); + } + + private ArrayList inventory(Inventory inventory) { + ArrayList items = new ArrayList<>(inventory.size()); + inventory.slots().forEach(i -> items.add(i.peek().orElse(null))); + inventory.clear(); + return items; + } + + private void restoreInventory(Inventory inventory, List items) { + inventory.clear(); + + Iterator ii = items.iterator(); + Iterator si = inventory.slots().iterator(); + + for(;ii.hasNext();) { + ItemStack item = ii.next(); + Inventory slot = si.next(); + if (item != null) { + slot.set(item); + } + } + } + + public void restore(Player player) { + + player.offer(Keys.DISPLAY_NAME, displayNameData.get()); + restoreInventory(player.getEnderChestInventory(), enderChestInventory); + player.offer(Keys.GAME_MODE, gameModeData.get()); + + player.setScoreboard(scoreboard); + + player.offer(Keys.FOOD_LEVEL, foodLevel.get()); + player.offer(Keys.EXHAUSTION, exhaustion.get()); + player.offer(Keys.SATURATION, saturation.get()); + + restoreInventory(player.getInventory(), inventory); + + player.offer(Keys.HEALTH, health.get()); + player.offer(Keys.MAX_HEALTH, maxHealth.get()); + + player.setHeadRotation(headRotation); + Optional.ofNullable(vehicle).ifPresent(player::setVehicle); + if (passengers.size() > 0) { + player.clearPassengers(); + passengers.forEach(player::addPassenger); + } + player.setRotation(rotation); + player.setVelocity(velocity); + player.setLocation(location); + } +} diff --git a/src/main/java/io/github/m0pt0pmatt/survivalgames/game/SurvivalGame.java b/src/main/java/io/github/m0pt0pmatt/survivalgames/game/SurvivalGame.java index 2979272b..ef777df9 100644 --- a/src/main/java/io/github/m0pt0pmatt/survivalgames/game/SurvivalGame.java +++ b/src/main/java/io/github/m0pt0pmatt/survivalgames/game/SurvivalGame.java @@ -47,7 +47,7 @@ public class SurvivalGame { private final Set commandBlocks; private final Set activeMobSpawners; private final Set activeEventIntervals; - private final Map playerSnapshots; + private final Map playerSnapshots; public SurvivalGame(String name, GameConfig config) { this.name = checkNotNull(name); @@ -102,7 +102,7 @@ public Set getActiveEventIntervals() { return activeEventIntervals; } - public Map getPlayerSnapshots() { + public Map getPlayerSnapshots() { return playerSnapshots; } diff --git a/src/main/java/io/github/m0pt0pmatt/survivalgames/listener/PlayerDeathListener.java b/src/main/java/io/github/m0pt0pmatt/survivalgames/listener/PlayerDeathListener.java index 83f0396b..38e03af0 100644 --- a/src/main/java/io/github/m0pt0pmatt/survivalgames/listener/PlayerDeathListener.java +++ b/src/main/java/io/github/m0pt0pmatt/survivalgames/listener/PlayerDeathListener.java @@ -42,6 +42,7 @@ import org.spongepowered.api.event.entity.DamageEntityEvent; import org.spongepowered.api.item.inventory.Inventory; import org.spongepowered.api.item.inventory.ItemStack; +import org.spongepowered.api.text.Text; import org.spongepowered.api.util.TextMessageException; import org.spongepowered.api.world.World; @@ -121,6 +122,9 @@ private static void performDeadPlayer(SurvivalGame survivalGame, Player player, // Post the death event Sponge.getEventManager().post(new PlayerDeathEvent(cause, survivalGame, player)); + // Tell the poor player + player.sendMessage(Text.of("You were killed. Wait for the game to end.")); + // Check for a win condition. try { WinChecker.checkWin(survivalGame); diff --git a/src/main/java/io/github/m0pt0pmatt/survivalgames/task/CleanStateTask.java b/src/main/java/io/github/m0pt0pmatt/survivalgames/task/CleanStateTask.java index 0065dde1..8442525f 100644 --- a/src/main/java/io/github/m0pt0pmatt/survivalgames/task/CleanStateTask.java +++ b/src/main/java/io/github/m0pt0pmatt/survivalgames/task/CleanStateTask.java @@ -1,3 +1,28 @@ +/* + * This file is part of SurvivalGames, licensed under the MIT License (MIT). + * + * Copyright (c) Matthew Broomfield + * Copyright (c) contributors + * + * 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. + */ + package io.github.m0pt0pmatt.survivalgames.task; import io.github.m0pt0pmatt.survivalgames.game.SurvivalGame; diff --git a/src/main/java/io/github/m0pt0pmatt/survivalgames/task/player/ReturnPlayerTask.java b/src/main/java/io/github/m0pt0pmatt/survivalgames/task/player/ReturnPlayerTask.java index d241d136..577fe607 100644 --- a/src/main/java/io/github/m0pt0pmatt/survivalgames/task/player/ReturnPlayerTask.java +++ b/src/main/java/io/github/m0pt0pmatt/survivalgames/task/player/ReturnPlayerTask.java @@ -1,8 +1,34 @@ +/* + * This file is part of SurvivalGames, licensed under the MIT License (MIT). + * + * Copyright (c) Matthew Broomfield + * Copyright (c) contributors + * + * 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. + */ + package io.github.m0pt0pmatt.survivalgames.task.player; +import io.github.m0pt0pmatt.survivalgames.game.PlayerRestorer; import io.github.m0pt0pmatt.survivalgames.game.SurvivalGame; import io.github.m0pt0pmatt.survivalgames.task.Task; -import org.spongepowered.api.entity.EntitySnapshot; +import org.spongepowered.api.Sponge; import org.spongepowered.api.util.TextMessageException; import java.util.Iterator; @@ -22,11 +48,11 @@ public static Task getInstance() { @Override public void execute(SurvivalGame survivalGame) throws TextMessageException { - for(Iterator> i = survivalGame.getPlayerSnapshots().entrySet().iterator(); i.hasNext();) { - Map.Entry entry = i.next(); + for(Iterator> i = survivalGame.getPlayerSnapshots().entrySet().iterator(); i.hasNext();) { + Map.Entry entry = i.next(); i.remove(); - entry.getValue().restore(); + Sponge.getServer().getPlayer(entry.getKey()).ifPresent(p -> entry.getValue().restore(p)); } } } diff --git a/src/main/java/io/github/m0pt0pmatt/survivalgames/task/player/SpawnPlayersTask.java b/src/main/java/io/github/m0pt0pmatt/survivalgames/task/player/SpawnPlayersTask.java index fe1e5a13..907acfff 100644 --- a/src/main/java/io/github/m0pt0pmatt/survivalgames/task/player/SpawnPlayersTask.java +++ b/src/main/java/io/github/m0pt0pmatt/survivalgames/task/player/SpawnPlayersTask.java @@ -29,6 +29,7 @@ import com.flowpowered.math.vector.Vector3d; import com.flowpowered.math.vector.Vector3i; import io.github.m0pt0pmatt.survivalgames.command.CommandKeys; +import io.github.m0pt0pmatt.survivalgames.game.PlayerRestorer; import io.github.m0pt0pmatt.survivalgames.game.SurvivalGame; import java.util.ArrayList; import java.util.Collections; @@ -68,7 +69,7 @@ public void execute(SurvivalGame survivalGame, Player player) throws TextMessage private static void spawnPlayer(SurvivalGame survivalGame, Player player, World world, Vector3d spawnPoint, Vector3d centerVector) { - survivalGame.getPlayerSnapshots().put(player.getUniqueId(), player.createSnapshot()); + survivalGame.getPlayerSnapshots().put(player.getUniqueId(), new PlayerRestorer(player)); player.setLocation(world.getLocation(spawnPoint).add(new Vector3d(0.5, 0, 0.5))); player.lookAt(centerVector); diff --git a/src/main/java/io/github/m0pt0pmatt/survivalgames/task/player/SpawnSpectatorsTask.java b/src/main/java/io/github/m0pt0pmatt/survivalgames/task/player/SpawnSpectatorsTask.java index f2d55efa..8cd5a583 100644 --- a/src/main/java/io/github/m0pt0pmatt/survivalgames/task/player/SpawnSpectatorsTask.java +++ b/src/main/java/io/github/m0pt0pmatt/survivalgames/task/player/SpawnSpectatorsTask.java @@ -28,6 +28,7 @@ import com.flowpowered.math.vector.Vector3d; import io.github.m0pt0pmatt.survivalgames.command.CommandKeys; +import io.github.m0pt0pmatt.survivalgames.game.PlayerRestorer; import io.github.m0pt0pmatt.survivalgames.game.SurvivalGame; import java.util.ArrayList; import java.util.Collection; @@ -68,7 +69,7 @@ public void execute(SurvivalGame survivalGame, Player player) throws TextMessage private static void spawnPlayer(SurvivalGame survivalGame, Player player, World world, Vector3d spawnPoint, Vector3d centerVector) { - survivalGame.getPlayerSnapshots().put(player.getUniqueId(), player.createSnapshot()); + survivalGame.getPlayerSnapshots().put(player.getUniqueId(), new PlayerRestorer(player)); player.setLocation(world.getLocation(spawnPoint).add(new Vector3d(0.5, 10, 0.5))); player.lookAt(centerVector); player.offer(Keys.GAME_MODE, GameModes.SPECTATOR); diff --git a/src/main/java/io/github/m0pt0pmatt/survivalgames/thread/BlankProgressable.java b/src/main/java/io/github/m0pt0pmatt/survivalgames/thread/BlankProgressable.java index 5351fd1d..0552f748 100644 --- a/src/main/java/io/github/m0pt0pmatt/survivalgames/thread/BlankProgressable.java +++ b/src/main/java/io/github/m0pt0pmatt/survivalgames/thread/BlankProgressable.java @@ -1,3 +1,28 @@ +/* + * This file is part of SurvivalGames, licensed under the MIT License (MIT). + * + * Copyright (c) Matthew Broomfield + * Copyright (c) contributors + * + * 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. + */ + package io.github.m0pt0pmatt.survivalgames.thread; public class BlankProgressable implements Progressable { diff --git a/src/main/java/io/github/m0pt0pmatt/survivalgames/thread/ProgressBuilder.java b/src/main/java/io/github/m0pt0pmatt/survivalgames/thread/ProgressBuilder.java index d6a6bb08..be782004 100644 --- a/src/main/java/io/github/m0pt0pmatt/survivalgames/thread/ProgressBuilder.java +++ b/src/main/java/io/github/m0pt0pmatt/survivalgames/thread/ProgressBuilder.java @@ -1,3 +1,28 @@ +/* + * This file is part of SurvivalGames, licensed under the MIT License (MIT). + * + * Copyright (c) Matthew Broomfield + * Copyright (c) contributors + * + * 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. + */ + package io.github.m0pt0pmatt.survivalgames.thread; import org.spongepowered.api.text.Text; diff --git a/src/main/java/io/github/m0pt0pmatt/survivalgames/thread/SetBlocksProgressable.java b/src/main/java/io/github/m0pt0pmatt/survivalgames/thread/SetBlocksProgressable.java index 381b1bd5..a1adde63 100644 --- a/src/main/java/io/github/m0pt0pmatt/survivalgames/thread/SetBlocksProgressable.java +++ b/src/main/java/io/github/m0pt0pmatt/survivalgames/thread/SetBlocksProgressable.java @@ -1,3 +1,28 @@ +/* + * This file is part of SurvivalGames, licensed under the MIT License (MIT). + * + * Copyright (c) Matthew Broomfield + * Copyright (c) contributors + * + * 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. + */ + package io.github.m0pt0pmatt.survivalgames.thread; import com.flowpowered.math.vector.Vector3d;