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 798574b commit 7443926
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private void renderLatestChessTips(TileEntityGomoku gomoku, PoseStack poseStack,
poseStack.mulPose(Vector3f.YN.rotationDegrees(180 + camera.getYRot()));
poseStack.scale(0.015625F, -0.015625F, 0.015625F);
float width = (float) (-this.font.width("▼") / 2) + 0.5f;
this.font.drawInBatch("▼", width, -1.5f, 0xFF0000, false, poseStack.last().pose(), bufferIn, true, 0, combinedLightIn);
this.font.drawInBatch("▼", width, -1.5f, 0xFF0000, false, poseStack.last().pose(), bufferIn, false, 0, combinedLightIn);
poseStack.popPose();
}
}
Expand All @@ -70,6 +70,9 @@ private void renderChessboard(TileEntityGomoku gomoku, PoseStack poseStack, Mult
poseStack.translate(0.5, 1.5, 0.5);
poseStack.mulPose(Vector3f.ZN.rotationDegrees(180));
poseStack.mulPose(Vector3f.YN.rotationDegrees(facing.get2DDataValue() * 90));
if (facing == Direction.SOUTH || facing == Direction.NORTH) {
poseStack.mulPose(Vector3f.YN.rotationDegrees(180));
}
VertexConsumer checkerBoardBuff = bufferIn.getBuffer(RenderType.entityTranslucent(CHECKER_BOARD_TEXTURE));
CHECKER_BOARD_MODEL.renderToBuffer(poseStack, checkerBoardBuff, combinedLightIn, combinedOverlayIn, 1.0F, 1.0F, 1.0F, 1.0F);
poseStack.popPose();
Expand Down Expand Up @@ -122,10 +125,10 @@ private void renderTipsText(TileEntityGomoku gomoku, PoseStack poseStack, MultiB
poseStack.mulPose(Vector3f.YN.rotationDegrees(180 + camera.getYRot()));
poseStack.mulPose(Vector3f.XN.rotationDegrees(camera.getXRot()));
poseStack.scale(0.03F, -0.03F, 0.03F);
this.font.drawInBatch(loseTips, loseTipsWidth, -10, 0xFFFFFF, true, poseStack.last().pose(), bufferIn, true, 0, combinedLightIn);
this.font.drawInBatch(loseTips, loseTipsWidth, -10, 0xFFFFFF, true, poseStack.last().pose(), bufferIn, false, 0, combinedLightIn);
poseStack.scale(0.5F, 0.5F, 0.5F);
this.font.drawInBatch(roundTips, roundTipsWidth, -30, 0xFFFFFF, true, poseStack.last().pose(), bufferIn, true, 0, combinedLightIn);
this.font.drawInBatch(resetTips, resetTipsWidth, 0, 0xFFFFFF, true, poseStack.last().pose(), bufferIn, true, 0, combinedLightIn);
this.font.drawInBatch(roundTips, roundTipsWidth, -30, 0xFFFFFF, true, poseStack.last().pose(), bufferIn, false, 0, combinedLightIn);
this.font.drawInBatch(resetTips, resetTipsWidth, 0, 0xFFFFFF, true, 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, Player player, EntityMaid maid) {
@Override
public void onTakeOff(ItemStack stack, Player 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 @@ -35,13 +35,14 @@ public void onPutOn(ItemStack stack, Player player, EntityMaid maid) {
@Override
public void onTakeOff(ItemStack stack, Player 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 @@ -38,19 +38,21 @@ public void onPutOn(ItemStack stack, Player player, EntityMaid maid) {

@Override
public void onTakeOff(ItemStack stack, Player 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) {
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, Player player, EntityMaid maid) {
@Override
public void onTakeOff(ItemStack stack, Player 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.vertex.PoseStack;
import net.minecraft.client.model.EntityModel;
import net.minecraft.client.model.geom.EntityModelSet;
Expand All @@ -34,9 +33,11 @@ public void onPutOn(ItemStack stack, Player player, EntityMaid maid) {

@Override
public void onTakeOff(ItemStack stack, Player 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 @@ -95,6 +95,14 @@ private static void removeMaidSomeData(CompoundTag 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 7443926

Please sign in to comment.