Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"block": "anvilcraft:large_fluid_tank",
"condition": "minecraft:block_state_property",
"properties": {
"half": "bottom_center"
"half": "mid_center"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"values": [
"minecraft:snow_block",
"minecraft:white_wool",
"anvilcraft:heavy_iron_block",
"#c:ingots",
"#c:storage_blocks"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public boolean shouldMute(@Nullable Level level, ResourceLocation sound, Vec3 po
if (level == null) return false;
return this.eventListeners.computeIfAbsent(level.dimension(), k -> new CopyOnWriteArrayList<>())
.stream()
.allMatch(it -> it.shouldMute(sound, pos));
.anyMatch(it -> it.shouldMute(sound, pos));
}

public void register(Level level, ISoundEventListener eventListener) {
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/dev/dubhe/anvilcraft/block/LargeFluidTankBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import net.minecraft.world.ItemInteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.EntityBlock;
Expand Down Expand Up @@ -94,4 +95,14 @@ protected ItemInteractionResult useItemOn(
return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION;

}

@Override
protected float getShadeBrightness(BlockState state, BlockGetter level, BlockPos pos) {
return 1.0F;
}

@Override
protected boolean propagatesSkylightDown(BlockState state, BlockGetter level, BlockPos pos) {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ private boolean isPowered(Level level, BlockPos pos) {

@Override
public void stepOn(Level level, BlockPos pos, BlockState state, Entity entity) {
if (!level.getEntitiesOfClass(MagnetizedNodeEntity.class, new AABB(pos)).isEmpty()) return;
boolean magnetizedNodeExist = !level.getEntitiesOfClass(MagnetizedNodeEntity.class, new AABB(pos)).isEmpty();
if (entity.getType() == EntityType.ITEM && magnetizedNodeExist) return;
if (entity.getType() != EntityType.ITEM && !(entity instanceof LivingEntity)) return;
boolean isSneakPlayer = entity instanceof Player player && player.isShiftKeyDown();
if (!state.getValue(POWERED)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ public static void init(RegistrateTagsProvider<Item> provider) {
provider.addTag(ModItemTags.COMPRESS_ITEM)
.add(findResourceKey(Items.SNOW_BLOCK))
.add(findResourceKey(Items.WHITE_WOOL))
.add(findResourceKey(ModBlocks.HEAVY_IRON_BLOCK.asItem()))
.addTag(Tags.Items.INGOTS)
.addTag(Tags.Items.STORAGE_BLOCKS);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1797,7 +1797,7 @@ public class ModBlocks {
LargeFluidTankBlock::new
)
.initialProperties(() -> Blocks.IRON_BLOCK)
.properties(p -> p.isSuffocating(ModBlocks::never).isSuffocating(ModBlocks::never).noOcclusion().isValidSpawn(Blocks::never))
.properties(p -> p.isSuffocating(ModBlocks::never).noOcclusion().isValidSpawn(Blocks::never))
.loot(SimpleMultiPartBlock::loot)
.item(SimpleMultiPartBlockItem<Cube3x3PartHalf>::new)
.properties((properties) -> properties.stacksTo(16))
Expand Down