Skip to content

Commit

Permalink
Removed unused TF variant tags, added temporary_only tag, overrides c…
Browse files Browse the repository at this point in the history
…hanged:keepForm allowing to escape soft-banning forms.
  • Loading branch information
LtxProgrammer committed Nov 28, 2024
1 parent ae27d4a commit 95e4e52
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public LocalTransfurVariantInstance(TransfurVariant<T> parent, LocalPlayer host)
protected void tickTransfurProgress() {
super.tickTransfurProgress();

if (transfurProgression < 1f || this.ageAsVariant < 30) {
if (transfurProgression < 1f || this.ageAsVariant < 30 || !this.getItemUseMode().holdMainHand) {
((LocalPlayerAccessor)host).setHandsBusy(true);
} else if (host.getVehicle() == null && host.isHandsBusy()) {
((LocalPlayerAccessor)host).setHandsBusy(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,9 @@ private static TagKey<Biome> create(String name) {
}

public static class TransfurVariants {
public static final TagKey<TransfurVariant<?>> WOLF_LIKE = create("wolf_like");
public static final TagKey<TransfurVariant<?>> SHARK_LIKE = create("shark_like");
public static final TagKey<TransfurVariant<?>> CAT_LIKE = create("cat_like");
public static final TagKey<TransfurVariant<?>> LEOPARD_LIKE = create("leopard_like");

public static final TagKey<TransfurVariant<?>> CAN_SLEEP_ON_PILLOWS = create("can_sleep_on_pillows");
public static final TagKey<TransfurVariant<?>> BREAK_ITEMS_ON_TF = create("break_items_on_tf");
public static final TagKey<TransfurVariant<?>> TEMPORARY_ONLY = create("temporary_only");

private static TagKey<TransfurVariant<?>> create(String name) {
return TagKey.create(ChangedRegistry.TRANSFUR_VARIANT.key, Changed.modResource(name));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
import net.ltxprogrammer.changed.Changed;
import net.ltxprogrammer.changed.entity.PlayerDataExtension;
import net.ltxprogrammer.changed.entity.TransfurCause;
import net.ltxprogrammer.changed.entity.UseItemMode;
import net.ltxprogrammer.changed.entity.variant.TransfurVariant;
import net.ltxprogrammer.changed.entity.variant.TransfurVariantInstance;
import net.ltxprogrammer.changed.init.ChangedGameRules;
import net.ltxprogrammer.changed.init.ChangedRegistry;
import net.ltxprogrammer.changed.init.ChangedTags;
import net.ltxprogrammer.changed.init.ChangedTransfurVariants;
import net.ltxprogrammer.changed.network.packet.MountTransfurPacket;
import net.ltxprogrammer.changed.process.Pale;
Expand Down Expand Up @@ -49,8 +51,12 @@ public void restoreFrom(ServerPlayer player, boolean restore, CallbackInfo callb
ProcessTransfur.ifPlayerTransfurred(player, oldVariant -> {
if (!oldVariant.willSurviveTransfur)
return;
if (!restore && oldVariant.getParent().is(ChangedTags.TransfurVariants.TEMPORARY_ONLY))
return; // Exception to keepForm gamerule

var newVariant = ProcessTransfur.setPlayerTransfurVariant(self, oldVariant.getParent(), oldVariant.transfurContext, oldVariant.transfurProgression);
if (newVariant == null)
return;
newVariant.load(oldVariant.save());
newVariant.getChangedEntity().readPlayerVariantData(oldVariant.getChangedEntity().savePlayerVariantData());
newVariant.handleRespawn();
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"changed:form_latex_benign_wolf"
]
}

This file was deleted.

0 comments on commit 95e4e52

Please sign in to comment.