Skip to content

Commit

Permalink
Auto Manager: Use RevEnchant's fortune.
Browse files Browse the repository at this point in the history
This may have been a bug, but not sure.  Was successfully loading Rev's fortune level, but it appears like the default minecraft fortune level may have overwritten it. If so, its now fixed.
  • Loading branch information
rbluer committed Sep 6, 2024
1 parent a480c01 commit c56343a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions docs/changelog_v3.3.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ These change logs represent the work that has been going on within prison.

# 3.3.0-alpha.18d 2024-09-05


* **Auto Manager: Use RevEnchant's fortune.**
This may have been a bug, but not sure. Was successfully loading Rev's fortune level, but it appears like the default minecraft fortune level may have overwritten it. If so, its now fixed.


* **Auto Features: blocking: Fixed a bug where 'blockAllBlocks' was incorrectly using 'smeltAllBlocks'.**
Fixed. 'blockAllBlocks' now works properly.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,9 @@ protected int getFortune(SpigotItemStack itemInHand, StringBuilder debugInfo ){
try {
Class.forName( "me.revils.revenchants.api.RevEnchantApi", false, this.getClass().getClassLoader() );

boolean has1 = PrisonNBTUtil.hasNBTInt( itemInHand.getBukkitStack(), "tag");
boolean has2 = PrisonNBTUtil.hasNBTInt( itemInHand.getBukkitStack(), "tag.Enchants");
boolean has3 = PrisonNBTUtil.hasNBTInt( itemInHand.getBukkitStack(), "tag.Enchants.Fortune");
// boolean has1 = PrisonNBTUtil.hasNBTInt( itemInHand.getBukkitStack(), "tag");
// boolean has2 = PrisonNBTUtil.hasNBTInt( itemInHand.getBukkitStack(), "tag.Enchants");
// boolean has3 = PrisonNBTUtil.hasNBTInt( itemInHand.getBukkitStack(), "tag.Enchants.Fortune");

if ( RevEnchantsApi.isTool( itemInHand.getBukkitStack() ) &&
PrisonNBTUtil.hasNBTInt( itemInHand.getBukkitStack(), "tag.Enchants.Fortune") ) {
Expand All @@ -457,6 +457,7 @@ protected int getFortune(SpigotItemStack itemInHand, StringBuilder debugInfo ){
if ( fortRevEnchants > -1 ) {

fortLevel = fortRevEnchants;
usedRevEnchantsFortune = true;

debugInfo.append( "used RevEnchant NBT: level " ).append( fortLevel );
}
Expand All @@ -466,7 +467,7 @@ protected int getFortune(SpigotItemStack itemInHand, StringBuilder debugInfo ){
}


usedRevEnchantsFortune = true;
// usedRevEnchantsFortune = true;
}
}
catch ( Exception e ) {
Expand All @@ -484,6 +485,7 @@ protected int getFortune(SpigotItemStack itemInHand, StringBuilder debugInfo ){

try {
if ( !usedTEFortune &&
!usedRevEnchantsFortune &&
itemInHand != null &&
itemInHand.getBukkitStack() != null &&
itemInHand.getBukkitStack().containsEnchantment( Enchantment.LOOT_BONUS_BLOCKS ) &&
Expand Down

0 comments on commit c56343a

Please sign in to comment.