mirror of
https://github.com/TeamMidnightDust/MidnightLib.git
synced 2025-12-16 09:15:10 +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:
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user