mirror of
https://github.com/TeamMidnightDust/MidnightLib.git
synced 2025-12-16 17:25:09 +01:00
MidnightLib v0.2.0 for 21w19a
- MidnightConfig screens can be viewed from a new screen in the minecraft options - Code cleanup - Examples & Documentation - New Methods - Upgrade to 21w19a and Java 16 MidnightConfig v1.0.0: - The config screen no longer shows the entries of all instances of MidnightConfig - Compatible with servers! - Scrollable! - Comment support! - Fresh new design
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
package eu.midnightdust.hats;
|
||||
|
||||
import eu.midnightdust.hats.bunny.BunnyEarsFeatureRenderer;
|
||||
import eu.midnightdust.hats.christmas.ChristmasHatFeatureRenderer;
|
||||
import eu.midnightdust.hats.config.HatsConfig;
|
||||
import eu.midnightdust.hats.tater.TinyPotatoFeatureRenderer;
|
||||
import eu.midnightdust.hats.web.HatLoader;
|
||||
import eu.midnightdust.hats.witch.WitchHatFeatureRenderer;
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.fabric.api.client.rendereregistry.v1.EntityModelLayerRegistry;
|
||||
|
||||
@SuppressWarnings({"deprecation", "UnstableApiUsage"})
|
||||
public class HatsClient implements ClientModInitializer {
|
||||
|
||||
public static final String MOD_ID = "midnightlib";
|
||||
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
HatsConfig.init("midnightlib", HatsConfig.class);
|
||||
|
||||
EntityModelLayerRegistry.registerModelLayer(BunnyEarsFeatureRenderer.RABBIT_EARS_MODEL_LAYER, BunnyEarsFeatureRenderer::getTexturedModelData);
|
||||
EntityModelLayerRegistry.registerModelLayer(ChristmasHatFeatureRenderer.CHRISTMAS_HAT_MODEL_LAYER, ChristmasHatFeatureRenderer::getTexturedModelData);
|
||||
EntityModelLayerRegistry.registerModelLayer(TinyPotatoFeatureRenderer.TINY_POTATO_MODEL_LAYER, TinyPotatoFeatureRenderer::getTexturedModelData);
|
||||
EntityModelLayerRegistry.registerModelLayer(WitchHatFeatureRenderer.WITCH_HAT_MODEL_LAYER, WitchHatFeatureRenderer::getTexturedModelData);
|
||||
if (HatsConfig.special_hats) {
|
||||
HatLoader.init();
|
||||
}
|
||||
}
|
||||
}
|
||||
15
src/main/java/eu/midnightdust/hats/bunny/BunnyEarsFeatureRenderer.java
Normal file → Executable file
15
src/main/java/eu/midnightdust/hats/bunny/BunnyEarsFeatureRenderer.java
Normal file → Executable file
@@ -1,7 +1,7 @@
|
||||
package eu.midnightdust.hats.bunny;
|
||||
|
||||
import eu.midnightdust.hats.HatsClient;
|
||||
import eu.midnightdust.hats.config.AreEventHatsEnabled;
|
||||
import eu.midnightdust.core.MidnightLibClient;
|
||||
import eu.midnightdust.core.config.MidnightLibConfig;
|
||||
import eu.midnightdust.hats.web.HatLoader;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
@@ -25,7 +25,7 @@ import java.util.UUID;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class BunnyEarsFeatureRenderer<T extends LivingEntity, M extends EntityModel<T>> extends FeatureRenderer<T, M> {
|
||||
private static final String MOD_ID = HatsClient.MOD_ID;
|
||||
private static final String MOD_ID = MidnightLibClient.MOD_ID;
|
||||
public static final EntityModelLayer RABBIT_EARS_MODEL_LAYER = new EntityModelLayer(new Identifier("midnight-hats","bunny_ears"), "main");
|
||||
private static final UUID MOTSCHEN = UUID.fromString("a44c2660-630f-478f-946a-e518669fcf0c");
|
||||
|
||||
@@ -49,13 +49,10 @@ public class BunnyEarsFeatureRenderer<T extends LivingEntity, M extends EntityMo
|
||||
if (livingEntity != null) {
|
||||
|
||||
if (Calendar.getInstance().get(Calendar.MONTH) == Calendar.APRIL && Calendar.getInstance().get(Calendar.DAY_OF_MONTH) <= 4) {
|
||||
if (FabricLoader.getInstance().isModLoaded("cloth-config2")) {
|
||||
if (AreEventHatsEnabled.areEventHatsEnabled()) {
|
||||
hat_type = RABBIT;
|
||||
}
|
||||
else hat_type = DEACTIVATED;
|
||||
if (MidnightLibConfig.event_hats) {
|
||||
hat_type = RABBIT;
|
||||
}
|
||||
else hat_type = RABBIT;
|
||||
else hat_type = DEACTIVATED;
|
||||
}else {
|
||||
hat_type = DEACTIVATED;
|
||||
}
|
||||
|
||||
10
src/main/java/eu/midnightdust/hats/bunny/BunnyEarsModel.java
Normal file → Executable file
10
src/main/java/eu/midnightdust/hats/bunny/BunnyEarsModel.java
Normal file → Executable file
@@ -11,10 +11,8 @@ public class BunnyEarsModel<T extends LivingEntity> extends SinglePartEntityMode
|
||||
|
||||
public BunnyEarsModel(ModelPart root) {
|
||||
this.right_ear = root;
|
||||
|
||||
right_ear.setPivot(0.0F, -3.0F, -1.0F);
|
||||
|
||||
}
|
||||
}
|
||||
public static ModelData getModelData(){
|
||||
ModelData modelData = new ModelData();
|
||||
ModelPartData modelPartData = modelData.getRoot();
|
||||
@@ -35,10 +33,4 @@ public class BunnyEarsModel<T extends LivingEntity> extends SinglePartEntityMode
|
||||
public void render(MatrixStack matrixStack, VertexConsumer buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha){
|
||||
right_ear.render(matrixStack, buffer, packedLight, packedOverlay);
|
||||
}
|
||||
|
||||
public void setRotationAngle(ModelPart bone, float x, float y, float z) {
|
||||
bone.pitch = x;
|
||||
bone.yaw = y;
|
||||
bone.roll = z;
|
||||
}
|
||||
}
|
||||
18
src/main/java/eu/midnightdust/hats/christmas/ChristmasHatFeatureRenderer.java
Normal file → Executable file
18
src/main/java/eu/midnightdust/hats/christmas/ChristmasHatFeatureRenderer.java
Normal file → Executable file
@@ -1,11 +1,10 @@
|
||||
package eu.midnightdust.hats.christmas;
|
||||
|
||||
import eu.midnightdust.hats.HatsClient;
|
||||
import eu.midnightdust.hats.config.AreEventHatsEnabled;
|
||||
import eu.midnightdust.core.MidnightLibClient;
|
||||
import eu.midnightdust.core.config.MidnightLibConfig;
|
||||
import eu.midnightdust.hats.web.HatLoader;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.minecraft.client.model.TexturedModelData;
|
||||
import net.minecraft.client.network.AbstractClientPlayerEntity;
|
||||
import net.minecraft.client.render.OverlayTexture;
|
||||
@@ -28,7 +27,7 @@ import java.util.UUID;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class ChristmasHatFeatureRenderer<T extends LivingEntity, M extends EntityModel<T>> extends FeatureRenderer<T, M> {
|
||||
private static final String MOD_ID = HatsClient.MOD_ID;
|
||||
private static final String MOD_ID = MidnightLibClient.MOD_ID;
|
||||
public static final EntityModelLayer CHRISTMAS_HAT_MODEL_LAYER = new EntityModelLayer(new Identifier("midnight-hats","christmas_hat"), "main");
|
||||
private static final UUID MOTSCHEN = UUID.fromString("a44c2660-630f-478f-946a-e518669fcf0c");
|
||||
|
||||
@@ -38,7 +37,7 @@ public class ChristmasHatFeatureRenderer<T extends LivingEntity, M extends Entit
|
||||
|
||||
public ChristmasHatFeatureRenderer(FeatureRendererContext<T, M> featureRendererContext, EntityModelLoader entityModelLoader) {
|
||||
super(featureRendererContext);
|
||||
this.christmasHat = new ChristmasHatModel(entityModelLoader.getModelPart(CHRISTMAS_HAT_MODEL_LAYER));
|
||||
this.christmasHat = new ChristmasHatModel<>(entityModelLoader.getModelPart(CHRISTMAS_HAT_MODEL_LAYER));
|
||||
}
|
||||
|
||||
public static TexturedModelData getTexturedModelData() {
|
||||
@@ -51,13 +50,10 @@ public class ChristmasHatFeatureRenderer<T extends LivingEntity, M extends Entit
|
||||
Identifier hat_type;
|
||||
if (livingEntity != null) {
|
||||
if (Calendar.getInstance().get(Calendar.MONTH) == Calendar.DECEMBER && Calendar.getInstance().get(Calendar.DAY_OF_MONTH) >= 23 && Calendar.getInstance().get(Calendar.DAY_OF_MONTH) <= 26) {
|
||||
if (FabricLoader.getInstance().isModLoaded("cloth-config2")) {
|
||||
if (AreEventHatsEnabled.areEventHatsEnabled()) {
|
||||
hat_type = CHRISTMAS;
|
||||
}
|
||||
else hat_type = DEACTIVATED;
|
||||
if (MidnightLibConfig.event_hats) {
|
||||
hat_type = CHRISTMAS;
|
||||
}
|
||||
else hat_type = CHRISTMAS;
|
||||
else hat_type = DEACTIVATED;
|
||||
}else {
|
||||
hat_type = DEACTIVATED;
|
||||
}
|
||||
|
||||
13
src/main/java/eu/midnightdust/hats/christmas/ChristmasHatModel.java
Normal file → Executable file
13
src/main/java/eu/midnightdust/hats/christmas/ChristmasHatModel.java
Normal file → Executable file
@@ -8,33 +8,30 @@ import net.minecraft.entity.LivingEntity;
|
||||
|
||||
public class ChristmasHatModel<T extends LivingEntity> extends SinglePartEntityModel<T> {
|
||||
private final ModelPart headwear;
|
||||
private final ModelPart bone;
|
||||
private final ModelPart bone2;
|
||||
private final ModelPart bone3;
|
||||
|
||||
public ChristmasHatModel(ModelPart root) {
|
||||
headwear = root;
|
||||
root.setPivot(5.0F, -9.0F, -5.0F);
|
||||
|
||||
bone = headwear.getChild("bone");
|
||||
ModelPart bone = headwear.getChild("bone");
|
||||
bone.setPivot(-8.5F, -0.1F, 1.5F);
|
||||
setRotationAngle(bone, -0.0524F, 0.0F, 0.0349F);
|
||||
|
||||
bone2 = bone.getChild("bone2");
|
||||
ModelPart bone2 = bone.getChild("bone2");
|
||||
bone2.setPivot(1.5F, -4.0F, 1.5F);
|
||||
setRotationAngle(bone2, -0.1222F, 0.0F, 0.0698F);
|
||||
|
||||
bone3 = bone2.getChild("bone3");
|
||||
ModelPart bone3 = bone2.getChild("bone3");
|
||||
bone3.setPivot(1.5F, -4.0F, 1.5F);
|
||||
setRotationAngle(bone3, -0.2618F, 0.0F, 0.1047F);
|
||||
}
|
||||
public static ModelData getModelData(){
|
||||
ModelData modelData = new ModelData();
|
||||
ModelPartData modelPartData = modelData.getRoot();
|
||||
modelPartData.addChild("headwear", ModelPartBuilder.create().uv(0, 0).cuboid(-10.0F, -0.1F, 0.0F, 10.0F, 2.0F, 10.0F), ModelTransform.NONE);
|
||||
modelPartData.addChild("headwear", ModelPartBuilder.create().uv(0, 0).cuboid(-10.0F, -0.1F, 0.0F, 10.0F, 2.0F, 10.0F), ModelTransform.NONE);
|
||||
ModelPartData modelPartData2 = modelPartData.addChild("bone", ModelPartBuilder.create().uv(0, 12).cuboid(0.0F, -4.0F, 0.0F, 7.0F, 4.0F, 7.0F), ModelTransform.rotation(-0.0524F, 0.0F, 0.0349F));
|
||||
ModelPartData modelPartData3 = modelPartData2.addChild("bone2", ModelPartBuilder.create().uv(0, 23).cuboid(0.0F, -4.0F, 0.0F, 4.0F, 4.0F, 4.0F), ModelTransform.rotation(-0.1222F, 0.0F, 0.0698F));
|
||||
ModelPartData modelPartData4 = modelPartData3.addChild("bone3", ModelPartBuilder.create().uv(21, 12).cuboid(0.0F, -3.0F, 0.0F, 3.0F, 3.0F, 3.0F), ModelTransform.rotation(-0.2618F, 0.0F, 0.1047F));
|
||||
modelPartData3.addChild("bone3", ModelPartBuilder.create().uv(21, 12).cuboid(0.0F, -3.0F, 0.0F, 3.0F, 3.0F, 3.0F), ModelTransform.rotation(-0.2618F, 0.0F, 0.1047F));
|
||||
|
||||
return modelData;
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
package eu.midnightdust.hats.config;
|
||||
|
||||
public class AreEventHatsEnabled {
|
||||
|
||||
public static boolean areEventHatsEnabled() {
|
||||
return HatsConfig.event_hats;
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package eu.midnightdust.hats.config;
|
||||
|
||||
import eu.midnightdust.lib.config.MidnightConfig;
|
||||
|
||||
public class HatsConfig extends MidnightConfig {
|
||||
|
||||
@Entry // Enable or disable event hats
|
||||
public static boolean event_hats = true;
|
||||
|
||||
@Entry // Enable or disable hats for contributors, friends and donors.
|
||||
public static boolean special_hats = true;
|
||||
}
|
||||
7
src/main/java/eu/midnightdust/hats/config/ModMenuIntegration.java
Normal file → Executable file
7
src/main/java/eu/midnightdust/hats/config/ModMenuIntegration.java
Normal file → Executable file
@@ -1,7 +1,8 @@
|
||||
package eu.midnightdust.hats.config;
|
||||
|
||||
import io.github.prospector.modmenu.api.ConfigScreenFactory;
|
||||
import io.github.prospector.modmenu.api.ModMenuApi;
|
||||
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
|
||||
import com.terraformersmc.modmenu.api.ModMenuApi;
|
||||
import eu.midnightdust.lib.config.MidnightConfig;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
@@ -10,6 +11,6 @@ public class ModMenuIntegration implements ModMenuApi {
|
||||
|
||||
@Override
|
||||
public ConfigScreenFactory<?> getModConfigScreenFactory() {
|
||||
return parent -> new HatsConfig().getScreen(parent);
|
||||
return parent -> MidnightConfig.getScreen(parent, "midnightlib");
|
||||
}
|
||||
}
|
||||
0
src/main/java/eu/midnightdust/hats/mixin/PlayerEntityRendererMixin.java
Normal file → Executable file
0
src/main/java/eu/midnightdust/hats/mixin/PlayerEntityRendererMixin.java
Normal file → Executable file
19
src/main/java/eu/midnightdust/hats/tater/TinyPotatoFeatureRenderer.java
Normal file → Executable file
19
src/main/java/eu/midnightdust/hats/tater/TinyPotatoFeatureRenderer.java
Normal file → Executable file
@@ -1,11 +1,10 @@
|
||||
package eu.midnightdust.hats.tater;
|
||||
|
||||
import eu.midnightdust.hats.HatsClient;
|
||||
import eu.midnightdust.hats.config.AreEventHatsEnabled;
|
||||
import eu.midnightdust.core.MidnightLibClient;
|
||||
import eu.midnightdust.core.config.MidnightLibConfig;
|
||||
import eu.midnightdust.hats.web.HatLoader;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.minecraft.client.model.TexturedModelData;
|
||||
import net.minecraft.client.network.AbstractClientPlayerEntity;
|
||||
import net.minecraft.client.render.OverlayTexture;
|
||||
@@ -28,7 +27,7 @@ import java.util.UUID;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class TinyPotatoFeatureRenderer<T extends LivingEntity, M extends EntityModel<T>> extends FeatureRenderer<T, M> {
|
||||
private static final String MOD_ID = HatsClient.MOD_ID;
|
||||
private static final String MOD_ID = MidnightLibClient.MOD_ID;
|
||||
public static final EntityModelLayer TINY_POTATO_MODEL_LAYER = new EntityModelLayer(new Identifier("midnight-hats","tiny_potato"), "main");
|
||||
private static final UUID MOTSCHEN = UUID.fromString("a44c2660-630f-478f-946a-e518669fcf0c");
|
||||
|
||||
@@ -38,7 +37,7 @@ public class TinyPotatoFeatureRenderer<T extends LivingEntity, M extends EntityM
|
||||
|
||||
public TinyPotatoFeatureRenderer(FeatureRendererContext<T, M> featureRendererContext, EntityModelLoader entityModelLoader) {
|
||||
super(featureRendererContext);
|
||||
this.tinyPotato = new TinyPotatoModel(entityModelLoader.getModelPart(TINY_POTATO_MODEL_LAYER));
|
||||
this.tinyPotato = new TinyPotatoModel<>(entityModelLoader.getModelPart(TINY_POTATO_MODEL_LAYER));
|
||||
}
|
||||
|
||||
public static TexturedModelData getTexturedModelData() {
|
||||
@@ -50,15 +49,11 @@ public class TinyPotatoFeatureRenderer<T extends LivingEntity, M extends EntityM
|
||||
AbstractClientPlayerEntity abstractClientPlayerEntity = (AbstractClientPlayerEntity)livingEntity;
|
||||
Identifier hat_type;
|
||||
if (livingEntity != null) {
|
||||
|
||||
if (Calendar.getInstance().get(Calendar.MONTH) == Calendar.DECEMBER && Calendar.getInstance().get(Calendar.DAY_OF_MONTH) == 10) {
|
||||
if (FabricLoader.getInstance().isModLoaded("cloth-config2")) {
|
||||
if (AreEventHatsEnabled.areEventHatsEnabled()) {
|
||||
hat_type = TATER;
|
||||
}
|
||||
else hat_type = DEACTIVATED;
|
||||
if (MidnightLibConfig.event_hats) {
|
||||
hat_type = TATER;
|
||||
}
|
||||
else hat_type = TATER;
|
||||
else hat_type = DEACTIVATED;
|
||||
}else {
|
||||
hat_type = DEACTIVATED;
|
||||
}
|
||||
|
||||
6
src/main/java/eu/midnightdust/hats/tater/TinyPotatoModel.java
Normal file → Executable file
6
src/main/java/eu/midnightdust/hats/tater/TinyPotatoModel.java
Normal file → Executable file
@@ -33,10 +33,4 @@ public class TinyPotatoModel <T extends LivingEntity> extends SinglePartEntityMo
|
||||
|
||||
tater.render(matrixStack, buffer, packedLight, packedOverlay);
|
||||
}
|
||||
|
||||
public void setRotationAngle(ModelPart bone, float x, float y, float z) {
|
||||
bone.pitch = x;
|
||||
bone.yaw = y;
|
||||
bone.roll = z;
|
||||
}
|
||||
}
|
||||
3
src/main/java/eu/midnightdust/hats/web/HatLoader.java
Normal file → Executable file
3
src/main/java/eu/midnightdust/hats/web/HatLoader.java
Normal file → Executable file
@@ -26,8 +26,7 @@ public class HatLoader {
|
||||
public static void init() {
|
||||
CompletableFuture.supplyAsync(() -> {
|
||||
try (Reader reader = new InputStreamReader(new URL(HATS_URL).openStream())) {
|
||||
Map<UUID, PlayerHatData> playerData = GSON.fromJson(reader, HAT_TYPE);
|
||||
return playerData;
|
||||
return GSON.<Map<UUID, PlayerHatData>>fromJson(reader, HAT_TYPE);
|
||||
} catch (MalformedURLException error) {
|
||||
logger.log(Level.ERROR, "Unable to load player hats because of connection problems: " + error.getMessage());
|
||||
} catch (IOException error) {
|
||||
|
||||
0
src/main/java/eu/midnightdust/hats/web/PlayerHatData.java
Normal file → Executable file
0
src/main/java/eu/midnightdust/hats/web/PlayerHatData.java
Normal file → Executable file
48
src/main/java/eu/midnightdust/hats/witch/WitchHatFeatureRenderer.java
Normal file → Executable file
48
src/main/java/eu/midnightdust/hats/witch/WitchHatFeatureRenderer.java
Normal file → Executable file
@@ -1,11 +1,10 @@
|
||||
package eu.midnightdust.hats.witch;
|
||||
|
||||
import eu.midnightdust.hats.HatsClient;
|
||||
import eu.midnightdust.hats.config.AreEventHatsEnabled;
|
||||
import eu.midnightdust.core.MidnightLibClient;
|
||||
import eu.midnightdust.core.config.MidnightLibConfig;
|
||||
import eu.midnightdust.hats.web.HatLoader;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.minecraft.client.model.TexturedModelData;
|
||||
import net.minecraft.client.network.AbstractClientPlayerEntity;
|
||||
import net.minecraft.client.render.OverlayTexture;
|
||||
@@ -28,7 +27,7 @@ import java.util.UUID;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class WitchHatFeatureRenderer<T extends LivingEntity, M extends EntityModel<T>> extends FeatureRenderer<T, M> {
|
||||
private static final String MOD_ID = HatsClient.MOD_ID;
|
||||
private static final String MOD_ID = MidnightLibClient.MOD_ID;
|
||||
public static final EntityModelLayer WITCH_HAT_MODEL_LAYER = new EntityModelLayer(new Identifier("midnight-hats","witch_hat"), "main");
|
||||
private static final UUID MOTSCHEN = UUID.fromString("a44c2660-630f-478f-946a-e518669fcf0c");
|
||||
|
||||
@@ -44,7 +43,7 @@ public class WitchHatFeatureRenderer<T extends LivingEntity, M extends EntityMod
|
||||
|
||||
public WitchHatFeatureRenderer(FeatureRendererContext<T, M> featureRendererContext, EntityModelLoader entityModelLoader) {
|
||||
super(featureRendererContext);
|
||||
this.witchHat = new WitchHatModel(entityModelLoader.getModelPart(WITCH_HAT_MODEL_LAYER));
|
||||
this.witchHat = new WitchHatModel<>(entityModelLoader.getModelPart(WITCH_HAT_MODEL_LAYER));
|
||||
}
|
||||
|
||||
public static TexturedModelData getTexturedModelData() {
|
||||
@@ -54,40 +53,35 @@ public class WitchHatFeatureRenderer<T extends LivingEntity, M extends EntityMod
|
||||
public void render(MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, T livingEntity, float f, float g, float h, float j, float k, float l) {
|
||||
{
|
||||
Identifier hat_type = DEACTIVATED;
|
||||
if (livingEntity instanceof AbstractClientPlayerEntity) {
|
||||
AbstractClientPlayerEntity abstractClientPlayerEntity = (AbstractClientPlayerEntity)livingEntity;
|
||||
if (livingEntity instanceof AbstractClientPlayerEntity abstractClientPlayerEntity) {
|
||||
|
||||
if (abstractClientPlayerEntity.getUuid().equals(MOTSCHEN)) {
|
||||
hat_type = MOTSCHEN_SKIN;
|
||||
}else if (HatLoader.PLAYER_HATS.containsKey(abstractClientPlayerEntity.getUuid()) && HatLoader.PLAYER_HATS.get(abstractClientPlayerEntity.getUuid()).getHatType().contains("contributer")) {
|
||||
} else if (HatLoader.PLAYER_HATS.containsKey(abstractClientPlayerEntity.getUuid()) && HatLoader.PLAYER_HATS.get(abstractClientPlayerEntity.getUuid()).getHatType().contains("contributer")) {
|
||||
hat_type = CONTRIBUTER_SKIN;
|
||||
}else if (HatLoader.PLAYER_HATS.containsKey(abstractClientPlayerEntity.getUuid()) && HatLoader.PLAYER_HATS.get(abstractClientPlayerEntity.getUuid()).getHatType().contains("friend")) {
|
||||
} else if (HatLoader.PLAYER_HATS.containsKey(abstractClientPlayerEntity.getUuid()) && HatLoader.PLAYER_HATS.get(abstractClientPlayerEntity.getUuid()).getHatType().contains("friend")) {
|
||||
hat_type = FRIEND_SKIN;
|
||||
}else if (HatLoader.PLAYER_HATS.containsKey(abstractClientPlayerEntity.getUuid()) && HatLoader.PLAYER_HATS.get(abstractClientPlayerEntity.getUuid()).getHatType().contains("donator")) {
|
||||
} else if (HatLoader.PLAYER_HATS.containsKey(abstractClientPlayerEntity.getUuid()) && HatLoader.PLAYER_HATS.get(abstractClientPlayerEntity.getUuid()).getHatType().contains("donator")) {
|
||||
hat_type = DONATOR_SKIN;
|
||||
}else if (HatLoader.PLAYER_HATS.containsKey(abstractClientPlayerEntity.getUuid()) && HatLoader.PLAYER_HATS.get(abstractClientPlayerEntity.getUuid()).getHatType().contains("social")) {
|
||||
} else if (HatLoader.PLAYER_HATS.containsKey(abstractClientPlayerEntity.getUuid()) && HatLoader.PLAYER_HATS.get(abstractClientPlayerEntity.getUuid()).getHatType().contains("social")) {
|
||||
hat_type = SOCIAL_SKIN;
|
||||
}else if (HatLoader.PLAYER_HATS.containsKey(abstractClientPlayerEntity.getUuid()) && HatLoader.PLAYER_HATS.get(abstractClientPlayerEntity.getUuid()).getHatType().contains("pride")) {
|
||||
} else if (HatLoader.PLAYER_HATS.containsKey(abstractClientPlayerEntity.getUuid()) && HatLoader.PLAYER_HATS.get(abstractClientPlayerEntity.getUuid()).getHatType().contains("pride")) {
|
||||
hat_type = PRIDE_SKIN;
|
||||
}else if (Calendar.getInstance().get(Calendar.MONTH) == Calendar.OCTOBER && Calendar.getInstance().get(Calendar.DAY_OF_MONTH) >= 30) {
|
||||
if (FabricLoader.getInstance().isModLoaded("cloth-config2")) {
|
||||
if (AreEventHatsEnabled.areEventHatsEnabled()) {
|
||||
hat_type = WITCH;
|
||||
}
|
||||
else hat_type = DEACTIVATED;
|
||||
} else if (Calendar.getInstance().get(Calendar.MONTH) == Calendar.OCTOBER && Calendar.getInstance().get(Calendar.DAY_OF_MONTH) >= 30) {
|
||||
if (MidnightLibConfig.event_hats) {
|
||||
hat_type = WITCH;
|
||||
}
|
||||
else hat_type = WITCH;
|
||||
}else hat_type = DEACTIVATED;
|
||||
} else { hat_type = DEACTIVATED; }
|
||||
}
|
||||
|
||||
if (!(hat_type == DEACTIVATED)) {
|
||||
matrixStack.push();
|
||||
if (!(hat_type == DEACTIVATED)) {
|
||||
matrixStack.push();
|
||||
|
||||
((ModelWithHead) this.getContextModel()).getHead().rotate(matrixStack);
|
||||
VertexConsumer vertexConsumer = ItemRenderer.getArmorGlintConsumer(vertexConsumerProvider, RenderLayer.getEntityCutoutNoCull(hat_type), false, false);
|
||||
this.witchHat.render(matrixStack, vertexConsumer, i, OverlayTexture.DEFAULT_UV, 1.0F, 1.0F, 1.0F, 1.0F);
|
||||
((ModelWithHead) this.getContextModel()).getHead().rotate(matrixStack);
|
||||
VertexConsumer vertexConsumer = ItemRenderer.getArmorGlintConsumer(vertexConsumerProvider, RenderLayer.getEntityCutoutNoCull(hat_type), false, false);
|
||||
this.witchHat.render(matrixStack, vertexConsumer, i, OverlayTexture.DEFAULT_UV, 1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
matrixStack.pop();
|
||||
matrixStack.pop();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
2
src/main/java/eu/midnightdust/hats/witch/WitchHatModel.java
Normal file → Executable file
2
src/main/java/eu/midnightdust/hats/witch/WitchHatModel.java
Normal file → Executable file
@@ -35,7 +35,7 @@ public class WitchHatModel<T extends LivingEntity> extends SinglePartEntityModel
|
||||
modelPartData.addChild("headwear", ModelPartBuilder.create().uv(0, 64).cuboid(-10.0F, -0.1F, 0.0F, 10.0F, 2.0F, 10.0F), ModelTransform.NONE);
|
||||
ModelPartData modelPartData2 = modelPartData.addChild("bone", ModelPartBuilder.create().uv(0, 76).cuboid(0.0F, -4.0F, 0.0F, 7.0F, 4.0F, 7.0F), ModelTransform.rotation(-0.0524F, 0.0F, 0.0349F));
|
||||
ModelPartData modelPartData3 = modelPartData2.addChild("bone2", ModelPartBuilder.create().uv(0, 87).cuboid(0.0F, -4.0F, 0.0F, 4.0F, 4.0F, 4.0F), ModelTransform.rotation(-0.1222F, 0.0F, 0.0698F));
|
||||
ModelPartData modelPartData4 = modelPartData3.addChild("bone3", ModelPartBuilder.create().uv(0, 95).cuboid(0.0F, -2.0F, 0.0F, 1.0F, 2.0F, 1.0F), ModelTransform.rotation(-0.2618F, 0.0F, 0.1047F));
|
||||
modelPartData3.addChild("bone3", ModelPartBuilder.create().uv(0, 95).cuboid(0.0F, -2.0F, 0.0F, 1.0F, 2.0F, 1.0F), ModelTransform.rotation(-0.2618F, 0.0F, 0.1047F));
|
||||
|
||||
return modelData;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user