Skip to content

Commit 1c12a02

Browse files
committed
Merge branch 'dev' of github.com:GlowstoneMC/Glowstone into dev
2 parents f71f6fb + f0f9fc7 commit 1c12a02

35 files changed

+683
-128
lines changed

pom.xml

+7-9
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@
66
<groupId>net.glowstone</groupId>
77
<artifactId>glowstone</artifactId>
88
<packaging>jar</packaging>
9-
<version>2018.6.0-SNAPSHOT</version>
9+
<version>2018.7.0-SNAPSHOT</version>
1010
<name>Glowstone</name>
1111
<url>https://www.glowstone.net</url>
1212
<description>A fast, customizable and compatible open source Minecraft server.</description>
1313

1414
<properties>
1515
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16-
<api.version>1.12.2-R4.2-SNAPSHOT</api.version>
16+
<api.version>1.12.2-R5.0-SNAPSHOT</api.version>
1717
<minecraft.version>1.12.2</minecraft.version>
1818
<maven.build.timestamp.format>yyyyMMdd-HHmm</maven.build.timestamp.format>
1919
<maven.compiler.source>1.8</maven.compiler.source>
2020
<maven.compiler.target>1.8</maven.compiler.target>
21-
<kotlin.version>1.2.40</kotlin.version>
21+
<kotlin.version>1.2.51</kotlin.version>
2222
<powermock.version>2.0.0-beta.5</powermock.version>
23-
<junit.jupiter.version>5.1.1</junit.jupiter.version>
24-
<junit.vintage.version>5.1.1</junit.vintage.version>
23+
<junit.jupiter.version>5.2.0</junit.jupiter.version>
24+
<junit.vintage.version>5.2.0</junit.vintage.version>
2525
</properties>
2626

2727
<repositories>
@@ -300,14 +300,12 @@
300300
</plugin>
301301
<plugin>
302302
<artifactId>maven-surefire-plugin</artifactId>
303-
<!-- Upgrade to 2.21.0 when junit-platform-surefire-provider 1.2.0 releases
304-
See https://github.com/junit-team/junit5/issues/809 -->
305-
<version>2.19.1</version>
303+
<version>2.22.0</version>
306304
<dependencies>
307305
<dependency>
308306
<groupId>org.junit.platform</groupId>
309307
<artifactId>junit-platform-surefire-provider</artifactId>
310-
<version>1.1.1</version>
308+
<version>1.2.0</version>
311309
</dependency>
312310
<dependency>
313311
<groupId>org.junit.jupiter</groupId>

src/main/java/net/glowstone/GlowWorld.java

+17
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,16 @@ public Collection<Entity> getNearbyEntities(Location location, double x, double
772772
return entityManager.getEntitiesInside(searchBox, except);
773773
}
774774

775+
@Override
776+
public Entity getEntity(UUID uuid) {
777+
for (Entity entity : getEntities()) {
778+
if (entity.getUniqueId().equals(uuid)) {
779+
return entity;
780+
}
781+
}
782+
return null;
783+
}
784+
775785
@Override
776786
public List<Entity> getEntities() {
777787
return new ArrayList<>(entityManager.getAll());
@@ -1703,6 +1713,13 @@ public boolean createExplosion(Location loc, float power, boolean setFire) {
17031713
return createExplosion(loc.getX(), loc.getY(), loc.getZ(), power, setFire, true);
17041714
}
17051715

1716+
@Override
1717+
public boolean createExplosion(Entity source, Location loc, float power, boolean setFire,
1718+
boolean breakBlocks) {
1719+
return createExplosion(source, loc.getX(), loc.getY(), loc.getZ(), power, setFire,
1720+
breakBlocks);
1721+
}
1722+
17061723
@Override
17071724
public boolean createExplosion(double x, double y, double z, float power) {
17081725
return createExplosion(x, y, z, power, false, true);

src/main/java/net/glowstone/block/itemtype/ItemBow.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import org.bukkit.inventory.meta.PotionMeta;
2323

2424
public class ItemBow extends ItemTimedUsage {
25-
private static final long TICKS_TO_FULLY_CHARGE = 20;
25+
private static final int TICKS_TO_FULLY_CHARGE = 20;
2626
private static final double MAX_BASE_DAMAGE = 9;
2727
private static final double MAX_SPEED = 40;
2828

@@ -83,9 +83,9 @@ public void endUse(GlowPlayer player, ItemStack bow) {
8383
- Floats.constrainToRange(player.getUsageTime(), 0.0f, TICKS_TO_FULLY_CHARGE))
8484
/ TICKS_TO_FULLY_CHARGE;
8585
EntityShootBowEvent event = EventFactory.getInstance().callEvent(
86-
new EntityShootBowEvent(player, bow, launchedProjectile, chargeFraction,
86+
new EntityShootBowEvent(player, bow, arrow, launchedProjectile, chargeFraction,
8787
consumeArrow));
88-
consumeArrow = event.isConsumeArrow();
88+
consumeArrow = event.getConsumeArrow();
8989
//TODO: Call for Skeleton firing too when implemented
9090

9191
if (event.isCancelled()) {

src/main/java/net/glowstone/constants/ItemIds.java

+12-1
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ private ItemIds() {
502502
}
503503

504504
/**
505-
* Get the string identifier for a specified Material.
505+
* Get the full string identifier for a specified Material.
506506
*
507507
* @param mat the Material.
508508
* @return the identifier.
@@ -512,6 +512,17 @@ public static String getName(Material mat) {
512512
return names.get(mat.getId());
513513
}
514514

515+
/**
516+
* Get the key segment of the string identifier for a specified Material.
517+
*
518+
* @param mat the Material.
519+
* @return the identifier.
520+
*/
521+
public static String getKeyName(Material mat) {
522+
String[] segments = getName(mat).split(":");
523+
return segments[segments.length - 1];
524+
}
525+
515526
/**
516527
* Get the Material corresponding to the specified item identifier.
517528
*

0 commit comments

Comments
 (0)