mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Fixed a taming NPE
This commit is contained in:
parent
b35c58ec21
commit
b0e8fedf6f
@ -1,3 +1,9 @@
|
||||
Version 2.1.144
|
||||
Fixed a NPE that would happen involving taming in combat processing
|
||||
Updated hu_HU locale (thanks andris155)
|
||||
|
||||
|
||||
|
||||
Version 2.1.143
|
||||
mcMMO now tracks super ability boosted items through persistent metadata
|
||||
mcMMO no longer relies on lore to tell if an item has been modified by a super ability
|
||||
|
2
pom.xml
2
pom.xml
@ -2,7 +2,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.gmail.nossr50.mcMMO</groupId>
|
||||
<artifactId>mcMMO</artifactId>
|
||||
<version>2.1.143</version>
|
||||
<version>2.1.144-SNAPSHOT</version>
|
||||
<name>mcMMO</name>
|
||||
<url>https://github.com/mcMMO-Dev/mcMMO</url>
|
||||
<scm>
|
||||
|
@ -72,7 +72,9 @@ public class InventoryListener implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
Bukkit.broadcastMessage("Debug: Modifying burn time from - "+event.getBurnTime());
|
||||
event.setBurnTime(UserManager.getPlayer(player).getSmeltingManager().fuelEfficiency(event.getBurnTime()));
|
||||
Bukkit.broadcastMessage("Debug: New burn time "+event.getBurnTime());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,8 +5,8 @@ import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.util.StringUtils;
|
||||
import com.gmail.nossr50.util.compat.layers.attackcooldown.PlayerAttackCooldownExploitPreventionLayer;
|
||||
import com.gmail.nossr50.util.compat.layers.persistentdata.AbstractPersistentDataLayer;
|
||||
import com.gmail.nossr50.util.compat.layers.persistentdata.SpigotPersistentDataLayer;
|
||||
import com.gmail.nossr50.util.compat.layers.persistentdata.SpigotTemporaryDataLayer;
|
||||
import com.gmail.nossr50.util.compat.layers.persistentdata.SpigotPersistentDataLayer_1_14;
|
||||
import com.gmail.nossr50.util.compat.layers.persistentdata.SpigotPersistentDataLayer_1_13;
|
||||
import com.gmail.nossr50.util.nms.NMSVersion;
|
||||
import com.gmail.nossr50.util.platform.MinecraftGameVersion;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -67,10 +67,10 @@ public class CompatibilityManager {
|
||||
private void initPersistentDataLayer() {
|
||||
if(minecraftGameVersion.getMinorVersion().asInt() >= 14 || minecraftGameVersion.getMajorVersion().asInt() >= 2) {
|
||||
|
||||
persistentDataLayer = new SpigotPersistentDataLayer();
|
||||
persistentDataLayer = new SpigotPersistentDataLayer_1_14();
|
||||
} else {
|
||||
|
||||
persistentDataLayer = new SpigotTemporaryDataLayer();
|
||||
persistentDataLayer = new SpigotPersistentDataLayer_1_13();
|
||||
}
|
||||
|
||||
supportedLayers.put(CompatibilityType.PERSISTENT_DATA, true);
|
||||
|
@ -16,7 +16,7 @@ import java.util.UUID;
|
||||
/**
|
||||
* Persistent Data API is unavailable
|
||||
*/
|
||||
public class SpigotTemporaryDataLayer extends AbstractPersistentDataLayer {
|
||||
public class SpigotPersistentDataLayer_1_13 extends AbstractPersistentDataLayer {
|
||||
|
||||
private final String FURNACE_OWNER_METADATA_KEY = "mcMMO_furnace_owner";
|
||||
|
@ -14,7 +14,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class SpigotPersistentDataLayer extends AbstractPersistentDataLayer {
|
||||
public class SpigotPersistentDataLayer_1_14 extends AbstractPersistentDataLayer {
|
||||
|
||||
/*
|
||||
* Don't modify these keys
|
@ -414,6 +414,10 @@ public final class CombatUtils {
|
||||
|
||||
if (target.getType() != EntityType.CREEPER && !Misc.isNPCEntityExcludingVillagers(player) && PrimarySkillType.TAMING.getPermissions(player)) {
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
|
||||
if(mcMMOPlayer == null)
|
||||
return;
|
||||
|
||||
TamingManager tamingManager = mcMMOPlayer.getTamingManager();
|
||||
tamingManager.attackTarget(target);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user