diff --git a/docs/changelog_v3.3.x.md b/docs/changelog_v3.3.x.md
index e9a059d07..b7774bbbd 100644
--- a/docs/changelog_v3.3.x.md
+++ b/docs/changelog_v3.3.x.md
@@ -17,6 +17,10 @@ These change logs represent the work that has been going on within prison.
# 3.3.0-alpha.19e 2024-12-22
+* **PrisonBlock: Add isSellallOnly to prevent blocks added through sellall from being used in mines.**
+
+
+
* **Sellall: Much better support for blocks with custom names.** Both for rejecting the wrong blocks, but also for now being able to sell them.
These changes are not perfect and does not support some conditions.
Prison currently does not support multiple custom blocks with the same material types and the same display name.
diff --git a/prison-core/src/main/java/tech/mcprison/prison/internal/block/Block.java b/prison-core/src/main/java/tech/mcprison/prison/internal/block/Block.java
index df65f516f..677eb1717 100644
--- a/prison-core/src/main/java/tech/mcprison/prison/internal/block/Block.java
+++ b/prison-core/src/main/java/tech/mcprison/prison/internal/block/Block.java
@@ -36,7 +36,7 @@ public interface Block {
*
* @return The {@link Location} of the block.
*/
- Location getLocation();
+ public Location getLocation();
/**
* Returns the {@link Block} at the position relative to this one.
@@ -44,7 +44,7 @@ public interface Block {
* @param face The {@link BlockFace} that the relative block touches.
* @return The {@link Block} relative to this one.
*/
- Block getRelative(BlockFace face);
+ public Block getRelative(BlockFace face);
// /**
// * Returns the type of this block.
diff --git a/prison-core/src/main/java/tech/mcprison/prison/internal/block/PrisonBlock.java b/prison-core/src/main/java/tech/mcprison/prison/internal/block/PrisonBlock.java
index 9a1601ea3..e0ee6ed29 100644
--- a/prison-core/src/main/java/tech/mcprison/prison/internal/block/PrisonBlock.java
+++ b/prison-core/src/main/java/tech/mcprison/prison/internal/block/PrisonBlock.java
@@ -40,6 +40,7 @@ public class PrisonBlock
private boolean valid = true;
private boolean block = true;
+ private boolean sellallOnly = false;
private boolean legacyBlock = false;
@@ -150,6 +151,8 @@ public PrisonBlock( PrisonBlock clonable ) {
this.useBlockTypeAsPrefix = clonable.isUseBlockTypeAsPrefix();
this.valid = clonable.isValid();
this.block = clonable.isBlock();
+ this.sellallOnly = clonable.isSellallOnly();
+
this.legacyBlock = clonable.isLegacyBlock();
this.setLoreAllowed( clonable.isLoreAllowed() );
@@ -340,6 +343,25 @@ public void setBlock( boolean isBlock ){
this.block = isBlock;
}
+ /**
+ *
If isSellallOnly, this item should never be used within a mine since prison
+ * cannot regenerate the block to place it in the mines. Custom blocks have
+ * many uncontrollable aspects on how they create and use blocks, of which
+ * prison cannot begin to magically guess all of these requirements.
+ *
+ *
+ * If this value is set to true, then the PrisonBlock was added to prison as
+ * a custom block that is supported only within sellall.
+ *
+ *
+ * @return
+ */
+ public boolean isSellallOnly() {
+ return sellallOnly;
+ }
+ public void setSellallOnly(boolean sellallOnly) {
+ this.sellallOnly = sellallOnly;
+ }
/**
* This value isLegacyBlock indicates that there was not a direct match
* with the stored (saved) name of the block, and list of valid block types
diff --git a/prison-core/src/main/java/tech/mcprison/prison/internal/block/PrisonBlockTypes.java b/prison-core/src/main/java/tech/mcprison/prison/internal/block/PrisonBlockTypes.java
index 05e2fe764..ba5cbfff2 100644
--- a/prison-core/src/main/java/tech/mcprison/prison/internal/block/PrisonBlockTypes.java
+++ b/prison-core/src/main/java/tech/mcprison/prison/internal/block/PrisonBlockTypes.java
@@ -114,7 +114,9 @@ public List getBlockTypes( String searchTerm, boolean restrictToBlo
searchTerm = searchTerm.toLowerCase().replace(" ", "_");
for ( PrisonBlock pBlock : getBlockTypes() ) {
- if ( (!restrictToBlocks || restrictToBlocks && pBlock.isBlock()) &&
+ if ( (!restrictToBlocks ||
+ restrictToBlocks &&
+ pBlock.isBlock() && !pBlock.isSellallOnly()) &&
pBlock.getBlockNameSearch().contains( searchTerm )) {
results.add( pBlock );
}
diff --git a/prison-core/src/main/resources/lang/mines/en_US.properties b/prison-core/src/main/resources/lang/mines/en_US.properties
index 325817eea..4ddf1717b 100644
--- a/prison-core/src/main/resources/lang/mines/en_US.properties
+++ b/prison-core/src/main/resources/lang/mines/en_US.properties
@@ -60,7 +60,7 @@
#
-messages__version=5
+messages__version=6
messages__auto_refresh=true
@@ -90,6 +90,7 @@ spawn_set=&7The mine spawnpoint has been set.
spawn_removed=&7The mine spawnpoint has been removed.
spawnpoint_same_world=&7The &cspawnpoint &7must be in the same &cworld &7as the mine.
not_a_block=&c%1 &7is not a block.
+not_a_block_sellall=&c%1 &7is not a block that can be used in mines. Its only for sellall usage.
block_already_added=&7That block has already been added to the mine.
mine_full=&cThe mine will be too full. &7Try lowering the percentage of this block and/or other blocks in the mine to make some room.
block_added=&7Added block &3%1 &7to mine &3%2&7.
diff --git a/prison-core/src/main/resources/lang/mines/es_ES.properties b/prison-core/src/main/resources/lang/mines/es_ES.properties
index dcf8181ba..2f7de6a62 100644
--- a/prison-core/src/main/resources/lang/mines/es_ES.properties
+++ b/prison-core/src/main/resources/lang/mines/es_ES.properties
@@ -60,7 +60,7 @@
#
-messages__version=5
+messages__version=6
messages__auto_refresh=true
reset_warning=&7Todas las minas %1 se reiniciarán en &3%2&7.
@@ -86,6 +86,7 @@ spawn_set=&7El punto de aparición (spawnpoint) de la mina ha sido definid.
spawn_removed=&7The mine spawnpoint has been removed.
spawnpoint_same_world=&7El &cpunto de aparición &7debe estar en el mismo &cmundo &7que la mina.
not_a_block=&c%1 &7no es un bloque.
+not_a_block_sellall=&c%1 &7is not a block that can be used in mines. Its only for sellall usage.
block_already_added=&7Ese bloque ya ha sido añadido a la mina.
mine_full=&cLa mina estará demasiado llena. &7Intenta reduciendo el porcentaje de este bloque y/u otros bloques en la mina para hacer más espacio.
block_added=&7Se ha añadido el bloque &3%1 &7a la mina &3%2&7.
diff --git a/prison-core/src/main/resources/lang/mines/fi_FI.properties b/prison-core/src/main/resources/lang/mines/fi_FI.properties
index a17a07eae..d29b4e55c 100644
--- a/prison-core/src/main/resources/lang/mines/fi_FI.properties
+++ b/prison-core/src/main/resources/lang/mines/fi_FI.properties
@@ -60,7 +60,7 @@
#
-messages__version=5
+messages__version=6
messages__auto_refresh=true
@@ -90,6 +90,7 @@ spawn_set=&7Mainin spawni on asetettu.
spawn_removed=&7Mainin spawni on onnistuneesti poistettu.
spawnpoint_same_world=&cspawnpoint &7pit olla samassa mailmassa kuin maini.
not_a_block=&c%1 &7ei ole blockki.
+not_a_block_sellall=&c%1 &7is not a block that can be used in mines. Its only for sellall usage.
block_already_added=&7Tm blockki on jo listty mainiin..
mine_full=&cMaini on jo tynn.
block_added=&7Listty &3%1 &7mainiin &3%2&7.
diff --git a/prison-core/src/main/resources/lang/mines/fr_FR.properties b/prison-core/src/main/resources/lang/mines/fr_FR.properties
index fccacf7cb..4cc5ac32d 100644
--- a/prison-core/src/main/resources/lang/mines/fr_FR.properties
+++ b/prison-core/src/main/resources/lang/mines/fr_FR.properties
@@ -60,7 +60,7 @@
#
-messages__version=5
+messages__version=6
messages__auto_refresh=true
@@ -89,7 +89,8 @@ mine_does_not_exist=&7Une mine du même nom existe déjà.
spawn_set=&7Le point de spawn de la mine a été défini.
spawn_removed=&7Le point de spawn de la mine a été supprimé.
spawnpoint_same_world=&7Le &cpoint de spawn &7doit être dans le même &cmonde &7que la mine.
-not_a_block=&c%1 &7n'est pas un bloc.
+not_a_block=&c%1 &7n'est pas un bloc..
+not_a_block_sellall=&c%1 &7is not a block that can be used in mines. Its only for sellall usage.
block_already_added=&7Ce bloc a déjà été ajouté dans la mine.
mine_full=&cCette mine sera trop remplie. &7Essaye de réduire le percentage de ce block ou d'un autre dans la mine pour faire de la place.
block_added=&7Le bloc &3%1 &7a été ajoutée à la mine &3%2&7.
diff --git a/prison-core/src/main/resources/lang/mines/hu_HU.properties b/prison-core/src/main/resources/lang/mines/hu_HU.properties
index 83167c089..6ef77b837 100644
--- a/prison-core/src/main/resources/lang/mines/hu_HU.properties
+++ b/prison-core/src/main/resources/lang/mines/hu_HU.properties
@@ -60,7 +60,7 @@
#
-messages__version=5
+messages__version=6
messages__auto_refresh=true
@@ -90,6 +90,7 @@ spawn_set=&7A bánya spawnpontja beállítva.
spawn_removed=&7The mine spawnpoint has been removed.
spawnpoint_same_world=&7A &cspawnpont-nak&7 ugyanabban a &cvilágban&7 bányában kell lennie.
not_a_block=&c%1 &7nem egy blokk.
+not_a_block_sellall=&c%1 &7is not a block that can be used in mines. Its only for sellall usage.
block_already_added=&7Ez a blokk már felkerült a bányába.
mine_full=&cA bánya túlságosan tele lesz. &7Jobban próbáld csökkenteni a blokk és/vagy más blokkok százalékos arányát a bányában.
block_added=&7A blokk hozzáadva &3%1 &7a(z) &3%2&7 bányához.
diff --git a/prison-core/src/main/resources/lang/mines/it_IT.properties b/prison-core/src/main/resources/lang/mines/it_IT.properties
index 50773dfc3..06213227e 100644
--- a/prison-core/src/main/resources/lang/mines/it_IT.properties
+++ b/prison-core/src/main/resources/lang/mines/it_IT.properties
@@ -60,7 +60,7 @@
#
-messages__version=5
+messages__version=6
messages__auto_refresh=true
@@ -90,6 +90,7 @@ spawn_set=&7Il punto di spawn della miniera è stato settato.
spawn_removed=&7The mine spawnpoint has been removed.
spawnpoint_same_world=&7Il &cPunto di spawn &7deve essere nello stesso &cmondo &7della miniera.
not_a_block=&c%1 &7non è un blocco.
+not_a_block_sellall=&c%1 &7is not a block that can be used in mines. Its only for sellall usage.
block_already_added=&7Quel blocco è già stato aggiunto alla miniera.
mine_full=&cLa miniera con quel valore supera il limite. &7Prova ad abbassare la percentuale di questo blocco e / o altri blocchi nella miniera per fare spazio.
block_added=&7Aggiunto il blocco &3%1 &7alla miniera &3%2&7.
diff --git a/prison-core/src/main/resources/lang/mines/nl_BE.properties b/prison-core/src/main/resources/lang/mines/nl_BE.properties
index 7762b0988..a3464ed54 100644
--- a/prison-core/src/main/resources/lang/mines/nl_BE.properties
+++ b/prison-core/src/main/resources/lang/mines/nl_BE.properties
@@ -60,7 +60,7 @@
#
-messages__version=5
+messages__version=6
messages__auto_refresh=true
@@ -88,6 +88,7 @@ spawn_set=&7De mijn zijn startpunt is gezet.
spawn_removed=&7The mine spawnpoint has been removed.
spawnpoint_same_world=&7Het startpunt moet in dezelfde wereld als de mijn zijn .
not_a_block=&c%1 &7is geen blok.
+not_a_block_sellall=&c%1 &7is not a block that can be used in mines. Its only for sellall usage.
block_already_added=&7Deze blok is al in de mijn toegevoegd.
mine_full=&cDe mijn zal te vol worden. &7Probeer het precentage te verlagen van deze blok en/of andere bloken in de mijn om plaats te maken.
block_added=&7blok &3%1 &7bijgevoeg &7bij mijn &3%2&7.
diff --git a/prison-core/src/main/resources/lang/mines/nl_NL.properties b/prison-core/src/main/resources/lang/mines/nl_NL.properties
index 6d980bef4..b40f54a17 100644
--- a/prison-core/src/main/resources/lang/mines/nl_NL.properties
+++ b/prison-core/src/main/resources/lang/mines/nl_NL.properties
@@ -60,7 +60,7 @@
#
-messages__version=5
+messages__version=6
messages__auto_refresh=true
@@ -88,6 +88,7 @@ spawn_set=&7De mijn zijn startpunt is gezet.
spawn_removed=&7The mine spawnpoint has been removed.
spawnpoint_same_world=&7Het startpunt moet in dezelfde wereld als de mijn zijn .
not_a_block=&c%1 &7is geen blok.
+not_a_block_sellall=&c%1 &7is not a block that can be used in mines. Its only for sellall usage.
block_already_added=&7Deze blok is al in de mijn toegevoegd.
mine_full=&cDe mijn zal te vol worden. &7Probeer het precentage te verlagen van deze blok en/of andere bloken in de mijn om plaats te maken.
block_added=&7blok &3%1 &7bijgevoeg &7bij mijn &3%2&7.
diff --git a/prison-core/src/main/resources/lang/mines/pt_PT.properties b/prison-core/src/main/resources/lang/mines/pt_PT.properties
index af7aa2c7b..0ef4465f9 100644
--- a/prison-core/src/main/resources/lang/mines/pt_PT.properties
+++ b/prison-core/src/main/resources/lang/mines/pt_PT.properties
@@ -60,7 +60,7 @@
#
-messages__version=5
+messages__version=6
messages__auto_refresh=true
@@ -90,6 +90,7 @@ spawn_set=&7O spawnpoint da mina foi defenido.
spawn_removed=&7O spawnpoint da mina foi eliminado.
spawnpoint_same_world=&7O &cspawnpoint &7tem de ser no mesmo &cmundo &7que a mina.
not_a_block=&c%1 &7não é um bloco.
+not_a_block_sellall=&c%1 &7is not a block that can be used in mines. Its only for sellall usage.
block_already_added=&7Esse bloco já foi adicionado à mina.
mine_full=&cA mina vai estar cheia demais. &7Tenta baixa a precentagem deste bloco e/ou outros blocos dentro da mina para fazer espaço.
block_added=&7Bloco adicionado &3%1 &7á mina &3%2&7.
diff --git a/prison-core/src/main/resources/lang/mines/ro_RO.properties b/prison-core/src/main/resources/lang/mines/ro_RO.properties
index fe42318c2..0c2169975 100644
--- a/prison-core/src/main/resources/lang/mines/ro_RO.properties
+++ b/prison-core/src/main/resources/lang/mines/ro_RO.properties
@@ -60,7 +60,7 @@
#
-messages__version=5
+messages__version=6
messages__auto_refresh=true
@@ -90,6 +90,7 @@ spawn_set=&7Spawnpoint-ul minei a fost setat.
spawn_removed=&7Spawnpoint-ul minei a fost șters.
spawnpoint_same_world=&cSpawnpoint-ul &7trebuie să fie în aceeași &clume &7cu mina.
not_a_block=&c%1 &7nu este un block.
+not_a_block_sellall=&c%1 &7is not a block that can be used in mines. Its only for sellall usage.
block_already_added=&7Acel block a fost adăugat deja în mină.
mine_full=&cMina va fi prea plină. &7Încearcă să scazi șansele apariției acestui block și/sau altor block-uri din mină pentru a avea mai mult spațiu.
block_added=&7Block-ul &3%1 &7a fost adăugat în mina &3%2&7.
diff --git a/prison-core/src/main/resources/lang/mines/zh-CN.properties b/prison-core/src/main/resources/lang/mines/zh-CN.properties
index d5e632a9b..3259e89a6 100644
--- a/prison-core/src/main/resources/lang/mines/zh-CN.properties
+++ b/prison-core/src/main/resources/lang/mines/zh-CN.properties
@@ -60,7 +60,7 @@
#
-messages__version=4
+messages__version=6
messages__auto_refresh=true
@@ -89,7 +89,8 @@ mine_does_not_exist=&7没有叫这个名字的矿区
spawn_set=&7矿区出生点已设置
spawn_removed=&7矿区出生点已移除
spawnpoint_same_world=&7&c出生点&7必须与矿区位于同一个&c世界&7中
-not_a_block=&c%1 &7不是一个方块,请检查拼写
+not_a_block=&c%1 &7不是一个方块,请检查拼
+not_a_block_sellall=&c%1 &7is not a block that can be used in mines. Its only for sellall usage.
block_already_added=&7该方块已成功添加到矿区中
mine_full=&c矿区满了 &7试着降低该方块或其他方块的百分比,以腾出一些空间
block_added=&7将方块&3%1 &7添加到矿区&3%2&7.
diff --git a/prison-core/src/main/resources/lang/mines/zh_TW.properties b/prison-core/src/main/resources/lang/mines/zh_TW.properties
index 7de3182b6..045bf9d92 100644
--- a/prison-core/src/main/resources/lang/mines/zh_TW.properties
+++ b/prison-core/src/main/resources/lang/mines/zh_TW.properties
@@ -60,7 +60,7 @@
#
-messages__version=6
+messages__version=7
messages__auto_refresh=true
@@ -89,7 +89,8 @@ mine_does_not_exist=&7此礦場名稱並不存在
spawn_set=&7礦場出生點 已成功 設定
spawn_removed=&7The mine spawnpoint has been removed.
spawnpoint_same_world=&7這個 &c出生點 &7必須與其他 礦場 在同一個 &c世界
-not_a_block=&c%1 &7不是一個方塊
+not_a_block=&c%1 &7不是一個方
+not_a_block_sellall=&c%1 &7is not a block that can be used in mines. Its only for sellall usage.
block_already_added=&7此方塊已經被新增到礦場
mine_full=&c此礦場已經滿了。 &7請降低礦場中該方塊或其他方塊的 百分比 以騰出更多空間
block_added=&7將方塊 &3%1 &7加入到礦場 &3%2&7
diff --git a/prison-mines/src/main/java/tech/mcprison/prison/mines/commands/MinesBlockCommands.java b/prison-mines/src/main/java/tech/mcprison/prison/mines/commands/MinesBlockCommands.java
index a1687677a..1448f02cc 100644
--- a/prison-mines/src/main/java/tech/mcprison/prison/mines/commands/MinesBlockCommands.java
+++ b/prison-mines/src/main/java/tech/mcprison/prison/mines/commands/MinesBlockCommands.java
@@ -70,6 +70,12 @@ public void addBlockCommand(CommandSender sender,
return;
}
+ if ( prisonBlock.isSellallOnly() ) {
+ pMines.getMinesMessages().getLocalizable("not_a_block_sellall").
+ withReplacements(block).sendTo(sender);
+ return;
+ }
+
if ( !prisonBlock.isBlock() ) {
pMines.getMinesMessages().getLocalizable("not_a_block").
withReplacements(block).sendTo(sender);
diff --git a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/sellall/SellAllUtil.java b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/sellall/SellAllUtil.java
index 4adfd842b..1f5ec5758 100644
--- a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/sellall/SellAllUtil.java
+++ b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/sellall/SellAllUtil.java
@@ -1556,6 +1556,10 @@ public HashMap initSellAllItems(){
// create a prison block for this sellall item:
pBlock = new PrisonBlock( key.trim().toLowerCase() );
+
+ // Prevent this item from being used within mines:
+ pBlock.setSellallOnly( true );
+
// Add it:
List newBlockTypes = new ArrayList<>();
newBlockTypes.add( pBlock );