Skip to content

Commit

Permalink
0.6.11a
Browse files Browse the repository at this point in the history
Updated Spanish base translations (#481)
Updated Simplified Chinese translation (#482)
Added a warning message when connecting to offline servers
Editor QoL:
- Added a warning if animated texture regions overlap
- Added part locking
- Added 'Copy Transform from original' quick action when duplicating
Added animations:
- Using brush animations
- Head rotation animations
Added biome and entity tags system
- Only available through OSC for now
Ported to 1.20.2 Pre Release 2

Fixed crash with Cosmetic Armor fabric
Fixed player heads with Optifine on 1.19.4 and 1.20
Fixed armor on 1.20 Optifine
Fixed glow not working in first person with Iris (Closes #473)
Fixed skulls not showing glow layers with Iris
Fixed crash on fabric 1.16 and older (Closes #472)
Fixed export crash (Closes #483)
Fixed editor ui not updating correctly in some cases (Closes #476)
Fixed paste showing incorrect error messages
Fixed editor now shows the correct error message on corrupted install
Fixed armor root duplications not loading in the editor (Closes #479)
Fixed more than 255 animations breaking when exporting
  • Loading branch information
tom5454 committed Sep 9, 2023
1 parent 97c2d0a commit 285ab80
Show file tree
Hide file tree
Showing 386 changed files with 13,356 additions and 8,629 deletions.
13,933 changes: 6,984 additions & 6,949 deletions Blockbench/cpm_plugin.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Blockbench/cpm_plugin.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions CPM-OSC-Compat/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ minecraft_version=1.18.2
loader_version=0.13.3
fabric_version=0.47.8+1.18.2

mod_version=1.3.0
mod_version=1.4.0

# CPM versions
cpm_api_version=0.6.10
cpm_runtime_version=0.6.10a
cpm_api_version=0.6.11
cpm_runtime_version=0.6.11a

cpm_source=com.tom5454.cpm
6 changes: 3 additions & 3 deletions CPM-OSC-Compat/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
modLoader="javafml"
loaderVersion="[31,)"
loaderVersion="[28,)"
license="MIT"
issueTrackerURL="https://github.com/tom5454/CustomPlayerModels/issues"
[[mods]]
Expand All @@ -17,13 +17,13 @@ A Customizable Player Models, OSC/VMC protocol compat mod.
[[dependencies.cpmoscc]]
modId="forge"
mandatory=true
versionRange="[31,)"
versionRange="[28,)"
ordering="NONE"
side="BOTH"
[[dependencies.cpmoscc]]
modId="minecraft"
mandatory=true
versionRange="[1.16.5,)"
versionRange="[1.14.4,)"
ordering="NONE"
side="BOTH"
[[dependencies.cpmoscc]]
Expand Down
2 changes: 1 addition & 1 deletion CPM-OSC-Compat/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
],
"depends": {
"fabricloader": ">=0.7.4",
"minecraft": ">=1.17.1",
"minecraft": ">=1.14.4",
"fabric": "*",
"cpm": "*"
}
Expand Down
68 changes: 48 additions & 20 deletions CPM-OSC-Compat/src/shared/java/com/tom/cpmoscc/CPMOSC.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.lang.reflect.Field;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import com.tom.cpl.block.Biome;
import com.tom.cpl.block.BlockState;
import com.tom.cpl.block.World;
import com.tom.cpl.item.Inventory;
import com.tom.cpl.item.NamedSlot;
import com.tom.cpl.item.Stack;
import com.tom.cpl.tag.TagManager;
import com.tom.cpm.api.IClientAPI;
import com.tom.cpm.shared.MinecraftClientAccess;
import com.tom.cpm.shared.MinecraftClientAccess.ServerStatus;
Expand Down Expand Up @@ -67,24 +72,25 @@ public static void tick(Object playerIn) {
}
player.updatePlayer(playerIn);
long time = MinecraftClientAccess.get().getPlayerRenderManager().getAnimationEngine().getTime();
AnimationState st = player.animState;
try {
for (Field f : outputFields) {
send(player.animState, f);
send(st, f);
}
for (Field f : outputFields2) {
send(player.animState.localState, f);
send(st.localState, f);
}
if(def != null) {
AnimationRegistry reg = def.getAnimations();
reg.forEachLayer((g, id) -> {
if(g.command)return;
String gid = g.getName().replaceAll("[^a-zA-Z0-9\\.\\-]", "");
try {
if(player.animState.gestureData.length > id) {
if(st.gestureData.length > id) {
if(g.type == AnimationType.VALUE_LAYER)
transmit.send("/cpm/layer/" + gid + "/value", player.animState.gestureData[id]);
transmit.send("/cpm/layer/" + gid + "/value", st.gestureData[id]);
else
transmit.send("/cpm/layer/" + gid + "/toggle", player.animState.gestureData[id] != 0);
transmit.send("/cpm/layer/" + gid + "/toggle", st.gestureData[id] != 0);
} else {
if(g.type == AnimationType.VALUE_LAYER)
transmit.send("/cpm/layer/" + gid + "/value", g.defVal);
Expand All @@ -94,20 +100,20 @@ public static void tick(Object playerIn) {
} catch (IOException e) {
}
});
int gesture = player.animState.encodedState;
int gesture = st.encodedState;
Gesture g = null;
if (MinecraftClientAccess.get().getNetHandler().hasServerCap(ServerCaps.GESTURES) && player.animState.gestureData != null && player.animState.gestureData.length > 1) {
g = reg.getGesture(player.animState.gestureData[1]);
if (MinecraftClientAccess.get().getNetHandler().hasServerCap(ServerCaps.GESTURES) && st.gestureData != null && st.gestureData.length > 1) {
g = reg.getGesture(st.gestureData[1]);
} else {
g = reg.getGesture(gesture);
}
transmit.send("/cpm/gesture", g != null ? g.getName().replaceAll("[^a-zA-Z0-9\\.\\-]", "") : "null");
VanillaPose pose = player.animState.getMainPose(time, reg);
VanillaPose pose = st.getMainPose(time, reg);
sendEnum("/cpm/vanilla_pose", pose);
IPose currentPose = pose;
if (MinecraftClientAccess.get().getNetHandler().hasServerCap(ServerCaps.GESTURES) && player.animState.gestureData != null && player.animState.gestureData.length > 1) {
if(player.animState.gestureData[0] != 0) {
currentPose = reg.getPose(player.animState.gestureData[0], player.currentPose);
if (MinecraftClientAccess.get().getNetHandler().hasServerCap(ServerCaps.GESTURES) && st.gestureData != null && st.gestureData.length > 1) {
if(st.gestureData[0] != 0) {
currentPose = reg.getPose(st.gestureData[0], player.currentPose);
}
} else {
currentPose = reg.getPose(gesture, player.currentPose);
Expand All @@ -120,8 +126,8 @@ public static void tick(Object playerIn) {
transmit.send("/cpm/pose/name", p.getId());
transmit.send("/cpm/pose/id", -1);
}
if (player.animState.playerInventory != null) {
Inventory i = player.animState.playerInventory;
if (st.playerInventory != null) {
Inventory i = st.playerInventory;
sendItem(def, "held_item", i.getStack(i.getNamedSlotId(NamedSlot.MAIN_HAND)));
sendItem(def, "armor/helmet", i.getStack(i.getNamedSlotId(NamedSlot.ARMOR_HELMET)));
sendItem(def, "armor/chestplate", i.getStack(i.getNamedSlotId(NamedSlot.ARMOR_CHESTPLATE)));
Expand All @@ -130,11 +136,29 @@ public static void tick(Object playerIn) {
sendItem(def, "off_hand", i.getStack(i.getNamedSlotId(NamedSlot.OFF_HAND)));
transmit.send("/cpm/heldSlot", i.getNamedSlotId(NamedSlot.MAIN_HAND));
}
if (player.animState.world != null) {
sendBlock(def, "below", player.animState.world.getBlock(0, -1, 0));
sendBlock(def, "feet", player.animState.world.getBlock(0, 0, 0));
sendBlock(def, "head", player.animState.world.getBlock(0, 1, 0));
World w = st.world;
if (w != null) {
sendBlock(def, "below", w.getBlock(0, -1, 0));
sendBlock(def, "feet", w.getBlock(0, 0, 0));
sendBlock(def, "head", w.getBlock(0, 1, 0));
transmit.send("/cpm/world/canSeeSky", w.isCovered());
sendEnum("/cpm/world/weather", w.getWeather());
transmit.send("/cpm/world/y", (w.getYHeight() - w.getMinHeight()) / (float) (w.getMaxHeight() - w.getMinHeight()), w.getYHeight(), w.getMinHeight(), w.getMaxHeight());
Biome b = w.getBiome();
transmit.send("/cpm/world/biome/id", b.getBiomeId());
transmit.send("/cpm/world/biome/tags", listTags(def.modelTagManager.getBiomeTags(), b));
sendEnum("/cpm/world/biome/rainType", b.getRainType());
transmit.send("/cpm/world/biome/temperature", b.getTemperature());
transmit.send("/cpm/world/biome/humidity", b.getHumidity());
}
if (st.vehicle != null) {
transmit.send("/cpm/vehicle/id", st.vehicle.getId());
transmit.send("/cpm/vehicle/tags", listTags(def.modelTagManager.getEntityTags(), st.vehicle));
} else {
transmit.send("/cpm/vehicle/id", "null");
transmit.send("/cpm/vehicle/tags");
}
transmit.send("/cpm/potion", st.allEffects.stream().flatMap(e -> Stream.of(e.effectId, e.amplifier, e.duration, e.hidden)).toArray());
}
transmit.send("/cpm/gameTime", time);
} catch (Exception e) {
Expand All @@ -145,16 +169,20 @@ public static void tick(Object playerIn) {
}
}

private static <T> List<String> listTags(TagManager<T> mngr, T e) {
return mngr.listStackTags(e).stream().map(t -> t.getId()).collect(Collectors.toList());
}

private static void sendBlock(ModelDefinition def, String name, BlockState st) throws IOException {
transmit.send("/cpm/world/" + name + "/id", st.getBlockId());
transmit.send("/cpm/world/" + name + "/tags", def.modelTagManager.getBlockTags().listStackTags(st).stream().map(t -> t.getId()).collect(Collectors.toList()));
transmit.send("/cpm/world/" + name + "/tags", listTags(def.modelTagManager.getBlockTags(), st));
}

private static void sendItem(ModelDefinition def, String name, Stack stack) throws IOException {
transmit.send("/cpm/" + name + "/id", stack.getItemId());
transmit.send("/cpm/" + name + "/count", stack.getCount(), stack.getMaxCount());
transmit.send("/cpm/" + name + "/damage", stack.getDamage(), stack.getMaxDamage());
transmit.send("/cpm/" + name + "/tags", def.modelTagManager.getItemTags().listStackTags(stack).stream().map(t -> t.getId()).collect(Collectors.toList()));
transmit.send("/cpm/" + name + "/tags", listTags(def.modelTagManager.getItemTags(), stack));
}

private static void send(Object inst, Field f) throws Exception {
Expand Down
61 changes: 55 additions & 6 deletions CPM-OSC-Compat/version-check.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
{
"homepage": "https://www.curseforge.com/minecraft/mc-mods/cpmoscc",
"promos": {
"1.19.4-latest": "1.2.1",
"1.19.3-latest": "1.2.1",
"1.19.2-latest": "1.2.1",
"1.18.2-latest": "1.2.1",
"1.17.1-latest": "1.2.1",
"1.16.5-latest": "1.2.1"
"1.20.1-latest": "1.4.0",
"1.19.4-latest": "1.4.0",
"1.19.3-latest": "1.4.0",
"1.19.2-latest": "1.4.0",
"1.18.2-latest": "1.4.0",
"1.17.1-latest": "1.4.0",
"1.16.5-latest": "1.4.0",
"1.15.2-latest": "1.4.0",
"1.14.4-latest": "1.4.0",
"1.12.2-latest": "1.4.0",
"1.10.2-latest": "1.4.0",
"1.8.9-latest": "1.4.0"
},
"1.20.1": {
"1.4.0": "New output parameters:\n- current biome details\n- current dimension\n- y level and world min/max\n- current weather\n- active potion effects\n- vehicle entity",
"1.3.0": "New OSC output parameters:\n- Sky/Block Light level\n- In-game day time\n- Held & armor items id, count, damage, and tags\n- Blocks below and inside the player id and tags\n- Selected hotbar slot",
"1.2.2": "Output layer states and active pose"
},
"1.19.4": {
"1.4.0": "New output parameters:\n- current biome details\n- current dimension\n- y level and world min/max\n- current weather\n- active potion effects\n- vehicle entity",
"1.3.0": "New OSC output parameters:\n- Sky/Block Light level\n- In-game day time\n- Held & armor items id, count, damage, and tags\n- Blocks below and inside the player id and tags\n- Selected hotbar slot",
"1.2.2": "Output layer states and active pose",
"1.2.1": "Added support for the new options in CPM 0.6.7",
"1.2.0": "Added OSC Output functionality",
"1.1.2": "Added an Edit Selected option to the OSC Animation Wizard\nFixed mod homepage links",
Expand All @@ -17,6 +31,9 @@
"1.0.0": "First Release"
},
"1.19.3": {
"1.4.0": "New output parameters:\n- current biome details\n- current dimension\n- y level and world min/max\n- current weather\n- active potion effects\n- vehicle entity",
"1.3.0": "New OSC output parameters:\n- Sky/Block Light level\n- In-game day time\n- Held & armor items id, count, damage, and tags\n- Blocks below and inside the player id and tags\n- Selected hotbar slot",
"1.2.2": "Output layer states and active pose",
"1.2.1": "Added support for the new options in CPM 0.6.7",
"1.2.0": "Added OSC Output functionality",
"1.1.2": "Added an Edit Selected option to the OSC Animation Wizard\nFixed mod homepage links",
Expand All @@ -25,6 +42,9 @@
"1.0.0": "First Release"
},
"1.19.2": {
"1.4.0": "New output parameters:\n- current biome details\n- current dimension\n- y level and world min/max\n- current weather\n- active potion effects\n- vehicle entity",
"1.3.0": "New OSC output parameters:\n- Sky/Block Light level\n- In-game day time\n- Held & armor items id, count, damage, and tags\n- Blocks below and inside the player id and tags\n- Selected hotbar slot",
"1.2.2": "Output layer states and active pose",
"1.2.1": "Added support for the new options in CPM 0.6.7",
"1.2.0": "Added OSC Output functionality",
"1.1.2": "Added an Edit Selected option to the OSC Animation Wizard\nFixed mod homepage links",
Expand All @@ -33,6 +53,9 @@
"1.0.0": "First Release"
},
"1.18.2": {
"1.4.0": "New output parameters:\n- current biome details\n- current dimension\n- y level and world min/max\n- current weather\n- active potion effects\n- vehicle entity",
"1.3.0": "New OSC output parameters:\n- Sky/Block Light level\n- In-game day time\n- Held & armor items id, count, damage, and tags\n- Blocks below and inside the player id and tags\n- Selected hotbar slot",
"1.2.2": "Output layer states and active pose",
"1.2.1": "Added support for the new options in CPM 0.6.7",
"1.2.0": "Added OSC Output functionality",
"1.1.2": "Added an Edit Selected option to the OSC Animation Wizard\nFixed mod homepage links",
Expand All @@ -41,6 +64,9 @@
"1.0.0": "First Release"
},
"1.17.1": {
"1.4.0": "New output parameters:\n- current biome details\n- current dimension\n- y level and world min/max\n- current weather\n- active potion effects\n- vehicle entity",
"1.3.0": "New OSC output parameters:\n- Sky/Block Light level\n- In-game day time\n- Held & armor items id, count, damage, and tags\n- Blocks below and inside the player id and tags\n- Selected hotbar slot",
"1.2.2": "Output layer states and active pose",
"1.2.1": "Added support for the new options in CPM 0.6.7",
"1.2.0": "Added OSC Output functionality",
"1.1.2": "Added an Edit Selected option to the OSC Animation Wizard\nFixed mod homepage links",
Expand All @@ -49,11 +75,34 @@
"1.0.0": "First Release"
},
"1.16.5": {
"1.4.0": "New output parameters:\n- current biome details\n- current dimension\n- y level and world min/max\n- current weather\n- active potion effects\n- vehicle entity",
"1.3.0": "New OSC output parameters:\n- Sky/Block Light level\n- In-game day time\n- Held & armor items id, count, damage, and tags\n- Blocks below and inside the player id and tags\n- Selected hotbar slot",
"1.2.2": "Output layer states and active pose",
"1.2.1": "Added support for the new options in CPM 0.6.7",
"1.2.0": "Added OSC Output functionality",
"1.1.2": "Added an Edit Selected option to the OSC Animation Wizard\nFixed mod homepage links",
"1.1.1": "Added Simplified Chinese translation",
"1.1.0": "Fixed OSC select from inputs using the wrong argument id\nFixed crash with OSC mod on Fabric\nFixed OSC Settings not saving in some cases",
"1.0.0": "First Release"
},
"1.15.2": {
"1.4.0": "New output parameters:\n- current biome details\n- current dimension\n- y level and world min/max\n- current weather\n- active potion effects\n- vehicle entity",
"1.3.0": "Ported to older MC versions\nNew OSC output parameters:\n- Sky/Block Light level\n- In-game day time\n- Held & armor items id, count, damage, and tags\n- Blocks below and inside the player id and tags\n- Selected hotbar slot"
},
"1.14.4": {
"1.4.0": "New output parameters:\n- current biome details\n- current dimension\n- y level and world min/max\n- current weather\n- active potion effects\n- vehicle entity",
"1.3.0": "Ported to older MC versions\nNew OSC output parameters:\n- Sky/Block Light level\n- In-game day time\n- Held & armor items id, count, damage, and tags\n- Blocks below and inside the player id and tags\n- Selected hotbar slot"
},
"1.12.2": {
"1.4.0": "New output parameters:\n- current biome details\n- current dimension\n- y level and world min/max\n- current weather\n- active potion effects\n- vehicle entity",
"1.3.0": "OSC Retro port\nNew OSC output parameters:\n- Sky/Block Light level\n- In-game day time\n- Held & armor items id, count, damage, and tags\n- Blocks below and inside the player id and tags\n- Selected hotbar slot"
},
"1.10.2": {
"1.4.0": "New output parameters:\n- current biome details\n- current dimension\n- y level and world min/max\n- current weather\n- active potion effects\n- vehicle entity",
"1.3.0": "OSC Retro port\nNew OSC output parameters:\n- Sky/Block Light level\n- In-game day time\n- Held & armor items id, count, damage, and tags\n- Blocks below and inside the player id and tags\n- Selected hotbar slot"
},
"1.8.9": {
"1.4.0": "New output parameters:\n- current biome details\n- current dimension\n- y level and world min/max\n- current weather\n- active potion effects\n- vehicle entity",
"1.3.0": "OSC Retro port\nNew OSC output parameters:\n- Sky/Block Light level\n- In-game day time\n- Held & armor items id, count, damage, and tags\n- Blocks below and inside the player id and tags\n- Selected hotbar slot"
}
}
2 changes: 1 addition & 1 deletion CustomPlayerModels-1.10/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false

mod_version=0.6.10a
mod_version=0.6.11a
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import net.minecraftforge.fml.common.event.FMLServerStoppingEvent;

import com.tom.cpl.block.BlockStateHandler;
import com.tom.cpl.block.entity.EntityTypeHandler;
import com.tom.cpl.config.ModConfigFile;
import com.tom.cpl.item.ItemStackHandler;
import com.tom.cpl.text.TextRemapper;
Expand All @@ -35,6 +36,7 @@
import com.tom.cpm.api.ICPMPlugin;
import com.tom.cpm.common.BlockStateHandlerImpl;
import com.tom.cpm.common.Command;
import com.tom.cpm.common.EntityTypeHandlerImpl;
import com.tom.cpm.common.ItemStackHandlerImpl;
import com.tom.cpm.common.ServerHandler;
import com.tom.cpm.shared.MinecraftCommonAccess;
Expand Down Expand Up @@ -168,4 +170,9 @@ public BlockStateHandler<?> getBlockStateHandler() {
public ItemStackHandler<?> getItemStackHandler() {
return ItemStackHandlerImpl.impl;
}

@Override
public EntityTypeHandler<?> getEntityTypeHandler() {
return EntityTypeHandlerImpl.impl;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

import net.minecraft.server.MinecraftServer;

import com.tom.cpl.block.BiomeHandler;
import com.tom.cpl.config.ModConfigFile;
import com.tom.cpm.common.BiomeHandlerImpl;
import com.tom.cpm.common.ServerHandler;
import com.tom.cpm.shared.MinecraftServerAccess;
import com.tom.cpm.shared.network.NetHandler;
Expand All @@ -27,4 +29,9 @@ public ModConfigFile getConfig() {
public NetHandler<?, ?, ?> getNetHandler() {
return ServerHandler.netHandler;
}

@Override
public BiomeHandler<?> getBiomeHandler() {
return BiomeHandlerImpl.impl;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

import com.mojang.authlib.GameProfile;

import com.tom.cpl.block.BiomeHandler;
import com.tom.cpl.gui.Frame;
import com.tom.cpl.gui.IGui;
import com.tom.cpl.gui.IKeybind;
Expand All @@ -36,6 +37,7 @@
import com.tom.cpl.util.DynamicTexture.ITexture;
import com.tom.cpl.util.Image;
import com.tom.cpl.util.ImageIO.IImageIO;
import com.tom.cpm.common.BiomeHandlerImpl;
import com.tom.cpm.shared.MinecraftClientAccess;
import com.tom.cpm.shared.MinecraftObjectHolder;
import com.tom.cpm.shared.definition.ModelDefinitionLoader;
Expand Down Expand Up @@ -227,4 +229,9 @@ public Proxy getProxy() {
public AllTagManagers getBuiltinTags() {
return tags;
}

@Override
public BiomeHandler<?> getBiomeHandler() {
return BiomeHandlerImpl.impl;
}
}
Loading

0 comments on commit 285ab80

Please sign in to comment.