Skip to content

Commit

Permalink
部分 bug 修正
Browse files Browse the repository at this point in the history
- 祭坛合成女仆丢失问题
- 女仆攻击盔甲架、扫帚和坐垫
- 水流破坏棋盘
  • Loading branch information
TartaricAcid committed Oct 25, 2024
1 parent 6de4279 commit e6f37e6
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 18 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ dependencies {
// EMI
compileOnly "maven.modrinth:emi:${emi_version}"
implementation "maven.modrinth:jade:${jade_version}"
implementation "maven.modrinth:the-one-probe:${top_version}"
compileOnly "maven.modrinth:the-one-probe:${top_version}"
implementation "maven.modrinth:cloth-config:${cloth_config_version}"
implementation "maven.modrinth:iron-chests:${iron_chests_version}"
implementation "maven.modrinth:carry-on:${carry_on_version}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.github.tartaricacid.touhoulittlemaid.api.task;

import com.github.tartaricacid.touhoulittlemaid.config.subconfig.MaidConfig;
import com.github.tartaricacid.touhoulittlemaid.entity.item.AbstractEntityFromItem;
import com.github.tartaricacid.touhoulittlemaid.entity.misc.DefaultMonsterType;
import com.github.tartaricacid.touhoulittlemaid.entity.misc.MonsterType;
import com.github.tartaricacid.touhoulittlemaid.entity.passive.EntityMaid;
Expand All @@ -12,6 +13,7 @@
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.TamableAnimal;
import net.minecraft.world.entity.ai.memory.MemoryModuleType;
import net.minecraft.world.entity.decoration.ArmorStand;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;

Expand Down Expand Up @@ -41,8 +43,8 @@ default boolean canAttack(EntityMaid maid, LivingEntity target) {
// 获取实体 ID
ResourceLocation id = BuiltInRegistries.ENTITY_TYPE.getKey(target.getType());

// 模组自身强制指定的
if (target instanceof Player) {
// 排除一些盔甲架,还有本模组的实体,以及玩家
if (target instanceof ArmorStand || target instanceof AbstractEntityFromItem || target instanceof Player) {
return false;
}
// 有主的宠物也不攻击
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class BlockCChess extends BlockJoy implements IBoardGameBlock {
public static final VoxelShape AABB = Block.box(0, 0, 0, 16, 2, 16);

public BlockCChess() {
super(BlockBehaviour.Properties.of().mapColor(MapColor.WOOD).sound(SoundType.WOOD).strength(2.0F, 3.0F).noOcclusion());
super(BlockBehaviour.Properties.of().mapColor(MapColor.WOOD).sound(SoundType.WOOD).strength(2.0F, 3.0F).forceSolidOn().noOcclusion());
this.registerDefaultState(this.stateDefinition.any().setValue(PART, GomokuPart.CENTER).setValue(FACING, Direction.NORTH));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public class BlockGomoku extends BlockJoy implements IBoardGameBlock {
public static final VoxelShape RIGHT_DOWN_WITH_BOX = Shapes.or(RIGHT_DOWN, Block.box(0, 0, 9, 5, 4, 14));

public BlockGomoku() {
super(BlockBehaviour.Properties.of().mapColor(MapColor.WOOD).sound(SoundType.WOOD).strength(2.0F, 3.0F).noOcclusion());
super(BlockBehaviour.Properties.of().mapColor(MapColor.WOOD).sound(SoundType.WOOD).strength(2.0F, 3.0F).forceSolidOn().noOcclusion());
this.registerDefaultState(this.stateDefinition.any().setValue(PART, GomokuPart.CENTER).setValue(FACING, Direction.NORTH));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.DirectionProperty;
import net.minecraft.world.level.material.Fluid;
import net.minecraft.world.level.material.MapColor;
import net.minecraft.world.level.pathfinder.PathComputationType;
import net.minecraft.world.phys.BlockHitResult;
Expand All @@ -36,7 +37,7 @@ protected BlockJoy(BlockBehaviour.Properties properties) {
}

public BlockJoy() {
this(BlockBehaviour.Properties.of().mapColor(MapColor.WOOD).sound(SoundType.WOOD).strength(2.0F, 3.0F).noOcclusion());
this(BlockBehaviour.Properties.of().mapColor(MapColor.WOOD).sound(SoundType.WOOD).strength(2.0F, 3.0F).forceSolidOn().noOcclusion());
this.registerDefaultState(this.stateDefinition.any().setValue(FACING, Direction.NORTH));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class BlockPicnicMat extends Block implements EntityBlock {
public static final VoxelShape AABB = Block.box(0, 0, 0, 16, 1, 16);

public BlockPicnicMat() {
super(BlockBehaviour.Properties.of().mapColor(MapColor.WOOD).sound(SoundType.WOOD).strength(2.0F, 3.0F).noOcclusion());
super(BlockBehaviour.Properties.of().mapColor(MapColor.WOOD).sound(SoundType.WOOD).strength(2.0F, 3.0F).forceSolidOn().noOcclusion());
this.registerDefaultState(this.stateDefinition.any().setValue(FACING, Direction.NORTH).setValue(PART, PicnicMatPart.CENTER));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class BlockWChess extends BlockJoy implements IBoardGameBlock {
public static final VoxelShape AABB = Block.box(0, 0, 0, 16, 2, 16);

public BlockWChess() {
super(BlockBehaviour.Properties.of().mapColor(MapColor.WOOD).sound(SoundType.WOOD).strength(2.0F, 3.0F).noOcclusion());
super(BlockBehaviour.Properties.of().mapColor(MapColor.WOOD).sound(SoundType.WOOD).strength(2.0F, 3.0F).forceSolidOn().noOcclusion());
this.registerDefaultState(this.stateDefinition.any().setValue(PART, GomokuPart.CENTER).setValue(FACING, Direction.NORTH));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,25 +81,28 @@ private void rebornMaid(ServerLevel world, BlockPos pos, @Nullable List<ItemStac
if (list != null) {
itemFilm = list.stream().filter(stack -> stack.getItem() instanceof ItemFilm).findFirst().orElse(ItemStack.EMPTY);
}
EntityMaid maid = InitEntities.MAID.get().create(world);
EntityMaid maid = new EntityMaid(world);
CustomData compoundData = itemFilm.get(InitDataComponent.MAID_INFO);
if (compoundData != null && maid != null) {
if (compoundData != null) {
CompoundTag maidCompound = compoundData.copyTag();
maid.readAdditionalSaveData(maidCompound);
maid.spawnExplosionParticle();
maid.setPos(pos.getX(), pos.getY(), pos.getZ());
world.addFreshEntity(maid);
} else {
maid.finalizeSpawn(world, world.getCurrentDifficultyAt(pos), MobSpawnType.SPAWN_EGG, null);
}
maid.setPos(pos.getX(), pos.getY(), pos.getZ());
world.addFreshEntity(maid);
}

private void spawnBoxMaid(ServerLevel world, BlockPos pos) {
EntityBox box = new EntityBox(world);
world.addFreshEntity(box);
EntityMaid maid = new EntityMaid(world);
maid.finalizeSpawn(world, world.getCurrentDifficultyAt(pos), MobSpawnType.STRUCTURE, null);
world.addFreshEntity(maid);
maid.startRiding(box);
box.setPos(pos.getX(), pos.getY(), pos.getZ());

EntityMaid maid = new EntityMaid(world);
maid.setPos(pos.getX(), pos.getY(), pos.getZ());
maid.finalizeSpawn(world, world.getCurrentDifficultyAt(pos), MobSpawnType.SPAWN_EGG, null);
maid.startRiding(box, true);

world.tryAddFreshEntityWithPassengers(box);
}

private void spawnItem(ServerLevel world, BlockPos pos) {
Expand Down

0 comments on commit e6f37e6

Please sign in to comment.