Skip to content

Commit

Permalink
update to neoforge 21.0.111-beta
Browse files Browse the repository at this point in the history
close #1394
  • Loading branch information
Cheaterpaul committed Jul 19, 2024
1 parent 121a42b commit 81116b8
Show file tree
Hide file tree
Showing 15 changed files with 37 additions and 97 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ org.gradle.debug=false
# forge
minecraft_version=1.21
minecraft_version_range=[1.21,1.22)
forge_version=21.0.86-beta
forge_version_range=[21.0.86-beta,)
forge_version=21.0.111-beta
forge_version_range=[21.0.111-beta,)
loader_version_range=[1,)
parchment_minecraft_version=1.20.6
parchment_mappings_version=2024.05.01
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/de/teamlapen/vampirism/blocks/TentBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.google.common.collect.Table;
import com.mojang.datafixers.util.Pair;
import de.teamlapen.lib.lib.util.UtilLib;
import de.teamlapen.vampirism.client.extensions.BlockExtensions;
import de.teamlapen.vampirism.core.ModBlocks;
import de.teamlapen.vampirism.core.ModItems;
import de.teamlapen.vampirism.entity.player.VampirismPlayerAttributes;
Expand Down Expand Up @@ -37,12 +36,9 @@
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.neoforged.neoforge.client.extensions.common.IClientBlockExtensions;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.Map;
import java.util.function.Consumer;

import static net.minecraft.world.level.block.BedBlock.OCCUPIED;
import static net.minecraft.world.level.block.state.properties.BlockStateProperties.HORIZONTAL_FACING;
Expand Down Expand Up @@ -209,12 +205,6 @@ public TentBlock() {
this.registerDefaultState(this.getStateDefinition().any().setValue(FACING, Direction.NORTH).setValue(POSITION, 0).setValue(OCCUPIED, false));
}

@Override
public void initializeClient(@NotNull Consumer<IClientBlockExtensions> consumer) {
consumer.accept(BlockExtensions.TENT);
}


