Skip to content

Commit

Permalink
Add more items to moth held target and add a tag for moth breakable b…
Browse files Browse the repository at this point in the history
…locks, remove redstone torches as moth breakable
  • Loading branch information
itsmeow committed Apr 23, 2022
1 parent dd400eb commit 257f04c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ protected void customServerAiStep() {
this.setYRot(this.getYRot() + f1);
}
int moths_req = getContainer().getCustomConfiguration().getInt("moths_to_destroy_torch");
if(moths_req != 0 && level.getBlockState(this.blockPosition()).getBlock() instanceof TorchBlock && level.getEntitiesOfClass(EntityMoth.class, this.getBoundingBox()).size() >= moths_req && ModPlatformEvents.mobGrief(this.level, this)) {
if(moths_req != 0 && level.getEntitiesOfClass(EntityMoth.class, this.getBoundingBox()).size() >= moths_req && level.getBlockState(this.blockPosition()).getBlock().is(ModTags.Blocks.MOTH_BREAKABLE) && ModPlatformEvents.mobGrief(this.level, this)) {
BlockState state = level.getBlockState(this.blockPosition());
Block.dropResources(state, level, this.blockPosition());
level.setBlockAndUpdate(this.blockPosition(), Blocks.AIR.defaultBlockState());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class ModTags {
public static final class Blocks {
public static final Tag.Named<Block> GHOST_LIGHT = tag("ghost_light");
public static final Tag.Named<Block> WISP_LANTERN = tag("wisp_lantern");
public static final Tag.Named<Block> MOTH_BREAKABLE = tag("moth_breakable");


public static void loadTags() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"replace": false,
"values": [
"minecraft:torch",
"minecraft:wall_torch",
"minecraft:soul_torch",
"minecraft:soul_wall_torch"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@
"replace": false,
"values": [
"minecraft:torch",
"minecraft:soul_torch",
"minecraft:lantern",
"minecraft:soul_lantern",
"minecraft:end_rod",
"minecraft:glowstone",
"minecraft:jack_o_lantern",
"minecraft:campfire",
"minecraft:soul_campfire",
"minecraft:beacon",
"minecraft:shroomlight",
"minecraft:lava_bucket",
"minecraft:sea_lantern",
"#whisperwoods:ghost_light",
"#whisperwoods:wisp_lantern"
]
Expand Down

0 comments on commit 257f04c

Please sign in to comment.