Skip to content

Commit

Permalink
Fix missing copper sulfate wall lantern and possibly more.
Browse files Browse the repository at this point in the history
  • Loading branch information
LambdAurora committed Aug 8, 2023
1 parent 4ab217a commit ce9aa00
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 18 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,8 @@
- Fixed some issues with the detection of wood types.
- Fixed compatibility issues with other mods by requiring a fixed version of QSL.

### 1.0.0-beta.15

- Fixed missing copper sulfate wall lantern and possibly more.

[EMI]: https://modrinth.com/mod/emi "EMI Modrinth page"
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
org.gradle.jvmargs=-Xmx1G

# Mod properties
mod_version=1.0.0-beta.14
mod_version=1.0.0-beta.15
maven_group=dev.lambdaurora
archives_base_name=aurorasdecorations
modrinth_id=GOqAnOfW
Expand Down
14 changes: 9 additions & 5 deletions src/main/java/dev/lambdaurora/aurorasdeco/AurorasDeco.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import dev.lambdaurora.aurorasdeco.util.AuroraUtil;
import dev.lambdaurora.aurorasdeco.world.gen.DynamicWorldGen;
import net.minecraft.block.Blocks;
import net.minecraft.item.Item;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.resource.ResourceType;
Expand Down Expand Up @@ -61,17 +62,20 @@ public void onInitialize(ModContainer mod) {
AurorasDecoRegistry.init();

RegistryMonitor.create(Registries.ITEM).forAll(context -> {
if (AuroraUtil.idEqual(context.id(), "pockettools", "pocket_cactus")) {
Identifier id = context.id();
Item item = context.value();

if (AuroraUtil.idEqual(id, "pockettools", "pocket_cactus")) {
Registry.register(Registries.BLOCK, id("big_flower_pot/pocket_cactus"),
PottedPlantType.register("pocket_cactus", Blocks.POTTED_CACTUS, context.value(),
PottedPlantType.register("pocket_cactus", Blocks.POTTED_CACTUS, item,
type -> new BigPottedCactusBlock(type, BigPottedCactusBlock.POCKET_CACTUS_SHAPE)));
} else if (PottedPlantType.isValidPlant(context.value())) {
var potBlock = PottedPlantType.registerFromItem(context.value());
} else if (PottedPlantType.isValidPlant(item)) {
var potBlock = PottedPlantType.registerFromItem(item);
if (potBlock != null)
Registry.register(Registries.BLOCK, id("big_flower_pot/" + potBlock.getPlantType().getId()), potBlock);
}

BlackboardColor.tryRegisterColorFromItem(context.id(), context.value());
BlackboardColor.tryRegisterColorFromItem(id, item);
});

ItemTree.init();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ private AurorasDecoRegistry() {
.build()
);
public static final WallLanternBlock<AmethystLanternBlock> AMETHYST_WALL_LANTERN_BLOCK = LanternRegistry.registerWallLantern(AMETHYST_LANTERN_BLOCK);
public static final WallLanternBlock<LanternBlock> COPPER_SULFATE_WALL_LANTERN_BLOCK = LanternRegistry.registerWallLantern(COPPER_SULFATE_LANTERN_BLOCK);
//endregion

public static final WindChimeBlock WIND_CHIME_BLOCK = registerWithItem("wind_chime",
Expand Down Expand Up @@ -603,32 +604,36 @@ public static void init() {

if ((id.getNamespace().equals("betternether") || id.getNamespace().equals("betterend")) && (id.getPath().contains("stripped") || (id.getPath().contains("mushroom") && !id.getPath().contains("mushroom_fir")) || id.getPath().contains("amaranita")))
return false;
return !id.getNamespace().equals("aurorasdeco") && !id.getPath().contains("sign_post");
return !(id.getNamespace().equals("aurorasdeco") && id.getPath().contains("sign_post"));
})
.forAll(context -> {
if (context.value() instanceof FlowerPotBlock flowerPotBlock) {
Identifier id = context.id();
Block block = context.value();

if (block instanceof FlowerPotBlock flowerPotBlock) {
if (flowerPotBlock == Blocks.FLOWER_POT) return;

context.register(
AurorasDeco.id(AuroraUtil.getIdPath("hanging_flower_pot", context.id(), "^potted[_/]")),
AurorasDeco.id(AuroraUtil.getIdPath("hanging_flower_pot", id, "^potted[_/]")),
new HangingFlowerPotBlock(flowerPotBlock)
);
} else {
WoodType.onBlockRegister(context.id(), context.value());
if (context.value() instanceof FenceBlock fenceBlock) {
WoodType.onBlockRegister(id, block);
if (block instanceof FenceBlock fenceBlock) {
var signPostBlock = Registry.register(
context.registry(),
AurorasDeco.id(AuroraUtil.getIdPath("sign_post", context.id(), "_fence$")),
AurorasDeco.id(AuroraUtil.getIdPath("sign_post", id, "_fence$")),
new SignPostBlock(fenceBlock)
);

SIGN_POST_BLOCK_ENTITY_TYPE.addSupportedBlock(signPostBlock);
} else LanternRegistry.tryRegisterWallLantern(context.registry(), context.value(), context.id());
} else LanternRegistry.tryRegisterWallLantern(context.registry(), block, id);
}
});

RegistryMonitor.create(Registries.ITEM).filter(context -> context.value() instanceof BlockItem item)
.forAll(context -> {
Identifier id = context.id();
var accessor = (BlockItemAccessor) context.value();
var item = (BlockItem) context.value();

Expand All @@ -637,20 +642,20 @@ public static void init() {
if (lanternBlock != null)
accessor.aurorasdeco$setWallBlock(lanternBlock);
Item.BLOCK_ITEMS.put(lanternBlock, item);
} else if (item.getBlock() instanceof CandleBlock candleBlock && context.id().getNamespace().equals("minecraft")) {
} else if (item.getBlock() instanceof CandleBlock candleBlock && id.getNamespace().equals("minecraft")) {
var wall = registerBlock(
"wall_" + context.id().getPath(),
"wall_" + id.getPath(),
new WallCandleBlock(candleBlock)
);
var chandelier = registerBlock(
"chandelier/" + context.id().getPath().replace("_candle", ""),
"chandelier/" + id.getPath().replace("_candle", ""),
new ChandelierBlock(candleBlock)
);
accessor.aurorasdeco$setWallBlock(wall);
accessor.aurorasdeco$setCeilingBlock(chandelier);

Item.BLOCK_ITEMS.put(wall, context.value());
Item.BLOCK_ITEMS.put(chandelier, context.value());
Item.BLOCK_ITEMS.put(wall, item);
Item.BLOCK_ITEMS.put(chandelier, item);
}
});

Expand Down
16 changes: 16 additions & 0 deletions src/main/resources/data/aurorasdeco/tags/blocks/benches.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"replace": false,
"values": [
"aurorasdeco:bench/oak",
"aurorasdeco:bench/spruce",
"aurorasdeco:bench/birch",
"aurorasdeco:bench/jungle",
"aurorasdeco:bench/acacia",
"aurorasdeco:bench/dark_oak",
"aurorasdeco:bench/mangrove",
"aurorasdeco:bench/cherry",
"aurorasdeco:bench/bamboo",
"aurorasdeco:bench/crimson",
"aurorasdeco:bench/warped"
]
}
16 changes: 16 additions & 0 deletions src/main/resources/data/aurorasdeco/tags/blocks/shelves.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"replace": false,
"values": [
"aurorasdeco:shelf/oak",
"aurorasdeco:shelf/spruce",
"aurorasdeco:shelf/birch",
"aurorasdeco:shelf/jungle",
"aurorasdeco:shelf/acacia",
"aurorasdeco:shelf/dark_oak",
"aurorasdeco:shelf/mangrove",
"aurorasdeco:shelf/cherry",
"aurorasdeco:shelf/bamboo",
"aurorasdeco:shelf/crimson",
"aurorasdeco:shelf/warped"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"replace": false,
"values": [
"aurorasdeco:small_log_pile/oak",
"aurorasdeco:small_log_pile/spruce",
"aurorasdeco:small_log_pile/birch",
"aurorasdeco:small_log_pile/jungle",
"aurorasdeco:small_log_pile/acacia",
"aurorasdeco:small_log_pile/dark_oak",
"aurorasdeco:small_log_pile/mangrove",
"aurorasdeco:small_log_pile/cherry",
"aurorasdeco:small_log_pile/bamboo",
"aurorasdeco:small_log_pile/crimson",
"aurorasdeco:small_log_pile/warped"
]
}
15 changes: 15 additions & 0 deletions src/main/resources/data/aurorasdeco/tags/blocks/stumps.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"replace": false,
"values": [
"aurorasdeco:stump/oak",
"aurorasdeco:stump/spruce",
"aurorasdeco:stump/birch",
"aurorasdeco:stump/jungle",
"aurorasdeco:stump/acacia",
"aurorasdeco:stump/dark_oak",
"aurorasdeco:stump/mangrove",
"aurorasdeco:stump/cherry",
"aurorasdeco:stump/crimson",
"aurorasdeco:stump/warped"
]
}
10 changes: 10 additions & 0 deletions src/main/resources/data/aurorasdeco/tags/blocks/wall_lanterns.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"replace": false,
"values": [
"aurorasdeco:wall_lantern/amethyst",
"aurorasdeco:wall_lantern/soul",
"aurorasdeco:wall_lantern/copper_sulfate",
"aurorasdeco:wall_lantern/redstone",
"aurorasdeco:wall_lantern"
]
}

0 comments on commit ce9aa00

Please sign in to comment.