mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-25 22:07:59 +01:00
21w05b -> 21w11a
This commit is contained in:
parent
99ed7699a1
commit
e5fc54c49f
11 changed files with 64 additions and 61 deletions
|
@ -36,6 +36,7 @@ archivesBaseName = project.name
|
|||
|
||||
minecraft {
|
||||
refmapName = 'minelp.mixin.refmap.json'
|
||||
accessWidener 'src/main/resources/minelp.aw'
|
||||
}
|
||||
|
||||
repositories {
|
||||
|
|
|
@ -3,10 +3,10 @@ org.gradle.daemon=false
|
|||
|
||||
# Fabric Properties
|
||||
# check these on https://modmuss50.me/fabric.html
|
||||
minecraft_version=21w05b
|
||||
yarn_mappings=21w05b+build.5
|
||||
loader_version=0.11.1
|
||||
fabric_version=0.30.1+1.17
|
||||
minecraft_version=21w11a
|
||||
yarn_mappings=21w11a+build.29
|
||||
loader_version=0.11.3
|
||||
fabric_version=0.32.5+1.17
|
||||
|
||||
# Mod Properties
|
||||
group=com.minelittlepony
|
||||
|
@ -18,6 +18,6 @@ org.gradle.daemon=false
|
|||
|
||||
# Dependencies
|
||||
modmenu_version=1.15.+
|
||||
kirin_version=1.8-21w05b-SNAPSHOT
|
||||
hd_skins_version=6.4-21w05b-SNAPSHOT
|
||||
mson_version=1.3.2-21w05b-SNAPSHOT
|
||||
kirin_version=1.8-21w11a-SNAPSHOT
|
||||
hd_skins_version=6.4.1-21w11a-SNAPSHOT
|
||||
mson_version=1.3.2-21w11a-SNAPSHOT
|
||||
|
|
|
@ -1,27 +1,32 @@
|
|||
package com.minelittlepony.client.mixin;
|
||||
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.listener.ServerPlayPacketListener;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
|
||||
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Mutable;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import com.minelittlepony.client.HorseCam;
|
||||
|
||||
@Mixin(PlayerMoveC2SPacket.Both.class)
|
||||
abstract class MixinPlayerMoveC2SPacket extends PlayerMoveC2SPacket {
|
||||
@Inject(method = "<init>(DDDFFZ)V",
|
||||
@Mixin(PlayerMoveC2SPacket.class)
|
||||
abstract class MixinPlayerMoveC2SPacket implements Packet<ServerPlayPacketListener> {
|
||||
@Shadow @Final @Mutable
|
||||
protected float pitch;
|
||||
|
||||
@Shadow @Final
|
||||
protected boolean changeLook;
|
||||
|
||||
@Inject(method = "<init>(DDDFFZZZ)V",
|
||||
at = @At("RETURN"))
|
||||
private void onInit(CallbackInfo info) {
|
||||
this.pitch = HorseCam.transformCameraAngle(this.pitch);
|
||||
}
|
||||
}
|
||||
@Mixin(PlayerMoveC2SPacket.LookOnly.class)
|
||||
abstract class MixinPlayerMoveC2SPacket_LookOnly extends PlayerMoveC2SPacket {
|
||||
@Inject(method = "<init>(FFZ)V",
|
||||
at = @At("RETURN"))
|
||||
private void onInit(CallbackInfo info) {
|
||||
this.pitch = HorseCam.transformCameraAngle(this.pitch);
|
||||
if (changeLook) {
|
||||
pitch = HorseCam.transformCameraAngle(pitch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,6 @@ public class EquineRenderManager<T extends LivingEntity, M extends EntityModel<T
|
|||
if (!skipBlend) {
|
||||
RenderSystem.blendFunc(SrcFactor.SRC_ALPHA, DstFactor.ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
RenderSystem.alphaFunc(516, 0.003921569F);
|
||||
}
|
||||
|
||||
public static void disableModelRenderProfile() {
|
||||
|
|
|
@ -5,48 +5,44 @@ import net.minecraft.client.render.RenderPhase;
|
|||
import net.minecraft.client.render.VertexFormat;
|
||||
import net.minecraft.client.render.VertexFormats;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.Util;
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager.DstFactor;
|
||||
import com.mojang.blaze3d.platform.GlStateManager.SrcFactor;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
public class MagicGlow extends RenderPhase {
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
public abstract class MagicGlow extends RenderPhase {
|
||||
private MagicGlow(String name, Runnable beginAction, Runnable endAction) {
|
||||
super(name, beginAction, endAction);
|
||||
}
|
||||
|
||||
protected static final RenderPhase.Transparency GLOWING_TRANSPARENCY = new RenderPhase.Transparency("glowing_transparency", () -> {
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.blendFuncSeparate(
|
||||
SrcFactor.CONSTANT_COLOR, DstFactor.ONE,
|
||||
SrcFactor.ONE, DstFactor.ZERO);
|
||||
}, () -> {
|
||||
RenderSystem.disableBlend();
|
||||
RenderSystem.defaultBlendFunc();
|
||||
});
|
||||
|
||||
private static final RenderLayer MAGIC = RenderLayer.of("mlp_magic_glow", VertexFormats.POSITION_COLOR_TEXTURE_LIGHT_NORMAL, VertexFormat.DrawMode.QUADS, 256, RenderLayer.MultiPhaseParameters.builder()
|
||||
.texture(NO_TEXTURE)
|
||||
private static final RenderLayer MAGIC = RenderLayer.of("mlp_magic_glow", VertexFormats.POSITION_COLOR_LIGHT, VertexFormat.DrawMode.QUADS, 256, RenderLayer.MultiPhaseParameters.builder()
|
||||
.method_34578/*shader*/(field_29414/*EYES*/)
|
||||
.writeMaskState(COLOR_MASK)
|
||||
.depthTest(LEQUAL_DEPTH_TEST)
|
||||
.transparency(LIGHTNING_TRANSPARENCY)
|
||||
.lightmap(DISABLE_LIGHTMAP)
|
||||
.cull(DISABLE_CULLING)
|
||||
.build(false));
|
||||
|
||||
private static final BiFunction<Identifier, Integer, RenderLayer> TINTED_LAYER = Util.memoize((texture, color) -> {
|
||||
return RenderLayer.of("mlp_tint_layer", VertexFormats.POSITION_COLOR_TEXTURE_OVERLAY_LIGHT_NORMAL, VertexFormat.DrawMode.QUADS, 256, true, true, RenderLayer.MultiPhaseParameters.builder()
|
||||
.method_34577/*texture*/(new Color(texture, color))
|
||||
.method_34578/*shader*/(field_29414/*EYES*/)
|
||||
.writeMaskState(COLOR_MASK)
|
||||
.depthTest(LEQUAL_DEPTH_TEST)
|
||||
.transparency(LIGHTNING_TRANSPARENCY)
|
||||
.lightmap(DISABLE_LIGHTMAP)
|
||||
.cull(DISABLE_CULLING)
|
||||
.build(true));
|
||||
});
|
||||
|
||||
public static RenderLayer getRenderLayer() {
|
||||
return MAGIC;
|
||||
}
|
||||
|
||||
public static RenderLayer getTintedTexturedLayer(Identifier texture, float red, float green, float blue, float alpha) {
|
||||
return RenderLayer.of("mlp_tint_layer", VertexFormats.POSITION_COLOR_TEXTURE_OVERLAY_LIGHT_NORMAL, VertexFormat.DrawMode.QUADS, 256, true, true, RenderLayer.MultiPhaseParameters.builder()
|
||||
.texture(new Color(texture, red, green, blue, alpha))
|
||||
.writeMaskState(COLOR_MASK)
|
||||
.alpha(ONE_TENTH_ALPHA)
|
||||
.transparency(GLOWING_TRANSPARENCY)
|
||||
.lightmap(DISABLE_LIGHTMAP)
|
||||
.overlay(DISABLE_OVERLAY_COLOR)
|
||||
.cull(DISABLE_CULLING)
|
||||
.build(true));
|
||||
return TINTED_LAYER.apply(texture, com.minelittlepony.common.util.Color.argbToHex(alpha, red, green, blue));
|
||||
}
|
||||
|
||||
private static class Color extends Texture {
|
||||
|
@ -56,24 +52,24 @@ public class MagicGlow extends RenderPhase {
|
|||
private final float blue;
|
||||
private final float alpha;
|
||||
|
||||
public Color(Identifier texture, float red, float green, float blue, float alpha) {
|
||||
public Color(Identifier texture, int color) {
|
||||
super(texture, false, false);
|
||||
this.red = red;
|
||||
this.green = green;
|
||||
this.blue = blue;
|
||||
this.alpha = alpha;
|
||||
this.red = com.minelittlepony.common.util.Color.r(color);
|
||||
this.green = com.minelittlepony.common.util.Color.g(color);
|
||||
this.blue = com.minelittlepony.common.util.Color.b(color);
|
||||
this.alpha = com.minelittlepony.common.util.Color.a(color);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startDrawing() {
|
||||
RenderSystem.blendColor(red, green, blue, alpha);
|
||||
RenderSystem.setShaderColor(red, green, blue, alpha);
|
||||
super.startDrawing();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endDrawing() {
|
||||
super.endDrawing();
|
||||
RenderSystem.blendColor(1, 1, 1, 1);
|
||||
RenderSystem.setShaderColor(1, 1, 1, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -8,7 +8,6 @@ import com.minelittlepony.client.model.entity.GuardianPonyModel;
|
|||
import com.minelittlepony.client.render.entity.PonyRenderer.Proxy;
|
||||
import com.minelittlepony.client.render.entity.feature.HeldItemFeature;
|
||||
import com.minelittlepony.client.render.entity.feature.GlowingItemFeature;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
import net.minecraft.client.render.entity.EntityRendererFactory;
|
||||
|
@ -64,8 +63,6 @@ public class SeaponyRenderer extends GuardianEntityRenderer {
|
|||
|
||||
super.render(entity, entityYaw, tickDelta, stack, renderContext, lightUv);
|
||||
|
||||
// The beams in RenderGuardian leave lighting disabled, so we need to change it back. #MojangPls
|
||||
RenderSystem.enableLighting();
|
||||
resize.setCurrentSize(origin);
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import net.minecraft.client.util.math.MatrixStack;
|
|||
import net.minecraft.util.math.Vec3f;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import com.minelittlepony.api.model.BodyPart;
|
||||
|
@ -39,7 +39,7 @@ public class PassengerFeature<T extends PlayerEntity, M extends ClientPonyModel<
|
|||
});
|
||||
}
|
||||
|
||||
private Optional<Identifier> getShoulderParrot(CompoundTag tag) {
|
||||
private Optional<Identifier> getShoulderParrot(NbtCompound tag) {
|
||||
return EntityType.get(tag.getString("id"))
|
||||
.filter(p -> p == EntityType.PARROT)
|
||||
.map(type -> ParrotEntityRenderer.TEXTURES[tag.getInt("Variant")]);
|
||||
|
|
|
@ -28,7 +28,7 @@ import net.minecraft.item.ArmorItem;
|
|||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.nbt.NbtHelper;
|
||||
import net.minecraft.village.VillagerDataContainer;
|
||||
|
||||
|
@ -91,7 +91,7 @@ public class SkullFeature<T extends LivingEntity, M extends EntityModel<T> & IPo
|
|||
GameProfile profile = null;
|
||||
|
||||
if (itemstack.hasTag()) {
|
||||
CompoundTag nbt = itemstack.getTag();
|
||||
NbtCompound nbt = itemstack.getTag();
|
||||
|
||||
assert nbt != null;
|
||||
|
||||
|
@ -99,7 +99,7 @@ public class SkullFeature<T extends LivingEntity, M extends EntityModel<T> & IPo
|
|||
profile = NbtHelper.toGameProfile(nbt.getCompound("SkullOwner"));
|
||||
} else if (nbt.contains("SkullOwner", 8)) {
|
||||
profile = SkullBlockEntity.loadProperties(new GameProfile(null, nbt.getString("SkullOwner")));
|
||||
nbt.put("SkullOwner", NbtHelper.fromGameProfile(new CompoundTag(), profile));
|
||||
nbt.put("SkullOwner", NbtHelper.writeGameProfile(new NbtCompound(), profile));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,8 @@ import net.minecraft.client.texture.NativeImage;
|
|||
import net.minecraft.client.texture.TextureManager;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
|
@ -93,7 +95,7 @@ public class NativeUtil {
|
|||
MinecraftClient mc = MinecraftClient.getInstance();
|
||||
TextureManager textures = mc.getTextureManager();
|
||||
|
||||
if (!mc.isOnThread()) {
|
||||
if (!RenderSystem.isOnRenderThread()) {
|
||||
throw new IllegalStateException("This can only be called from the main thread.");
|
||||
}
|
||||
|
||||
|
@ -119,5 +121,4 @@ public class NativeUtil {
|
|||
return consumer.apply(image);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"icon": "minelp_logo.png",
|
||||
"accessWidener": "minelp.aw",
|
||||
"environment": "client",
|
||||
"entrypoints": {
|
||||
"client": [
|
||||
|
|
3
src/main/resources/minelp.aw
Normal file
3
src/main/resources/minelp.aw
Normal file
|
@ -0,0 +1,3 @@
|
|||
accessWidener v1 named
|
||||
accessible method net/minecraft/client/render/RenderLayer of (Ljava/lang/String;Lnet/minecraft/client/render/VertexFormat;Lnet/minecraft/client/render/VertexFormat$DrawMode;ILnet/minecraft/client/render/RenderLayer$MultiPhaseParameters;)Lnet/minecraft/client/render/RenderLayer$MultiPhase;
|
||||
accessible method net/minecraft/client/render/RenderLayer of (Ljava/lang/String;Lnet/minecraft/client/render/VertexFormat;Lnet/minecraft/client/render/VertexFormat$DrawMode;IZZLnet/minecraft/client/render/RenderLayer$MultiPhaseParameters;)Lnet/minecraft/client/render/RenderLayer$MultiPhase;
|
Loading…
Reference in a new issue