Skip to content

Commit

Permalink
支持1.7.10
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCraftGoo committed Feb 24, 2020
1 parent 249562b commit 0683361
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@
<version>1.8.8-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot1.7.10</artifactId>
<version>1.7.10</version>
<systemPath>D:/Minecraft/Plugin/Cores/Spigot1.7.10.jar</systemPath>
<scope>system</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot1.8.8</artifactId>
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/xyz/hstudio/hstudiolibrary/nms/McAccessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ public class McAccessor {

static {
switch (Version.VERSION) {
case v1_7_R4:
INSTANCE = new v1_7_R4();
break;
case v1_8_R3:
INSTANCE = new v1_8_R3();
break;
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/xyz/hstudio/hstudiolibrary/nms/v1_7_R4.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package xyz.hstudio.hstudiolibrary.nms;

import net.minecraft.server.v1_7_R4.ChatComponentText;
import net.minecraft.server.v1_7_R4.PacketPlayOutChat;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
import org.bukkit.entity.Player;

public class v1_7_R4 implements IMcAccessor {

@Override
public void sendActionBar(final Player player, final String msg) {
PacketPlayOutChat packet = new PacketPlayOutChat(new ChatComponentText(msg), (byte) 2);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

public enum Version {

v1_7_R4,
v1_8_R3,
v1_9_R2,
v1_10_R1,
Expand Down

0 comments on commit 0683361

Please sign in to comment.