Skip to content

Commit

Permalink
fix invalid dist DEDICATED_SERVER error
Browse files Browse the repository at this point in the history
  • Loading branch information
cnlimiter committed Jun 12, 2022
1 parent f138f49 commit 08ae35f
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 27 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ repositories {

dependencies {

minecraft 'net.minecraftforge:forge:1.18.2-40.1.19'
minecraft 'net.minecraftforge:forge:1.18.2-40.1.31'
//compileOnly fg.deobf("codechicken:CodeChickenLib:1.18.2-4.1.0.449:universal")
//runtimeOnly fg.deobf("codechicken:CodeChickenLib:1.18.2-4.1.0.449:universal")
compileOnly fg.deobf('com.blamejared.crafttweaker:CraftTweaker-forge-1.18.2:9.1.116')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.Entity;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import nova.committee.avaritia.Static;
import nova.committee.avaritia.client.model.GapingVoidModel;
import nova.committee.avaritia.common.entity.GapingVoidEntity;
Expand All @@ -20,6 +22,7 @@
* Date: 2022/4/3 10:34
* Version: 1.0
*/
@OnlyIn(Dist.CLIENT)
public class GapingVoidRender extends EntityRenderer<GapingVoidEntity> {
private final ResourceLocation fill = new ResourceLocation(Static.MOD_ID, "textures/entity/void.png");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import net.minecraft.client.renderer.entity.ArrowRenderer;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import nova.committee.avaritia.Static;
import nova.committee.avaritia.common.entity.HeavenArrowEntity;
import org.jetbrains.annotations.NotNull;
Expand All @@ -13,6 +15,7 @@
* Date: 2022/4/20 18:54
* Version: 1.0
*/
@OnlyIn(Dist.CLIENT)
public class HeavenArrowRender extends ArrowRenderer<HeavenArrowEntity> {

private static final ResourceLocation tex = new ResourceLocation(Static.MOD_ID, "textures/entity/heavenarrow.png");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import net.minecraft.client.renderer.entity.ArrowRenderer;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import nova.committee.avaritia.Static;
import nova.committee.avaritia.common.entity.HeavenSubArrowEntity;
import org.jetbrains.annotations.NotNull;
Expand All @@ -13,6 +15,7 @@
* Date: 2022/4/20 18:54
* Version: 1.0
*/
@OnlyIn(Dist.CLIENT)
public class HeavenSubArrowRender extends ArrowRenderer<HeavenSubArrowEntity> {

private static final ResourceLocation tex = new ResourceLocation(Static.MOD_ID, "textures/entity/heavenarrow.png");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import net.minecraft.client.renderer.entity.layers.EyesLayer;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.Player;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import nova.committee.avaritia.Static;
import nova.committee.avaritia.init.handler.InfinityHandler;

Expand All @@ -17,6 +19,7 @@
* Date: 2022/5/16 20:40
* Version: 1.0
*/
@OnlyIn(Dist.CLIENT)
public class EyeInfinityLayer extends EyesLayer<Player, HumanoidModel<Player>> {
private static final RenderType EYES = RenderType.eyes(new ResourceLocation(Static.MOD_ID, "textures/models/armor/infinity_armor_eyes.png"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.client.event.ModelBakeEvent;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.client.model.ForgeModelBakery;
Expand All @@ -17,6 +18,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.function.Function;

/**
Expand All @@ -25,7 +27,7 @@
* Date: 2022/6/4 12:36
* Version: 1.0
*/
@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
public class ModelsHandler {
//protected CustomBlockModels customBlockModels = new CustomBlockModels();
//protected CustomItemModels customItemModels = new CustomItemModels();
Expand Down Expand Up @@ -90,6 +92,6 @@ public static List<ModelResourceLocation> getAllBlockStateModelLocations(Block b
}

public static ModelResourceLocation getItemModelLocation(Item item) {
return new ModelResourceLocation(item.getRegistryName(), "inventory");
return new ModelResourceLocation(Objects.requireNonNull(item.getRegistryName()), "inventory");
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.entity.LivingEntityRenderer;
import net.minecraft.world.entity.player.Player;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.event.EntityRenderersEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.IEventBus;
Expand Down Expand Up @@ -35,6 +37,7 @@ public void addLayers(EntityRenderersEvent.AddLayers evt) {
addPlayerLayer(evt, "slim");
}

@OnlyIn(Dist.CLIENT)
private void addPlayerLayer(EntityRenderersEvent.AddLayers evt, String skin) {
EntityRenderer<? extends Player> renderer = evt.getSkin(skin);

Expand All @@ -56,7 +59,7 @@ public void onClientSetUpEvent(FMLClientSetupEvent event) {
//ClientRegistry.registerKeyBinding(openKey);
ModMenus.onClientSetup();
ModEntities.onClientSetup();
addTESR(event);
//addTESR(event);
}

@Override
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/avaritia.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"mixins": [
],
"client": [
"client.AccessorModelManager"
],
"injectors": {
"defaultRequire": 1
Expand Down

0 comments on commit 08ae35f

Please sign in to comment.