Skip to content

Commit

Permalink
Remove desu gun
Browse files Browse the repository at this point in the history
Prompted by randomguypi and ok-ed by vaz
  • Loading branch information
williewillus committed Sep 26, 2023
1 parent 049ebef commit 22c5fc9
Show file tree
Hide file tree
Showing 25 changed files with 33 additions and 163 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,23 @@
* Pretty much all of the data of the superclass is ignored.
*/
public class FabricManaBlasterModel extends BlockModel {
private final ResourceLocation gunNoClip, gunClip, desuGunNoClip, desuGunClip;
private final ResourceLocation gunNoClip, gunClip;

public FabricManaBlasterModel(ResourceLocation gunNoClip, ResourceLocation gunClip,
ResourceLocation desuGunNoClip, ResourceLocation desuGunClip) {
public FabricManaBlasterModel(ResourceLocation gunNoClip, ResourceLocation gunClip) {
super(null, Collections.emptyList(), Collections.emptyMap(), false, GuiLight.SIDE, ItemTransforms.NO_TRANSFORMS, Collections.emptyList());
this.gunNoClip = gunNoClip;
this.gunClip = gunClip;
this.desuGunNoClip = desuGunNoClip;
this.desuGunClip = desuGunClip;
}

@Override
public Collection<ResourceLocation> getDependencies() {
return List.of(this.gunNoClip, this.gunClip, this.desuGunNoClip, this.desuGunClip);
return List.of(this.gunNoClip, this.gunClip);
}

@Override
public void resolveParents(Function<ResourceLocation, UnbakedModel> modelGetter) {
modelGetter.apply(this.gunNoClip).resolveParents(modelGetter);
modelGetter.apply(this.gunClip).resolveParents(modelGetter);
modelGetter.apply(this.desuGunNoClip).resolveParents(modelGetter);
modelGetter.apply(this.desuGunClip).resolveParents(modelGetter);
}

@Nullable
Expand All @@ -55,7 +50,6 @@ public BakedModel bake(ModelBaker baker, Function<Material, TextureAtlasSprite>
return ManaBlasterBakedModel.create(
baker,
this.gunNoClip, this.gunClip,
this.desuGunNoClip, this.desuGunClip,
state);
}

Expand All @@ -67,9 +61,7 @@ public static FabricManaBlasterModel hookModelLoad(JsonElement jsonElement) {
&& loader.getAsString().equals(ClientXplatAbstractions.MANA_GUN_MODEL_LOADER_ID.toString())) {
return new FabricManaBlasterModel(
new ResourceLocation(GsonHelper.getAsString(json, "gun_noclip")),
new ResourceLocation(GsonHelper.getAsString(json, "gun_clip")),
new ResourceLocation(GsonHelper.getAsString(json, "desu_gun_noclip")),
new ResourceLocation(GsonHelper.getAsString(json, "desu_gun_clip"))
new ResourceLocation(GsonHelper.getAsString(json, "gun_clip"))
);
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,17 @@
import java.util.function.Function;

public class ForgeManaBlasterModel implements IUnbakedGeometry<ForgeManaBlasterModel> {
private final ResourceLocation gunNoClip, gunClip, desuGunNoClip, desuGunClip;
private final ResourceLocation gunNoClip, gunClip;

public ForgeManaBlasterModel(ResourceLocation gunNoClip, ResourceLocation gunClip,
ResourceLocation desuGunNoClip, ResourceLocation desuGunClip) {
public ForgeManaBlasterModel(ResourceLocation gunNoClip, ResourceLocation gunClip) {
this.gunNoClip = gunNoClip;
this.gunClip = gunClip;
this.desuGunNoClip = desuGunNoClip;
this.desuGunClip = desuGunClip;
}

@Override
public void resolveParents(Function<ResourceLocation, UnbakedModel> modelGetter, IGeometryBakingContext context) {
modelGetter.apply(this.gunNoClip).resolveParents(modelGetter);
modelGetter.apply(this.gunClip).resolveParents(modelGetter);
modelGetter.apply(this.desuGunNoClip).resolveParents(modelGetter);
modelGetter.apply(this.desuGunClip).resolveParents(modelGetter);
}

@Override
Expand All @@ -49,7 +44,7 @@ public Transformation getRotation() {
return transform;
}
};
return ManaBlasterBakedModel.create(baker, this.gunNoClip, this.gunClip, this.desuGunNoClip, this.desuGunClip, state);
return ManaBlasterBakedModel.create(baker, this.gunNoClip, this.gunClip, state);
}

enum Loader implements IGeometryLoader<ForgeManaBlasterModel> {
Expand All @@ -60,9 +55,7 @@ enum Loader implements IGeometryLoader<ForgeManaBlasterModel> {
public ForgeManaBlasterModel read(JsonObject json, JsonDeserializationContext deserializationContext) {
return new ForgeManaBlasterModel(
new ResourceLocation(GsonHelper.getAsString(json, "gun_noclip")),
new ResourceLocation(GsonHelper.getAsString(json, "gun_clip")),
new ResourceLocation(GsonHelper.getAsString(json, "desu_gun_noclip")),
new ResourceLocation(GsonHelper.getAsString(json, "desu_gun_clip"))
new ResourceLocation(GsonHelper.getAsString(json, "gun_clip"))
);
}
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,17 @@
import java.util.*;

public class ManaBlasterBakedModel extends DelegatedModel {
private final BakedModel desuGunNoClip;
private final BakedModel desuGunClip;
// key is (lens, hasClip). If no lens, the Item is null
private final Map<Pair<Item, Boolean>, BakedModel> models;

private ManaBlasterBakedModel(BakedModel desuGunNoClip, BakedModel desuGunClip,
Map<Pair<Item, Boolean>, BakedModel> models) {
private ManaBlasterBakedModel(Map<Pair<Item, Boolean>, BakedModel> models) {
super(models.get(Pair.of(null, false)));
this.desuGunNoClip = desuGunNoClip;
this.desuGunClip = desuGunClip;
this.models = models;
}

public static ManaBlasterBakedModel create(ModelBaker baker,
ResourceLocation gunNoClip, ResourceLocation gunClip,
ResourceLocation desuGunNoClip, ResourceLocation desuGunClip, ModelState state) {
ModelState state) {
BakedModel gunNoClipModel = Preconditions.checkNotNull(baker.bake(gunNoClip, state));
BakedModel gunClipModel = Preconditions.checkNotNull(baker.bake(gunClip, state));
Map<Pair<Item, Boolean>, BakedModel> models = new HashMap<>();
Expand All @@ -65,11 +60,7 @@ public static ManaBlasterBakedModel create(ModelBaker baker,
models.put(Pair.of(item, true), new ManaBlasterBakedModel.CompositeBakedModel(baker, lens, gunClipModel));
}
}
return new ManaBlasterBakedModel(
baker.bake(desuGunNoClip, state),
baker.bake(desuGunClip, state),
models
);
return new ManaBlasterBakedModel(models);
}

private final ItemOverrides itemHandler = new ItemOverrides() {
Expand All @@ -78,10 +69,6 @@ public static ManaBlasterBakedModel create(ModelBaker baker,
public BakedModel resolve(BakedModel model, ItemStack stack, @Nullable ClientLevel worldIn, @Nullable LivingEntity entityIn, int seed) {
boolean clip = ManaBlasterItem.hasClip(stack);

if (ManaBlasterItem.isSugoiKawaiiDesuNe(stack)) {
return clip ? ManaBlasterBakedModel.this.desuGunClip : ManaBlasterBakedModel.this.desuGunNoClip;
}

ItemStack lens = ManaBlasterItem.getLens(stack);
Pair<Item, Boolean> key = Pair.of(lens.isEmpty() ? null : lens.getItem(), clip);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
import net.minecraft.world.item.ItemStack;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import vazkii.botania.common.item.ManaBlasterItem;

import static vazkii.botania.common.lib.ResourceLocationHelper.prefix;

Expand All @@ -37,9 +34,8 @@ public ResourceLocation getId() {
@NotNull
@Override
public ManaBlasterTrigger.Instance createInstance(@NotNull JsonObject json, ContextAwarePredicate playerPred, DeserializationContext conditions) {
Boolean desu = json.get("desu") == null ? null : json.get("desu").getAsBoolean();
return new ManaBlasterTrigger.Instance(playerPred, ItemPredicate.fromJson(json.get("item")),
EntityPredicate.fromJson(json.get("user")), desu);
EntityPredicate.fromJson(json.get("user")));
}

public void trigger(ServerPlayer player, ItemStack stack) {
Expand All @@ -49,14 +45,11 @@ public void trigger(ServerPlayer player, ItemStack stack) {
public static class Instance extends AbstractCriterionTriggerInstance {
private final ItemPredicate item;
private final EntityPredicate user;
@Nullable
private final Boolean desu;

public Instance(ContextAwarePredicate entityPred, ItemPredicate count, EntityPredicate user, Boolean desu) {
public Instance(ContextAwarePredicate entityPred, ItemPredicate count, EntityPredicate user) {
super(ID, entityPred);
this.item = count;
this.user = user;
this.desu = desu;
}

@NotNull
Expand All @@ -66,8 +59,7 @@ public ResourceLocation getCriterion() {
}

boolean test(ItemStack stack, ServerPlayer entity) {
return this.item.matches(stack) && this.user.matches(entity, entity)
&& (desu == null || desu == ManaBlasterItem.isSugoiKawaiiDesuNe(stack));
return this.item.matches(stack) && this.user.matches(entity, entity);
}

@Override
Expand All @@ -79,9 +71,6 @@ public JsonObject serializeToJson(SerializationContext context) {
if (user != EntityPredicate.ANY) {
json.add("user", user.serializeToJson());
}
if (desu != null) {
json.addProperty("desu", desu);
}
return json;
}

Expand All @@ -92,10 +81,5 @@ public ItemPredicate getItem() {
public EntityPredicate getUser() {
return this.user;
}

@Nullable
public Boolean getDesu() {
return this.desu;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -98,24 +98,6 @@ public InteractionResultHolder<ItemStack> use(Level world, Player player, @NotNu
return InteractionResultHolder.pass(stack);
}

// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
public static boolean isSugoiKawaiiDesuNe(ItemStack stack) {
return stack.getHoverName().getString().equalsIgnoreCase("desu gun");
}

@NotNull
public BurstProperties getBurstProps(Player player, ItemStack stack, boolean request, InteractionHand hand) {
int maxMana = 120;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public void generate(HolderLookup.Provider lookup, Consumer<Advancement> consume
Advancement.Builder.advancement()
.display(simple(BotaniaItems.manaGun, "manaBlasterShoot", FrameType.TASK))
.parent(runePickup)
.addCriterion("shoot", new ManaBlasterTrigger.Instance(ContextAwarePredicate.ANY, ItemPredicate.ANY, EntityPredicate.ANY, null))
.addCriterion("shoot", new ManaBlasterTrigger.Instance(ContextAwarePredicate.ANY, ItemPredicate.ANY, EntityPredicate.ANY))
.save(consumer, mainId("mana_blaster_shoot"));
Advancement.Builder.advancement()
.display(simple(BotaniaFlowerBlocks.pollidisiac, "pollidisiacPickup", FrameType.TASK))
Expand Down Expand Up @@ -377,14 +377,6 @@ ContextAwarePredicate.ANY, matchItems(BotaniaItems.pinkinator), LocationPredicat
.addCriterion("flower", onPickup(BotaniaBlocks.motifDaybloom, BotaniaBlocks.motifNightshade))
.requirements(RequirementsStrategy.OR)
.save(consumer, challengeId("old_flower_pickup"));
DisplayInfo desuGun = simple(BotaniaItems.manaGun, "desuGun", FrameType.CHALLENGE);
desuGun.getIcon().setHoverName(Component.literal("desu gun"));
Advancement.Builder.advancement()
.display(desuGun)
.parent(root)
.addCriterion("use_gun", new ManaBlasterTrigger.Instance(
ContextAwarePredicate.ANY, ItemPredicate.ANY, EntityPredicate.ANY, true))
.save(consumer, challengeId("desu_gun"));
Advancement.Builder.advancement()
.display(simple(BotaniaBlocks.corporeaIndex, "superCorporeaRequest", FrameType.CHALLENGE))
.parent(root)
Expand Down
2 changes: 0 additions & 2 deletions Xplat/src/main/resources/assets/botania/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,6 @@
"advancement.botania:old_flower_pickup": "Deja Vu",
"advancement.botania:old_flower_pickup.desc": "Discover the Daybloom Motif or Nightshade Motif",

"advancement.botania:desuGun": "Two-Faced Lovers",
"advancement.botania:desuGun.desc": "ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN",
"advancement.botania:tinyPotatoBirthday": "Blessing",
"advancement.botania:tinyPotatoBirthday.desc": "Celebrate Tiny Potato's Birthday on July 19th",

Expand Down
1 change: 0 additions & 1 deletion Xplat/src/main/resources/assets/botania/lang/es_es.json
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@
"advancement.botania:lokiRing": "Aritmética",
"advancement.botania:lokiRing.desc": "Se recompensado con el anillo de Loki",

"advancement.botania:desuGun": "Amante de dos caras.",

"botania.challengelevel.easy": "Fácil",
"botania.challengelevel.normal": "Normal",
Expand Down
2 changes: 0 additions & 2 deletions Xplat/src/main/resources/assets/botania/lang/fr_fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,6 @@
"advancement.botania:old_flower_pickup": "Déjà-vu",
"advancement.botania:old_flower_pickup.desc": "Découvrez un motif Fleurjour ou un motif Ombrenuit",

"advancement.botania:desuGun": "nya nya nya",
"advancement.botania:desuGun.desc": "ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN",

"advancement.botania:tinyPotatoBirthday": "Un grand jour",
"advancement.botania:tinyPotatoBirthday.desc": "Célébrez l'anniversaire de la petite patate un 19 juillet",
Expand Down
2 changes: 0 additions & 2 deletions Xplat/src/main/resources/assets/botania/lang/ja_jp.json
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,6 @@
"advancement.botania:old_flower_pickup": "Deja Vu",
"advancement.botania:old_flower_pickup.desc": "デイブルームモチーフまたはナイトシェイドモチーフを発見する",

"advancement.botania:desuGun": "裏表ラバーズ",
"advancement.botania:desuGun.desc": "アサダサンアサダサンアサダサンアサダサンアサダサンアサダサンアサダサンアサダサンアサダサンアサダサンアサダサンアサダサン",
"advancement.botania:tinyPotatoBirthday": "Blessing",
"advancement.botania:tinyPotatoBirthday.desc": "7月19日に小さなポテトの誕生日をお祝いしよう",

Expand Down
1 change: 0 additions & 1 deletion Xplat/src/main/resources/assets/botania/lang/ko_kr.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@
"advancement.botania:odinRing.desc": "영웅적인 위업을 달성해서 오딘의 반지를 획득해보세요",
"advancement.botania:lokiRing.desc": "영웅적인 위업을 달성해서 로키의 반지를 획득해보세요",

"advancement.botania:desuGun": "겉과 속이 다른 러버즈",

"botania.challengelevel.easy": "쉬움",
"botania.challengelevel.normal": "보통",
Expand Down
1 change: 0 additions & 1 deletion Xplat/src/main/resources/assets/botania/lang/nl_nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@
"advancement.botania:lokiRing": "Rekenkunst",
"advancement.botania:lokiRing.desc": "Verdien de Ring van Loki voor een heldhaftige daad",

"advancement.botania:desuGun": "Tweezijdige Liefde",

"botania.challengelevel.easy": "Makkelijk",
"botania.challengelevel.normal": "Normaal",
Expand Down
1 change: 0 additions & 1 deletion Xplat/src/main/resources/assets/botania/lang/ru_ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,6 @@
"advancement.botania:old_flower_pickup": "Deja Vu!!!",
"advancement.botania:old_flower_pickup.desc": "Откройте для себя мотив Днецвета или мотив Ночного паслена",

"advancement.botania:desuGun": "Двуликие Любовники",

"botania.challengelevel.easy": "Легкий",
"botania.challengelevel.normal": "Средний",
Expand Down
2 changes: 0 additions & 2 deletions Xplat/src/main/resources/assets/botania/lang/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,6 @@
"advancement.botania:old_flower_pickup": "逮虾户",
"advancement.botania:old_flower_pickup.desc": "发现装饰用太阳花或装饰用夜颠茄",

"advancement.botania:desuGun": "裏表ラバーズ",
"advancement.botania:desuGun.desc": "ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN",
"advancement.botania:tinyPotatoBirthday": "Blessing",
"advancement.botania:tinyPotatoBirthday.desc": "7月19日,庆祝小土豆的生日",

Expand Down
2 changes: 0 additions & 2 deletions Xplat/src/main/resources/assets/botania/lang/zh_tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,6 @@
"advancement.botania:lokiRing": "Arithmetic",
"advancement.botania:lokiRing.desc": "獲得戰利品:洛基之戒",

"advancement.botania:desuGun": "裏表ラバーズ",
"advancement.botania:desuGun.desc": "アサダサンアサダサンアサダサンアサダサンアサダサンアサダサンアサダサンアサダサンアサダサンアサダサンアサダサン",

"botania.challengelevel.easy": "簡單",
"botania.challengelevel.normal": "普通",
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 22c5fc9

Please sign in to comment.