diff --git a/src/main/java/com/micle/totemofreviving/items/StrawTotemItem.java b/src/main/java/com/micle/totemofreviving/items/StrawTotemItem.java index 938d883..0afeb2f 100755 --- a/src/main/java/com/micle/totemofreviving/items/StrawTotemItem.java +++ b/src/main/java/com/micle/totemofreviving/items/StrawTotemItem.java @@ -29,7 +29,7 @@ public class StrawTotemItem extends Item { public static final String TAG_TARGET_INDEX = "target_index"; public static final String TAG_TARGET_NAME = "target_name"; public static final String TAG_FAIL_CHANCE = "fail_chance"; - public static final int STARTING_FAIL_CHANCE = 50; + public static final int STARTING_FAIL_CHANCE = 35; public StrawTotemItem() { super(new Item.Properties().tab(ItemGroup.TAB_MISC).stacksTo(1).rarity(Rarity.UNCOMMON)); @@ -41,7 +41,7 @@ public class StrawTotemItem extends Item { tooltip.add(new StringTextComponent( TextFormatting.GOLD + "Charges: " + TextFormatting.GRAY + stack.getOrCreateTag().getInt(TAG_CHARGE_AMOUNT))); tooltip.add(new StringTextComponent(TextFormatting.GOLD + "Target: " + TextFormatting.GRAY + stack.getOrCreateTag().getString(TAG_TARGET_NAME))); tooltip.add(new StringTextComponent(TextFormatting.GOLD + "Fail Chance: " + TextFormatting.GRAY + stack.getOrCreateTag().getInt(TAG_FAIL_CHANCE))); - tooltip.add(new StringTextComponent(TextFormatting.GRAY + "\"Feels kinda funky.\"")); + tooltip.add(new StringTextComponent(TextFormatting.ITALIC + "" + TextFormatting.DARK_GRAY + "\"Feels kinda funky.\"")); tooltip.add(new StringTextComponent("")); if (InputMappings.isKeyDown(Minecraft.getInstance().getWindow().getWindow(), GLFW.GLFW_KEY_LEFT_SHIFT)) { tooltip.add(new StringTextComponent(TextFormatting.YELLOW + "R-CLICK")); diff --git a/src/main/java/com/micle/totemofreviving/network/C2SRequestPlayerRevive.java b/src/main/java/com/micle/totemofreviving/network/C2SRequestPlayerRevive.java index 429b215..78e3952 100755 --- a/src/main/java/com/micle/totemofreviving/network/C2SRequestPlayerRevive.java +++ b/src/main/java/com/micle/totemofreviving/network/C2SRequestPlayerRevive.java @@ -60,11 +60,11 @@ public class C2SRequestPlayerRevive { if (item.getOrCreateTag().contains(StrawTotemItem.TAG_FAIL_CHANCE)) { int fail_chance = item.getOrCreateTag().getInt(StrawTotemItem.TAG_FAIL_CHANCE); if (Utils.randomIntRange(0, 100) <= fail_chance) { - sender.setItemInHand(msg.hand, new ItemStack(Items.AIR)); + item.getOrCreateTag().putInt(StrawTotemItem.TAG_CHARGE_AMOUNT, item.getOrCreateTag().getInt(StrawTotemItem.TAG_CHARGE_AMOUNT)-required_charge); + item.getOrCreateTag().putInt(StrawTotemItem.TAG_FAIL_CHANCE, fail_chance-(5*required_charge)); sender.hurt(DamageSource.GENERIC, (sender.getHealth() * (fail_chance / 100.0f))); return; } - sender.setItemInHand(msg.hand, new ItemStack(Items.AIR)); } player_to_revive.teleportTo(sender.getX(), sender.getY(), sender.getZ()); player_to_revive.setGameMode(GameType.SURVIVAL); diff --git a/src/main/java/com/micle/totemofreviving/network/C2SRequestTotemCharge.java b/src/main/java/com/micle/totemofreviving/network/C2SRequestTotemCharge.java index 5e921aa..ec069aa 100755 --- a/src/main/java/com/micle/totemofreviving/network/C2SRequestTotemCharge.java +++ b/src/main/java/com/micle/totemofreviving/network/C2SRequestTotemCharge.java @@ -54,7 +54,7 @@ public class C2SRequestTotemCharge { sender.setItemInHand(msg.hand, new ItemStack(Items.AIR)); sender.hurt(DamageSource.GENERIC, (sender.getHealth() * (fail_chance / 100.0f))); } else { - totem_item.getOrCreateTag().putInt(StrawTotemItem.TAG_FAIL_CHANCE, (int)Utils.clamp(fail_chance+(fail_chance/10), 0, 100)); + totem_item.getOrCreateTag().putInt(StrawTotemItem.TAG_FAIL_CHANCE, fail_chance+5); } } });