Update to MC 1.13 / Caliburn 0.4.5 / DRECommons 4.3

This commit is contained in:
Daniel Saukel 2018-07-17 16:12:13 +02:00
parent 90c386873a
commit fa103f2468
7 changed files with 19 additions and 18 deletions

View File

@ -55,10 +55,10 @@ Building DungeonsXL from source requires [Apache Maven](https://maven.apache.org
Maven automatically fetches all dependencies and builds DungeonsXL; just run _build.bat_ or enter the command _mvn clean install_. Maven automatically fetches all dependencies and builds DungeonsXL; just run _build.bat_ or enter the command _mvn clean install_.
#### DRECommons #### DRECommons
[DRECommons](https://github.com/DRE2N/DRECommons) is a util library for common tasks. DungeonsXL contains DRECommons 4.2.1. [DRECommons](https://github.com/DRE2N/DRECommons) is a util library for common tasks. DungeonsXL contains DRECommons 4.3.
#### Caliburn API #### Caliburn API
[Caliburn](https://github.com/DRE2N/CaliburnAPI) is an API to read custom items and mobs from config files. DungeonsXL contains Caliburn Beta 0.4.2. [Caliburn](https://github.com/DRE2N/CaliburnAPI) is an API to read custom items and mobs from config files. DungeonsXL contains Caliburn Beta 0.4.5.
### Java ### Java
Make sure that your server uses Java 8 or higher. Make sure that your server uses Java 8 or higher.

View File

@ -65,7 +65,7 @@
<dependency> <dependency>
<groupId>org.spigotmc</groupId> <groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId> <artifactId>spigot-api</artifactId>
<version>1.12.2-R0.1-SNAPSHOT</version> <version>1.13-pre7-R0.1-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -77,7 +77,7 @@
<dependency> <dependency>
<groupId>de.erethon</groupId> <groupId>de.erethon</groupId>
<artifactId>caliburn</artifactId> <artifactId>caliburn</artifactId>
<version>0.4.4</version> <version>0.4.5</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -70,7 +70,7 @@ public class PortalCommand extends DRECommand {
DPortal dPortal = dGlobalPlayer.getPortal(); DPortal dPortal = dGlobalPlayer.getPortal();
if (dPortal == null) { if (dPortal == null) {
dPortal = new DPortal(plugin.getGlobalProtections().generateId(DPortal.class, player.getWorld()), player.getWorld(), material.getMaterial(), false); dPortal = new DPortal(plugin.getGlobalProtections().generateId(DPortal.class, player.getWorld()), player.getWorld(), material, false);
dGlobalPlayer.setCreatingPortal(dPortal); dGlobalPlayer.setCreatingPortal(dPortal);
dPortal.setWorld(player.getWorld()); dPortal.setWorld(player.getWorld());
dGlobalPlayer.setCachedItem(player.getItemInHand()); dGlobalPlayer.setCachedItem(player.getItemInHand());

View File

@ -16,6 +16,7 @@
*/ */
package de.erethon.dungeonsxl.global; package de.erethon.dungeonsxl.global;
import de.erethon.caliburn.item.ExItem;
import de.erethon.caliburn.item.VanillaItem; import de.erethon.caliburn.item.VanillaItem;
import de.erethon.commons.chat.MessageUtil; import de.erethon.commons.chat.MessageUtil;
import de.erethon.commons.misc.BlockUtil; import de.erethon.commons.misc.BlockUtil;
@ -45,23 +46,23 @@ public class DPortal extends GlobalProtection {
private Block block1; private Block block1;
private Block block2; private Block block2;
private Material material = Material.PORTAL; private ExItem material = VanillaItem.NETHER_PORTAL;
private byte axis; private byte axis;
private boolean active; private boolean active;
private Set<Block> blocks; private Set<Block> blocks;
public DPortal(int id, World world, boolean active) { public DPortal(int id, World world, boolean active) {
this(id, world, Material.PORTAL, active); this(id, world, VanillaItem.NETHER_PORTAL, active);
} }
public DPortal(int id, World world, Material material, boolean active) { public DPortal(int id, World world, ExItem material, boolean active) {
super(world, id); super(world, id);
this.material = material; this.material = material;
this.active = active; this.active = active;
} }
public DPortal(int id, Block block1, Block block2, Material material, byte axis, boolean active) { public DPortal(int id, Block block1, Block block2, ExItem material, byte axis, boolean active) {
super(block1.getWorld(), id); super(block1.getWorld(), id);
this.block1 = block1; this.block1 = block1;
@ -125,7 +126,7 @@ public class DPortal extends GlobalProtection {
return; return;
} }
if (player != null && material == Material.PORTAL) { if (player != null && material == VanillaItem.NETHER_PORTAL) {
float yaw = player.getPlayer().getLocation().getYaw(); float yaw = player.getPlayer().getLocation().getYaw();
if (yaw >= 45 & yaw < 135 || yaw >= 225 & yaw < 315) { if (yaw >= 45 & yaw < 135 || yaw >= 225 & yaw < 315) {
axis = 2;//z; axis = 2;//z;
@ -165,8 +166,8 @@ public class DPortal extends GlobalProtection {
Material type = getWorld().getBlockAt(xx, yy, zz).getType(); Material type = getWorld().getBlockAt(xx, yy, zz).getType();
if (!type.isSolid()) { if (!type.isSolid()) {
Block block = getWorld().getBlockAt(xx, yy, zz); Block block = getWorld().getBlockAt(xx, yy, zz);
block.setType(material, false); block.setType(material.getMaterial(), false);
if (material == Material.PORTAL) { if (material == VanillaItem.NETHER_PORTAL) {
block.setData(axis); block.setData(axis);
} }
} }
@ -268,8 +269,8 @@ public class DPortal extends GlobalProtection {
configFile.set(preString + ".loc2.y", block2.getY()); configFile.set(preString + ".loc2.y", block2.getY());
configFile.set(preString + ".loc2.z", block2.getZ()); configFile.set(preString + ".loc2.z", block2.getZ());
configFile.set(preString + ".material", VanillaItem.get(material).getId()); configFile.set(preString + ".material", material.getId());
if (material == Material.PORTAL) { if (material == VanillaItem.NETHER_PORTAL) {
configFile.set(preString + ".axis", axis == 2 ? "z" : "x"); configFile.set(preString + ".axis", axis == 2 ? "z" : "x");
} }
} }
@ -312,7 +313,7 @@ public class DPortal extends GlobalProtection {
do { do {
Material type = getWorld().getBlockAt(xx, yy, zz).getType(); Material type = getWorld().getBlockAt(xx, yy, zz).getType();
if (type == material) { if (material.getMaterial() == type) {
getWorld().getBlockAt(xx, yy, zz).setType(Material.AIR); getWorld().getBlockAt(xx, yy, zz).setType(Material.AIR);
} }

View File

@ -17,6 +17,7 @@
package de.erethon.dungeonsxl.global; package de.erethon.dungeonsxl.global;
import de.erethon.caliburn.item.ExItem; import de.erethon.caliburn.item.ExItem;
import de.erethon.caliburn.item.VanillaItem;
import de.erethon.dungeonsxl.DungeonsXL; import de.erethon.dungeonsxl.DungeonsXL;
import de.erethon.dungeonsxl.player.DGroup; import de.erethon.dungeonsxl.player.DGroup;
import java.io.File; import java.io.File;
@ -24,7 +25,6 @@ import java.util.HashSet;
import java.util.Set; import java.util.Set;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.Sign; import org.bukkit.block.Sign;
@ -249,7 +249,7 @@ public class GlobalProtectionCache {
Block block2 = world.getBlockAt(data.getInt(preString + "loc2.x"), data.getInt(preString + "loc2.y"), data.getInt(preString + "loc2.z")); Block block2 = world.getBlockAt(data.getInt(preString + "loc2.x"), data.getInt(preString + "loc2.y"), data.getInt(preString + "loc2.z"));
ExItem material = plugin.getCaliburn().getExItem(data.getString(preString + "material")); ExItem material = plugin.getCaliburn().getExItem(data.getString(preString + "material"));
String axis = data.getString(preString + "axis"); String axis = data.getString(preString + "axis");
DPortal dPortal = new DPortal(id, block1, block2, material != null ? material.getMaterial() : Material.PORTAL, (byte) (axis != null && axis.equals("z") ? 2 : 1), true); DPortal dPortal = new DPortal(id, block1, block2, material != null ? material : VanillaItem.NETHER_PORTAL, (byte) (axis != null && axis.equals("z") ? 2 : 1), true);
dPortal.create(null); dPortal.create(null);
} }

View File

@ -16,7 +16,6 @@
*/ */
package de.erethon.dungeonsxl.sign; package de.erethon.dungeonsxl.sign;
import de.erethon.caliburn.item.VanillaItem;
import de.erethon.dungeonsxl.world.DGameWorld; import de.erethon.dungeonsxl.world.DGameWorld;
import org.bukkit.block.Sign; import org.bukkit.block.Sign;

View File

@ -9,3 +9,4 @@ commands:
dungeonsxl: dungeonsxl:
description: Reference command for DungeonsXL. description: Reference command for DungeonsXL.
aliases: [dxl,dungeon] aliases: [dxl,dungeon]
api-version: 1.13