Skip to content

Commit

Permalink
修正部分问题
Browse files Browse the repository at this point in the history
- 背包物品掉落问题
- 棋盘文字渲染问题
- 女仆胶片数据记录问题
  • Loading branch information
TartaricAcid committed Dec 19, 2023
1 parent 922ccc5 commit f488199
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private void renderLatestChessTips(TileEntityGomoku gomoku, MatrixStack poseStac
poseStack.mulPose(Vector3f.YN.rotationDegrees(180 + camera.getYRot()));
poseStack.scale(0.015625F, -0.015625F, 0.015625F);
float width = (float) (-renderer.font.width("▼") / 2) + 0.5f;
renderer.font.drawInBatch("▼", width, -1.5f, 0xFF0000, false, poseStack.last().pose(), bufferIn, true, 0, combinedLightIn);
renderer.font.drawInBatch("▼", width, -1.5f, 0xFF0000, false, poseStack.last().pose(), bufferIn, false, 0, combinedLightIn);
poseStack.popPose();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,18 @@ public void onPutOn(ItemStack stack, PlayerEntity player, EntityMaid maid) {
@Override
public void onTakeOff(ItemStack stack, PlayerEntity player, EntityMaid maid) {
Item item = stack.getItem();
if (item instanceof ItemMaidBackpack) {
if (item == InitItems.MAID_BACKPACK_SMALL.get()) {
ItemsUtil.dropEntityItems(maid, maid.getMaidInv(), BackpackLevel.SMALL_CAPACITY);
}
if (item == InitItems.MAID_BACKPACK_MIDDLE.get()) {
ItemsUtil.dropEntityItems(maid, maid.getMaidInv(), BackpackLevel.MIDDLE_CAPACITY);
}
} else {
this.dropAllItems(maid);
if (item == InitItems.MAID_BACKPACK_SMALL.get()) {
ItemsUtil.dropEntityItems(maid, maid.getMaidInv(), BackpackLevel.SMALL_CAPACITY);
return;
}
if (item == InitItems.MAID_BACKPACK_MIDDLE.get()) {
ItemsUtil.dropEntityItems(maid, maid.getMaidInv(), BackpackLevel.MIDDLE_CAPACITY);
return;
}
if (item == InitItems.MAID_BACKPACK_BIG.get()) {
return;
}
this.dropAllItems(maid);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ public void onPutOn(ItemStack stack, PlayerEntity player, EntityMaid maid) {
@Override
public void onTakeOff(ItemStack stack, PlayerEntity player, EntityMaid maid) {
Item item = stack.getItem();
if (item instanceof ItemMaidBackpack) {
if (item == InitItems.MAID_BACKPACK_SMALL.get()) {
ItemsUtil.dropEntityItems(maid, maid.getMaidInv(), BackpackLevel.SMALL_CAPACITY);
}
} else {
this.dropAllItems(maid);
if (item == InitItems.MAID_BACKPACK_SMALL.get()) {
ItemsUtil.dropEntityItems(maid, maid.getMaidInv(), BackpackLevel.SMALL_CAPACITY);
return;
}
if (item == InitItems.MAID_BACKPACK_MIDDLE.get() || item == InitItems.MAID_BACKPACK_BIG.get()) {
return;
}
this.dropAllItems(maid);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import com.github.tartaricacid.touhoulittlemaid.inventory.container.AbstractMaidContainer;
import com.github.tartaricacid.touhoulittlemaid.inventory.container.backpack.FurnaceBackpackContainer;
import com.github.tartaricacid.touhoulittlemaid.item.BackpackLevel;
import com.github.tartaricacid.touhoulittlemaid.item.ItemMaidBackpack;
import com.github.tartaricacid.touhoulittlemaid.util.ItemsUtil;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.renderer.entity.model.EntityModel;
Expand All @@ -38,20 +37,22 @@ public void onPutOn(ItemStack stack, PlayerEntity player, EntityMaid maid) {

@Override
public void onTakeOff(ItemStack stack, PlayerEntity player, EntityMaid maid) {
Item item = stack.getItem();
if (item instanceof ItemMaidBackpack) {
if (item == InitItems.MAID_BACKPACK_SMALL.get()) {
ItemsUtil.dropEntityItems(maid, maid.getMaidInv(), BackpackLevel.SMALL_CAPACITY);
}
} else {
this.dropAllItems(maid);
}
IBackpackData backpackData = maid.getBackpackData();
if (backpackData instanceof FurnaceBackpackData) {
FurnaceBackpackData furnaceBackpackData = (FurnaceBackpackData) backpackData;
InvWrapper inv = new InvWrapper(furnaceBackpackData);
ItemsUtil.dropEntityItems(maid, inv);
}

Item item = stack.getItem();
if (item == InitItems.MAID_BACKPACK_SMALL.get()) {
ItemsUtil.dropEntityItems(maid, maid.getMaidInv(), BackpackLevel.SMALL_CAPACITY);
return;
}
if (item == InitItems.MAID_BACKPACK_MIDDLE.get() || item == InitItems.MAID_BACKPACK_BIG.get()) {
return;
}
this.dropAllItems(maid);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ public void onPutOn(ItemStack stack, PlayerEntity player, EntityMaid maid) {
@Override
public void onTakeOff(ItemStack stack, PlayerEntity player, EntityMaid maid) {
Item item = stack.getItem();
if (item instanceof ItemMaidBackpack) {
if (item == InitItems.MAID_BACKPACK_SMALL.get()) {
ItemsUtil.dropEntityItems(maid, maid.getMaidInv(), BackpackLevel.SMALL_CAPACITY);
}
} else {
this.dropAllItems(maid);
if (item == InitItems.MAID_BACKPACK_SMALL.get()) {
ItemsUtil.dropEntityItems(maid, maid.getMaidInv(), BackpackLevel.SMALL_CAPACITY);
return;
}
if (item == InitItems.MAID_BACKPACK_MIDDLE.get() || item == InitItems.MAID_BACKPACK_BIG.get()) {
return;
}
this.dropAllItems(maid);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import com.github.tartaricacid.touhoulittlemaid.inventory.container.AbstractMaidContainer;
import com.github.tartaricacid.touhoulittlemaid.inventory.container.backpack.SmallBackpackContainer;
import com.github.tartaricacid.touhoulittlemaid.item.BackpackLevel;
import com.github.tartaricacid.touhoulittlemaid.item.ItemMaidBackpack;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.renderer.entity.model.EntityModel;
import net.minecraft.entity.player.PlayerEntity;
Expand All @@ -34,9 +33,11 @@ public void onPutOn(ItemStack stack, PlayerEntity player, EntityMaid maid) {

@Override
public void onTakeOff(ItemStack stack, PlayerEntity player, EntityMaid maid) {
if (!(stack.getItem() instanceof ItemMaidBackpack)) {
this.dropAllItems(maid);
Item item = stack.getItem();
if (item == InitItems.MAID_BACKPACK_SMALL.get() || item == InitItems.MAID_BACKPACK_MIDDLE.get() || item == InitItems.MAID_BACKPACK_BIG.get()) {
return;
}
this.dropAllItems(maid);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ private static void removeMaidSomeData(CompoundNBT nbt) {
nbt.remove("HurtTime");
nbt.remove("DeathTime");
nbt.remove("HurtByTimestamp");
nbt.remove("Pos");
nbt.remove("Motion");
nbt.remove("FallDistance");
nbt.remove("Fire");
nbt.remove("Air");
nbt.remove("TicksFrozen");
nbt.remove("HasVisualFire");
nbt.remove("Passengers");
}

@Override
Expand Down

0 comments on commit f488199

Please sign in to comment.