Skip to content

Commit

Permalink
v2.0.5 - Fixed issue with arrows
Browse files Browse the repository at this point in the history
*Fixed arrows causing crashes on servers.
*Fixed ranged crit chance displaying melee crit damage instead of the appropriate stat.
+A few minor fixes/streamlining.
+Incremented version to 2.0.5.
  • Loading branch information
CleverNucleus committed Jul 23, 2021
1 parent 55bfaf0 commit 367db3f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ org.gradle.jvmargs=-Xmx2G
loader_version=0.11.3

# Mod Properties
mod_version = 2.0.4
mod_version = 2.0.5
maven_group = com.github.clevernucleus
archives_base_name = playerex

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private void meleeCritTT(MatrixStack matrices, int mouseX, int mouseY) {

private void rangedCritTT(MatrixStack matrices, int mouseX, int mouseY) {
List<Text> tooltip = new ArrayList<Text>();
IPlayerAttribute attribute = PlayerAttributes.MELEE_CRIT_CHANCE.get();
IPlayerAttribute attribute = PlayerAttributes.RANGED_CRIT_DAMAGE.get();

tooltip.add((new TranslatableText("gui.playerex.tooltip.ranged_crit_damage")).formatted(Formatting.GRAY));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,13 @@ public static void onArrowHit(ProjectileEntity projectile, Random rand) {

PersistentProjectileEntity arrow = (PersistentProjectileEntity)projectile;

if(arrow.getOwner() == null) return;
if(arrow.getOwner() instanceof PlayerEntity) {
PlayerEntity player = (PlayerEntity)arrow.getOwner();
AttributeData data = ExAPI.DATA.get(player);

if(player.world.isClient) return;

float critChance = (float)data.get(PlayerAttributes.RANGED_CRIT_CHANCE.get());
float critDamage = (float)data.get(PlayerAttributes.RANGED_CRIT_DAMAGE.get());
float nextDamage = (float)data.get(PlayerAttributes.RANGED_DAMAGE.get());
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"id": "playerex",
"version": "2.0.4",
"version": "2.0.5",
"name": "PlayerEx",
"description": "Implements a more detailed attributes system with an rpg theme.",
"authors": [
Expand Down

0 comments on commit 367db3f

Please sign in to comment.