Skip to content

Commit

Permalink
Merge branch 'downstream-1.11' into downstream-master
Browse files Browse the repository at this point in the history
  • Loading branch information
asanetargoss committed Feb 11, 2024
2 parents be50997 + b83f8e9 commit 3804ba0
Show file tree
Hide file tree
Showing 91 changed files with 6,346 additions and 3,171 deletions.
133 changes: 132 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,141 @@
## Metamorph 1.3.1

This update was made by Chryfi.

**Compatible** with McLib `2.4`. It doesn't mean that future versions of McLib would be incompatible, but older versions are most likely incompatible.

* Added local / global translation mode
* Added useTargetDefault method to AbstractMorph to get rid of bad name checks in bodypart menu code
* Fixed bodypart axis drawing at non selected bodyparts
* Fixed NPE crash with Metamorph capabilities
* Removed W and S key for bodypart cycling - use the arrow keys now

## Metamorph 1.3

This update was made by MiaoNLI.

**Compatible** with McLib `2.4`. It doesn't mean that future versions of McLib would be incompatible, but older versions are most likely incompatible.

* GUI
* Added Onion Skin (Toggled by Q)
* Adjusted the width of GuiTransformations
* BodyPart
* Hold down the Alt/Option key to lock the space transformed while switching limbs
* Show onion skin while editing a morph
* Morph
* Added option to enable/disable/only rendering shadow of Optifine shaderpack
* Label Morph
* Fixed crash when text has non-English character
* Entity Morph
* Compatible with CEM of Optifine (suggested by MichaelCreeper_)
* File Encoding
* UTF-8 file encoding is used by default

## Metamorph 1.2.13

This update fixed rotation yaw wasn't synchronized with body parts with use target.

**Compatible** with McLib `2.3.6`. It doesn't mean that future versions of McLib would be incompatible, but older versions are most likely incompatible.

* Fixed `entity.rotationYaw` not being synchronized with body parts when use target is enabled.

## Metamorph 1.2.12

This update adds a couple of QoL tweaks.

**Compatible** with McLib `2.3.6`. It doesn't mean that future versions of McLib would be incompatible, but older versions are most likely incompatible.

* Added up and down arrows (and `W` and `S`) in body part morph editor panel
* Added toggle to hide/show separate morph categories

## Metamorph 1.2.11

This update was made by Chryfi. The only change is making Use target option enabled by default for Blockbuster's tracker morphs.

**Compatible** with McLib `2.3.6`. It doesn't mean that future versions of McLib would be incompatible, but older versions are most likely incompatible.

* Added `tracker` morph to Use option enabled by default list

## Metamorph 1.2.10

This patch adds an option to replace entity morphs texture.

**Compatible** with McLib `2.3.1`. It doesn't mean that future versions of McLib would be incompatible, but older versions are most likely incompatible.

* Added two options to entity morphs:
* User texture: you can change mob's texture for that specific morph
* Entity scale: you can change mob's overall size (hitbox is configured separately) for that specific morph

## Metamorph 1.2.9

This is patch fixes a couple of bugs.

**Compatible** with McLib `2.3.1`. It doesn't mean that future versions of McLib would be incompatible, but older versions are most likely incompatible.

* Added confirmation modal when removing individual morphs (added by Chryfi)
* Fixed acquired morphs being cleared
* Fixed entity selector's matching NBT field not resetting the value
* Fixed entity selectors not updating when entity's data was changed
* Fixed entity's hitbox remained same from past entity selectors
* Fixed crash when using arrow keys navigation when Chameleon with no models installed

## Metamorph 1.2.8

This is a hot fix patch that fixes dedicated server crash on start.

**Compatible** with McLib `2.3`. It doesn't mean that future versions of McLib would be incompatible, but older versions are most likely incompatible.

* Fixed a dedicated server crash on start due to referencing client code
* Fixed morphs not being reset after exiting multiplayer server immediately

## Metamorph 1.2.7

This patch update adds a lot of random features.

**Compatible** with McLib `2.3`. It doesn't mean that future versions of McLib would be incompatible, but older versions are most likely incompatible.

* Added OP access only to entity selectors
* Added automatic enabling of Use target when picking Blockbuster's `particle` or `snowstorm` morphs
* Added interpolation preview to animation component
* Added an option to disable rendering of body part axes (developed by Chryfi)
* Added text formatting to `label` morph (for example `Hey [6man[r!` highlights `man` as gold color, suggestd by Centryfuga)
* Added background color option to `label` morph (suggestd by Sbriser)
* Added look at player option to `label` morph (suggested by Sbriser and Jvonlins)
* Changed animation duration field to increment 1, 2, 5 (weak, normal, strong)
* Changed body parts merging to correctly handle transition of non equal amount of incoming body parts
* Improved entity selectors (intant application of selectors upon newly spawned mobs, and instant update on mobs when changing)
* Fixed `block` morph Z-fighting
* Fixed NPE in Metamorph's name renderer (reported by Berm1zzov)

