Ore Stages
This mod is an addon for the GameStage API. It allows for blocks in the world, like ores, to be put into game stages. You should check out the GameStage API mod's description for more info. To give a brief run down, stages are parts of the progression system set up by the modpack or server. Stages are given to players through a command, which is typically ran by a questing mod, advancement, or even a Command Block.
This project is sponsored by Nodecraft. Use code Darkhax for 30% off your first month of service!
Setup
This mod uses CraftTweaker for configuration.
What happens when staged?
If a player does not have the right stage for the block
- The block will look like the block it is hidden as.
- The player will not be able to right click the block.
- The block will drop the items it's replacement would drop.
- The block will take as long to mine as it's replacement.
In situations where no player is present, it will be assumed that there is no stage. This is referred to as defaulting behavior.
Will changing blocks back to normal cause any lag?
Unhiding the blocks is very fast. The process involves reloading the chunk renderers on the the client. While this may sound complicated or laggy, it's actually very simple that on even slower computers will only take a second or two at most. This is the same as pressing f3 + a in vanilla.
CraftTweaker methods
This method can be used to replace a block with vanilla stone.
mods.orestages.OreStages.addReplacement(String stage, IIngredient original);
This method can be used to replace a block with another block.
mods.orestages.OreStages.addReplacement(String stage, IIngredient original, IItemStack replacement);
This method can be used to replace a block with another block by specifying exact block ids. The above two methods only work for blocks with items.
mods.orestages.OreStages.addReplacementById(String stage, String original, String replacement);
The following methods are used to add a replacement which do not use the defaulting behavior. Meaning if no player broke the block (water, explosion, machine) the block will break as if it was not hidden.
mods.orestages.OreStages.addNonDefaultingReplacement(String stage, IIngredient original);
mods.orestages.OreStages.addNonDefaultingReplacement(String stage, IIngredient original, IItemStack replacement);
mods.orestages.OreStages.addNonDefaultingReplacementById(String stage, String original, String replacement);
Example Script
mods.orestages.OreStages.addReplacementById("one", "minecraft:potatoes:*", "minecraft:tallgrass:2");
mods.orestages.OreStages.addReplacementById("two", "minecraft:wheat:*", "minecraft:carrots:3");
mods.orestages.OreStages.addReplacementById("three", "minecraft:nether_wart:*", "minecraft:beetroots");
mods.orestages.OreStages.addReplacement("four", <minecraft:dirt>, <minecraft:stone>);
mods.orestages.OreStages.addReplacement("one", <minecraft:obsidian>, <minecraft:cobblestone>);
mods.orestages.OreStages.addNonDefaultingReplacement("one", <minecraft:torch:*>, <minecraft:redstone_torch>);
mods.orestages.OreStages.addReplacement("five", <minecraft:furnace:*>, <minecraft:stone>);
Despite using mods.orestages.OreStages.addNonDefaultingReplacement, the Digital Miner from Mekanism detects hidden ores, but when it mines them it gets the replacement drop. How can I fix this?
EDIT: SOLUTION.
1) Add a file in the config folder named gameStagesFakePlayerData.json (I don't know if the name actually matters, but it works this way and this name clarifies what the file is about, so I'm rolling with it.)
2) Add this in the file:
[
{
"fakePlayerName" : "[Mekanism]",
"stages": [ "stage1", "stage2" ]
}
]
Remember to change stage1 and stage2 with the actual stages in your modpack. You need to add at least one (obviously) and you can expand the list by adding a comma separating stage names.
You can actually repeat this for any auto mining method that uses a fake player.
Possible questions:
-How do I know if an auto miner uses a fake player?
Open a creative world and set the miner to work. If gated blocks drop themselves, you're good. If they drop what the replacement would, they are using fake players.
I am no computer genius, so I don't know if ALL auto miners must use fake players.
-How do I know the fake player's name?
After you started the miner in your creative test world and you see it only mines replacements, close the game. Open the logs folder in the same directory as confing and open the latest.log file. Now use the search function of your text editor (ctrl+f often opens it) and search for "Fake player" (no quotes included of course). Among a few other things, you will find a few lines saying this:
Fake player DEFAULT does not have stage magician. Thay do have [].
(Yes it says "Thay" instead of "They", at least in my log files. It might help you find that specific line).
Above each of those "Fake player" lines there are lines that say something like this:
Could not find stage data for [Mekanism]. Using default data.
or
Could not find stage data for AS-FakePlayer. Using default data.
If you are using Astral Sorcery's evorsio ritual.
The name of the fake player you're looking for is there, between "for" and the full stop.
Here's how my gameStagesFakePlayerData.json file looks like:
[
{
"fakePlayerName" : "AS-FakePlayer",
"stages": [ "first", "second" ]
};
{
"fakePlayerName" : "[Mekanism]",
"stages": [ "first", "second" ]
}
]
Remember the comma to separate stages and the semicolon to separate the brackets (5th line in my example)
the mod works fine until i attempt to use one of my own blocks from my mod. the mod is More TCon, and idk why it cant find any blocks.
https://pastebin.com/7eTKCTyt
here is the 2 different methods i tried to to register the blocks.
if this problem is on my end, please let me know so i can fix it
mods.orestages.OreStages.addNonDefaultingReplacement("metallic_age", <ore:oreRadium>, <fhantoncore:unidentifiedore>);
mods.orestages.OreStages.addNonDefaultingReplacement("metallic_age", <ore:oreFusionite>, <fhantoncore:unidentifiedore>);
mods.orestages.OreStages.addNonDefaultingReplacement("metallic_age", <tconmaterial:oreradium:*>, <fhantoncore:unidentifiedore>);
mods.orestages.OreStages.addNonDefaultingReplacement("metallic_age", <tconmaterial:orefusionite:*>, <fhantoncore:unidentifiedore>);
In situations where no player is present, it will be assumed that there is no stage. This is referred to as defaulting behavior.
is there a way to make it so that it will assume a stage like say if you had the digital miner from mekanism could you make it so it could mine blocks that need a stage
Does this affect fake players like a minecolonies npc? or do they ignore it?
In reply to teagan75:
Fake players need special handling. This can usually be done in the configs.
I'm trying to do something a little weird, and I might need help. I'm using CofH World to place deposits of sulfur from Pollution of the Realms upon worldgen. I was hoping to use this mod to hide them/keep them inactive until a certain stage was added. Unfortunately, even though disguised, they still behave like the base blocks - they visibly appear to be the placeholder, but they still float up into the sky and contribute to the pollution amount.
I'm assuming what I want to do just isn't possible, and is an unusual enough use case that it wouldn't be worth trying to accommodate, but I wanted to ask just in case you had any insight on how I might accomplish this? Thanks so much! :)
In reply to monsterpants:
Yep, only basic/standard minecraft features are covered by this mod. So visibility, break speed, and harvest level.
In reply to DarkhaxDev:
That makes sense. Thanks for the response! :)
Im having real troubles with this mod. I got it to replace all silver ore with stone on stage 1 but i need when they get to stage 2 it becomes silver again
In reply to Forge_User_55114010:
I think you may be confused about how game stages and ore stages work. You should be staging silver to stage 2 and then not add anything for stage 1 or any other stage. For example if you wanted iron ore to be hidden until the player has stage 2 you would do a simple one line entry in your script. Just replace the id for iron with the silver ore you are using.
In reply to DarkhaxDev:
Oh so stage one id "basic" stage then?
Ill try it
Edit: I added it too stage two but i still get stone when i place it on a higher stage and a lower stage
mods.orestages.OreStages.addReplacement("two", <drpmedieval:silver_ore>, <minecraft:stone>);
mods.orestages.OreStages.addReplacement("two", <iceandfire:silver_ore>, <minecraft:stone>);
mods.orestages.OreStages.addReplacement("two", <techores:silver_ore>, <minecraft:stone>);
and included imports aswell
It seems like /orestages command doenst work. I cant use it basiclly. Might be something wiht that
In reply to Forge_User_55114010:
Stages are not linear or automatically connected together. If you stage it to "two" giving the player stage "three" will not also give them stage "two" and stage "one". If you want them to be linear that is something you will need to add yourself through your quests/advancements or whatever your pack uses.
In reply to DarkhaxDev:
It has come to the point where i just might move on without this mod. To clarify what i wanted is that when i swap to stage 3 the silver ore becomes silver again from stone.But if i would turn stone into silver then it would turn all stone into silve right?
In reply to Forge_User_55114010:
No, the block is camouflaged but keeps it's block ID. Silver ore is always silver ore, it will only look and act like stone.
In reply to DarkhaxDev:
Idk why but I am getting notifications from this XD
So I wanted a mod that I could put rooms behind rooms to unlock new areas. I figured I could mask blocks as bedrock (in a room of bedrock) in order to make them indestructible but the masked blocks can still be broken.
Is there a way to have a masked block be indestructible ( ie. granite into bedrock, for example)?
I just thought about this too but I have ore tweaker installed and I am not sure if this is affecting this mod. I am not at my computer currently.
Correction - block tweaker, not ore tweaker..
I think I thought this would actually swap the blocks out, more or less, along with all of their properties and that they would be considered the block that they were replacing for mining/harvesting purposes. The masking block still retains the harvesting level and indestructibility of the original block.
Masked bedrock is still indestructible and a masked stone as bedrock is still mineable.
And block tweaker wasn't an issue.
I apologize that I didn't realize this earlier. If anyone has any advice, it would be greatly appreciated as I'm still very new to Crafttweaker and Stages and modpacks.
In reply to theklois:
If you mask stone as bedrock the stone should not be mineable. You could mask multiple blocks as bedrock, such as the dyed terracotta blocks. If this isn't the case let me know and I can do a test and potentially add a fix.
In reply to DarkhaxDev:
Thanks for the reply,
I just made a new modpack to make sure that I wasn't getting any interference from other mods/files and put in stage mods and craftweaker and their dependencies. I made a new script folder and put in 1 file that contains:
I then opened up a new world, found stone (bedrock) and was able to mine it. If you could add a fix, that would be greatly appreciated!
I have OreStages-1.12.2-2.0.37.jar and GameStages-1.12.2-2.0.115.jar installed.
In reply to theklois:
Hey, so I have checked other versions of Forge, CraftTweaker and Ore Stages. None have made bedrock unmineable for me. Also, any bedrock that is masked can not be mineable. I think you are swapping the harvestability but not the hardness. Could this be fixed easily? I am pretty sure you would need to use Block.getBlockHardness() and Block.setHardness().
On a side note - It also doesn't set the harvestability correctly, meaning that lapis_ore masked as diamond_ore will break with a stone tool and give me a diamond when it shouldn't break with anything less than iron. That doesn't really affect me because I don't plan to mask ore with other ore. Nor would I mask diamond as lapis, iron, coal, etc. This might actually be as intended.
Anyway, I realize this is a busy time of the year but it had been a week and I wanted to update my post and see if you have come up with anything.
Thank you