1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-25 20:16:13 +01:00

Initial 1.15 support

This commit is contained in:
Zrips 2019-12-12 11:39:42 +02:00
parent 834da89d10
commit 390b1a47ba
4 changed files with 1119 additions and 1053 deletions

18
pom.xml
View File

@ -18,7 +18,7 @@
<dependency> <dependency>
<groupId>org.spigotmc</groupId> <groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId> <artifactId>spigot-api</artifactId>
<version>1.14.4-R0.1-SNAPSHOT</version> <version>1.15-R0.1-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!-- MyPet --> <!-- MyPet -->
@ -184,14 +184,14 @@
<target>1.8</target> <target>1.8</target>
</configuration> </configuration>
</plugin> </plugin>
<!-- <plugin> --> <plugin>
<!-- <groupId>org.apache.maven.plugins</groupId> --> <groupId>org.apache.maven.plugins</groupId>
<!-- <artifactId>maven-jar-plugin</artifactId> --> <artifactId>maven-jar-plugin</artifactId>
<!-- <version>2.3.1</version> --> <version>2.3.1</version>
<!-- <configuration> --> <configuration>
<!-- <outputDirectory>C:\Users\Arte\Desktop\Server 1.14\plugins\</outputDirectory> --> <outputDirectory>C:\Users\Arte\Desktop\Server 1.15\plugins\</outputDirectory>
<!-- </configuration> --> </configuration>
<!-- </plugin> --> </plugin>
</plugins> </plugins>
</build> </build>
</project> </project>

View File

@ -122,9 +122,6 @@ public enum CMIEntityType {
"ZGZiNjc1Y2I1YTdlM2ZkMjVlMjlkYTgyNThmMjRmYzAyMGIzZmE5NTAzNjJiOGJjOGViMjUyZTU2ZTc0In19fQ==")), "ZGZiNjc1Y2I1YTdlM2ZkMjVlMjlkYTgyNThmMjRmYzAyMGIzZmE5NTAzNjJiOGJjOGViMjUyZTU2ZTc0In19fQ==")),
SHULKER(69, "Shulker", Arrays.asList( SHULKER(69, "Shulker", Arrays.asList(
"MWU3MzgzMmUyNzJmODg0NGM0NzY4NDZiYzQyNGEzNDMyZmI2OThjNThlNmVmMmE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jMyZDQzNjU3YmNiNmFhZjRiNTE4MjgyNWIyMmI0In19fQ==")),
ENDER_CRYSTAL(200, "End Crystal"), ENDER_CRYSTAL(200, "End Crystal"),
TURTLE(901, "Turtle", Arrays.asList( TURTLE(901, "Turtle", Arrays.asList(
"MGE0MDUwZTdhYWNjNDUzOTIwMjY1OGZkYzMzOWRkMTgyZDdlMzIyZjlmYmNjNGQ1Zjk5YjU3MThhIn19fQ==")), "MGE0MDUwZTdhYWNjNDUzOTIwMjY1OGZkYzMzOWRkMTgyZDdlMzIyZjlmYmNjNGQ1Zjk5YjU3MThhIn19fQ==")),
@ -231,15 +220,31 @@ public enum CMIEntityType {
COMPLEX_PART(915, "Complex Part"), COMPLEX_PART(915, "Complex Part"),
TIPPED_ARROW(916, "Tipped Arrow"), TIPPED_ARROW(916, "Tipped Arrow"),
RAVAGER(917, "Ravager", Arrays.asList( PANDA(917, "Panda", Arrays.asList(
"ZDE4OGM5ODBhYWNmYTk0Y2YzMzA4ODUxMmIxYjk1MTdiYTgyNmIxNTRkNGNhZmMyNjJhZmY2OTc3YmU4YSJ9fX0=")),
PILLAGER(918, "Pillager", Arrays.asList(
"NGFlZTZiYjM3Y2JmYzkyYjBkODZkYjVhZGE0NzkwYzY0ZmY0NDY4ZDY4Yjg0OTQyZmRlMDQ0MDVlOGVmNTMzMyJ9fX0=")),
RAVAGER(919, "Ravager", Arrays.asList(
"MWNiOWYxMzlmOTQ4OWQ4NmU0MTBhMDZkOGNiYzY3MGM4MDI4MTM3NTA4ZTNlNGJlZjYxMmZlMzJlZGQ2MDE5MyJ9fX0=", "MWNiOWYxMzlmOTQ4OWQ4NmU0MTBhMDZkOGNiYzY3MGM4MDI4MTM3NTA4ZTNlNGJlZjYxMmZlMzJlZGQ2MDE5MyJ9fX0=",
"M2I2MjUwMWNkMWI4N2IzN2Y2MjgwMTgyMTBlYzU0MDBjYjY1YTRkMWFhYjc0ZTZhM2Y3ZjYyYWE4NWRiOTdlZSJ9fX0=")), "M2I2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(
"YjZmZWI3NjFiMmY1OWZhYmU1Y2MzY2M4MmE5MzRiNTM0ZWE5OWVkYjkxMzJjY2RhOWY0ODRiZDU5ODZkNyJ9fX0=",
"MjRhMDM0NzQzNjQzNGViMTNkNTM3YjllYjZiNDViNmVmNGM1YTc4Zjg2ZTkxODYzZWY2MWQyYjhhNTNiODIifX19",
"MTZkYjdkNTA3Mzg5YTE0YmJlYzM5ZGU2OTIyMTY1YjMyZDQzNjU3YmNiNmFhZjRiNTE4MjgyNWIyMmI0In19fQ==")),
CAT(923, "Cat", Arrays.asList(
"N2M5Yjc0MDllN2I1MzgzYzE5YjM2MmIyYTBjYjQzZDUwOTNiMTNlMmIyMzRlOGExODkxNTYzZTU1ZWFlOWQ2OCJ9fX0=",
"NTg4MDNmMDI3MGY4Y2RmNGUwZmU5NzMyZDQ5NjdjY2NjMGEyZjRmY2QxMThjZDE1MDAwOTc5YjE4ODg1MTQ0ZiJ9fX0=")),
BEE(924, "Bee", Arrays.asList(
"OTQ3MzIyZjgzMWUzYzE2OGNmYmQzZTI4ZmU5MjUxNDRiMjYxZTc5ZWIzOWM3NzEzNDlmYWM1NWE4MTI2NDczIn19fQ==",
"OTlkYzNmMDBlY2FiMjI0OWJiNmExNmM4YzUxMTVjZWI5ZjIzMjA1YTBkNTVjYzBlOWJhYmQyNTYyZjc5NTljNCJ9fX0==",
"ZTZiNzRlMDUyYjc0Mjg4Nzk5YmE2ZDlmMzVjNWQwMjIxY2Y4YjA0MzMxNTQ3ZWMyZjY4ZDczNTk3YWUyYzliIn19fQ==",
"YmIxNzc3NDY2MjUxMmQ3ODdlZjc3YjFhNDZhMDRlMmM2ZmQ2Nzc5NGJmN2Y3Nzk1NjZlYjIxYzgxNDNhYWQ5ZSJ9fX0=")),
// if possible we can remove this string for each texture to save up some space // if possible we can remove this string for each texture to save up some space
// eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUv // eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUv
UNKNOWN(999, "Unknown"); UNKNOWN(999, "Unknown");
@ -435,8 +440,7 @@ public enum CMIEntityType {
} }
public CMIMaterial getSpawnEggMaterial() { public CMIMaterial getSpawnEggMaterial() {
CMIMaterial m = CMIMaterial.get((this.equals(CMIEntityType.MUSHROOM_COW) ? CMIMaterial m = CMIMaterial.get((this.equals(CMIEntityType.MUSHROOM_COW) ? "Mooshroom".toLowerCase() : this.toString().toLowerCase()) + "_spawn_egg");
"Mooshroom".toLowerCase() : this.toString().toLowerCase()) + "_spawn_egg");
return m != null && m.isMonsterEgg() ? m : null; return m != null && m.isMonsterEgg() ? m : null;
} }
} }

