Browse Source

1.4

tags/1.4.1
Nazar Kalinowski 1 year ago
parent
commit
c16229d68b
5 changed files with 37 additions and 6 deletions
  1. +4
    -0
      CHANGELOG
  2. +2
    -2
      pom.xml
  3. +2
    -2
      src/main/java/dev/gwm/spongeplugin/cosmetics/Cosmetics.java
  4. +14
    -1
      src/main/java/dev/gwm/spongeplugin/cosmetics/superobject/effect/FigletCosmeticEffect.java
  5. +15
    -1
      src/main/java/dev/gwm/spongeplugin/cosmetics/superobject/effect/WallCosmeticEffects.java

+ 4
- 0
CHANGELOG View File

@@ -1,3 +1,7 @@
VERSION 1.4
* Add 'DOTS_FILE' parameter to 'WALL' Cosmetic Effect
* Add 'TEXT_FILE' parameter to 'FIGLET' Cosmetic Effect

VERSION 1.3
* Update to GWMLibrary 2.4
* Add 'FIGLET' Cosmetic Effect


+ 2
- 2
pom.xml View File

@@ -6,7 +6,7 @@

<groupId>dev.gwm.spongeplugin</groupId>
<artifactId>cosmetics</artifactId>
<version>1.3</version>
<version>1.4</version>
<name>Cosmetics</name>
<packaging>jar</packaging>

@@ -33,7 +33,7 @@
<dependency>
<groupId>dev.gwm.spongeplugin</groupId>
<artifactId>library</artifactId>
<version>2.4</version>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>


+ 2
- 2
src/main/java/dev/gwm/spongeplugin/cosmetics/Cosmetics.java View File

@@ -32,7 +32,7 @@ import java.util.concurrent.atomic.AtomicInteger;
@Plugin(id = "cosmetics",
name = "Cosmetics",
version = "1.3",
version = "1.4",
description = "Fancy cosmetic effects",
authors = {"GWM"/* My contacts:
* E-Mail(nazark@tutanota.com),
@@ -43,7 +43,7 @@ import java.util.concurrent.atomic.AtomicInteger;
})
public class Cosmetics extends SpongePlugin {
public static final Version VERSION = new Version(null, 1, 3);
public static final Version VERSION = new Version(null, 1, 4);
private static Cosmetics instance = null;


+ 14
- 1
src/main/java/dev/gwm/spongeplugin/cosmetics/superobject/effect/FigletCosmeticEffect.java View File

@@ -9,8 +9,12 @@ import io.leego.banana.BananaUtils;
import ninja.leaping.configurate.ConfigurationNode;
import org.spongepowered.api.effect.particle.ParticleEffect;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;

public class FigletCosmeticEffect extends Abstract2dCosmeticEffect {

@@ -32,13 +36,22 @@ public class FigletCosmeticEffect extends Abstract2dCosmeticEffect {
super(node);
try {
ConfigurationNode textNode = node.getNode("TEXT");
ConfigurationNode textFileNode = node.getNode("TEXT_FILE");
ConfigurationNode fontNode = node.getNode("FONT");
ConfigurationNode horizontalParticleDistanceNode = node.getNode("HORIZONTAL_PARTICLE_DISTANCE");
ConfigurationNode verticalParticleDistanceNode = node.getNode("VERTICAL_PARTICLE_DISTANCE");
ConfigurationNode xAngleNode = node.getNode("X_ROTATION");
ConfigurationNode yAngleNode = node.getNode("Y_ROTATION");
ConfigurationNode zAngleNode = node.getNode("Z_ROTATION");
text = textNode.getList(TypeToken.of(String.class));
if (!textNode.isVirtual()) {
text = textNode.getList(TypeToken.of(String.class));
} else if (!textFileNode.isVirtual()) {
text = new BufferedReader(new FileReader(new File(textFileNode.getString()))).
lines().
collect(Collectors.toList());
} else {
throw new IllegalArgumentException("Both TEXT and TEXT_FILE node do not exist!");
}
font = fontNode.getString("Banner");
dots = convert(text, font);
horizontalParticleDistance = horizontalParticleDistanceNode.getDouble(0.2);


+ 15
- 1
src/main/java/dev/gwm/spongeplugin/cosmetics/superobject/effect/WallCosmeticEffects.java View File

@@ -7,8 +7,12 @@ import dev.gwm.spongeplugin.library.exception.SuperObjectConstructionException;
import ninja.leaping.configurate.ConfigurationNode;
import org.spongepowered.api.effect.particle.ParticleEffect;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;

public class WallCosmeticEffects extends Abstract2dCosmeticEffect {

@@ -28,12 +32,22 @@ public class WallCosmeticEffects extends Abstract2dCosmeticEffect {
super(node);
try {
ConfigurationNode dotsNode = node.getNode("DOTS");
ConfigurationNode dotsFileNode = node.getNode("DOTS_FILE");
ConfigurationNode horizontalParticleDistanceNode = node.getNode("HORIZONTAL_PARTICLE_DISTANCE");
ConfigurationNode verticalParticleDistanceNode = node.getNode("VERTICAL_PARTICLE_DISTANCE");
ConfigurationNode xAngleNode = node.getNode("X_ROTATION");
ConfigurationNode yAngleNode = node.getNode("Y_ROTATION");
ConfigurationNode zAngleNode = node.getNode("Z_ROTATION");
List<String> dotsLines = dotsNode.getList(TypeToken.of(String.class));
List<String> dotsLines;
if (!dotsNode.isVirtual()) {
dotsLines = dotsNode.getList(TypeToken.of(String.class));
} else if (!dotsFileNode.isVirtual()) {
dotsLines = new BufferedReader(new FileReader(new File(dotsFileNode.getString()))).
lines().
collect(Collectors.toList());
} else {
throw new IllegalArgumentException("Both DOTS and DOTS_FILES node do not exist!");
}
dots = new boolean[dotsLines.size()][];
for (int i = dotsLines.size() - 1; i >= 0; i--) {
String dotLine = dotsLines.get(i);


Loading…
Cancel
Save