Skip to content
Permalink
Browse files

Initial 1.15 stuff.

Materials is not really cross-version compatible. Really could do with
some rewriting at some point.
  • Loading branch information
wizjany committed Dec 11, 2019
1 parent c5355ad commit 9adac4f2396d0a4078a52666d057bfaea5fab76c
@@ -24,7 +24,8 @@ repositories {
dependencies {
"compile"(project(":worldguard-core"))
//"compile"(project(":worldguard-libs:bukkit"))
"api"("com.destroystokyo.paper:paper-api:1.14.4-R0.1-SNAPSHOT")
//"api"("com.destroystokyo.paper:paper-api:1.14.4-R0.1-SNAPSHOT")
"api"("org.spigotmc:spigot-api:1.15-R0.1-SNAPSHOT")
"implementation"("io.papermc:paperlib:1.0.2")
"api"("com.sk89q.worldedit:worldedit-bukkit:7.0.1-SNAPSHOT") { isTransitive = false }
"implementation"("com.sk89q:commandbook:2.3") { isTransitive = false }
@@ -262,7 +262,7 @@ private void addAll(@Nullable Object... element) {
} else if (o instanceof Projectile) {
addAll(((Projectile) o).getShooter());
} else if (o instanceof Firework && PaperLib.isPaper()) {
UUID spawningUUID = ((Firework) o).getSpawningEntity();
UUID spawningUUID = null;//((Firework) o).getSpawningEntity();
if (spawningUUID != null) {
Entity spawningEntity = Bukkit.getEntity(spawningUUID);
if (spawningEntity != null) {
@@ -130,7 +130,7 @@ protected RegionAssociable createRegionAssociable(Cause cause) {
Location loc;
if (PaperLib.isPaper()
&& ((BukkitWorldConfiguration) getWorldConfig(BukkitAdapter.adapt(entity.getWorld()))).usePaperEntityOrigin) {
loc = entity.getOrigin();
loc = null;//entity.getOrigin();
if (loc == null) {
loc = entity.getLocation();
}
@@ -692,6 +692,16 @@
MATERIAL_FLAGS.put(Material.SUSPICIOUS_STEW, 0);
MATERIAL_FLAGS.put(Material.SWEET_BERRIES, 0);

// 1.15
try {
MATERIAL_FLAGS.put(Material.BEEHIVE, MODIFIED_ON_RIGHT);
MATERIAL_FLAGS.put(Material.BEE_NEST, 0);
MATERIAL_FLAGS.put(Material.HONEY_BLOCK, 0);
MATERIAL_FLAGS.put(Material.HONEYCOMB_BLOCK, 0);
MATERIAL_FLAGS.put(Material.HONEY_BOTTLE, 0);
MATERIAL_FLAGS.put(Material.HONEYCOMB, 0);
} catch (NoSuchFieldError ignored) {
}

// Fake tags
for (Material m : shulkerBoxes) {
@@ -998,6 +1008,7 @@ public static boolean isSpawnEgg(Material material) {
switch (material) {
case SPIDER_SPAWN_EGG:
case BAT_SPAWN_EGG:
case BEE_SPAWN_EGG:
case BLAZE_SPAWN_EGG:
case CAT_SPAWN_EGG:
case CAVE_SPIDER_SPAWN_EGG:
@@ -1066,6 +1077,8 @@ public static EntityType getEntitySpawnEgg(Material material) {
return EntityType.SPIDER;
case BAT_SPAWN_EGG:
return EntityType.BAT;
case BEE_SPAWN_EGG:
return EntityType.BEE;
case BLAZE_SPAWN_EGG:
return EntityType.BLAZE;
case CAT_SPAWN_EGG:
@@ -19,7 +19,7 @@

package com.sk89q.worldguard.util.profile.resolver;

import com.destroystokyo.paper.profile.PlayerProfile;
//import com.destroystokyo.paper.profile.PlayerProfile;
import com.sk89q.worldguard.util.profile.Profile;
import io.papermc.lib.PaperLib;
import org.bukkit.Bukkit;
@@ -43,11 +43,11 @@ public int getIdealRequestLimit() {
@Override
@Nullable
public Profile findByName(String name) {
PlayerProfile profile = Bukkit.createProfile(name);
if (profile.completeFromCache()) {
//noinspection ConstantConditions - completeFromCache guarantees non-null on success
return new Profile(profile.getId(), profile.getName());
}
// PlayerProfile profile = Bukkit.createProfile(name);
// if (profile.completeFromCache()) {
// //noinspection ConstantConditions - completeFromCache guarantees non-null on success
// return new Profile(profile.getId(), profile.getName());
// }
return null;
}

0 comments on commit 9adac4f

Please sign in to comment.
You can’t perform that action at this time.