mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-24 05:47:59 +01:00
Wearing mob heads and pumpkins is an effective way for bat ponies to protect their eyes
This commit is contained in:
parent
840519c1b4
commit
8c30f38cbc
6 changed files with 35 additions and 2 deletions
|
@ -16,6 +16,8 @@ public interface UTags {
|
||||||
|
|
||||||
Tag<Item> MAGIC_FEATHERS = item("magic_feathers");
|
Tag<Item> MAGIC_FEATHERS = item("magic_feathers");
|
||||||
|
|
||||||
|
Tag<Item> SHADES = item("sun_blockers");
|
||||||
|
|
||||||
Tag<Block> FRAGILE = block("fragile");
|
Tag<Block> FRAGILE = block("fragile");
|
||||||
Tag<Block> INTERESTING = block("interesting");
|
Tag<Block> INTERESTING = block("interesting");
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class UnicopiaClient implements ClientModInitializer {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static float getWorldBrightness(float initial) {
|
public static float getWorldBrightness(float initial) {
|
||||||
return Math.min(1, initial + 0.6F);
|
return initial > 0 ? 3 : 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -2,12 +2,17 @@ package com.minelittlepony.unicopia.entity.effect;
|
||||||
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
import com.minelittlepony.unicopia.EquinePredicates;
|
||||||
|
import com.minelittlepony.unicopia.UTags;
|
||||||
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EquipmentSlot;
|
||||||
import net.minecraft.entity.LivingEntity;
|
import net.minecraft.entity.LivingEntity;
|
||||||
import net.minecraft.entity.damage.DamageSource;
|
import net.minecraft.entity.damage.DamageSource;
|
||||||
import net.minecraft.entity.effect.StatusEffect;
|
import net.minecraft.entity.effect.StatusEffect;
|
||||||
import net.minecraft.entity.effect.StatusEffectInstance;
|
import net.minecraft.entity.effect.StatusEffectInstance;
|
||||||
import net.minecraft.entity.effect.StatusEffectType;
|
import net.minecraft.entity.effect.StatusEffectType;
|
||||||
|
import net.minecraft.entity.effect.StatusEffects;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
import net.minecraft.util.registry.Registry;
|
import net.minecraft.util.registry.Registry;
|
||||||
import net.minecraft.world.LightType;
|
import net.minecraft.world.LightType;
|
||||||
|
@ -51,6 +56,18 @@ public class SunBlindnessStatusEffect extends StatusEffect {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean hasSunExposure(LivingEntity entity) {
|
public static boolean hasSunExposure(LivingEntity entity) {
|
||||||
|
if (entity.hasStatusEffect(StatusEffects.BLINDNESS)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (EquinePredicates.PLAYER_BAT.test(entity) && entity.hasStatusEffect(StatusEffects.NIGHT_VISION)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entity.getEquippedStack(EquipmentSlot.HEAD).isIn(UTags.SHADES)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (entity.world.isClient) {
|
if (entity.world.isClient) {
|
||||||
entity.world.calculateAmbientDarkness();
|
entity.world.calculateAmbientDarkness();
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
|
|
||||||
"unicopia.effect.tribe.stage.initial": "It appears to have no effect.",
|
"unicopia.effect.tribe.stage.initial": "It appears to have no effect.",
|
||||||
"unicopia.effect.tribe.stage.crawling": "You feel the skin crawling on your back.",
|
"unicopia.effect.tribe.stage.crawling": "You feel the skin crawling on your back.",
|
||||||
"unicopia.effect.tribe.stage.determination": "As your bones realign you are filled determination.",
|
"unicopia.effect.tribe.stage.determination": "As your bones realign you are filled by determination.",
|
||||||
"unicopia.effect.tribe.stage.resurection": "Knowing you will return to this world as a %s",
|
"unicopia.effect.tribe.stage.resurection": "Knowing you will return to this world as a %s",
|
||||||
|
|
||||||
"effect.food_poisoning": "Food Poisoning",
|
"effect.food_poisoning": "Food Poisoning",
|
||||||
|
@ -76,6 +76,8 @@
|
||||||
"player.miningSpeed": "Mining Speed",
|
"player.miningSpeed": "Mining Speed",
|
||||||
"player.gravityModifier": "Gravity",
|
"player.gravityModifier": "Gravity",
|
||||||
|
|
||||||
|
"effect.unicopia.sun_blindness": "Sun Blindness",
|
||||||
|
|
||||||
"effect.unicopia.change_race_earth": "Earth Pony Metamorphosis",
|
"effect.unicopia.change_race_earth": "Earth Pony Metamorphosis",
|
||||||
"item.minecraft.potion.effect.unicopia.tribe_swap_earth": "Potion of Earth Pony Metamorphosis",
|
"item.minecraft.potion.effect.unicopia.tribe_swap_earth": "Potion of Earth Pony Metamorphosis",
|
||||||
"item.minecraft.splash_potion.effect.unicopia.tribe_swap_earth": "Splash Potion of Earth Pony Metamorphosis",
|
"item.minecraft.splash_potion.effect.unicopia.tribe_swap_earth": "Splash Potion of Earth Pony Metamorphosis",
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 166 B |
12
src/main/resources/data/unicopia/tags/items/shades.json
Normal file
12
src/main/resources/data/unicopia/tags/items/shades.json
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"minecraft:carved_pumpkin",
|
||||||
|
"minecraft:skeleton_skull",
|
||||||
|
"minecraft:wither_skeleton_skull",
|
||||||
|
"minecraft:player_head",
|
||||||
|
"minecraft:zombie_head",
|
||||||
|
"minecraft:creeper_head",
|
||||||
|
"minecraft:dragon_head"
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in a new issue