Skip to content

Commit

Permalink
minor block tags refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
luxtracon committed May 24, 2024
1 parent 6fd0840 commit 332b740
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
"values": [
"landsoficaria:grassy_marl",
"landsoficaria:marl",
"landsoficaria:marl_chert",
"landsoficaria:marl_bones",
"landsoficaria:marl_lignite",
"landsoficaria:coarse_marl",
"landsoficaria:dry_lake_bed",
"landsoficaria:loam",
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void tick() {
var blockPos = this.entity.blockPosition().offset(-8 + this.entity.getRandom().nextInt(16), 0, -8 + this.entity.getRandom().nextInt(16));
if (entity != null) {
if (level.getBlockState(blockPos).canBeReplaced()) {
if (this.entity.getBlockStateOn().is(IcariaBlockTags.CAPTAIN_SUMMONS_ON)) {
if (this.entity.getBlockStateOn().is(IcariaBlockTags.DIRT_AND_SAND)) {
entity.moveTo(blockPos, 0.0F, 0.0F);
level.addFreshEntity(entity);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void tick() {
var blockPos = this.entity.blockPosition().offset(-4 + this.entity.getRandom().nextInt(8), 0, -4 + this.entity.getRandom().nextInt(8));
if (entity != null) {
if (level.getBlockState(blockPos).canBeReplaced()) {
if (this.entity.getBlockStateOn().is(IcariaBlockTags.MYRMEKE_SUMMONS_ON)) {
if (this.entity.getBlockStateOn().is(IcariaBlockTags.DIRT_AND_SAND)) {
entity.moveTo(blockPos, 0.0F, 0.0F);
level.addFreshEntity(entity);
}
Expand Down
31 changes: 13 additions & 18 deletions src/main/java/com/axanthic/icaria/data/tags/IcariaBlockTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@

public class IcariaBlockTags extends BlockTagsProvider {
// BLOCK TAGS
public static final TagKey<Block> SLUG_HIDE_BLOCKS = IcariaBlockTags.icariaTag("slug_hide_blocks");
public static final TagKey<Block> DIRT_AND_SAND = IcariaBlockTags.icariaTag("dirt_and_sand");

public static final TagKey<Block> MYRMEKE_SUMMONS_ON = IcariaBlockTags.icariaTag("myrmeke_summons_on");
public static final TagKey<Block> CAPTAIN_SUMMONS_ON = IcariaBlockTags.icariaTag("captain_summons_on");
public static final TagKey<Block> RUBBLE_SPAWNS_ON = IcariaBlockTags.icariaTag("rubble_spawns_on");
public static final TagKey<Block> RELICSTONE_RUBBLE_SPAWNS_ON = IcariaBlockTags.icariaTag("relicstone_rubble_spawns_on");

public static final TagKey<Block> VILLAGE_REPLACE_BLOCKS = IcariaBlockTags.icariaTag("village_replace_blocks");
public static final TagKey<Block> RUINED_VILLAGE_REPLACE_BLOCKS = IcariaBlockTags.icariaTag("ruined_village_replace_blocks");
Expand Down Expand Up @@ -141,39 +141,34 @@ public IcariaBlockTags(PackOutput pOutput, CompletableFuture<HolderLookup.Provid
@Override
public void addTags(HolderLookup.Provider pProvider) {
// BLOCK TAGS
this.tag(IcariaBlockTags.SLUG_HIDE_BLOCKS)
this.tag(IcariaBlockTags.DIRT_AND_SAND)
.add(IcariaBlocks.GRASSY_MARL.get())
.add(IcariaBlocks.MARL.get())
.add(IcariaBlocks.MARL_CHERT.get())
.add(IcariaBlocks.MARL_BONES.get())
.add(IcariaBlocks.MARL_LIGNITE.get())
.add(IcariaBlocks.COARSE_MARL.get())
.add(IcariaBlocks.DRY_LAKE_BED.get())
.add(IcariaBlocks.LOAM.get());
.add(IcariaBlocks.LOAM.get())
.add(IcariaBlocks.GRAINEL.get())
.add(IcariaBlocks.SILKSAND.get());

this.tag(IcariaBlockTags.MYRMEKE_SUMMONS_ON)
this.tag(IcariaBlockTags.RUBBLE_SPAWNS_ON)
.add(IcariaBlocks.GRASSY_MARL.get())
.add(IcariaBlocks.MARL.get())
.add(IcariaBlocks.MARL_CHERT.get())
.add(IcariaBlocks.MARL_BONES.get())
.add(IcariaBlocks.MARL_LIGNITE.get())
.add(IcariaBlocks.COARSE_MARL.get())
.add(IcariaBlocks.DRY_LAKE_BED.get())
.add(IcariaBlocks.LOAM.get())
.add(IcariaBlocks.GRAINEL.get())
.add(IcariaBlocks.SILKSAND.get());
.add(IcariaBlocks.SILKSAND.get())
.add(IcariaBlocks.YELLOWSTONE.get());

this.tag(IcariaBlockTags.CAPTAIN_SUMMONS_ON)
this.tag(IcariaBlockTags.RELICSTONE_RUBBLE_SPAWNS_ON)
.add(IcariaBlocks.GRASSY_MARL.get())
.add(IcariaBlocks.MARL.get())
.add(IcariaBlocks.MARL_CHERT.get())
.add(IcariaBlocks.MARL_BONES.get())
.add(IcariaBlocks.MARL_LIGNITE.get())
.add(IcariaBlocks.COARSE_MARL.get())
.add(IcariaBlocks.DRY_LAKE_BED.get())
.add(IcariaBlocks.LOAM.get())
.add(IcariaBlocks.GRAINEL.get())
.add(IcariaBlocks.SILKSAND.get());
.add(IcariaBlocks.SILKSAND.get())
.add(IcariaBlocks.RELICSTONE.get());

this.tag(IcariaBlockTags.VILLAGE_REPLACE_BLOCKS)
.add(Blocks.COBWEB) // TODO: replace with Arachne web
Expand Down

0 comments on commit 332b740

Please sign in to comment.