Skip to content

Commit 681bfa1

Browse files
committed
Initial Commit (done)
1 parent cfb961f commit 681bfa1

File tree

4 files changed

+268
-0
lines changed

4 files changed

+268
-0
lines changed

.gitignore

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Windows image file caches
2+
Thumbs.db
3+
ehthumbs.db
4+
.settings
5+
.project
6+
.classpath
7+
8+
# Eclipse & Maven
9+
target/
10+
.metadata
11+
bin/
12+
tmp/
13+
*.tmp
14+
*.bak
15+
*.swp
16+
*~.nib
17+
local.properties
18+
.settings/
19+
.loadpath
20+
.recommenders
21+
22+
# Eclipse Core
23+
.project
24+
25+
# External tool builders
26+
.externalToolBuilders/
27+
28+
# Locally stored "Eclipse launch configurations"
29+
*.launch
30+
31+
# PyDev specific (Python IDE for Eclipse)
32+
*.pydevproject
33+
34+
# CDT-specific (C/C++ Development Tooling)
35+
.cproject
36+
37+
# JDT-specific (Eclipse Java Development Tools)
38+
.classpath
39+
40+
# Java annotation processor (APT)
41+
.factorypath
42+
43+
# PDT-specific (PHP Development Tools)
44+
.buildpath
45+
46+
# sbteclipse plugin
47+
.target
48+
49+
# Tern plugin
50+
.tern-project
51+
52+
# TeXlipse plugin
53+
.texlipse
54+
55+
# STS (Spring Tool Suite)
56+
.springBeans
57+
58+
# Code Recommenders
59+
.recommenders/
60+
61+
# Folder config file
62+
Desktop.ini
63+
64+
# Recycle Bin used on file shares
65+
$RECYCLE.BIN/
66+
67+
# Windows Installer files
68+
*.cab
69+
*.msi
70+
*.msm
71+
*.msp
72+
73+
# Windows shortcuts
74+
*.lnk
75+
76+
# =========================
77+
# Operating System Files
78+
# =========================
79+
80+
# OSX
81+
# =========================
82+
83+
.DS_Store
84+
.AppleDouble
85+
.LSOverride
86+
87+
# Thumbnails
88+
._*
89+
90+
# Files that might appear in the root of a volume
91+
.DocumentRevisions-V100
92+
.fseventsd
93+
.Spotlight-V100
94+
.TemporaryItems
95+
.Trashes
96+
.VolumeIcon.icns
97+
98+
# Directories potentially created on remote AFP share
99+
.AppleDB
100+
.AppleDesktop
101+
Network Trash Folder
102+
Temporary Items
103+
.apdisk
104+
/bin/
105+
*.classpath
106+
*.classpath

