Skip to content

Commit

Permalink
Auto Features: Added support for 9 new Blocking combinations.
Browse files Browse the repository at this point in the history
These can be individually controlled to disable.
  • Loading branch information
rbluer committed Sep 6, 2024
1 parent c56343a commit d0ce4c9
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 12 deletions.
4 changes: 4 additions & 0 deletions docs/changelog_v3.3.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ These change logs represent the work that has been going on within prison.
# 3.3.0-alpha.18d 2024-09-05


* **Auto Features: Added support for 9 new Blocking combinations.**
These can be individually controlled to disable.


* **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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,22 +452,36 @@ public enum AutoFeatures {
blockAllBlocks(blockFeature, true),


blockRawCopperBlock(blockFeature, true),
blockCopperBlock(blockFeature, true),

blockGoldIngot(blockFeature, true),
blockRawGoldBlock(blockFeature, true),
blockGoldBlock(blockFeature, true),
blockIronBlock(blockFeature, true),

blockIronIngot(blockFeature, true),
blockRawIronBlock(blockFeature, true),
blockCoalBlock(blockFeature, true),
blockIronBlock(blockFeature, true),

blockAmethystBlock(blockFeature, true),
blockDiamondBlock(blockFeature, true),
blockRedstoneBlock(blockFeature, true),
blockEmeraldBlock(blockFeature, true),
blockQuartzBlock(blockFeature, true),
blockPrismarineBlock(blockFeature, true),
blockRedstoneBlock(blockFeature, true),

blockCoalBlock(blockFeature, true),
blockLapisBlock(blockFeature, true),
blockSnowBlock(blockFeature, true),
blockPrismarineBlock(blockFeature, true),
blockQuartzBlock(blockFeature, true),

blockBoneBlock(blockFeature, true),
blockDriedKelpBlock(blockFeature, true),
blockGlowstone(blockFeature, true),
blockRawCopperBlock(blockFeature, true),
blockCopperBlock(blockFeature, true),

blockHayBlock(blockFeature, true),
blockNetherWartBlock(blockFeature, true),
blockMelon(blockFeature, true),
blockPackedIceBlock(blockFeature, true),
blockSnowBlock(blockFeature, true),



blockConverters(options),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2705,9 +2705,20 @@ protected void normalDropBlock( Player player, List<SpigotItemStack> drops, Stri

switch ( source )
{
case GOLD_NUGGET:
if ( isAll || isBoolean( AutoFeatures.blockGoldIngot ) ) {

if ( includePlayerInventory ) {
SpigotUtil.getAllDroppedItemTypesFromPlayerInventory(
player, source, drop );
}
SpigotUtil.itemStackReplaceItems( drops, source, XMaterial.GOLD_INGOT, 9, debugInfo );
}
break;

case RAW_GOLD:
if ( isAll || isBoolean( AutoFeatures.blockRawGoldBlock ) ) {

if ( includePlayerInventory ) {
SpigotUtil.getAllDroppedItemTypesFromPlayerInventory(
player, source, drop );
Expand All @@ -2727,9 +2738,20 @@ protected void normalDropBlock( Player player, List<SpigotItemStack> drops, Stri
}
break;

case RAW_IRON:
if ( isAll || isBoolean( AutoFeatures.blockRawIronBlock ) ) {
case IRON_NUGGET:
if ( isAll || isBoolean( AutoFeatures.blockIronIngot ) ) {

if ( includePlayerInventory ) {
SpigotUtil.getAllDroppedItemTypesFromPlayerInventory(
player, source, drop );
}
SpigotUtil.itemStackReplaceItems( drops, source, XMaterial.IRON_INGOT, 9, debugInfo );
}
break;

case RAW_IRON:
if ( isAll || isBoolean( AutoFeatures.blockRawIronBlock ) ) {

if ( includePlayerInventory ) {
SpigotUtil.getAllDroppedItemTypesFromPlayerInventory(
player, source, drop );
Expand Down Expand Up @@ -2826,6 +2848,72 @@ protected void normalDropBlock( Player player, List<SpigotItemStack> drops, Stri
}
break;

case PACKED_ICE:
if ( isAll || isBoolean( AutoFeatures.blockPackedIceBlock ) ) {

if ( includePlayerInventory ) {
SpigotUtil.getAllDroppedItemTypesFromPlayerInventory(
player, source, drop );
}
SpigotUtil.itemStackReplaceItems( drops, source, XMaterial.BLUE_ICE, 9, debugInfo );
}
break;

case BONE_MEAL:
if ( isAll || isBoolean( AutoFeatures.blockBoneBlock ) ) {

if ( includePlayerInventory ) {
SpigotUtil.getAllDroppedItemTypesFromPlayerInventory(
player, source, drop );
}
SpigotUtil.itemStackReplaceItems( drops, source, XMaterial.BONE_BLOCK, 9, debugInfo );
}
break;

case DRIED_KELP:
if ( isAll || isBoolean( AutoFeatures.blockDriedKelpBlock ) ) {

if ( includePlayerInventory ) {
SpigotUtil.getAllDroppedItemTypesFromPlayerInventory(
player, source, drop );
}
SpigotUtil.itemStackReplaceItems( drops, source, XMaterial.DRIED_KELP_BLOCK, 9, debugInfo );
}
break;

case WHEAT:
if ( isAll || isBoolean( AutoFeatures.blockHayBlock ) ) {

if ( includePlayerInventory ) {
SpigotUtil.getAllDroppedItemTypesFromPlayerInventory(
player, source, drop );
}
SpigotUtil.itemStackReplaceItems( drops, source, XMaterial.HAY_BLOCK, 9, debugInfo );
}
break;

case MELON_SLICE:
if ( isAll || isBoolean( AutoFeatures.blockMelon ) ) {

if ( includePlayerInventory ) {
SpigotUtil.getAllDroppedItemTypesFromPlayerInventory(
player, source, drop );
}
SpigotUtil.itemStackReplaceItems( drops, source, XMaterial.MELON, 9, debugInfo );
}
break;

case NETHER_WART:
if ( isAll || isBoolean( AutoFeatures.blockNetherWartBlock ) ) {

if ( includePlayerInventory ) {
SpigotUtil.getAllDroppedItemTypesFromPlayerInventory(
player, source, drop );
}
SpigotUtil.itemStackReplaceItems( drops, source, XMaterial.NETHER_WART_BLOCK, 9, debugInfo );
}
break;

case GLOWSTONE_DUST:
if ( isAll || isBoolean( AutoFeatures.blockGlowstone ) ) {

Expand Down Expand Up @@ -2870,6 +2958,19 @@ protected void normalDropBlock( Player player, List<SpigotItemStack> drops, Stri
}
break;



case AMETHYST_SHARD:
if ( isAll || isBoolean( AutoFeatures.blockAmethystBlock ) ) {

if ( includePlayerInventory ) {
SpigotUtil.getAllDroppedItemTypesFromPlayerInventory(
player, source, drop );
}
SpigotUtil.itemStackReplaceItems( drops, source, XMaterial.AMETHYST_BLOCK, 4, debugInfo );
}
break;

default:
break;
}
Expand Down

0 comments on commit d0ce4c9

Please sign in to comment.