View File

@ -991,6 +991,15 @@ public enum CMIMaterial {
YELLOW_DYE(null, null, 5952, "Yellow Dye"), YELLOW_DYE(null, null, 5952, "Yellow Dye"),
COMPOSTER(null, null, -4, "Composter"), COMPOSTER(null, null, -4, "Composter"),
//1.15
BEEHIVE("Beehive"),
BEE_NEST("Bee Nest"),
BEE_SPAWN_EGG("Bee Spawn Egg"),
HONEYCOMB("Honeycomb"),
HONEYCOMB_BLOCK("Honeycomb Block"),
HONEY_BLOCK("Honey Block"),
HONEY_BOTTLE("Honey Bottle"),
// Legacy // Legacy
LEGACY_STATIONARY_WATER(9, 0, null, "Stationary Water"), LEGACY_STATIONARY_WATER(9, 0, null, "Stationary Water"),
LEGACY_STATIONARY_LAVA(11, 0, null, "Stationary Lava"), LEGACY_STATIONARY_LAVA(11, 0, null, "Stationary Lava"),
@ -1042,12 +1051,16 @@ public enum CMIMaterial {
this(legacyId, legacyData, id, name, ""); this(legacyId, legacyData, id, name, "");
} }
CMIMaterial(String name, String... legacyName) {
this(null, null, null, name, legacyName);
}
CMIMaterial(Integer legacyId, Integer legacyData, Integer id, String name, String... legacyName) { CMIMaterial(Integer legacyId, Integer legacyData, Integer id, String name, String... legacyName) {
this.legacyId = legacyId; this.legacyId = legacyId;
this.legacyData = legacyData; this.legacyData = legacyData;
this.id = id; this.id = id;
this.name = name; this.name = name;
if (legacyName != null && !legacyName[0].isEmpty()) if (legacyName != null && legacyName.length > 0 && !legacyName[0].isEmpty())
this.legacyName = Arrays.asList(legacyName); this.legacyName = Arrays.asList(legacyName);
} }

View File

@ -0,0 +1,49 @@
package com.gamingmesh.jobs.nmsUtil;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.attribute.Attribute;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.block.BlockPistonRetractEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.Damageable;
import com.gamingmesh.jobs.NMS;
public class v1_15 implements NMS {
@Override
public List<Block> getPistonRetractBlocks(BlockPistonRetractEvent event) {
List<Block> blocks = new ArrayList<>();
blocks.addAll(event.getBlocks());
return blocks;
}
@Override
public String getRealType(Entity entity) {
return entity.getType().name();
}
@Override
public ItemStack getItemInMainHand(Player player) {
return player.getInventory().getItemInMainHand();
}
@Override
public void setItemInMainHand(Player player, ItemStack item) {
player.getInventory().setItemInMainHand(item);
}
@Override
public double getMaxHealth(LivingEntity entity) {
return entity.getAttribute(Attribute.GENERIC_MAX_HEALTH).getBaseValue();
}
@Override
public short getDurability(ItemStack item) {
return (short) ((Damageable) item.getItemMeta()).getDamage();
}
}