pom.xml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>com.volmit</groupId>
6+
<artifactId>GlossChatBubbles</artifactId>
7+
<version>1.0</version>
8+
<name>GlossChatBubbles</name>
9+
<properties>
10+
<maven.compiler.source>1.8</maven.compiler.source>
11+
<maven.compiler.target>1.8</maven.compiler.target>
12+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13+
</properties>
14+
<build>
15+
<resources>
16+
<resource>
17+
<directory>src/main/resources</directory>
18+
<filtering>true</filtering>
19+
<includes>
20+
<include>**/*.yml</include>
21+
<include>**/*.json</include>
22+
<include>**/*.txt</include>
23+
</includes>
24+
</resource>
25+
</resources>
26+
<plugins>
27+
<plugin>
28+
<groupId>org.apache.maven.plugins</groupId>
29+
<artifactId>maven-shade-plugin</artifactId>
30+
<version>3.1.0</version>
31+
<executions>
32+
<execution>
33+
<phase>package</phase>
34+
<goals>
35+
<goal>shade</goal>
36+
</goals>
37+
</execution>
38+
</executions>
39+
<configuration>
40+
<relocations>
41+
<relocation>
42+
<pattern>com.volmit.volume</pattern>
43+
<shadedPattern>com.volmit.gloss.chatbubbles.volume</shadedPattern>
44+
</relocation>
45+
</relocations>
46+
</configuration>
47+
</plugin>
48+
</plugins>
49+
</build>
50+
<repositories>
51+
<repository>
52+
<id>spigot-repo</id>
53+
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
54+
</repository>
55+
<repository>
56+
<id>volmit</id>
57+
<url>http://nexus.volmit.com/content/repositories/volmit</url>
58+
</repository>
59+
</repositories>
60+
<dependencies>
61+
<dependency>
62+
<groupId>org.spigotmc</groupId>
63+
<artifactId>spigot-api</artifactId>
64+
<version>1.12.2-R0.1-SNAPSHOT</version>
65+
<scope>provided</scope>
66+
</dependency>
67+
<dependency>
68+
<groupId>com.volmit</groupId>
69+
<artifactId>VolumePlugin</artifactId>
70+
<version>1.1</version>
71+
</dependency>
72+
<dependency>
73+
<groupId>com.volmit</groupId>
74+
<artifactId>GlossAPI</artifactId>
75+
<version>1.0</version>
76+
</dependency>
77+
</dependencies>
78+
</project>
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
package com.volmit.gloss.chatbubbles;
2+
3+
import java.util.UUID;
4+
5+
import org.bukkit.entity.Player;
6+
import org.bukkit.event.EventHandler;
7+
import org.bukkit.event.EventPriority;
8+
import org.bukkit.event.player.AsyncPlayerChatEvent;
9+
10+
import com.volmit.gloss.api.GLOSS;
11+
import com.volmit.gloss.api.intent.TemporaryDescriptor;
12+
import com.volmit.volume.bukkit.VolumePlugin;
13+
import com.volmit.volume.bukkit.command.CommandTag;
14+
import com.volmit.volume.bukkit.pawn.Async;
15+
import com.volmit.volume.bukkit.task.A;
16+
import com.volmit.volume.bukkit.util.data.Edgy;
17+
import com.volmit.volume.lang.format.F;
18+
import com.volmit.volume.math.M;
19+
20+
@CommandTag("&8[&5GCB&8]:&7 ")
21+
public class GlossChatBubbles extends VolumePlugin
22+
{
23+
@Async
24+
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
25+
public void on(AsyncPlayerChatEvent e)
26+
{
27+
int m = 0;
28+
29+
for(String i : F.wrapWords(e.getMessage(), 32).split("\n"))
30+
{
31+
new A(5 * m)
32+
{
33+
@Override
34+
public void run()
35+
{
36+
bubble(i, e.getPlayer());
37+
}
38+
};
39+
m++;
40+
}
41+
}
42+
43+
@Edgy
44+
@Async
45+
private void bubble(String msg, Player p)
46+
{
47+
TemporaryDescriptor d = GLOSS.getSourceLibrary().createTemporaryDescriptor("chat-" + p.getUniqueId() + "-" + M.ms() + UUID.randomUUID().toString(), p.getEyeLocation().clone().add(0, 1, 0), 5000);
48+
d.addLine("&s&7" + msg);
49+
int trk = GLOSS.getContextLibrary().getView(p).getTrackedBubbles();
50+
51+
d.bindPosition(() ->
52+
{
53+
int size = GLOSS.getContextLibrary().getView(p).getTrackedBubbles();
54+
int index = trk;
55+
double h = GLOSS.getIntentLibrary().getStackSpread() * ((size + index));
56+
double g = GLOSS.getIntentLibrary().getStackSpread() * (index);
57+
double m = size * GLOSS.getIntentLibrary().getStackSpread();
58+
double f = Math.min(index, size) * GLOSS.getIntentLibrary().getStackSpread();
59+
double j = Math.max((m) - (((m / 2D) - ((h + g) / 2D)) + (f * 2D)), 0);
60+
double v = d.getHealth() < 2000 ? (Math.pow(1D - ((double) d.getHealth() / 2000D), 16) * 10D) : 0;
61+
62+
return p.getEyeLocation().clone().add(0, 0.86 + j + v, 0);
63+
});
64+
65+
d.setLocation(p.getEyeLocation());
66+
67+
GLOSS.getContextLibrary().getView(p).setTrackedBubbles(GLOSS.getContextLibrary().getView(p).getTrackedBubbles() + 1);
68+
69+
new A(20 * 5)
70+
{
71+
@Override
72+
public void run()
73+
{
74+
GLOSS.getContextLibrary().getView(p).setTrackedBubbles(GLOSS.getContextLibrary().getView(p).getTrackedBubbles() - 1);
75+
}
76+
};
77+
78+
GLOSS.getSourceLibrary().register(d);
79+
}
80+
}

src/main/resources/plugin.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name: ${project.name}
2+
version: ${project.version}
3+
main: com.volmit.gloss.chatbubbles.GlossChatBubbles
4+
depend: [Gloss]

0 commit comments

Comments
 (0)