Skip to content

Commit

Permalink
Refactor MaxDikiy's creation notice
Browse files Browse the repository at this point in the history
  • Loading branch information
imDaniX committed Aug 20, 2023
1 parent 24fd068 commit 3c5f1cd
Show file tree
Hide file tree
Showing 30 changed files with 96 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
import java.util.Locale;

/**
* Created by MaxDikiy on 20/10/2017.
* @author MaxDikiy
* @since 20/10/2017
*/
@Aliased.Names("CLEAR_RADIUS")
public class ClearRadiusAction implements Action {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
import java.nio.file.StandardCopyOption;

/**
* Created by MaxDikiy on 5/7/2017.
* @author MaxDikiy
* @since 05/07/2017
*/
public class FileAction implements Action {
private static final String dir = new File("").getAbsolutePath();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
import org.jetbrains.annotations.NotNull;

/**
* Created by MaxDikiy on 2017-05-16.
* @author MaxDikiy
* @since 16/05/2017
*/
@Aliased.Names("FLIGHT_SPEED")
public class FlySpeedAction implements Action {
Expand All @@ -18,8 +19,9 @@ public boolean proceed(@NotNull Environment env, @NotNull String paramsStr) {
Parameters params = Parameters.fromString(paramsStr);
Player player = env.getPlayer();
double speed = params.getInteger("speed", () -> params.getInteger(Parameters.ORIGIN));
if (params.contains("player"))
player = Bukkit.getPlayerExact(params.getString("player"));
if (params.contains("player")) {
player = params.get("player", Bukkit::getPlayerExact);
}
return flySpeedPlayer(player, speed / 10);
}

Expand All @@ -35,8 +37,11 @@ public boolean requiresPlayer() {

private boolean flySpeedPlayer(Player player, double speed) {
if (player == null || player.isDead() || !player.isOnline()) return false;
if (speed > 1) speed = 1;
if (speed < 0) speed = 0;
if (speed > 1) {
speed = 1;
} else if (speed < 0) {
speed = 0;
}
player.setFlySpeed((float) speed);
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import org.jetbrains.annotations.NotNull;

/**
* Created by MaxDikiy on 5/8/2017.
* @author MaxDikiy
* @since 05/08/2017
*/
public class GlideAction implements Action {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
import java.util.Map;

/**
* Created by MaxDikiy on 2017-05-17.
* @author MaxDikiy
* @since 17/05/2017
*/
@Aliased.Names({"IF_ELSE", "JS_CONDITION"})
@Deprecated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
import org.jetbrains.annotations.NotNull;

/**
* Created by MaxDikiy on 5/6/2017.
* @author MaxDikiy
* @since 05/06/2017
*/
public class PlayerIdAction implements Action {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
import java.util.regex.Pattern;

/**
* Created by MaxDikiy on 2017-04-29.
* @author MaxDikiy
* @since 29/04/2017
*/
public class RegexAction implements Action {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import org.jetbrains.annotations.NotNull;

/**
* Created by MaxDikiy on 2017-10-04.
* @author MaxDikiy
* @since 04/10/2017
*/
@Aliased.Names({"CHAT", "CHAT_MESSAGE"})
public class SendChatAction implements Action {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import org.jetbrains.annotations.NotNull;

/**
* Created by MaxDikiy on 2017-05-16.
* @author MaxDikiy
* @since 16/05/2017
*/
public class WalkSpeedAction implements Action {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
import static fun.reactions.model.environment.Variable.simple;

/**
* Created by MaxDikiy on 2017-05-14.
* @author MaxDikiy
* @since 14/05/2017
*/
public class BlockBreakActivator extends Activator implements Locatable {

Expand Down Expand Up @@ -88,7 +89,8 @@ public String toString() {
}

/**
* Created by MaxDikiy on 2017-05-14.
* @author MaxDikiy
* @since 14/05/2017
*/
public static class Context extends ActivationContext {
public static final String DO_DROP = "is_drop";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
import java.util.Map;

/**
* Created by MaxDikiy on 2017-07-23.
* @author MaxDikiy
* @since 23/07/2017
*/
// TODO: Assemble to one activator
public class DamageActivator extends Activator {
Expand Down Expand Up @@ -73,7 +74,8 @@ public String toString() {
}

/**
* Created by MaxDikiy on 2017-07-23.
* @author MaxDikiy
* @since 23/07/2017
*/
public static class Context extends ActivationContext {
public static final String DAMAGE = "damage";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
import static fun.reactions.model.environment.Variable.simple;

/**
* Created by MaxDikiy on 2017-07-23.
* @author MaxDikiy
* @since 23/07/2017
*/
// TODO: Assemble to one activator
public class DamageByBlockActivator extends Activator implements Locatable {
Expand Down Expand Up @@ -111,7 +112,8 @@ public String toString() {
}

/**
* Created by MaxDikiy on 2017-07-23.
* @author MaxDikiy
* @since 23/07/2017
*/
public static class Context extends DamageActivator.Context {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
import java.util.Map;

/**
* Created by MaxDikiy on 2017-06-25.
* @author MaxDikiy
* @since 25/06/2017
*/
// TODO: Assemble to one activator
public class DamageByMobActivator extends Activator {
Expand Down Expand Up @@ -130,7 +131,8 @@ public String toString() {
}

/**
* Created by MaxDikiy on 2017-06-25.
* @author MaxDikiy
* @since 25/06/2017
*/
public static class Context extends DamageActivator.Context {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
import static fun.reactions.model.environment.Variable.simple;

/**
* Created by MaxDikiy on 2017-05-01.
* @author MaxDikiy
* @since 01/05/2017
*/
public class DropActivator extends Activator {

Expand Down Expand Up @@ -51,7 +52,8 @@ public void saveOptions(@NotNull ConfigurationSection cfg) {
}

/**
* Created by MaxDikiy on 2017-05-01.
* @author MaxDikiy
* @since 01/05/2017
*/
public static class Context extends ActivationContext {
public static final String PICKUP_DELAY = "pickupdelay";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
import static fun.reactions.model.environment.Variable.simple;

/**
* Created by MaxDikiy on 2017-05-14.
* @author MaxDikiy
* @since 14/05/2017
*/
public class EntityClickActivator extends Activator {
private final EntityType entityType;
Expand Down Expand Up @@ -63,7 +64,8 @@ public String toString() {
}

/**
* Created by MaxDikiy on 2017-05-14.
* @author MaxDikiy
* @since 14/05/2017
*/
public static class Context extends ActivationContext {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
import java.util.Map;

/**
* Created by MaxDikiy on 5/2/2017.
* @author MaxDikiy
* @since 05/02/2017
*/
public class FlightActivator extends Activator {
private final TriBoolean flight;
Expand Down Expand Up @@ -50,7 +51,8 @@ public String toString() {
}

/**
* Created by MaxDikiy on 5/2/2017.
* @author MaxDikiy
* @since 05/02/2017
*/
public static class Context extends ActivationContext {
private final boolean flying;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
import java.util.Map;

/**
* Created by MaxDikiy on 2017-10-27.
* @author MaxDikiy
* @since 27/10/2017
*/
public class GameModeActivator extends Activator {
private final GameMode gameMode;
Expand Down Expand Up @@ -59,7 +60,8 @@ public String toString() {
}

/**
* Created by MaxDikiy on 2017-10-27.
* @author MaxDikiy
* @since 27/10/2017
*/
public static class Context extends ActivationContext {
private final GameMode gameMode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
import java.util.Map;

/**
* Created by MaxDikiy on 2017-10-28.
* @author MaxDikiy
* @since 28/10/2017
*/
public class GodActivator extends Activator {
private final TriBoolean god;
Expand Down Expand Up @@ -50,7 +51,8 @@ public String toString() {
}

/**
* Created by MaxDikiy on 2017-10-27.
* @author MaxDikiy
* @since 27/10/2017
*/
public static class Context extends ActivationContext {
private final boolean god;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
import java.util.Map;

/**
* Created by MaxDikiy on 2017-11-11.
* @author MaxDikiy
* @since 11/11/2017
*/
public class ItemHeldActivator extends Activator {
private final int slotPrev;
Expand Down Expand Up @@ -82,7 +83,8 @@ public String toString() {
}

/**
* Created by MaxDikiy on 2017-11-11.
* @author MaxDikiy
* @since 11/11/2017
*/
public static class Context extends ActivationContext {
private final int newSlot;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
import static fun.reactions.model.environment.Variable.simple;

/**
* Created by MaxDikiy on 2017-09-04.
* @author MaxDikiy
* @since 04/09/2017
*/
public class PickupItemActivator extends Activator {
private final VirtualItem item;
Expand Down Expand Up @@ -59,7 +60,8 @@ public String toString() {
}

/**
* Created by MaxDikiy on 2017-09-04.
* @author MaxDikiy
* @since 04/09/2017
*/
public static class Context extends ActivationContext {
public static final String PICKUP_DELAY = "pickupdelay";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
import java.util.Map;

/**
* Created by MaxDikiy on 2017-05-16.
* @author MaxDikiy
* @since 16/05/2017
*/
public class SneakActivator extends Activator {
private final TriBoolean sneak;
Expand Down Expand Up @@ -50,7 +51,8 @@ public String toString() {
}

/**
* Created by MaxDikiy on 2017-05-16.
* @author MaxDikiy
* @since 16/05/2017
*/
public static class Context extends ActivationContext {
private final boolean sneaking;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import org.jetbrains.annotations.NotNull;

/**
* Created by MaxDikiy on 5/4/2017.
* @author MaxDikiy
* @since 05/04/2017
*/
public class FlySpeedFlag implements Flag {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import org.jetbrains.annotations.NotNull;

/**
* Created by MaxDikiy on 10/1/2017.
* @author MaxDikiy
* @since 10/01/2017
*/
public class NumCompareFlags implements Flag {
private final boolean greater;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
import org.jetbrains.annotations.NotNull;

/**
* Created by MaxDikiy on 5/4/2017.
* @author MaxDikiy
* @since 05/04/2017
*/
@Aliased.Names("WALKSPEED")
public class WalkSpeedFlag implements Flag {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
import org.jetbrains.annotations.NotNull;

/**
* Created by MaxDikiy on 18/10/2017.
* @author MaxDikiy
* @since 18/10/2017
*/
public class WeSuperPickaxeAction implements Action {
@Override
Expand Down
Loading

0 comments on commit 3c5f1cd

Please sign in to comment.