## Metamorph 1.2.6

This patch update adds context menu to body part list, which allows to copy paste body parts.

**Compatible** with McLib `2.2`. It doesn't mean that future versions of McLib would be incompatible, but older versions are most likely incompatible.

* Add **Copy body part** and **Paste copied body part** context menu items to body part list (suggested by Crazy)

## Metamorph 1.2.5

This patch update adds a keybind field to creative morph menu, added animation of body part transformations based on parent animated morph, and improved performance in the creative morph list.

**Compatible** with McLib `2.2`. It doesn't mean that future versions of McLib would be incompatible, but older versions are most likely incompatible.

* Added **Copy /morph command** context menu to creative morphs menu (suggested by Centryfuga)
* Added confirmation to remove all morphs context menu item
* Added keybind field to morph panel in morph editor
* Added custom hitbox options to all morphs
* Added an option (enabled by default) to animate body part's transformations based on parent morph's animation progress
* Fixed some (like copy to recent) context menus not appearing in creative morphs menu
* Fixed morphs not updating after server updated the blacklist

## Metamorph 1.2.4

This patch fix features some bug fixes that are required for the release of my new Chameleon mod.

**Compatible** with McLib `2.1`. It doesn't mean that future versions of McLib would be incompatible, but older versions are most likely incompatible.

* Changed the scrolling speed of morph panels from `35` to `45` pixels per mouse wheel scroll
* Changed the scrolling speed of morph panels from `35` to `45` pixels per mouse wheel scroll
* Fixed morph settings parsing to be more lenient to the provided data types

## Metamorph 1.2.3
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
**ATTENTION**: This mod is in non-gameplay maintenance mode, meaning that I'm **not going** to work on gameplay features **nor** I'm accepting suggestions. Check out [Changeling](https://www.curseforge.com/minecraft/mc-mods/changeling) mod maintained by asanetargoss, which is a gameplay-wise successor.
**ATTENTION**: This mod is **no longer being maintained by McHorse. It is now maintained by Chryfi.**
There are **still going to be official updates by Chryfi and other contributors** and there have been task forces that are investigating on porting it. **If you also want to contribute to official updates**, or to the porting effort, please **join the official [McHorse's Discord server](https://discord.gg/qfxrqUF), so we can communicate with you.** Check out the [source code](https://github.com/mchorse/metamorph).

![Metamorph](http://i.imgur.com/gbHB5iQ.png)

Expand All @@ -8,7 +9,7 @@

Most of vanilla mob morphs have their abilities (preconfigured), meanwhile most of modded morphs only grant you appearance and some attributes like health, unless configured. Morphs can be disabled and configured. See mod's wiki for more information.

Heavily inspired by iChun's Morph mod and zacuke's Shape Shifter Z mod, and works only with Forge for Minecraft 1.12.2 (past versions available in 1.10.2 and 1.11.2).
Heavily inspired by iChun's Morph mod and zacuke's Shape Shifter Z mod, and works only with Forge for Minecraft 1.12.2 (past versions are available for 1.10.2 and 1.11.2).

## FAQ

Expand Down
53 changes: 53 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,56 @@ task compareLangFiles {
}
}
}

task copyLangStrings {
doLast {
def parse = { File file ->
def map = new HashMap()
def splits = file.text.split("\n");

for (split in splits) {
def index = split.indexOf("=")

if (index == -1) {
continue
}

map.put(split.substring(0, index), split.substring(index + 1))
}

return map
}

def help = file("src/main/resources/assets/${project.archivesBaseName}/lang/")
def en = file("${help.getAbsolutePath()}/en_US.lang")

for (file in help.listFiles())
{
if (file.name.endsWith(".lang") && !file.name.startsWith("en_"))
{
def strings = parse(file)
def splits = en.text.split("\n")

for (def i = 0; i < splits.length; i++) {
def str = splits[i];

if (str.contains("=")) {
def index = str.indexOf("=")
def key = str.substring(0, index)
def value = str.substring(index)

if (strings.containsKey(key)) {
splits[i] = key + "=" + strings.get(key)
}
}
}

file.write(splits.join("\n"))

print("Wrote to ${file.name}...")
}
}

print("Done!")
}
}
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Metamorph gradle properties
version=1.2.5
mclib=2.1.3
version=1.3.1
mclib=2.4.2

mc_version=1.10.2
forge_version=12.18.3.2511
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/mchorse/metamorph/ClientProxy.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package mchorse.metamorph;

import mchorse.mclib.utils.OpHelper;
import mchorse.metamorph.api.MorphUtils;
import mchorse.metamorph.client.EntityModelHandler;
import mchorse.metamorph.client.KeyboardHandler;
Expand Down Expand Up @@ -180,4 +181,10 @@ public static GameType getGameMode(EntityPlayer player)

return networkplayerinfo != null ? networkplayerinfo.getGameType() : GameType.CREATIVE;
}

