mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-07 19:30:48 +01:00
Update to MC 1.13 / Caliburn 0.4.5 / DRECommons 4.3
This commit is contained in:
parent
90c386873a
commit
fa103f2468
@ -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_.
|
||||
|
||||
#### 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](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
|
||||
Make sure that your server uses Java 8 or higher.
|
||||
|
4
pom.xml
4
pom.xml
@ -65,7 +65,7 @@
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.12.2-R0.1-SNAPSHOT</version>
|
||||
<version>1.13-pre7-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -77,7 +77,7 @@
|
||||
<dependency>
|
||||
<groupId>de.erethon</groupId>
|
||||
<artifactId>caliburn</artifactId>
|
||||
<version>0.4.4</version>
|
||||
<version>0.4.5</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -70,7 +70,7 @@ public class PortalCommand extends DRECommand {
|
||||
DPortal dPortal = dGlobalPlayer.getPortal();
|
||||
|
||||
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);
|
||||
dPortal.setWorld(player.getWorld());
|
||||
dGlobalPlayer.setCachedItem(player.getItemInHand());
|
||||
|
@ -16,6 +16,7 @@
|
||||
*/
|
||||
package de.erethon.dungeonsxl.global;
|
||||
|
||||
import de.erethon.caliburn.item.ExItem;
|
||||
import de.erethon.caliburn.item.VanillaItem;
|
||||
import de.erethon.commons.chat.MessageUtil;
|
||||
import de.erethon.commons.misc.BlockUtil;
|
||||
@ -45,23 +46,23 @@ public class DPortal extends GlobalProtection {
|
||||
|
||||
private Block block1;
|
||||
private Block block2;
|
||||
private Material material = Material.PORTAL;
|
||||
private ExItem material = VanillaItem.NETHER_PORTAL;
|
||||
private byte axis;
|
||||
private boolean active;
|
||||
private Set<Block> blocks;
|
||||
|
||||
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);
|
||||
|
||||
this.material = material;
|
||||
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);
|
||||
|
||||
this.block1 = block1;
|
||||
@ -125,7 +126,7 @@ public class DPortal extends GlobalProtection {
|
||||
return;
|
||||
}
|
||||
|
||||
if (player != null && material == Material.PORTAL) {
|
||||
if (player != null && material == VanillaItem.NETHER_PORTAL) {
|
||||
float yaw = player.getPlayer().getLocation().getYaw();
|
||||
if (yaw >= 45 & yaw < 135 || yaw >= 225 & yaw < 315) {
|
||||
axis = 2;//z;
|
||||
@ -165,8 +166,8 @@ public class DPortal extends GlobalProtection {
|
||||
Material type = getWorld().getBlockAt(xx, yy, zz).getType();
|
||||
if (!type.isSolid()) {
|
||||
Block block = getWorld().getBlockAt(xx, yy, zz);
|
||||
block.setType(material, false);
|
||||
if (material == Material.PORTAL) {
|
||||
block.setType(material.getMaterial(), false);
|
||||
if (material == VanillaItem.NETHER_PORTAL) {
|
||||
block.setData(axis);
|
||||
}
|
||||
}
|
||||
@ -268,8 +269,8 @@ public class DPortal extends GlobalProtection {
|
||||
configFile.set(preString + ".loc2.y", block2.getY());
|
||||
configFile.set(preString + ".loc2.z", block2.getZ());
|
||||
|
||||
configFile.set(preString + ".material", VanillaItem.get(material).getId());
|
||||
if (material == Material.PORTAL) {
|
||||
configFile.set(preString + ".material", material.getId());
|
||||
if (material == VanillaItem.NETHER_PORTAL) {
|
||||
configFile.set(preString + ".axis", axis == 2 ? "z" : "x");
|
||||
}
|
||||
}
|
||||
@ -312,7 +313,7 @@ public class DPortal extends GlobalProtection {
|
||||
do {
|
||||
Material type = getWorld().getBlockAt(xx, yy, zz).getType();
|
||||
|
||||
if (type == material) {
|
||||
if (material.getMaterial() == type) {
|
||||
getWorld().getBlockAt(xx, yy, zz).setType(Material.AIR);
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
package de.erethon.dungeonsxl.global;
|
||||
|
||||
import de.erethon.caliburn.item.ExItem;
|
||||
import de.erethon.caliburn.item.VanillaItem;
|
||||
import de.erethon.dungeonsxl.DungeonsXL;
|
||||
import de.erethon.dungeonsxl.player.DGroup;
|
||||
import java.io.File;
|
||||
@ -24,7 +25,6 @@ import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
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"));
|
||||
ExItem material = plugin.getCaliburn().getExItem(data.getString(preString + "material"));
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
package de.erethon.dungeonsxl.sign;
|
||||
|
||||
import de.erethon.caliburn.item.VanillaItem;
|
||||
import de.erethon.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.block.Sign;
|
||||
|
||||
|
@ -9,3 +9,4 @@ commands:
|
||||
dungeonsxl:
|
||||
description: Reference command for DungeonsXL.
|
||||
aliases: [dxl,dungeon]
|
||||
api-version: 1.13
|
||||
|
Loading…
Reference in New Issue
Block a user