移除TAG

This commit is contained in:
Atsuishio 2025-07-13 22:34:29 +08:00 committed by Light_Quanta
parent ead5464212
commit 514c6ed288
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959
3 changed files with 16 additions and 10 deletions

View file

@ -77,8 +77,6 @@ public class ModItemTagProvider extends ItemTagsProvider {
this.tag(cTag("tools/crowbar")).add(ModItems.CROWBAR.get());
this.tag(ModTags.Items.MEDIUM_ROCKET).add(ModItems.MEDIUM_ROCKET_AP.get(), ModItems.MEDIUM_ROCKET_HE.get(), ModItems.MEDIUM_ROCKET_CM.get());
// TODO 清理枪械Tag
ModItems.GUNS.getEntries().forEach(registryObject -> this.tag(ModTags.Items.GUN).add(registryObject.get()));

View file

@ -189,14 +189,23 @@ public class Type63Entity extends ContainerMobileVehicleEntity implements GeoEnt
}
setChanged();
if (player.isShiftKeyDown() && stack.is(ModTags.Items.CROWBAR) && this.getPassengers().isEmpty()) {
ItemStack container = ContainerBlockItem.createInstance(this);
if (!player.addItem(container)) {
player.drop(container, false);
if (stack.is(ModTags.Items.CROWBAR)) {
if (player.isShiftKeyDown() && this.getPassengers().isEmpty()) {
ItemStack container = ContainerBlockItem.createInstance(this);
if (!player.addItem(container)) {
player.drop(container, false);
}
this.remove(RemovalReason.DISCARDED);
this.discard();
return InteractionResult.SUCCESS;
}
for (int i = 0; i < 12; i++) {
if (!items.get(i).isEmpty()) {
items.remove(i);
break;
}
}
this.remove(RemovalReason.DISCARDED);
this.discard();
return InteractionResult.SUCCESS;
}
return InteractionResult.FAIL;

View file

@ -42,7 +42,6 @@ public class ModTags {
public static final TagKey<Item> EPIC_BLUEPRINT = tag("blueprint/epic");
public static final TagKey<Item> LEGENDARY_BLUEPRINT = tag("blueprint/legendary");
public static final TagKey<Item> CANNON_BLUEPRINT = tag("blueprint/cannon");
public static final TagKey<Item> MEDIUM_ROCKET = tag("medium_rocket");
public static final TagKey<Item> WRENCHES = ItemTags.create(ResourceLocation.fromNamespaceAndPath("c", "wrenches"));
public static final TagKey<Item> WRENCH = ItemTags.create(ResourceLocation.fromNamespaceAndPath("c", "tools/wrench"));