Skip to content

Commit

Permalink
Small Update Bugfixes
Browse files Browse the repository at this point in the history
-Reduced Limit#maxValue for Dexterity from 4.0 to 2.0.
*Attack Speed gained from Dexterity is now diminishing.
*Fixed Modifiers from MAINHAND equipment not syncing to the client.
*Fixed NullPointerException for LootingEvent.
+Incremented version to 1.1.6
  • Loading branch information
CleverNucleus committed Jan 24, 2021
1 parent 4b506a6 commit 10b01df
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false

mod_version=1.1.5
mod_version=1.1.6
mod_group=com.github.clevernucleus
mod_name=playerex
mod_author=CleverNucleus
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class PlayerAttributes {
public static final IPlayerAttribute MELEE_DAMAGE = registerAttribute(new ResourceLocation("melee_damage"), UUID.fromString("608ce27e-c0ad-41c0-af72-0e14bdef431b"), Limit.hold(0.25D, 0.25D, 4D, 0.5D), IPlayerAttribute.Type.GAME, () -> Attributes.ATTACK_DAMAGE);
public static final IPlayerAttribute MELEE_CRIT_DAMAGE = registerAttribute(new ResourceLocation(ExAPI.MODID, "melee_crit_damage"), UUID.fromString("6ac065ba-47d0-4393-9053-4ebfa232ebbc"), Limit.hold(0.05D, 0.05D, 0.3D, 0.4D), IPlayerAttribute.Type.ALL, () -> (new RangedAttribute("attribute.name.playerex.melee_crit_damage", 0D, 0D, Integer.MAX_VALUE)).setShouldWatch(true));
public static final IPlayerAttribute MELEE_CRIT_CHANCE = registerAttribute(new ResourceLocation(ExAPI.MODID, "melee_crit_chance"), UUID.fromString("e0a8db40-8680-4b66-a81c-44dfa7520d8a"), Limit.hold(0.01D, 0.01D, 0.25D, 0.3D), IPlayerAttribute.Type.ALL, () -> (new RangedAttribute("attribute.name.playerex.melee_crit_chance", 0D, 0D, 1D)).setShouldWatch(true));
public static final IPlayerAttribute ATTACK_SPEED = registerAttribute(new ResourceLocation("attack_speed"), UUID.fromString("a27f0fc8-e975-4220-bd0a-4f045933fc13"), Limit.hold(0.25D, 0.25D, 4D, 0.6D), IPlayerAttribute.Type.GAME, () -> Attributes.ATTACK_SPEED);
public static final IPlayerAttribute ATTACK_SPEED = registerAttribute(new ResourceLocation("attack_speed"), UUID.fromString("a27f0fc8-e975-4220-bd0a-4f045933fc13"), Limit.hold(0.25D, 0.25D, 2D, 0.6D), IPlayerAttribute.Type.GAME, () -> Attributes.ATTACK_SPEED);
public static final IPlayerAttribute GRAVITY = registerAttribute(new ResourceLocation("forge", "gravity"), UUID.fromString("1c1e3b0c-665f-462a-a38d-205e61003ec1"), Limit.hold(0.002D, 0.002D, 0.06D, 0.05D), IPlayerAttribute.Type.GAME, ForgeMod.ENTITY_GRAVITY);
public static final IPlayerAttribute EVASION = registerAttribute(new ResourceLocation(ExAPI.MODID, "evasion"), UUID.fromString("6618d0f3-9312-4399-8aa1-6829202685e9"), Limit.hold(0.01D, 0.01D, 0.5D, 0.3D), IPlayerAttribute.Type.ALL, () -> (new RangedAttribute("attribute.name.playerex.evasion", 0D, 0D, 1D)).setShouldWatch(true));
public static final IPlayerAttribute RANGED_DAMAGE = registerAttribute(new ResourceLocation(ExAPI.MODID, "ranged_damage"), UUID.fromString("a5e9b729-49c8-4f26-b37b-782e581edae3"), Limit.hold(0.25D, 0.25D, 4D, 0.5D), IPlayerAttribute.Type.ALL, () -> (new RangedAttribute("attribute.name.playerex.ranged_damage", 0D, 0D, Integer.MAX_VALUE)).setShouldWatch(true));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ public static void onPlayerLoggedOut(final net.minecraftforge.event.entity.playe
@SubscribeEvent
public static void onPlayerEquippedItems(final net.minecraftforge.event.entity.living.LivingEquipmentChangeEvent par0) {
if(!(par0.getEntityLiving() instanceof PlayerEntity)) return;
if(par0.getSlot() == EquipmentSlotType.MAINHAND) return;

PlayerEntity var0 = (PlayerEntity)par0.getEntityLiving();
ExAPI.playerAttributes(var0).ifPresent(var -> ((AttributesCapability)var).putEquipment(par0.getSlot(), par0.getFrom()));
Expand All @@ -196,8 +195,6 @@ public static void onPlayerTick(final net.minecraftforge.event.TickEvent.PlayerT
AttributesCapability var1 = (AttributesCapability)var;

for(EquipmentSlotType var2 : EquipmentSlotType.values()) {
if(var2 == EquipmentSlotType.MAINHAND) continue;

ItemStack var3 = var0.getItemStackFromSlot(var2);
ItemStack var4 = var1.getEquipment(var2);

Expand Down Expand Up @@ -363,6 +360,7 @@ public static void onLivingLoot(final net.minecraftforge.event.entity.living.Loo
if(par0.getDamageSource().getTrueSource() instanceof PlayerEntity) {
PlayerEntity var0 = (PlayerEntity)par0.getDamageSource().getTrueSource();

if(var0 == null) return;
if(var0.world.isRemote) return;

ExAPI.playerAttributes(var0).ifPresent(var -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ public void readNBT(Capability<IPlayerAttributes> par0, IPlayerAttributes par1,
Util.add(var1, var0, PlayerAttributes.ARMOR, var2 * 0.25D, 100D);
});
PlayerAttributes.registerAdder(PlayerAttributes.DEXTERITY.registryName(), (var0, var1, var2) -> {
var1.add(var0, PlayerAttributes.ATTACK_SPEED, var2 * 0.1D);
var1.add(var0, PlayerAttributes.RANGED_DAMAGE, var2 * 0.25D);
Util.add(var1, var0, PlayerAttributes.ATTACK_SPEED, var2 * 0.1D, 8.0D);
Util.add(var1, var0, PlayerAttributes.MOVEMENT_SPEED, var2 * 0.004D, 1.0D);
Util.add(var1, var0, PlayerAttributes.MELEE_CRIT_DAMAGE, var2 * 0.05D, 10.0D);
});
Expand Down Expand Up @@ -117,7 +117,7 @@ public void readNBT(Capability<IPlayerAttributes> par0, IPlayerAttributes par1,
});
PlayerAttributes.registerModifier(PlayerAttributes.DEXTERITY.registryName(), (var0, var1, var2) -> {
Util.apply(var1, var0, PlayerAttributes.RANGED_DAMAGE, var2, 0.25D);
Util.apply(var1, var0, PlayerAttributes.ATTACK_SPEED, var2, 0.1D);
Util.apply(var1, var0, PlayerAttributes.ATTACK_SPEED, var2, 0.1D, 8.0D);
Util.apply(var1, var0, PlayerAttributes.MOVEMENT_SPEED, var2, 0.004D, 1.0D);
Util.apply(var1, var0, PlayerAttributes.MELEE_CRIT_DAMAGE, var2, 0.05D, 10.0D);
});
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ license="MIT License"

[[mods]]
modId="playerex"
version="1.1.5"
version="1.1.6"
displayName="Player Ex"
displayURL="https://github.com/CleverNucleus/PlayerEx"
logoFile="logo.png"
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/assets/playerex/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
"playerex.attribute.strength.alt2": "+0.25 to Armor (diminishing).",
"playerex.attribute.dexterity": "Dexterity: +%s",
"playerex.attribute.dexterity.alt0": "+0.08 Blocks/s to Movement Speed (diminishing).",
"playerex.attribute.dexterity.alt1": "+5%% to Melee Critical Damage. (diminishing).",
"playerex.attribute.dexterity.alt2": "+0.1 to Melee Attack Speed.",
"playerex.attribute.dexterity.alt1": "+5%% to Melee Critical Damage (diminishing).",
"playerex.attribute.dexterity.alt2": "+0.1 to Melee Attack Speed (diminishing).",
"playerex.attribute.dexterity.alt3": "+0.25 to Ranged Attack Damage.",
"playerex.attribute.intelligence": "Intelligence: +%s",
"playerex.attribute.intelligence.alt0": "+5%% to Ranged Critical Damage (diminishing).",
Expand Down

0 comments on commit 10b01df

Please sign in to comment.