Skip to content

Commit

Permalink
rework bedrock ore miner (#1124)
Browse files Browse the repository at this point in the history
* it works except I get a weird codec error...

* it work

* mfw I accidentally swapped fluid & bedrock ore vein event

* fix veined generator crashing on copy because `rareBlocks == null`

* add setter for `RecipeLogic#progress`

* fix miner having way too high of a multiplier

* run data

* fix n mB/s ore

* fix singleblocks not being able to accept items via GUI

* fix singleblocks not being able to accept items via GUI 2: electic boogaloo

* remove useless forge impls of data loaders

* return early if no valid items are found
  • Loading branch information
screret authored Apr 20, 2024
1 parent 6c2c1c9 commit 2e0f890
Show file tree
Hide file tree
Showing 41 changed files with 523 additions and 181 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,13 @@
"gtceu:andesite_diatomite_ore",
"gtceu:andesite_granitic_mineral_sand_ore",
"gtceu:andesite_garnet_sand_ore",
"gtceu:andesite_basaltic_mineral_sand_ore"
"gtceu:andesite_basaltic_mineral_sand_ore",
"gtceu:andesite_fluorite_ore",
"gtceu:andesite_dolomite_ore"
],
"page": "gtceu:generation/andesite",
"position": [
-200,
-50,
50
],
"pre_nodes": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@
"gtceu:basalt_diatomite_ore",
"gtceu:basalt_granitic_mineral_sand_ore",
"gtceu:basalt_garnet_sand_ore",
"gtceu:basalt_basaltic_mineral_sand_ore"
"gtceu:basalt_basaltic_mineral_sand_ore",
"gtceu:basalt_fluorite_ore",
"gtceu:basalt_dolomite_ore"
],
"page": "gtceu:generation/basalt",
"position": [
-50,
50
-150,
150
],
"pre_nodes": [
"gtceu:generation/ore"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@
"gtceu:deepslate_diatomite_ore",
"gtceu:deepslate_granitic_mineral_sand_ore",
"gtceu:deepslate_garnet_sand_ore",
"gtceu:deepslate_basaltic_mineral_sand_ore"
"gtceu:deepslate_basaltic_mineral_sand_ore",
"gtceu:deepslate_fluorite_ore",
"gtceu:deepslate_dolomite_ore"
],
"page": "gtceu:generation/deepslate",
"position": [
-150,
150
-200,
100
],
"pre_nodes": [
"gtceu:generation/ore"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@
"gtceu:diorite_diatomite_ore",
"gtceu:diorite_granitic_mineral_sand_ore",
"gtceu:diorite_garnet_sand_ore",
"gtceu:diorite_basaltic_mineral_sand_ore"
"gtceu:diorite_basaltic_mineral_sand_ore",
"gtceu:diorite_fluorite_ore",
"gtceu:diorite_dolomite_ore"
],
"page": "gtceu:generation/diorite",
"position": [
-200,
150
-100,
50
],
"pre_nodes": [
"gtceu:generation/ore"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@
"gtceu:endstone_diatomite_ore",
"gtceu:endstone_granitic_mineral_sand_ore",
"gtceu:endstone_garnet_sand_ore",
"gtceu:endstone_basaltic_mineral_sand_ore"
"gtceu:endstone_basaltic_mineral_sand_ore",
"gtceu:endstone_fluorite_ore",
"gtceu:endstone_dolomite_ore"
],
"page": "gtceu:generation/endstone",
"position": [
-200,
100
-50,
150
],
"pre_nodes": [
"gtceu:generation/ore"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@
"gtceu:granite_diatomite_ore",
"gtceu:granite_granitic_mineral_sand_ore",
"gtceu:granite_garnet_sand_ore",
"gtceu:granite_basaltic_mineral_sand_ore"
"gtceu:granite_basaltic_mineral_sand_ore",
"gtceu:granite_fluorite_ore",
"gtceu:granite_dolomite_ore"
],
"page": "gtceu:generation/granite",
"position": [
-150,
100
50
],
"pre_nodes": [
"gtceu:generation/ore"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,13 @@
"gtceu:gravel_diatomite_ore",
"gtceu:gravel_granitic_mineral_sand_ore",
"gtceu:gravel_garnet_sand_ore",
"gtceu:gravel_basaltic_mineral_sand_ore"
"gtceu:gravel_basaltic_mineral_sand_ore",
"gtceu:gravel_fluorite_ore",
"gtceu:gravel_dolomite_ore"
],
"page": "gtceu:generation/gravel",
"position": [
-100,
-200,
150
],
"pre_nodes": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@
"gtceu:netherrack_diatomite_ore",
"gtceu:netherrack_granitic_mineral_sand_ore",
"gtceu:netherrack_garnet_sand_ore",
"gtceu:netherrack_basaltic_mineral_sand_ore"
"gtceu:netherrack_basaltic_mineral_sand_ore",
"gtceu:netherrack_fluorite_ore",
"gtceu:netherrack_dolomite_ore"
],
"page": "gtceu:generation/netherrack",
"position": [
-100,
100
150
],
"pre_nodes": [
"gtceu:generation/ore"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@
"gtceu:red_sand_diatomite_ore",
"gtceu:red_sand_granitic_mineral_sand_ore",
"gtceu:red_sand_garnet_sand_ore",
"gtceu:red_sand_basaltic_mineral_sand_ore"
"gtceu:red_sand_basaltic_mineral_sand_ore",
"gtceu:red_sand_fluorite_ore",
"gtceu:red_sand_dolomite_ore"
],
"page": "gtceu:generation/red_sand",
"position": [
-100,
50
-50,
100
],
"pre_nodes": [
"gtceu:generation/ore"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@
"gtceu:sand_diatomite_ore",
"gtceu:sand_granitic_mineral_sand_ore",
"gtceu:sand_garnet_sand_ore",
"gtceu:sand_basaltic_mineral_sand_ore"
"gtceu:sand_basaltic_mineral_sand_ore",
"gtceu:sand_fluorite_ore",
"gtceu:sand_dolomite_ore"
],
"page": "gtceu:generation/sand",
"position": [
-150,
50
-100,
100
],
"pre_nodes": [
"gtceu:generation/ore"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@
"gtceu:diatomite_ore",
"gtceu:granitic_mineral_sand_ore",
"gtceu:garnet_sand_ore",
"gtceu:basaltic_mineral_sand_ore"
"gtceu:basaltic_mineral_sand_ore",
"gtceu:fluorite_ore",
"gtceu:dolomite_ore"
],
"page": "gtceu:generation/stone",
"position": [
-50,
100
-200,
50
],
"pre_nodes": [
"gtceu:generation/ore"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@
"gtceu:tuff_diatomite_ore",
"gtceu:tuff_granitic_mineral_sand_ore",
"gtceu:tuff_garnet_sand_ore",
"gtceu:tuff_basaltic_mineral_sand_ore"
"gtceu:tuff_basaltic_mineral_sand_ore",
"gtceu:tuff_fluorite_ore",
"gtceu:tuff_dolomite_ore"
],
"page": "gtceu:generation/tuff",
"position": [
-50,
150
-150,
100
],
"pre_nodes": [
"gtceu:generation/ore"
Expand Down
5 changes: 4 additions & 1 deletion src/generated/resources/assets/gtceu/lang/en_ud.json
Original file line number Diff line number Diff line change
Expand Up @@ -1843,8 +1843,8 @@
"config.gtceu.option.addLoot": "ʇooꞀppɐ",
"config.gtceu.option.allUniqueStoneTypes": "sǝdʎ⟘ǝuoʇSǝnbıu∩ןןɐ",
"config.gtceu.option.animationTime": "ǝɯı⟘uoıʇɐɯıuɐ",
"config.gtceu.option.bedrockOreDistance": "ǝɔuɐʇsıᗡǝɹOʞɔoɹpǝq",
"config.gtceu.option.bedrockOreDropTagPrefix": "xıɟǝɹԀbɐ⟘doɹᗡǝɹOʞɔoɹpǝq",
"config.gtceu.option.bedrockOreMultiplier": "ɹǝıןdıʇןnWǝɹOʞɔoɹpǝq",
"config.gtceu.option.casingsPerCraft": "ʇɟɐɹƆɹǝԀsbuısɐɔ",
"config.gtceu.option.cleanMultiblocks": "sʞɔoןqıʇןnWuɐǝןɔ",
"config.gtceu.option.client": "ʇuǝıןɔ",
Expand Down Expand Up @@ -3177,6 +3177,9 @@
"gtceu.multiblock.network_switch.description": "˙uoıʇɐʇndɯoƆ ɹıǝɥʇ ssǝɔɔɐ oʇ ǝןqɐ ǝq oʇ ɥɔʇıʍS ʞɹoʍʇǝN ǝɥʇ ɹoɟ ʇuǝuodɯoƆ ǝbpıɹᗺ ɐ ǝʌɐɥ ʇsnɯ sⱯƆԀH ˙ɥɔʇɐH uoıʇdǝɔǝᴚ ɐʇɐᗡ uoıʇɐʇndɯoƆ ǝuo ʇdǝɔɔɐ ʎןuo uɐɔ uoıʇɐʇS ɥɔɹɐǝsǝᴚ ǝɥʇ sɐ 'uoıʇɐʇndɯoƆ ɹǝɥbıɥ ɥɔnɯ sǝɹınbǝɹ ɥɔıɥʍ ɐʇɐᗡ ɥɔɹɐǝsǝᴚ ɹoɟ ʎɹɐssǝɔǝu sı ʇI ˙sǝɥɔʇɐH uoıssıɯsuɐɹ⟘ ɹo uoıʇdǝɔǝᴚ ɐʇɐᗡ uoıʇɐʇndɯoƆ ɟo ɹǝqɯnu ʎuɐ ʇdǝɔɔɐ uɐɔ ʇI ˙suoıʇɐuıʇsǝp ʎuɐɯ oʇ sǝɔɹnos ʎuɐɯ ɯoɹɟ uoıʇɐʇndɯoƆ buıʇnqıɹʇsıp ɹoɟ pǝsn ǝɹnʇɔnɹʇs ʞɔoןqıʇןnɯ ɐ sı ɥɔʇıʍS ʞɹoʍʇǝN ǝɥ⟘",
"gtceu.multiblock.not_enough_energy": "˙ʎbɹǝuǝ ǝɹoɯ spǝǝu ǝuıɥɔɐW :⅁NINᴚⱯM",
"gtceu.multiblock.not_enough_energy_output": "¡ʍoꞀ oo⟘ ɹǝı⟘ oɯɐuʎᗡ ʎbɹǝuƎ :⅁NINᴚⱯM",
"gtceu.multiblock.ore_rig.drilled_ore_entry": "%s - ",
"gtceu.multiblock.ore_rig.drilled_ores_list": ":sǝɹO",
"gtceu.multiblock.ore_rig.ore_amount": "%s :ǝʇɐᴚ buıןןıɹᗡ",
"gtceu.multiblock.page_switcher.io.both": "sʇndʇnO + sʇnduI pǝuıqɯoƆϛ§",
"gtceu.multiblock.page_switcher.io.export": "sʇndʇnOㄣ§",
"gtceu.multiblock.page_switcher.io.import": "sʇnduIᄅ§",
Expand Down
5 changes: 4 additions & 1 deletion src/generated/resources/assets/gtceu/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -1843,8 +1843,8 @@
"config.gtceu.option.addLoot": "addLoot",
"config.gtceu.option.allUniqueStoneTypes": "allUniqueStoneTypes",
"config.gtceu.option.animationTime": "animationTime",
"config.gtceu.option.bedrockOreDistance": "bedrockOreDistance",
"config.gtceu.option.bedrockOreDropTagPrefix": "bedrockOreDropTagPrefix",
"config.gtceu.option.bedrockOreMultiplier": "bedrockOreMultiplier",
"config.gtceu.option.casingsPerCraft": "casingsPerCraft",
"config.gtceu.option.cleanMultiblocks": "cleanMultiblocks",
"config.gtceu.option.client": "client",
Expand Down Expand Up @@ -3177,6 +3177,9 @@
"gtceu.multiblock.network_switch.description": "The Network Switch is a multiblock structure used for distributing Computation from many sources to many destinations. It can accept any number of Computation Data Reception or Transmission Hatches. It is necessary for Research Data which requires much higher Computation, as the Research Station can only accept one Computation Data Reception Hatch. HPCAs must have a Bridge Component for the Network Switch to be able to access their Computation.",
"gtceu.multiblock.not_enough_energy": "WARNING: Machine needs more energy.",
"gtceu.multiblock.not_enough_energy_output": "WARNING: Energy Dynamo Tier Too Low!",
"gtceu.multiblock.ore_rig.drilled_ore_entry": " - %s",
"gtceu.multiblock.ore_rig.drilled_ores_list": "Ores:",
"gtceu.multiblock.ore_rig.ore_amount": "Drilling Rate: %s",
"gtceu.multiblock.page_switcher.io.both": "§5Combined Inputs + Outputs",
"gtceu.multiblock.page_switcher.io.export": "§4Outputs",
"gtceu.multiblock.page_switcher.io.import": "§2Inputs",
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/com/gregtechceu/gtceu/api/addon/IGTAddon.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ default void registerFluidVeins() {

}

/**
* Use {@link com.gregtechceu.gtceu.api.data.worldgen.bedrockore.BedrockOreDefinition#builder(ResourceLocation)} to register the veins.
*/
default void registerBedrockOreVeins() {

}

/**
* Register Material -> Casing block mappings here
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ public void applyWidgetInfo(@NotNull Widget widget,
slot.setHandlerSlot(items, index);
slot.setIngredientIO(io == IO.IN ? IngredientIO.INPUT : IngredientIO.OUTPUT);
slot.setCanTakeItems(!isXEI);
slot.setCanPutItems(false);
slot.setCanPutItems(!isXEI && io.support(IO.IN));
}
// 1 over container size.
// If in a recipe viewer and a research slot can be added, add it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public static Optional<String> getWorldGenLayerKey(IWorldGenLayer layer) {
}

public static boolean isSameDimension(ResourceKey<Level> first, ResourceKey<Level> second) {
return first.location().equals(second.location());
return first == second;
}

public static <T> Map<ChunkPos, Map<BlockPos, T>> groupByChunks(Map<BlockPos, T> input) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public CompoundTag save(CompoundTag nbt) {
* @return The FluidVeinWorldInfo corresponding with the given chunk
*/
public FluidVeinWorldEntry getFluidVeinWorldEntry(int chunkX, int chunkZ) {
if (!veinFluids.containsKey(new ChunkPos(chunkX, chunkZ))) {
ChunkPos pos = new ChunkPos(chunkX, chunkZ);
if (!veinFluids.containsKey(pos)) {
BedrockFluidDefinition definition = null;
int query = RandomSource.create(Objects.hash(serverLevel.getSeed(), chunkX / VEIN_CHUNK_SIZE, chunkZ / VEIN_CHUNK_SIZE)).nextInt();
var biome = serverLevel.getBiome(new BlockPos(chunkX << 4, 64, chunkZ << 4));
Expand Down Expand Up @@ -108,10 +109,10 @@ public FluidVeinWorldEntry getFluidVeinWorldEntry(int chunkX, int chunkZ) {
}
maximumYield = Math.min(maximumYield, definition.getMaximumYield());
}
veinFluids.put(new ChunkPos(chunkX, chunkZ), new FluidVeinWorldEntry(definition, maximumYield, MAXIMUM_VEIN_OPERATIONS));
veinFluids.put(pos, new FluidVeinWorldEntry(definition, maximumYield, MAXIMUM_VEIN_OPERATIONS));
setDirty();
}
return veinFluids.get(new ChunkPos(chunkX, chunkZ));
return veinFluids.get(pos);
}

/**
Expand Down
Loading

0 comments on commit 2e0f890

Please sign in to comment.