@Override
public boolean canSurvive(@NotNull BlockState blockState, @NotNull LevelReader worldReader, @NotNull BlockPos blockPos) {
return worldReader.getBlockState(blockPos).isAir();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ public static VampirismModClient getINSTANCE() {
public void setupClient(@NotNull FMLClientSetupEvent event) {
VampirismMod.proxy.onInitStep(IInitListener.Step.CLIENT_SETUP, event);
event.enqueueWork(ModBlocksRender::register);
event.enqueueWork(ModEffects::modifyNightVisionRenderer);
event.enqueueWork(ModItemsRender::registerItemModelPropertyUnsafe);
event.enqueueWork(() -> {
Sheets.addWoodType(LogBlock.DARK_SPRUCE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,9 @@ public static void init(IEventBus modbus){
modbus.addListener(ModItemsRender::registerItemDecorator);
modbus.addListener(ClientEventHandler::registerReloadListener);
modbus.addListener(ClientEventHandler::registerStageEvent);
modbus.addListener(ModEffects::registerClientExtensions);
modbus.addListener(ModBlocksRender::registerClientExtensions);
modbus.addListener(ModClientFluids::registerClientExtensions);
modbus.addListener(ModItemsRender::registerClientExtensions);
}
}
Original file line number Diff line number Diff line change
@@ -1,29 +1,22 @@
package de.teamlapen.vampirism.client.core;

import de.teamlapen.vampirism.REFERENCE;
import de.teamlapen.vampirism.api.entity.factions.IFaction;
import de.teamlapen.vampirism.blockentity.AlchemicalCauldronBlockEntity;
import de.teamlapen.vampirism.blockentity.TotemBlockEntity;
import de.teamlapen.vampirism.blocks.TotemTopBlock;
import de.teamlapen.vampirism.client.extensions.BlockExtensions;
import de.teamlapen.vampirism.client.renderer.blockentity.*;
import de.teamlapen.vampirism.core.ModBlocks;
import de.teamlapen.vampirism.core.ModFluids;
import de.teamlapen.vampirism.core.ModTiles;
import net.minecraft.client.renderer.ItemBlockRenderTypes;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.resources.model.Material;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.DyeColor;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.neoforged.neoforge.client.event.EntityRenderersEvent;
import net.neoforged.neoforge.client.event.RegisterColorHandlersEvent;
import net.neoforged.neoforge.client.extensions.common.RegisterClientExtensionsEvent;
import org.jetbrains.annotations.NotNull;

import java.util.Arrays;
import java.util.Comparator;

import static net.minecraft.world.inventory.InventoryMenu.BLOCK_ATLAS;

/**
* Handles all block render registration including TileEntities
*/
Expand Down Expand Up @@ -79,5 +72,9 @@ private static void registerRenderType() {
ItemBlockRenderTypes.setRenderLayer(ModFluids.BLOOD.get(), RenderType.translucent());
}

public static void registerClientExtensions(RegisterClientExtensionsEvent event) {
event.registerBlock(BlockExtensions.TENT, ModBlocks.TENT.get(), ModBlocks.TENT_MAIN.get());
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package de.teamlapen.vampirism.client.core;

import de.teamlapen.vampirism.client.extensions.FluidExtensions;
import de.teamlapen.vampirism.core.ModFluids;
import net.neoforged.neoforge.client.extensions.common.RegisterClientExtensionsEvent;

public class ModClientFluids {

public static void registerClientExtensions(RegisterClientExtensionsEvent event) {
event.registerFluidType(FluidExtensions.BLOOD, ModFluids.BLOOD_TYPE.get());
event.registerFluidType(FluidExtensions.IMPURE_BLOOD, ModFluids.IMPURE_BLOOD_TYPE.get());
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
package de.teamlapen.vampirism.client.core;

import de.teamlapen.vampirism.client.extensions.EffectExtensions;
import de.teamlapen.vampirism.mixin.client.accessor.MobEffectAccessor;
import net.minecraft.world.effect.MobEffects;
import net.neoforged.neoforge.client.extensions.common.RegisterClientExtensionsEvent;

public class ModEffects {

public static void modifyNightVisionRenderer() {
MobEffectAccessor effect = (MobEffectAccessor) MobEffects.NIGHT_VISION.value();
if (effect.getEffectRenderer() == null) {
effect.setEffectRenderer(EffectExtensions.NIGHT_VISION);
}
public static void registerClientExtensions(RegisterClientExtensionsEvent event) {
event.registerMobEffect(EffectExtensions.NIGHT_VISION, MobEffects.NIGHT_VISION.value());
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package de.teamlapen.vampirism.client.core;

import com.mojang.blaze3d.vertex.PoseStack;
import de.teamlapen.vampirism.REFERENCE;
import de.teamlapen.vampirism.api.entity.player.refinement.IRefinementSet;
import de.teamlapen.vampirism.api.items.IArrowContainer;
import de.teamlapen.vampirism.api.items.IRefinementItem;
import de.teamlapen.vampirism.api.items.IVampirismCrossbow;
import de.teamlapen.vampirism.api.util.VResourceLocation;
import de.teamlapen.vampirism.client.extensions.ItemExtensions;
import de.teamlapen.vampirism.core.ModBlocks;
import de.teamlapen.vampirism.core.ModDataComponents;
import de.teamlapen.vampirism.core.ModItems;
Expand All @@ -18,9 +18,9 @@
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.CrossbowItem;
import net.minecraft.world.item.component.DyedItemColor;
import net.neoforged.neoforge.capabilities.Capabilities;
import net.neoforged.neoforge.client.event.RegisterColorHandlersEvent;
import net.neoforged.neoforge.client.event.RegisterItemDecorationsEvent;
import net.neoforged.neoforge.client.extensions.common.RegisterClientExtensionsEvent;
import org.jetbrains.annotations.NotNull;

import java.util.stream.Stream;
Expand Down Expand Up @@ -97,4 +97,11 @@ public static void registerItemDecorator(RegisterItemDecorationsEvent event) {
});
});
}

public static void registerClientExtensions(RegisterClientExtensionsEvent event) {
event.registerItem(ItemExtensions.HUNTER_HAT, ModItems.HUNTER_HAT_HEAD_0.get(), ModItems.HUNTER_HAT_HEAD_1.get());
event.registerItem(ItemExtensions.MOTHER_TROPHY, ModBlocks.MOTHER_TROPHY.asItem());
event.registerItem(ItemExtensions.VAMPIRE_CLOAK, ModItems.VAMPIRE_CLOAK_BLACK_BLUE.get(), ModItems.VAMPIRE_CLOAK_BLACK_RED.get(), ModItems.VAMPIRE_CLOAK_RED_BLACK.get(), ModItems.VAMPIRE_CLOAK_BLACK_WHITE.get(), ModItems.VAMPIRE_CLOAK_WHITE_BLACK.get());
event.registerItem(ItemExtensions.VAMPIRE_CLOTHING, ModItems.VAMPIRE_CLOTHING_CROWN.get(), ModItems.VAMPIRE_CLOTHING_HAT.get(), ModItems.VAMPIRE_CLOTHING_LEGS.get(), ModItems.VAMPIRE_CLOTHING_BOOTS.get());
}
}
13 changes: 0 additions & 13 deletions src/main/java/de/teamlapen/vampirism/core/ModFluids.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package de.teamlapen.vampirism.core;

import de.teamlapen.vampirism.REFERENCE;
import de.teamlapen.vampirism.client.extensions.FluidExtensions;
import de.teamlapen.vampirism.fluids.BloodFluid;
import de.teamlapen.vampirism.fluids.ImpureBloodFluid;
import net.minecraft.core.registries.Registries;
Expand All @@ -10,15 +9,11 @@
import net.minecraft.world.level.material.Fluid;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.fml.ModList;
import net.neoforged.neoforge.client.extensions.common.IClientFluidTypeExtensions;
import net.neoforged.neoforge.common.SoundActions;
import net.neoforged.neoforge.fluids.FluidType;
import net.neoforged.neoforge.registries.DeferredHolder;
import net.neoforged.neoforge.registries.DeferredRegister;
import net.neoforged.neoforge.registries.NeoForgeRegistries;
import org.jetbrains.annotations.NotNull;

import java.util.function.Consumer;

public class ModFluids {
public static final DeferredRegister<Fluid> FLUIDS = DeferredRegister.create(Registries.FLUID, REFERENCE.MODID);
Expand All @@ -34,10 +29,6 @@ public class ModFluids {
.density(1300)
.descriptionId(ModList.get().isLoaded(REFERENCE.INTEGRATIONS_MODID) ? "fluid.vampirism.blood.vampirism" : "fluid.vampirism.blood")) {

@Override
public void initializeClient(@NotNull Consumer<IClientFluidTypeExtensions> consumer) {
consumer.accept(FluidExtensions.BLOOD);
}
});

public static final DeferredHolder<FluidType, FluidType> IMPURE_BLOOD_TYPE = FLUID_TYPES.register("impure_blood", () -> new FluidType(FluidType.Properties.create()
Expand All @@ -47,10 +38,6 @@ public void initializeClient(@NotNull Consumer<IClientFluidTypeExtensions> consu
.density(1300)
.descriptionId(ModList.get().isLoaded(REFERENCE.INTEGRATIONS_MODID) ? "fluid.vampirism.blood.vampirism" : "fluid.vampirism.blood")) {

@Override
public void initializeClient(@NotNull Consumer<IClientFluidTypeExtensions> consumer) {
consumer.accept(FluidExtensions.IMPURE_BLOOD);
}
});
public static final DeferredHolder<Fluid, BloodFluid> BLOOD = FLUIDS.register("blood", BloodFluid::new);
public static final DeferredHolder<Fluid, ImpureBloodFluid> IMPURE_BLOOD = FLUIDS.register("impure_blood", ImpureBloodFluid::new);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
package de.teamlapen.vampirism.items;

import de.teamlapen.vampirism.client.extensions.ItemExtensions;
import de.teamlapen.vampirism.core.ModArmorMaterials;
import net.minecraft.core.Holder;
import net.minecraft.util.StringRepresentable;
import net.minecraft.world.item.ArmorItem;
import net.minecraft.world.item.ArmorMaterial;
import net.neoforged.neoforge.client.extensions.common.IClientItemExtensions;
import org.jetbrains.annotations.NotNull;

import java.util.function.Consumer;


public class ColoredVampireClothingItem extends VampireClothingItem {

public ColoredVampireClothingItem(@NotNull ArmorItem.Type type, EnumClothingColor color) {
super(type, color.armorMaterial);
}

@Override
public void initializeClient(@NotNull Consumer<IClientItemExtensions> consumer) {
consumer.accept(ItemExtensions.VAMPIRE_CLOAK);
}

public enum EnumClothingColor implements StringRepresentable {
REDBLACK("red_black", ModArmorMaterials.VAMPIRE_CLOAK_RED_BLACK),
BLACKRED("black_red", ModArmorMaterials.VAMPIRE_CLOAK_BLACK_RED),
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/de/teamlapen/vampirism/items/HunterHatItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import de.teamlapen.lib.lib.util.UtilLib;
import de.teamlapen.vampirism.api.VampirismAPI;
import de.teamlapen.vampirism.client.extensions.ItemExtensions;
import net.minecraft.core.Holder;
import net.minecraft.core.component.DataComponents;
import net.minecraft.core.particles.ParticleTypes;
Expand All @@ -11,14 +10,10 @@
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ArmorMaterial;
import net.minecraft.world.item.ArmorMaterials;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.neoforged.neoforge.client.extensions.common.IClientItemExtensions;
import org.jetbrains.annotations.NotNull;

import java.util.function.Consumer;

/**
* Simple headwear that look like a hunter head
*/
Expand All @@ -30,11 +25,6 @@ public HunterHatItem(HatType type, Holder<ArmorMaterial> armorMaterial) {
this.type = type;
}

@Override
public void initializeClient(@NotNull Consumer<IClientItemExtensions> consumer) {
consumer.accept(ItemExtensions.HUNTER_HAT);
}

private String descriptionId;

public HatType getHateType() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
package de.teamlapen.vampirism.items;

import de.teamlapen.vampirism.client.extensions.ItemExtensions;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.level.block.Block;
import net.neoforged.neoforge.client.extensions.common.IClientItemExtensions;

import java.util.function.Consumer;

public class MotherTrophyItem extends BlockItem {

public MotherTrophyItem(Block pBlock, Properties pProperties) {
super(pBlock, pProperties);
}

@Override
public void initializeClient(Consumer<IClientItemExtensions> consumer) {
consumer.accept(ItemExtensions.MOTHER_TROPHY);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import de.teamlapen.vampirism.api.VampirismAPI;
import de.teamlapen.vampirism.api.entity.factions.IFaction;
import de.teamlapen.vampirism.api.items.IFactionExclusiveItem;
import de.teamlapen.vampirism.client.extensions.ItemExtensions;
import de.teamlapen.vampirism.core.ModArmorMaterials;
import de.teamlapen.vampirism.core.ModEffects;
import de.teamlapen.vampirism.core.ModItems;
import de.teamlapen.vampirism.util.Helper;
Expand All @@ -25,12 +23,10 @@
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.level.Level;
import net.neoforged.neoforge.client.extensions.common.IClientItemExtensions;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;
import java.util.function.Consumer;

public class VampireClothingItem extends ArmorItem implements IFactionExclusiveItem {

Expand All @@ -43,12 +39,6 @@ public void appendHoverText(@NotNull ItemStack stack, @Nullable TooltipContext c
this.addFactionToolTips(stack, context, tooltip, flagIn, VampirismMod.proxy.getClientPlayer());
}


@Override
public void initializeClient(@NotNull Consumer<IClientItemExtensions> consumer) {
consumer.accept(ItemExtensions.VAMPIRE_CLOTHING);
}

@Override
public boolean canEquip(ItemStack stack, EquipmentSlot armorType, LivingEntity entity) {
return super.canEquip(stack, armorType, entity) && Helper.isVampire(entity);
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion src/main/resources/vampirism.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
"client.accessor.EntityRenderDispatcherAccessor",
"client.accessor.HumanoidArmorLayerAccessor",
"client.accessor.LivingEntityRendererAccessor",
"client.accessor.MobEffectAccessor",
"client.accessor.ParticleEngineAccessor",
"client.accessor.StatsScreenAccessor",
"client.accessor.VillagerModelAccessor"
Expand Down

0 comments on commit 81116b8

Please sign in to comment.