Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/kotlin/com/coderjoe/atlas/Atlas.kt
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ class Atlas : JavaPlugin() {
com.coderjoe.atlas.power.block.LavaGenerator.descriptor,
com.coderjoe.atlas.power.block.AutoSmelter.descriptor,
com.coderjoe.atlas.power.block.MultiPowerCable.descriptor,
com.coderjoe.atlas.power.block.CobblestoneGenerator.descriptor,
com.coderjoe.atlas.power.block.ObsidianGenerator.descriptor,
com.coderjoe.atlas.power.block.CobblestoneFactory.descriptor,
com.coderjoe.atlas.power.block.ObsidianFactory.descriptor,
com.coderjoe.atlas.power.block.PowerMerger.descriptor
).associateBy { it.baseBlockId }
}
Expand Down
12 changes: 6 additions & 6 deletions src/main/kotlin/com/coderjoe/atlas/power/PowerBlockDialog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import com.coderjoe.atlas.power.block.PowerCable
import com.coderjoe.atlas.power.block.SmallBattery
import com.coderjoe.atlas.power.block.SmallDrill
import com.coderjoe.atlas.power.block.MultiPowerCable
import com.coderjoe.atlas.power.block.CobblestoneGenerator
import com.coderjoe.atlas.power.block.ObsidianGenerator
import com.coderjoe.atlas.power.block.CobblestoneFactory
import com.coderjoe.atlas.power.block.ObsidianFactory
import com.coderjoe.atlas.power.block.PowerMerger
import com.coderjoe.atlas.power.block.SmallSolarPanel
import io.papermc.paper.dialog.Dialog
Expand Down Expand Up @@ -132,8 +132,8 @@ object PowerBlockDialog {
is LavaGenerator -> "Lava Generator"
is AutoSmelter -> "Auto Smelter (${powerBlock.facing.name.lowercase().replaceFirstChar { it.uppercase() }})"
is MultiPowerCable -> "Multi Power Cable (${powerBlock.facing.name.lowercase().replaceFirstChar { it.uppercase() }})"
is CobblestoneGenerator -> "Cobblestone Generator"
is ObsidianGenerator -> "Obsidian Generator"
is CobblestoneFactory -> "Cobblestone Factory"
is ObsidianFactory -> "Obsidian Factory"
is PowerMerger -> "Power Merger (${powerBlock.facing.name.lowercase().replaceFirstChar { it.uppercase() }})"
else -> "Power Block"
}
Expand Down Expand Up @@ -183,9 +183,9 @@ object PowerBlockDialog {
.color(NamedTextColor.GRAY)
is MultiPowerCable -> Component.text("Cable - distributes power to all adjacent faces")
.color(NamedTextColor.GRAY)
is CobblestoneGenerator -> Component.text("Machine - consumes ${CobblestoneGenerator.POWER_COST} power + water + lava → cobblestone")
is CobblestoneFactory -> Component.text("Machine - consumes ${CobblestoneFactory.POWER_COST} power + water + lava → cobblestone")
.color(NamedTextColor.GRAY)
is ObsidianGenerator -> Component.text("Machine - consumes ${ObsidianGenerator.POWER_COST} power + water + lava → obsidian")
is ObsidianFactory -> Component.text("Machine - consumes ${ObsidianFactory.POWER_COST} power + water + lava → obsidian")
.color(NamedTextColor.GRAY)
is PowerMerger -> Component.text("Cable - merges power from all sides, outputs in facing direction")
.color(NamedTextColor.GRAY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import org.bukkit.Material
import org.bukkit.block.BlockFace
import org.bukkit.inventory.ItemStack

class CobblestoneGenerator(location: Location) : PowerBlock(location, maxStorage = 2) {
class CobblestoneFactory(location: Location) : PowerBlock(location, maxStorage = 2) {

override val canReceivePower: Boolean = true
override val updateIntervalTicks: Long = 20L

companion object {
const val BLOCK_ID = "cobblestone_generator"
const val BLOCK_ID_ACTIVE = "cobblestone_generator_active"
const val BLOCK_ID = "cobblestone_factory"
const val BLOCK_ID_ACTIVE = "cobblestone_factory_active"
const val POWER_COST = 2

private val ADJACENT_FACES = listOf(
Expand All @@ -33,12 +33,12 @@ class CobblestoneGenerator(location: Location) : PowerBlock(location, maxStorage

val descriptor = BlockDescriptor(
baseBlockId = BLOCK_ID,
displayName = "Cobblestone Generator",
displayName = "Cobblestone Factory",
description = "Machine - consumes $POWER_COST power + water + lava → cobblestone",
placementType = PlacementType.SIMPLE,
directionalVariants = emptyMap(),
allRegistrableIds = listOf(BLOCK_ID, BLOCK_ID_ACTIVE),
constructor = { loc, _ -> CobblestoneGenerator(loc) }
constructor = { loc, _ -> CobblestoneFactory(loc) }
)
}

Expand Down Expand Up @@ -94,7 +94,7 @@ class CobblestoneGenerator(location: Location) : PowerBlock(location, maxStorage
val dropLocation = location.clone().add(0.5, 1.0, 0.5)
world.dropItemNaturally(dropLocation, ItemStack(Material.COBBLESTONE))

plugin.logger.atlasInfo("CobblestoneGenerator at ${location.blockX},${location.blockY},${location.blockZ} produced 1 cobblestone")
plugin.logger.atlasInfo("CobblestoneFactory at ${location.blockX},${location.blockY},${location.blockZ} produced 1 cobblestone")
}

private fun hasFluidAvailable(source: com.coderjoe.atlas.fluid.FluidBlock, face: BlockFace, fluidType: FluidType): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import org.bukkit.Material
import org.bukkit.block.BlockFace
import org.bukkit.inventory.ItemStack

class ObsidianGenerator(location: Location) : PowerBlock(location, maxStorage = 100) {
class ObsidianFactory(location: Location) : PowerBlock(location, maxStorage = 100) {

override val canReceivePower: Boolean = true
override val updateIntervalTicks: Long = 20L

companion object {
const val BLOCK_ID = "obsidian_generator"
const val BLOCK_ID_ACTIVE = "obsidian_generator_active"
const val BLOCK_ID = "obsidian_factory"
const val BLOCK_ID_ACTIVE = "obsidian_factory_active"
const val POWER_COST = 100

private val ADJACENT_FACES = listOf(
Expand All @@ -33,12 +33,12 @@ class ObsidianGenerator(location: Location) : PowerBlock(location, maxStorage =

val descriptor = BlockDescriptor(
baseBlockId = BLOCK_ID,
displayName = "Obsidian Generator",
displayName = "Obsidian Factory",
description = "Machine - consumes $POWER_COST power + water + lava → obsidian",
placementType = PlacementType.SIMPLE,
directionalVariants = emptyMap(),
allRegistrableIds = listOf(BLOCK_ID, BLOCK_ID_ACTIVE),
constructor = { loc, _ -> ObsidianGenerator(loc) }
constructor = { loc, _ -> ObsidianFactory(loc) }
)
}

Expand Down Expand Up @@ -94,7 +94,7 @@ class ObsidianGenerator(location: Location) : PowerBlock(location, maxStorage =
val dropLocation = location.clone().add(0.5, 1.0, 0.5)
world.dropItemNaturally(dropLocation, ItemStack(Material.OBSIDIAN))

plugin.logger.atlasInfo("ObsidianGenerator at ${location.blockX},${location.blockY},${location.blockZ} produced 1 obsidian")
plugin.logger.atlasInfo("ObsidianFactory at ${location.blockX},${location.blockY},${location.blockZ} produced 1 obsidian")
}

private fun hasFluidAvailable(source: com.coderjoe.atlas.fluid.FluidBlock, face: BlockFace, fluidType: FluidType): Boolean {
Expand Down
76 changes: 38 additions & 38 deletions src/main/resources/nexo/items/atlas_blocks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4082,20 +4082,20 @@ multi_power_cable_down_powered:
- nexo_item: multi_power_cable
probability: 1.0

# ─── Cobblestone Generator ──────────────────────────────────────
cobblestone_generator:
itemname: "<gradient:#8B8B8B:#C0C0C0>Cobblestone Generator"
# ─── Cobblestone Factory ──────────────────────────────────────
cobblestone_factory:
itemname: "<gradient:#8B8B8B:#C0C0C0>Cobblestone Factory"
material: paper
Pack:
generate_model: true
parent_model: block/cube
textures:
north: atlas:block/cobblestone_generator_side
south: atlas:block/cobblestone_generator_side
east: atlas:block/cobblestone_generator_side
west: atlas:block/cobblestone_generator_side
up: atlas:block/cobblestone_generator_top
down: atlas:block/cobblestone_generator_bottom
north: atlas:block/cobblestone_factory_side
south: atlas:block/cobblestone_factory_side
east: atlas:block/cobblestone_factory_side
west: atlas:block/cobblestone_factory_side
up: atlas:block/cobblestone_factory_top
down: atlas:block/cobblestone_factory_bottom
Mechanics:
custom_block:
type: NOTEBLOCK
Expand All @@ -4110,22 +4110,22 @@ cobblestone_generator:
drop:
silktouch: false
loots:
- nexo_item: cobblestone_generator
- nexo_item: cobblestone_factory
probability: 1.0

cobblestone_generator_active:
itemname: "<gradient:#8B8B8B:#C0C0C0>Cobblestone Generator"
cobblestone_factory_active:
itemname: "<gradient:#8B8B8B:#C0C0C0>Cobblestone Factory"
material: paper
Pack:
generate_model: true
parent_model: block/cube
textures:
north: atlas:block/cobblestone_generator_side_active
south: atlas:block/cobblestone_generator_side_active
east: atlas:block/cobblestone_generator_side_active
west: atlas:block/cobblestone_generator_side_active
up: atlas:block/cobblestone_generator_top_active
down: atlas:block/cobblestone_generator_bottom
north: atlas:block/cobblestone_factory_side_active
south: atlas:block/cobblestone_factory_side_active
east: atlas:block/cobblestone_factory_side_active
west: atlas:block/cobblestone_factory_side_active
up: atlas:block/cobblestone_factory_top_active
down: atlas:block/cobblestone_factory_bottom
Mechanics:
custom_block:
type: NOTEBLOCK
Expand All @@ -4140,23 +4140,23 @@ cobblestone_generator_active:
drop:
silktouch: false
loots:
- nexo_item: cobblestone_generator
- nexo_item: cobblestone_factory
probability: 1.0

# ─── Obsidian Generator ─────────────────────────────────────────
obsidian_generator:
itemname: "<gradient:#2D0047:#6A0DAD>Obsidian Generator"
# ─── Obsidian Factory ─────────────────────────────────────────
obsidian_factory:
itemname: "<gradient:#2D0047:#6A0DAD>Obsidian Factory"
material: paper
Pack:
generate_model: true
parent_model: block/cube
textures:
north: atlas:block/obsidian_generator_side
south: atlas:block/obsidian_generator_side
east: atlas:block/obsidian_generator_side
west: atlas:block/obsidian_generator_side
up: atlas:block/obsidian_generator_top
down: atlas:block/obsidian_generator_bottom
north: atlas:block/obsidian_factory_side
south: atlas:block/obsidian_factory_side
east: atlas:block/obsidian_factory_side
west: atlas:block/obsidian_factory_side
up: atlas:block/obsidian_factory_top
down: atlas:block/obsidian_factory_bottom
Mechanics:
custom_block:
type: NOTEBLOCK
Expand All @@ -4171,22 +4171,22 @@ obsidian_generator:
drop:
silktouch: false
loots:
- nexo_item: obsidian_generator
- nexo_item: obsidian_factory
probability: 1.0

obsidian_generator_active:
itemname: "<gradient:#2D0047:#6A0DAD>Obsidian Generator"
obsidian_factory_active:
itemname: "<gradient:#2D0047:#6A0DAD>Obsidian Factory"
material: paper
Pack:
generate_model: true
parent_model: block/cube
textures:
north: atlas:block/obsidian_generator_side_active
south: atlas:block/obsidian_generator_side_active
east: atlas:block/obsidian_generator_side_active
west: atlas:block/obsidian_generator_side_active
up: atlas:block/obsidian_generator_top_active
down: atlas:block/obsidian_generator_bottom
north: atlas:block/obsidian_factory_side_active
south: atlas:block/obsidian_factory_side_active
east: atlas:block/obsidian_factory_side_active
west: atlas:block/obsidian_factory_side_active
up: atlas:block/obsidian_factory_top_active
down: atlas:block/obsidian_factory_bottom
Mechanics:
custom_block:
type: NOTEBLOCK
Expand All @@ -4201,7 +4201,7 @@ obsidian_generator_active:
drop:
silktouch: false
loots:
- nexo_item: obsidian_generator
- nexo_item: obsidian_factory
probability: 1.0

# ─── Power Merger ────────────────────────────────────────────────
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions src/main/resources/nexo/recipes/shapeless/atlas_recipes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ auto_smelter_recipe:
G:
minecraft_type: FURNACE

cobblestone_generator_recipe:
cobblestone_factory_recipe:
result:
nexo_item: cobblestone_generator
nexo_item: cobblestone_factory
amount: 1
ingredients:
A:
Expand Down Expand Up @@ -248,9 +248,9 @@ power_merger_recipe:
E:
minecraft_type: REDSTONE

obsidian_generator_recipe:
obsidian_factory_recipe:
result:
nexo_item: obsidian_generator
nexo_item: obsidian_factory
amount: 1
ingredients:
A:
Expand Down
8 changes: 4 additions & 4 deletions src/test/kotlin/com/coderjoe/atlas/TestHelper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import com.coderjoe.atlas.power.block.PowerCable
import com.coderjoe.atlas.power.block.SmallBattery
import com.coderjoe.atlas.power.block.SmallDrill
import com.coderjoe.atlas.power.block.MultiPowerCable
import com.coderjoe.atlas.power.block.CobblestoneGenerator
import com.coderjoe.atlas.power.block.ObsidianGenerator
import com.coderjoe.atlas.power.block.CobblestoneFactory
import com.coderjoe.atlas.power.block.ObsidianFactory
import com.coderjoe.atlas.power.block.PowerMerger
import com.coderjoe.atlas.power.block.SmallSolarPanel
import io.mockk.*
Expand Down Expand Up @@ -177,8 +177,8 @@ object TestHelper {
SmallSolarPanel.descriptor, SmallDrill.descriptor,
SmallBattery.descriptor, PowerCable.descriptor,
LavaGenerator.descriptor, AutoSmelter.descriptor,
MultiPowerCable.descriptor, CobblestoneGenerator.descriptor,
ObsidianGenerator.descriptor, PowerMerger.descriptor
MultiPowerCable.descriptor, CobblestoneFactory.descriptor,
ObsidianFactory.descriptor, PowerMerger.descriptor
))
}

Expand Down
Loading
Loading