Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
PinkGoosik committed Jul 17, 2024
1 parent 303a0a8 commit 1ecd0cf
Show file tree
Hide file tree
Showing 15 changed files with 35 additions and 89 deletions.
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ maven_group = ru.pinkgoosik

# Mod Properties
mod_name = Winterly
mod_version = 0.11.0+1.21
mod_version = 0.11.1+1.21
mod_description = Winter expansion mod adding cold and sloppy stuff.
mod_id = winterly
homepage_url = https://github.com/tyap-lyap/winterly
Expand Down Expand Up @@ -40,6 +40,8 @@ owo_lib = 0.12.10+1.21
neoforge_version = 21.0.78-beta
neoforge_version_range = [21.0,)
curios_version = 7.0.0-beta.3+1.20.4
curios_kirill = 9.0.4+1.21
accessories = 1.0.0-beta.17+1.21

# Parchment
parchment_version=2024.06.23
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
package ru.pinkgoosik.winterly.block;

import net.minecraft.ChatFormatting;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.LevelAccessor;
Expand All @@ -27,9 +21,6 @@
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import org.jetbrains.annotations.Nullable;
import ru.pinkgoosik.winterly.Winterly;

import java.util.List;

@SuppressWarnings("NullableProblems")
public class IcicleBlock extends Block implements SimpleWaterloggedBlock {
Expand Down Expand Up @@ -108,13 +99,4 @@ public FluidState getFluidState(BlockState state) {
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
builder.add(WATERLOGGED, FACING);
}


@Override
public void appendHoverText(ItemStack stack, Item.TooltipContext context, List<Component> tooltip, TooltipFlag tooltipFlag) {
if(this.equals(BuiltInRegistries.BLOCK.get(Winterly.id("icicle")))) {
tooltip.add(Component.translatable("tag.winterly.placeable").withStyle(ChatFormatting.GRAY));
}
super.appendHoverText(stack, context, tooltip, tooltipFlag);
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
package ru.pinkgoosik.winterly.block;

import com.mojang.serialization.MapCodec;
import net.minecraft.ChatFormatting;
import net.minecraft.core.BlockPos;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.Block;
Expand All @@ -16,8 +11,6 @@
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;

import java.util.List;

@SuppressWarnings("NullableProblems")
public class SnowguyBlock extends HorizontalDirectionalBlock {
public static final VoxelShape SHAPE = box(4, 0, 4, 12, 14, 12);
Expand Down Expand Up @@ -45,10 +38,4 @@ public BlockState getStateForPlacement(BlockPlaceContext ctx) {
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
builder.add(FACING);
}

@Override
public void appendHoverText(ItemStack stack, Item.TooltipContext context, List<Component> tooltip, TooltipFlag tooltipFlag) {
tooltip.add(Component.translatable("tag.winterly.placeable").withStyle(ChatFormatting.GRAY));
super.appendHoverText(stack, context, tooltip, tooltipFlag);
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
package ru.pinkgoosik.winterly.item;

import net.minecraft.ChatFormatting;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.TooltipFlag;
import java.util.List;

public class CommonSantaHatItem extends Item {
public final String color;
Expand All @@ -14,11 +9,4 @@ public CommonSantaHatItem(Item.Properties settings, String color) {
super(settings);
this.color = color;
}

// @Override
// public void appendHoverText(ItemStack stack, TooltipContext context, List<Component> tooltip, TooltipFlag tooltipFlag) {
// tooltip.add(Component.translatable("tag.winterly.cosmetic").withStyle(ChatFormatting.GRAY));
// tooltip.add(Component.nullToEmpty(" "));
// super.appendHoverText(stack, context, tooltip, tooltipFlag);
// }
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
package ru.pinkgoosik.winterly.item;

import net.minecraft.ChatFormatting;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.TooltipFlag;

import java.util.List;

public class CommonScarfItem extends Item {
public final String color;
Expand All @@ -15,11 +9,4 @@ public CommonScarfItem(Item.Properties settings, String color) {
super(settings);
this.color = color;
}

@Override
public void appendHoverText(ItemStack stack, TooltipContext context, List<Component> tooltip, TooltipFlag tooltipFlag) {
tooltip.add(Component.translatable("tag.winterly.cosmetic").withStyle(ChatFormatting.GRAY));
tooltip.add(Component.nullToEmpty(" "));
super.appendHoverText(stack, context, tooltip, tooltipFlag);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@
"block.winterly.cyan_gift_box": "Cyan Gift Box",
"block.winterly.orange_gift_box": "Orange Gift Box",

"tag.winterly.placeable": "Placeable",
"tag.winterly.cosmetic": "Cosmetic",

"config.winterly.title": "Winterly Config",
"config.winterly.general": "General",
"config.winterly.option.max_gift_box_capacity": "Max Gift Box Capacity",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@
"block.winterly.cyan_gift_box": "Бирюзовая подарочная коробка",
"block.winterly.orange_gift_box": "Оранжевая подарочная коробка",

"tag.winterly.placeable": "Размещаемый предмет",
"tag.winterly.cosmetic": "Косметический предмет",

"config.winterly.title": "Настройки Winterly",
"config.winterly.general": "Общее",
"config.winterly.option.max_gift_box_capacity": "Максимальная вместимость подарочной коробки",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@
"block.winterly.cyan_gift_box": "Cyan Gift Box",
"block.winterly.orange_gift_box": "Orange Gift Box",

"tag.winterly.placeable": "可放置的",
"tag.winterly.cosmetic": "装饰品",

"config.winterly.title": "Winterly配置",
"config.winterly.general": "常规",
"config.winterly.option.max_gift_box_capacity": "Max Gift Box Capacity",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,14 @@ public SantaHatItem(Item.Properties settings, String color) {

@Override
public void appendHoverText(ItemStack stack, TooltipContext context, List<Component> tooltip, TooltipFlag tooltipFlag) {
tooltip.add(Component.translatable("tag.winterly.cosmetic").withStyle(ChatFormatting.GRAY));
tooltip.add(Component.nullToEmpty(" "));

if(!FabricLoader.getInstance().isModLoaded("trinkets")) {
Language lang = Language.getInstance();
String key = "tip.winterly.requires_trinkets.";

for(int i = 0; i <= 32; i++) {
if(lang.has(key + i)) {
tooltip.add(Component.translatable(key + i).toFlatList(Style.EMPTY.withColor(ChatFormatting.GRAY)).get(0));
tooltip.add(Component.translatable(key + i).toFlatList(Style.EMPTY.withColor(ChatFormatting.GRAY)).getFirst());
}
if(!lang.has(key + (i + 1))) {
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import java.util.List;

@SuppressWarnings("NullableProblems")
public class ScarfItem extends CommonScarfItem {

public ScarfItem(Item.Properties settings, String color) {
Expand All @@ -24,16 +25,14 @@ public ScarfItem(Item.Properties settings, String color) {

@Override
public void appendHoverText(ItemStack stack, TooltipContext context, List<Component> tooltip, TooltipFlag tooltipFlag) {
tooltip.add(Component.translatable("tag.winterly.cosmetic").withStyle(ChatFormatting.GRAY));
tooltip.add(Component.nullToEmpty(" "));

if(!FabricLoader.getInstance().isModLoaded("trinkets")) {
Language lang = Language.getInstance();
String key = "tip.winterly.requires_trinkets.";

for(int i = 0; i <= 32; i++) {
if(lang.has(key + i)) {
tooltip.add(Component.translatable(key + i).toFlatList(Style.EMPTY.withColor(ChatFormatting.GRAY)).get(0));
tooltip.add(Component.translatable(key + i).toFlatList(Style.EMPTY.withColor(ChatFormatting.GRAY)).getFirst());
}
if(!lang.has(key + (i + 1))) {
break;
Expand Down
20 changes: 15 additions & 5 deletions winterly-neoforge/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,30 @@ configurations {
}

repositories {
maven { url = uri("https://maven.theillusivec4.top/") }
maven { url = uri("https://maven.shedaniel.me/") }
maven { url = uri("https://maven.terraformersmc.com") }
// maven("https://maven.theillusivec4.top/")
maven("https://maven.shedaniel.me/")
maven("https://maven.terraformersmc.com")

maven("https://maven.wispforest.io/releases")
maven("https://maven.su5ed.dev/releases")
maven("https://maven.fabricmc.net")

maven("https://maven.octo-studios.com/releases")
}

dependencies {
neoForge("net.neoforged:neoforge:${rootProject.property("neoforge_version")}")

modCompileOnly("top.theillusivec4.curios:curios-neoforge:${rootProject.property("curios_version")}:api")
//modCompileOnly("top.theillusivec4.curios:curios-neoforge:${rootProject.property("curios_version")}:api")
// Use the full Curios API jar at runtime
modCompileOnly("top.theillusivec4.curios:curios-neoforge:${rootProject.property("curios_version")}")
//modCompileOnly("top.theillusivec4.curios:curios-neoforge:${rootProject.property("curios_version")}")

modApi("top.theillusivec4.curios:curios-neoforge:${rootProject.property("curios_kirill")}")

modApi("me.shedaniel.cloth:cloth-config-neoforge:${rootProject.property("cloth_config")}")

// implementation("io.wispforest:accessories-neoforge:${rootProject.property("accessories")}")

modLocalRuntime("dev.emi:emi-neoforge:1.1.10+1.21")

common(project(":winterly-common", configuration = "namedElements")) { isTransitive = false }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import net.minecraft.client.renderer.entity.DrownedRenderer;
import net.minecraft.client.renderer.entity.SkeletonRenderer;
import net.minecraft.client.renderer.entity.ZombieRenderer;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.world.entity.EntityType;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.api.distmarker.OnlyIn;
Expand Down Expand Up @@ -52,9 +53,9 @@ private static void registerRenderLayers(EntityRenderersEvent.AddLayers event) {

private static void clientSetup(FMLClientSetupEvent event) {
if(ModList.get().isLoaded("curios")) {
CommonWinterlyItems.ITEMS.forEach((resourceLocation, item) -> {
if(item instanceof CommonScarfItem scarf) WinterlyCuriosIntegration.registerScarfRenderer(scarf);
if(item instanceof CommonSantaHatItem hat) WinterlyCuriosIntegration.registerSantaHatRenderer(hat);
CommonWinterlyItems.ITEMS.forEach((id, sup) -> {
if(BuiltInRegistries.ITEM.get(id) instanceof CommonScarfItem scarf) WinterlyCuriosIntegration.registerScarfRenderer(scarf);
if(BuiltInRegistries.ITEM.get(id) instanceof CommonSantaHatItem hat) WinterlyCuriosIntegration.registerSantaHatRenderer(hat);
});
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"replace": false,
"values": [
"winterly:red_santa_hat",
"winterly:blue_santa_hat"
]
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{
"replace": false,
"values": [
"winterly:red_santa_hat",
"winterly:blue_santa_hat",
"winterly:red_scarf",
"winterly:green_scarf",
"winterly:blue_scarf",
"winterly:white_scarf",
"winterly:rainbow_scarf"
]
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"entities": ["minecraft:player"],
"slots": [
"belt",
"body",
"charm",
"head",
"necklace",
"ring"
"head"
]
}
}

0 comments on commit 1ecd0cf

Please sign in to comment.