Skip to content

Commit

Permalink
Merge branch '1.14'
Browse files Browse the repository at this point in the history
  • Loading branch information
ds58 committed Apr 26, 2019
2 parents 8d9c73b + b7ab2ea commit d3fb9fe
Show file tree
Hide file tree
Showing 78 changed files with 2,043 additions and 1,660 deletions.
48 changes: 24 additions & 24 deletions api/pom.xml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.ruinscraft</groupId>
<artifactId>panilla</artifactId>
<version>1.1</version>
</parent>
<parent>
<groupId>com.ruinscraft</groupId>
<artifactId>panilla</artifactId>
<version>1.1</version>
</parent>

<artifactId>panilla-api</artifactId>
<artifactId>panilla-api</artifactId>

<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.12.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<!-- 1.12.2 netty || should work with 1.12.2+ -->
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.24.Final</version>
<scope>provided</scope>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.12.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<!-- 1.12.2 netty || should work with 1.12.2+ -->
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.24.Final</version>
<scope>provided</scope>
</dependency>
</dependencies>

</project>
143 changes: 75 additions & 68 deletions api/src/main/java/com/ruinscraft/panilla/api/EnchantmentCompat.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,82 +2,89 @@

public enum EnchantmentCompat {

AQUA_AFFINITY("minecraft:aqua_affinity", "WATER_WORKER", 6),
BANE_OF_ARTHROPODS("minecraft:bane_of_arthropods", "DAMAGE_ARTHROPODS", 18),
BINDING_CURSE("minecraft:binding_curse", "BINDING_CURSE", 10),
BLAST_PROTECTION("minecraft:blast_protection", "PROTECTION_EXPLOSIONS", 3),
CHANNELING("minecraft:channeling", "", 68), // 1.13
DEPTH_STRIDER("minecraft:depth_strider", "DEPTH_STRIDER", 8),
EFFICIENCY("minecraft:efficiency", "DIG_SPEED", 32),
FEATHER_FALLING("minecraft:falling", "PROTECTION_FALL", 2),
FIRE_ASPECT("minecraft:fire_aspect", "FIRE_ASPECT", 20),
FIRE_PROTECTION("minecraft:fire_protection", "PROTECTION_FIRE", 1),
FLAME("minecraft:flame", "ARROW_FIRE", 50),
FORTUNE("minecraft:fortune", "LOOT_BONUS_BLOCKS", 35),
FROST_WALKER("minecraft:frost_walker", "FROST_WALKER", 9),
IMPALING("minecraft:impaling", "", 66), // 1.13
INFINITY("minecraft:infinity", "ARROW_INFINITE", 51),
KNOCKBACK("minecraft:knockback", "KNOCKBACK", 19),
LOOTING("minecraft:looting", "LOOT_BONUS_MOBS", 21),
LOYALTY("minecraft:loyalty", "", 65), // 1.13
LUCK_OF_THE_SEA("minecraft:luck_of_the_sea", "LUCK", 61),
LURE("minecraft:lure", "LURE", 62),
MENDING("minecraft:mending", "MENDING", 70),
POWER("minecraft:power", "ARROW_DAMAGE", 48),
PROJECTILE_PROTECTION("minecraft:projectile_protection", "PROTECTION_PROJECTILE", 4),
PROTECTION("minecraft:protection", "PROTECTION_ENVIRONMENTAL", 0),
PUNCH("minecraft:punch", "ARROW_KNOCKBACK", 49),
RESPIRATION("minecraft_respiration", "OXYGEN", 5),
RIPTIDE("minecraft:riptide", "", 67), // 1.13
SHARPNESS("minecraft:sharpness", "DAMAGE_ALL", 16),
SILK_TOUCH("minecraft:silk_touch", "SILK_TOUCH", 33),
SMITE("minecraft:smite", "DAMAGE_UNDEAD", 17),
SWEEPING("minecraft:sweeping", "SWEEPING_EDGE", 22),
THORNS("minecraft:thorns", "THORNS", 7),
UNBREAKING("minecraft:unbreaking", "DURABILITY", 34),
VANISHING_CURSE("minecraft:vanishing_curse", "VANISHING_CURSE", 71);
AQUA_AFFINITY("minecraft:aqua_affinity", "WATER_WORKER", 6),
BANE_OF_ARTHROPODS("minecraft:bane_of_arthropods", "DAMAGE_ARTHROPODS", 18),
BINDING_CURSE("minecraft:binding_curse", "BINDING_CURSE", 10),
BLAST_PROTECTION("minecraft:blast_protection", "PROTECTION_EXPLOSIONS", 3),
CHANNELING("minecraft:channeling", "", 68), // 1.13
DEPTH_STRIDER("minecraft:depth_strider", "DEPTH_STRIDER", 8),
EFFICIENCY("minecraft:efficiency", "DIG_SPEED", 32),
FEATHER_FALLING("minecraft:falling", "PROTECTION_FALL", 2),
FIRE_ASPECT("minecraft:fire_aspect", "FIRE_ASPECT", 20),
FIRE_PROTECTION("minecraft:fire_protection", "PROTECTION_FIRE", 1),
FLAME("minecraft:flame", "ARROW_FIRE", 50),
FORTUNE("minecraft:fortune", "LOOT_BONUS_BLOCKS", 35),
FROST_WALKER("minecraft:frost_walker", "FROST_WALKER", 9),
IMPALING("minecraft:impaling", "", 66), // 1.13
INFINITY("minecraft:infinity", "ARROW_INFINITE", 51),
KNOCKBACK("minecraft:knockback", "KNOCKBACK", 19),
LOOTING("minecraft:looting", "LOOT_BONUS_MOBS", 21),
LOYALTY("minecraft:loyalty", "", 65), // 1.13
LUCK_OF_THE_SEA("minecraft:luck_of_the_sea", "LUCK", 61),
LURE("minecraft:lure", "LURE", 62),
MENDING("minecraft:mending", "MENDING", 70),
POWER("minecraft:power", "ARROW_DAMAGE", 48),
PROJECTILE_PROTECTION("minecraft:projectile_protection", "PROTECTION_PROJECTILE", 4),
PROTECTION("minecraft:protection", "PROTECTION_ENVIRONMENTAL", 0),
PUNCH("minecraft:punch", "ARROW_KNOCKBACK", 49),
RESPIRATION("minecraft_respiration", "OXYGEN", 5),
RIPTIDE("minecraft:riptide", "", 67), // 1.13
SHARPNESS("minecraft:sharpness", "DAMAGE_ALL", 16),
SILK_TOUCH("minecraft:silk_touch", "SILK_TOUCH", 33),
SMITE("minecraft:smite", "DAMAGE_UNDEAD", 17),
SWEEPING("minecraft:sweeping", "SWEEPING_EDGE", 22),
THORNS("minecraft:thorns", "THORNS", 7),
UNBREAKING("minecraft:unbreaking", "DURABILITY", 34),
VANISHING_CURSE("minecraft:vanishing_curse", "VANISHING_CURSE", 71),

public final String namedKey;
public final String legacyName;
public final int legacyId;
// 1.14
MULTISHOT("minecraft:multishot", "", -1),
PIERCING("minecraft:piercing", "", -1),
QUICK_CHARGE("minecraft:quick_charge", "", -1);

private EnchantmentCompat(String namedKey, String legacyName, int legacyId) {
this.namedKey = namedKey;
this.legacyName = legacyName;
this.legacyId = legacyId;
}
public final String namedKey;
public final String legacyName;
public final int legacyId;

public static EnchantmentCompat getByNamedKey(String namedKey) {
for (EnchantmentCompat enchantmentCompat : EnchantmentCompat.values()) {
if (enchantmentCompat.namedKey.equals(namedKey)) {
return enchantmentCompat;
}
}
EnchantmentCompat(String namedKey, String legacyName, int legacyId) {
this.namedKey = namedKey;
this.legacyName = legacyName;
this.legacyId = legacyId;
}

return null;
}
public static EnchantmentCompat getByNamedKey(String namedKey) {
for (EnchantmentCompat enchantmentCompat : EnchantmentCompat.values()) {
if (enchantmentCompat.namedKey.equals(namedKey)) {
return enchantmentCompat;
}
}

public static EnchantmentCompat getByLegacyName(String legacyName) {
if (legacyName.isEmpty())
return null;
return null;
}

for (EnchantmentCompat enchantmentCompat : EnchantmentCompat.values()) {
if (enchantmentCompat.legacyName.equals(legacyName)) {
return enchantmentCompat;
}
}
@Deprecated
public static EnchantmentCompat getByLegacyName(String legacyName) {
if (legacyName.isEmpty())
return null;

return null;
}
for (EnchantmentCompat enchantmentCompat : EnchantmentCompat.values()) {
if (enchantmentCompat.legacyName.equals(legacyName)) {
return enchantmentCompat;
}
}

public static EnchantmentCompat getById(int legacyId) {
for (EnchantmentCompat enchantmentCompat : EnchantmentCompat.values()) {
if (enchantmentCompat.legacyId == legacyId) {
return enchantmentCompat;
}
}
return null;
}

return null;
}
@Deprecated
public static EnchantmentCompat getByLegacyId(int legacyId) {
for (EnchantmentCompat enchantmentCompat : EnchantmentCompat.values()) {
if (enchantmentCompat.legacyId == legacyId) {
return enchantmentCompat;
}
}

return null;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

public interface IContainerCleaner {

void clean(Player player);
void clean(Player player);

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,63 @@

/*
* Minecraft Constants
*
*
* Made up constants should be prefixed with NOT_PROTOCOL_
* and be a reasonable value which would prevent game-breaking things.
*/
public interface IProtocolConstants {

/*
* Values which could potentially change or have changed in previous versions of
* Minecraft
*/
/*
* Values which could potentially change or have changed in previous versions of
* Minecraft
*/

int maxPacketSizeBytes();
int maxPacketSizeBytes();

/*
* Default values that I don't expect to change in future versions of Minecraft
*/
/*
* Default values that I don't expect to change in future versions of Minecraft
*/

default int maxUsernameLength() {
return 16;
}
default int maxUsernameLength() {
return 16;
}

default int maxBookTitleLength() {
return 16;
}
default int maxBookTitleLength() {
return 16;
}

default int maxAnvilRenameChars() {
return 35;
}
default int maxAnvilRenameChars() {
return 35;
}

default int maxSignLineLength() {
return 48;
}
default int maxSignLineLength() {
return 48;
}

default int maxFireworksFlight() {
return 3;
}
default int maxFireworksFlight() {
return 3;
}

default int minFireworksFlight() {
return 1;
}
default int minFireworksFlight() {
return 1;
}

default int maxFireworksExplosions() {
return 8;
}

default int maxSlimeSize() {
return 3; // large slime
}
default int maxFireworksExplosions() {
return 8;
}

/* Not protocol -- Reasonable values/assumptions */
default int maxSlimeSize() {
return 3; // large slime
}

default int NOT_PROTOCOL_maxLoreLineLength() {
return 128;
}
/* Not protocol -- Reasonable values/assumptions */

default int NOT_PROTOCOL_maxLoreLineLength() {
return 128;
}

default int NOT_PROTOCOL_maxLoreLines() {
return 64;
}

}
Loading

0 comments on commit d3fb9fe

Please sign in to comment.