@Override
public boolean canEditSelectors()
{
return OpHelper.isPlayerOp() || Metamorph.opEntitySelector.get();
}
}
5 changes: 5 additions & 0 deletions src/main/java/mchorse/metamorph/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,9 @@ public boolean canUse(EntityPlayer player)
{
return player.isCreative() || Metamorph.allowMorphingIntoCategoryMorphs.get();
}

public boolean canEditSelectors()
{
return true;
}
}
17 changes: 14 additions & 3 deletions src/main/java/mchorse/metamorph/Metamorph.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ public class Metamorph
*/
public static FMLEventChannel channel;

/* Metamorph configuration */
/* Configuration */
public static ValueBoolean opEntitySelector;

public static ValueBoolean preventGhosts;
public static ValueBoolean preventKillAcquire;
public static ValueBoolean acquireImmediately;
Expand All @@ -76,6 +78,7 @@ public class Metamorph
public static ValueBoolean morphInTightSpaces;
public static ValueBoolean showMorphIdleSounds;
public static ValueBoolean pauseGUIInSP;
public static ValueBoolean renderBodyPartAxis;
public static ValueInt maxRecentMorphs;
public static ValueBoolean allowMorphingIntoCategoryMorphs;
public static ValueBoolean loadEntityMorphs;
Expand All @@ -85,6 +88,10 @@ public class Metamorph
@SubscribeEvent
public void onConfigRegister(RegisterConfigEvent event)
{
opEntitySelector = event.opAccess.category(MOD_ID).getBoolean("entity_selectors", true);
opEntitySelector.syncable();

/* Metamorph configuration */
ConfigBuilder builder = event.createBuilder(MOD_ID);

preventGhosts = builder.category("acquiring").getBoolean("prevent_ghosts", true);
Expand All @@ -97,14 +104,18 @@ public void onConfigRegister(RegisterConfigEvent event)
disableMorphAnimation = builder.getBoolean("disable_morph_animation", false);
disableMorphDisguise = builder.getBoolean("disable_morph_disguise", false);
disableFirstPersonHand = builder.getBoolean("disable_first_person_hand", false);
disableFirstPersonHand.clientSide();
morphInTightSpaces = builder.getBoolean("morph_in_tight_spaces", false);
showMorphIdleSounds = builder.getBoolean("show_morph_idle_sounds", true);
pauseGUIInSP = builder.getBoolean("pause_gui_in_sp", true);
pauseGUIInSP.clientSide();
renderBodyPartAxis = builder.getBoolean("render_bodypart_axis", true);
renderBodyPartAxis.clientSide();
maxRecentMorphs = builder.getInt("max_recent_morphs", 20, 1, 200);
maxRecentMorphs.clientSide();
allowMorphingIntoCategoryMorphs = builder.getBoolean("allow_morphing_into_category_morphs", false);
loadEntityMorphs = builder.getBoolean("load_entity_morphs", true);

event.modules.add(builder.build());
loadEntityMorphs.clientSide();
}

@EventHandler
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/mchorse/metamorph/api/MorphHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ public void onLivingSetAttackTarget(LivingSetAttackTargetEvent event)

AbstractMorph currentMorph = morphing.getCurrentMorph();

if (morphing.getCurrentMorph().settings.hostile && source.getAttackingEntity() != target &&
if (morphing.getCurrentMorph().getSettings().hostile && source.getAttackingEntity() != target &&
!(currentMorph instanceof mchorse.metamorph.api.morphs.EntityMorph && ((mchorse.metamorph.api.morphs.EntityMorph) currentMorph).getEntity() == source.getAttackingEntity()))
{
if (source instanceof EntityLiving)
Expand Down
12 changes: 2 additions & 10 deletions src/main/java/mchorse/metamorph/api/MorphManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class MorphManager
public List<IMorphFactory> factories = new ArrayList<IMorphFactory>();

/**
* Active morph settings
* Active morph settings from JSON config
*/
public Map<String, MorphSettings> activeSettings = new HashMap<String, MorphSettings>();

Expand Down Expand Up @@ -242,15 +242,7 @@ public AbstractMorph morphFromNBT(NBTTagCompound tag)
*/
public void applySettings(AbstractMorph morph)
{
if (morph.settings != MorphSettings.DEFAULT)
{
return;
}

if (this.activeSettings.containsKey(morph.name))
{
morph.settings = this.activeSettings.get(morph.name);
}
morph.setActiveSettings(this.activeSettings.get(morph.name));
}

/**
Expand Down
Loading

0 comments on commit 3804ba0

Please sign in to comment.