-
Posts
80 -
Joined
-
Last visited
Everything posted by bibouche_
-
[1.16.5] Animated block with several models
bibouche_ replied to bibouche_'s topic in Modder Support
Okayy so I have my model, and got it to render, however the only issue I have is that it doesn't display the texture, and I really don't know where it could come from. Model : public class CelestialWorkbenchLevitatingPartModel extends Model { private final ModelRenderer model; public CelestialWorkbenchLevitatingPartModel() { super(RenderType::getEntitySolid); textureWidth = 64; textureHeight = 32; model = new ModelRenderer(this); model.setRotationPoint(0.0F, 24.0F, 0.0F); model.setTextureOffset(0, 0).addBox(-7.0F, -6.0F, -7.0F, 14.0F, 1.0F, 14.0F, 0.0F, false); model.setTextureOffset(0, 23).addBox(7.0F, -7.0F, -8.0F, 1.0F, 5.0F, 1.0F, 0.0F, true); model.setTextureOffset(0, 23).addBox(-8.0F, -7.0F, -8.0F, 1.0F, 5.0F, 1.0F, 0.0F, true); model.setTextureOffset(0, 23).addBox(-8.0F, -7.0F, 7.0F, 1.0F, 5.0F, 1.0F, 0.0F, false); model.setTextureOffset(0, 23).addBox(7.0F, -7.0F, 7.0F, 1.0F, 5.0F, 1.0F, 0.0F, false); model.setTextureOffset(13, 15).addBox(-7.0F, -7.0F, -8.0F, 14.0F, 1.0F, 1.0F, 0.0F, false); model.setTextureOffset(13, 15).addBox(-7.0F, -7.0F, 7.0F, 14.0F, 1.0F, 1.0F, 0.0F, false); model.setTextureOffset(6, 17).addBox(7.0F, -7.0F, -7.0F, 1.0F, 1.0F, 14.0F, 0.0F, false); model.setTextureOffset(6, 17).addBox(-8.0F, -7.0F, -7.0F, 1.0F, 1.0F, 14.0F, 0.0F, true); model.setTextureOffset(0, 20).addBox(6.0F, -10.0F, -7.0F, 1.0F, 2.0F, 1.0F, 0.0F, true); model.setTextureOffset(0, 20).addBox(-7.0F, -10.0F, -7.0F, 1.0F, 2.0F, 1.0F, 0.0F, true); model.setTextureOffset(0, 20).addBox(-7.0F, -10.0F, 6.0F, 1.0F, 2.0F, 1.0F, 0.0F, true); model.setTextureOffset(0, 20).addBox(6.0F, -10.0F, 6.0F, 1.0F, 2.0F, 1.0F, 0.0F, true); model.setTextureOffset(0, 15).addBox(4.0F, -10.0F, -8.0F, 2.0F, 1.0F, 1.0F, 0.0F, false); model.setTextureOffset(0, 15).addBox(-6.0F, -10.0F, -8.0F, 2.0F, 1.0F, 1.0F, 0.0F, false); model.setTextureOffset(0, 15).addBox(-6.0F, -10.0F, 7.0F, 2.0F, 1.0F, 1.0F, 0.0F, false); model.setTextureOffset(0, 15).addBox(4.0F, -10.0F, 7.0F, 2.0F, 1.0F, 1.0F, 0.0F, false); model.setTextureOffset(0, 17).addBox(7.0F, -10.0F, -6.0F, 1.0F, 1.0F, 2.0F, 0.0F, true); model.setTextureOffset(0, 17).addBox(7.0F, -10.0F, 4.0F, 1.0F, 1.0F, 2.0F, 0.0F, true); model.setTextureOffset(0, 17).addBox(-8.0F, -10.0F, 4.0F, 1.0F, 1.0F, 2.0F, 0.0F, true); model.setTextureOffset(0, 17).addBox(-8.0F, -10.0F, -6.0F, 1.0F, 1.0F, 2.0F, 0.0F, true); model.setTextureOffset(35, 8).addBox(6.0F, -8.0F, -8.0F, 1.0F, 1.0F, 1.0F, 0.0F, false); model.setTextureOffset(31, 4).addBox(-7.0F, -8.0F, -8.0F, 1.0F, 1.0F, 1.0F, 0.0F, false); model.setTextureOffset(35, 8).addBox(-7.0F, -8.0F, 7.0F, 1.0F, 1.0F, 1.0F, 0.0F, true); model.setTextureOffset(29, 12).addBox(6.0F, -8.0F, 7.0F, 1.0F, 1.0F, 1.0F, 0.0F, false); model.setTextureOffset(30, 10).addBox(7.0F, -8.0F, -7.0F, 1.0F, 1.0F, 1.0F, 0.0F, false); model.setTextureOffset(28, 0).addBox(7.0F, -8.0F, 6.0F, 1.0F, 1.0F, 1.0F, 0.0F, false); model.setTextureOffset(37, 1).addBox(-8.0F, -8.0F, 6.0F, 1.0F, 1.0F, 1.0F, 0.0F, false); model.setTextureOffset(38, 12).addBox(-8.0F, -8.0F, -7.0F, 1.0F, 1.0F, 1.0F, 0.0F, false); model.setTextureOffset(0, 0).addBox(6.0F, -2.0F, -9.0F, 3.0F, 1.0F, 3.0F, 0.0F, true); model.setTextureOffset(0, 0).addBox(6.0F, -2.0F, 6.0F, 3.0F, 1.0F, 3.0F, 0.0F, true); model.setTextureOffset(0, 0).addBox(-9.0F, -2.0F, 6.0F, 3.0F, 1.0F, 3.0F, 0.0F, true); model.setTextureOffset(0, 0).addBox(-9.0F, -2.0F, -9.0F, 3.0F, 1.0F, 3.0F, 0.0F, true); model.setTextureOffset(37, 6).addBox(6.0F, -6.0F, -8.0F, 1.0F, 1.0F, 1.0F, 0.0F, false); model.setTextureOffset(32, 2).addBox(-7.0F, -6.0F, -8.0F, 1.0F, 1.0F, 1.0F, 0.0F, false); model.setTextureOffset(29, 0).addBox(-8.0F, -6.0F, -7.0F, 1.0F, 1.0F, 1.0F, 0.0F, false); model.setTextureOffset(36, 11).addBox(-8.0F, -6.0F, 6.0F, 1.0F, 1.0F, 1.0F, 0.0F, true); model.setTextureOffset(33, 3).addBox(-7.0F, -6.0F, 7.0F, 1.0F, 1.0F, 1.0F, 0.0F, false); model.setTextureOffset(31, 13).addBox(6.0F, -6.0F, 7.0F, 1.0F, 1.0F, 1.0F, 0.0F, false); model.setTextureOffset(29, 0).addBox(7.0F, -6.0F, 6.0F, 1.0F, 1.0F, 1.0F, 0.0F, false); model.setTextureOffset(37, 5).addBox(7.0F, -6.0F, -7.0F, 1.0F, 1.0F, 1.0F, 0.0F, false); model.setTextureOffset(0, 1).addBox(6.0F, -6.0F, -8.0F, 1.0F, 1.0F, 1.0F, 0.0F, false); model.setTextureOffset(35, 4).addBox(5.0F, -7.0F, -7.0F, 2.0F, 1.0F, 1.0F, 0.0F, false); model.setTextureOffset(36, 0).addBox(-7.0F, -7.0F, -7.0F, 2.0F, 1.0F, 1.0F, 0.0F, false); model.setTextureOffset(33, 4).addBox(-7.0F, -7.0F, 6.0F, 2.0F, 1.0F, 1.0F, 0.0F, false); model.setTextureOffset(30, 6).addBox(5.0F, -7.0F, 6.0F, 2.0F, 1.0F, 1.0F, 0.0F, false); model.setTextureOffset(32, 12).addBox(6.0F, -7.0F, -6.0F, 1.0F, 1.0F, 1.0F, 0.0F, false); model.setTextureOffset(33, 7).addBox(-7.0F, -7.0F, -6.0F, 1.0F, 1.0F, 1.0F, 0.0F, false); model.setTextureOffset(37, 7).addBox(-7.0F, -7.0F, 5.0F, 1.0F, 1.0F, 1.0F, 0.0F, false); model.setTextureOffset(33, 7).addBox(6.0F, -7.0F, 5.0F, 1.0F, 1.0F, 1.0F, 0.0F, false); model.setTextureOffset(30, 2).addBox(-1.0F, -7.0F, -7.0F, 2.0F, 1.0F, 1.0F, 0.0F, false); model.setTextureOffset(30, 5).addBox(-1.0F, -7.0F, 6.0F, 2.0F, 1.0F, 1.0F, 0.0F, false); model.setTextureOffset(35, 9).addBox(6.0F, -7.0F, -1.0F, 1.0F, 1.0F, 2.0F, 0.0F, false); model.setTextureOffset(31, 2).addBox(-7.0F, -7.0F, -1.0F, 1.0F, 1.0F, 2.0F, 0.0F, false); model.setTextureOffset(26, 12).addBox(-2.0F, -5.0F, -2.0F, 4.0F, 1.0F, 4.0F, 0.0F, true); model.setTextureOffset(34, 1).addBox(-1.0F, -5.0F, -4.0F, 2.0F, 1.0F, 2.0F, 0.0F, false); model.setTextureOffset(33, 8).addBox(-1.0F, -5.0F, 2.0F, 2.0F, 1.0F, 2.0F, 0.0F, true); model.setTextureOffset(29, 11).addBox(2.0F, -5.0F, -1.0F, 2.0F, 1.0F, 2.0F, 0.0F, false); model.setTextureOffset(32, 7).addBox(-4.0F, -5.0F, -1.0F, 2.0F, 1.0F, 2.0F, 0.0F, false); model.setTextureOffset(29, 1).addBox(-1.0F, -4.0F, -2.0F, 2.0F, 1.0F, 4.0F, 0.0F, false); model.setTextureOffset(30, 1).addBox(1.0F, -4.0F, -1.0F, 1.0F, 1.0F, 2.0F, 0.0F, true); model.setTextureOffset(34, 13).addBox(-2.0F, -4.0F, -1.0F, 1.0F, 1.0F, 2.0F, 0.0F, false); model.setTextureOffset(31, 2).addBox(0.0F, -3.0F, -1.0F, 1.0F, 3.0F, 1.0F, 0.0F, true); model.setTextureOffset(38, 10).addBox(-1.0F, -3.0F, -1.0F, 1.0F, 2.0F, 1.0F, 0.0F, false); model.setTextureOffset(30, 5).addBox(0.0F, -3.0F, 0.0F, 1.0F, 1.0F, 1.0F, 0.0F, false); } @Override public void render(MatrixStack matrixStackIn, IVertexBuilder bufferIn, int packedLightIn, int packedOverlayIn, float red, float green, float blue, float alpha) { model.render(matrixStackIn, bufferIn, packedLightIn, packedOverlayIn, red, green, blue, alpha); } } Renderer: public class CelestialWorkbenchTileEntityRenderer extends TileEntityRenderer<CelestialWorkbenchTileEntity> { public static final RenderMaterial TOP_TEXTURE = new RenderMaterial(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation(Alcamod.ModID, "entity/celestial_workbench_top")); private final CelestialWorkbenchLevitatingPartModel model_top = new CelestialWorkbenchLevitatingPartModel(); public CelestialWorkbenchTileEntityRenderer(TileEntityRendererDispatcher rendererDispatcher) { super(rendererDispatcher); } @Override public void render(CelestialWorkbenchTileEntity tileEntityIn, float partialTicks, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int combinedLightIn, int combinedOverlayIn) { matrixStackIn.push(); matrixStackIn.translate(0.0d, 1.0d, 0.0); matrixStackIn.rotate(Vector3f.XP.rotationDegrees(180.0F)); IVertexBuilder iVertexBuilder = TOP_TEXTURE.getBuffer(bufferIn, RenderType::getEntitySolid); this.model_top.render(matrixStackIn, iVertexBuilder, combinedLightIn, combinedOverlayIn, 1.0F, 1.0F, 1.0F, 1.0F); matrixStackIn.pop(); } } -
[1.16.5] Animated block with several models
bibouche_ replied to bibouche_'s topic in Modder Support
Oh, I was already using blockbench but I didn’t know that I should do Modded Entity project. Thanks, I should be able do finish it on my own now. -
[1.16.5] Animated block with several models
bibouche_ replied to bibouche_'s topic in Modder Support
Okay so I got that, however if I am right I do need to add the boxes manually, or is there a way to use a json model ? Because my model is quiet complex and adding cube by cube would take years -
Hi, I would like to create a two-part block, like a fixed base and an upper part which is moving up and down. So I looked how vanilla does for the bell and other blocks like this, however I am struggling, I know I should do it in TileEntityRenderer, but should I use IForgeBakedModel or anything else ? I also read the doc in Advanced Block Models but I think I need some more infos
-
[1.16.5] Server crashes on launching because of ArmorItems
bibouche_ replied to bibouche_'s topic in Modder Support
Oh I didn’t see the OnlyIn, such a stupid thing 😅, thanks got it to work -
[1.16.5] Server crashes on launching because of ArmorItems
bibouche_ replied to bibouche_'s topic in Modder Support
public enum ModArmorMaterial implements IArmorMaterial { ARGENTITE(Alcamod.ModID + ":argentite", 40, new int[] { 3, 6, 8, 3 }, 12, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 3.5F, 0.15F, () -> { return Ingredient.fromItems(ModItems.ARGENTITE_INGOT.get()); }), AZURITE(Alcamod.ModID + ":azurite", 45, new int[] { 3, 6, 8, 3 }, 10, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 3.7F, 0.16F, () -> { return Ingredient.fromItems(ModItems.AZURITE_INGOT.get()); }), EMATITE(Alcamod.ModID + ":ematite", 50, new int[] { 3, 6, 8, 3 }, 8, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 4.0F, 0.17F, () -> { return Ingredient.fromItems(ModItems.EMATITE_INGOT.get()); }), BARITE(Alcamod.ModID + ":barite", 60, new int[] { 3, 6, 8, 3 }, 6, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 4.2F, 0.19F, () -> { return Ingredient.fromItems(ModItems.BARITE_INGOT.get()); }), UNPOWERED_NETHER_STAR(Alcamod.ModID + ":unpowered_nether_star", 70, new int[] { 3, 6, 8, 3 }, 6, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 4.0F, 0.21F, () -> { return Ingredient.fromItems(Items.NETHER_STAR.getItem()); }), NETHER_STAR(Alcamod.ModID + ":nether_star", 80, new int[] { 3, 6, 8, 3 }, 2, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 5.0F, 0.35F, () -> { return Ingredient.fromItems(ModItems.POWERED_NETHER_STAR.get()); }), INVERTED_NETHER_STAR(Alcamod.ModID + ":inverted_nether_star", 100, new int[] { 3, 6, 8, 3 }, 2, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 6.0F, 0.60F, () -> { return Ingredient.fromItems(ModItems.INVERTED_NETHER_STAR.get()); }); private static final int[] MAX_DAMAGE_ARRAY = new int[] { 11, 16, 15, 13 }; private final String name; private final int maxDamageFactor; private final int[] damageReductionAmountArray; private final int enchantability; private final SoundEvent soundEvent; private final float toughness; private final float knockBackResistance; private final Supplier<Ingredient> repairMaterial; ModArmorMaterial(String name, int maxDamageFactor, int[] damageReductionAmountArray, int enchantability, SoundEvent soundEvent, float toughness, float knockbackResistance, Supplier<Ingredient> repairMaterial) { this.name = name; this.maxDamageFactor = maxDamageFactor; this.damageReductionAmountArray = damageReductionAmountArray; this.enchantability = enchantability; this.soundEvent = soundEvent; this.toughness = toughness; this.repairMaterial = repairMaterial; this.knockBackResistance = knockbackResistance; } @Override public int getDurability(EquipmentSlotType slotIn) { return MAX_DAMAGE_ARRAY[slotIn.getIndex()] * this.maxDamageFactor; } @Override public int getDamageReductionAmount(EquipmentSlotType slotIn) { return this.damageReductionAmountArray[slotIn.getIndex()]; } @Override public int getEnchantability() { return this.enchantability; } @Override public SoundEvent getSoundEvent() { return this.soundEvent; } @Override public Ingredient getRepairMaterial() { return this.repairMaterial.get(); } @Override public String getName() { return this.name; } @OnlyIn( Dist.CLIENT ) @Override public float getToughness() { return this.toughness; } public float getKnockbackResistance() { return this.knockBackResistance; } } -
[1.16.5] Server crashes on launching because of ArmorItems
bibouche_ replied to bibouche_'s topic in Modder Support
Yepp, I registered it correctly since it works in singleplayer [20:00:09] [main/ERROR] [ne.mi.fm.ja.FMLModContainer/]: Exception caught during firing event: null Index: 1 Listeners: 0: NORMAL 1: ASM: net.minecraftforge.registries.DeferredRegister$EventDispatcher@424b29b1 handleEvent(Lnet/minecraftforge/event/RegistryEvent$Register;)V 2: ASM: net.minecraftforge.registries.DeferredRegister$EventDispatcher@3ad59387 handleEvent(Lnet/minecraftforge/event/RegistryEvent$Register;)V 3: ASM: net.minecraftforge.registries.DeferredRegister$EventDispatcher@7f10071d handleEvent(Lnet/minecraftforge/event/RegistryEvent$Register;)V 4: ASM: net.minecraftforge.registries.DeferredRegister$EventDispatcher@2d0269f3 handleEvent(Lnet/minecraftforge/event/RegistryEvent$Register;)V 5: ASM: net.minecraftforge.registries.DeferredRegister$EventDispatcher@61b8c853 handleEvent(Lnet/minecraftforge/event/RegistryEvent$Register;)V 6: ASM: net.minecraftforge.registries.DeferredRegister$EventDispatcher@187cff67 handleEvent(Lnet/minecraftforge/event/RegistryEvent$Register;)V 7: ASM: net.minecraftforge.registries.DeferredRegister$EventDispatcher@7b9e59e7 handleEvent(Lnet/minecraftforge/event/RegistryEvent$Register;)V 8: ASM: class fr.alcanderia.alcamod.Alcamod$RegistryEvents onBlocksRegistry(Lnet/minecraftforge/event/RegistryEvent$Register;)V java.lang.AbstractMethodError at net.minecraft.item.ArmorItem.<init>(ArmorItem.java:68) at fr.alcanderia.alcamod.init.ModItems.lambda$static$60(ModItems.java:118) at net.minecraftforge.registries.DeferredRegister.lambda$register$0(DeferredRegister.java:124) at net.minecraftforge.registries.DeferredRegister.addEntries(DeferredRegister.java:200) at net.minecraftforge.registries.DeferredRegister.access$000(DeferredRegister.java:61) at net.minecraftforge.registries.DeferredRegister$EventDispatcher.handleEvent(DeferredRegister.java:172) at net.minecraftforge.eventbus.ASMEventHandler_0_EventDispatcher_handleEvent_Register.invoke(.dynamic) at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) at net.minecraftforge.fml.javafmlmod.FMLModContainer.acceptEvent(FMLModContainer.java:120) at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$4(ModContainer.java:121) at java.util.concurrent.CompletableFuture$AsyncRun.run$$$capture(CompletableFuture.java:1640) at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java) at net.minecraftforge.fml.ModWorkManager$SyncExecutor.driveOne(ModWorkManager.java:56) at net.minecraftforge.fml.ModWorkManager$DrivenExecutor.drive(ModWorkManager.java:40) at net.minecraftforge.fml.ModLoader.waitForTransition(ModLoader.java:243) at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:230) at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:196) at net.minecraftforge.fml.server.ServerModLoader.load(ServerModLoader.java:44) at net.minecraft.server.Main.main(Main.java:95) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraftforge.userdev.FMLUserdevServerLaunchProvider.lambda$launchService$0(FMLUserdevServerLaunchProvider.java:54) at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105) [20:00:09] [main/ERROR] [ne.mi.fm.ja.FMLModContainer/LOADING]: Caught exception during event RegistryEvent.Register<minecraft:item> dispatch for modid alcamod java.lang.AbstractMethodError: null at net.minecraft.item.ArmorItem.<init>(ArmorItem.java:68) ~[forge-1.16.5-36.1.32_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading} at fr.alcanderia.alcamod.init.ModItems.lambda$static$60(ModItems.java:118) ~[main/:?] {re:classloading} at net.minecraftforge.registries.DeferredRegister.lambda$register$0(DeferredRegister.java:124) ~[forge-1.16.5-36.1.32_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading} at net.minecraftforge.registries.DeferredRegister.addEntries(DeferredRegister.java:200) ~[forge-1.16.5-36.1.32_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading} at net.minecraftforge.registries.DeferredRegister.access$000(DeferredRegister.java:61) ~[forge-1.16.5-36.1.32_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading} at net.minecraftforge.registries.DeferredRegister$EventDispatcher.handleEvent(DeferredRegister.java:172) ~[forge-1.16.5-36.1.32_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading} at net.minecraftforge.eventbus.ASMEventHandler_0_EventDispatcher_handleEvent_Register.invoke(.dynamic) ~[?:?] {} at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-4.0.0.jar:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-4.0.0.jar:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-4.0.0.jar:?] {} at net.minecraftforge.fml.javafmlmod.FMLModContainer.acceptEvent(FMLModContainer.java:120) ~[forge-1.16.5-36.1.32_mapped_snapshot_20210309-1.16.5-recomp.jar:36.1] {re:classloading} at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$4(ModContainer.java:121) ~[forge-1.16.5-36.1.32_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading} at java.util.concurrent.CompletableFuture$AsyncRun.run$$$capture(CompletableFuture.java:1640) ~[?:1.8.0_271] {} at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java) ~[?:1.8.0_271] {} at net.minecraftforge.fml.ModWorkManager$SyncExecutor.driveOne(ModWorkManager.java:56) ~[forge-1.16.5-36.1.32_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading} at net.minecraftforge.fml.ModWorkManager$DrivenExecutor.drive(ModWorkManager.java:40) ~[forge-1.16.5-36.1.32_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading} at net.minecraftforge.fml.ModLoader.waitForTransition(ModLoader.java:243) ~[forge-1.16.5-36.1.32_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading} at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:230) ~[forge-1.16.5-36.1.32_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading} at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:196) ~[forge-1.16.5-36.1.32_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading} at net.minecraftforge.fml.server.ServerModLoader.load(ServerModLoader.java:44) ~[forge-1.16.5-36.1.32_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading} at net.minecraft.server.Main.main(Main.java:95) ~[forge-1.16.5-36.1.32_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading} at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_271] {} at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_271] {} at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_271] {} at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_271] {} at net.minecraftforge.userdev.FMLUserdevServerLaunchProvider.lambda$launchService$0(FMLUserdevServerLaunchProvider.java:54) ~[forge-1.16.5-36.1.32_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.0.9.jar:?] {} at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105) [forge-1.16.5-36.1.32_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {} -
Hi, so basically I try to launch the server to test my mod on a server, but it crashes on starting because of an "AbstractMethodError : null" on my ArmorItems. I use a DeferredRegister to register my items, and in these I register some ArmorItems : public static final RegistryObject<ArmorItem> ARGENTITE_HELMET = items.register("argentite_helmet", () -> new ArmorItem(ModArmorMaterial.ARGENTITE, EquipmentSlotType.HEAD, new Item.Properties().maxStackSize(1).group(ModItemGroups.ARMORS_TAB))); public static final RegistryObject<ArmorItem> ARGENTITE_CHESTPLATE = items.register("argentite_chestplate", () -> new ArmorItem(ModArmorMaterial.ARGENTITE, EquipmentSlotType.CHEST, new Item.Properties().maxStackSize(1).group(ModItemGroups.ARMORS_TAB))); public static final RegistryObject<ArmorItem> ARGENTITE_LEGGINGS = items.register("argentite_leggings", () -> new ArmorItem(ModArmorMaterial.ARGENTITE, EquipmentSlotType.LEGS, new Item.Properties().maxStackSize(1).group(ModItemGroups.ARMORS_TAB))); public static final RegistryObject<ArmorItem> ARGENTITE_BOOTS = items.register("argentite_boots", () -> new ArmorItem(ModArmorMaterial.ARGENTITE, EquipmentSlotType.FEET, new Item.Properties().maxStackSize(1).group(ModItemGroups.ARMORS_TAB))); What is wrong here ? When I launch it on client I don't have any problems at all Edit : The error : [main/ERROR] [ne.mi.fm.ja.FMLModContainer/LOADING]: Caught exception during event RegistryEvent.Register<minecraft:item> dispatch for modid alcamod java.lang.AbstractMethodError: null at net.minecraft.item.ArmorItem.<init>(ArmorItem.java:68) ~[forge-1.16.5-36.1.32_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading} at fr.alcanderia.alcamod.init.ModItems.lambda$static$60(ModItems.java:118) ~[main/:?] {re:classloading}
-
[1.16.5] TileEntityRenderer not accessing TileEntity inventory
bibouche_ replied to bibouche_'s topic in Modder Support
Oups, yeah of course, forgot that. Yepp, got it to work, thank you !!!! -
[1.16.5] TileEntityRenderer not accessing TileEntity inventory
bibouche_ replied to bibouche_'s topic in Modder Support
Ok got it, but still the same EDIT : reupload of the TE class https://pastebin.com/hsFJHsWE -
[1.16.5] TileEntityRenderer not accessing TileEntity inventory
bibouche_ replied to bibouche_'s topic in Modder Support
Like so ? https://pastebin.com/FuUvqppK -
[1.16.5] TileEntityRenderer not accessing TileEntity inventory
bibouche_ replied to bibouche_'s topic in Modder Support
Ok so I made it use ItemStackHandler, and removed the write method from the getUpdatePacket. And it's strange because Vanilla TEs juste return null. https://pastebin.com/3CuijXdR -
[1.16.5] TileEntityRenderer not accessing TileEntity inventory
bibouche_ replied to bibouche_'s topic in Modder Support
https://pastebin.com/SjjXivkK Yeah I know that, but I did not found a way yet, so I will look at it, maybe add a new CompoundNBT and use it in the functions -
[1.16.5] TileEntityRenderer not accessing TileEntity inventory
bibouche_ replied to bibouche_'s topic in Modder Support
https://pastebin.com/DKKj7JNG Yeah, I looked at some vanilla TEs, however they are using CompoundNBT, so I am a litte lost since IItemHandler uses INBT, and like the read and write methods are using CompoundNBT -
[1.16.5] TileEntityRenderer not accessing TileEntity inventory
bibouche_ replied to bibouche_'s topic in Modder Support
Yes, because I want it to write the data in the tileEntity on block update -
[1.16.5] TileEntityRenderer not accessing TileEntity inventory
bibouche_ replied to bibouche_'s topic in Modder Support
Ok but I tried it and I keep having the same issue, I really don't see what is causing this -
[1.16.5] TileEntityRenderer not accessing TileEntity inventory
bibouche_ replied to bibouche_'s topic in Modder Support
Ok so I came up with this : https://pastebin.com/L01ZkFj2, however I think I did something wrong since it did not fixed it, for the Direction I put Direction#NORT but I don't know if it is ok to put a fixed direction like this. I use the default instance since it creates a new IItemHandler with just one slot and it is to avoid creating more instances and classes -
[1.16.5] TileEntityRenderer not accessing TileEntity inventory
bibouche_ replied to bibouche_'s topic in Modder Support
Yeah I know I want to change my code formatter but I didn't do it yet XD Ok so I juste have to delete my getItems and read and write ? -
[1.16.5] TileEntityRenderer not accessing TileEntity inventory
bibouche_ replied to bibouche_'s topic in Modder Support
https://pastebin.com/YrCCHv8N -
[1.16.5] TileEntityRenderer not accessing TileEntity inventory
bibouche_ replied to bibouche_'s topic in Modder Support
May someone help please ? I am still working on it, I don't know what is causing it. -
Hi, so the thing is that I have a TileEntity for which I added a TileEntityRenderer, I already did this with two other TileEntities but this time it was not working and I found out that the Renderer class cannot reach TileEntity inventory, since when I have an ItemStack in a slot, it outputs Air. And also, my two other TileEntities uses ISidedInventory (which I know shouldn't be used but I will change this later), and this one uses IItemHandler. I don't know if it is what causes the issue or if I am networking bad or even if I am missing something, can someone help me please ? TileEntityRenderer : public class CelestialPowerPedestalTileEntityRenderer extends TileEntityRenderer<CelestialPowerPedestalTileEntity> { private Minecraft mc = Minecraft.getInstance(); public CelestialPowerPedestalTileEntityRenderer( TileEntityRendererDispatcher rendererDispatcherIn) { super(rendererDispatcherIn); } @Override public void render( CelestialPowerPedestalTileEntity te, float partialTicks, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int combinedLightIn, int combinedOverlayIn) { int lightLevel = getLightLevel(te.getWorld(), te.getPos()); if (!te.isFillable()) { renderItem(te.inv.getStackInSlot(0), new double[] {0.48d, 0.83d, 0.42d}, 90, 0, 0, matrixStackIn, bufferIn, partialTicks, combinedOverlayIn, lightLevel, 1.0f); } } private void renderItem( ItemStack stack, double[] translation, int rotX, int rotY, int rotZ, MatrixStack matrixStack, IRenderTypeBuffer buffer, float partialTicks, int combinedOverlay, int lightLevel, float scale) { matrixStack.push(); matrixStack.translate(translation[0], translation[1], translation[2]); matrixStack.rotate(Vector3f.XP.rotationDegrees((float) rotX)); matrixStack.rotate(Vector3f.YP.rotationDegrees((float) rotY)); matrixStack.rotate(Vector3f.ZP.rotationDegrees((float) rotZ)); matrixStack.scale(scale, scale, scale); IBakedModel model = mc.getItemRenderer().getItemModelWithOverrides(stack, null, null); mc.getItemRenderer().renderItem(stack, ItemCameraTransforms.TransformType.GROUND, true, matrixStack, buffer, lightLevel, combinedOverlay, model); matrixStack.pop(); } private int getLightLevel( World world, BlockPos pos) { int blockLight = world.getLightFor(LightType.BLOCK, pos); int skyLight = world.getLightFor(LightType.SKY, pos); return LightTexture.packLight(blockLight, skyLight); } } TileEntity networking and writing : public void read( BlockState state, CompoundNBT nbt) { super.read( state, nbt); NonNullList <ItemStack> inv = NonNullList.withSize( this.inv.getSlots(), ItemStack.EMPTY); ItemStackHelper.loadAllItems( nbt, inv); setItems(inv); } @Nonnull @Override public CompoundNBT write( CompoundNBT compound) { super.write(compound); ItemStackHelper.saveAllItems( compound, this.getItems()); return compound; } @Nullable @Override public SUpdateTileEntityPacket getUpdatePacket() { CompoundNBT nbt = new CompoundNBT(); this.write(nbt); return new SUpdateTileEntityPacket( this.pos, 0, nbt); } @Override public void onDataPacket( NetworkManager net, SUpdateTileEntityPacket pkt) { this.read( world.getBlockState(pkt.getPos()), pkt.getNbtCompound()); } @Override public CompoundNBT getUpdateTag() { CompoundNBT nbt = new CompoundNBT(); this.write(nbt); return nbt; } @Override public void handleUpdateTag( BlockState state, CompoundNBT tag) { this.read(state, tag); }
-
I just changes in my TileEntity class the "extends LockableLootTileEntity" with "extends TileEntity", and removed the functionds that were implemented with it I changed some : protected NonNullList <ItemStack> getItems() { NonNullList<ItemStack> items = NonNullList.withSize(slots, ItemStack.EMPTY); for (int i = 0; i < inv.getSlots(); i++) { items.set(i, inv.getStackInSlot(i)); } return items; } protected void setItems( NonNullList <ItemStack> itemsIn) { for (int i = 0; i < itemsIn.size(); i++) { inv.insertItem(i, itemsIn.get(i), false); } } public Item getItem() { return this.inv.getStackInSlot(0) .getItem(); } public boolean isFillable() { return inv.getStackInSlot(0).getItem() != ModItems.CELESTIAL_POWER_EYE.get(); } public void read( BlockState state, CompoundNBT nbt) { super.read( state, nbt); NonNullList <ItemStack> inv = NonNullList.withSize(this.inv.getSlots(), ItemStack.EMPTY); ItemStackHelper.loadAllItems(nbt, inv); setItems(inv); } @Nonnull @Override public CompoundNBT write( CompoundNBT compound) { super.write(compound); ItemStackHelper.saveAllItems(compound, this.getItems()); return compound; } I did not changed the capability and ItemHandler related things: public static final int slots = 1; private static Capability <IItemHandler> capability = CapabilityItemHandler.ITEM_HANDLER_CAPABILITY; public IItemHandler inv = capability.getDefaultInstance(); private final LazyOptional <IItemHandler> capabilityLazyOptional = LazyOptional.of(() -> inv); @Nonnull @Override public <T> LazyOptional <T> getCapability( Capability <T> cap, Direction side) { if (cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) { return capabilityLazyOptional.cast(); } return super.getCapability(cap, side); } @Override protected void invalidateCaps() { super.invalidateCaps(); capabilityLazyOptional.invalidate(); } And retouched the onBlockActivated function: @Override public ActionResultType onBlockActivated( BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { if (worldIn != null && !worldIn.isRemote()) { TileEntity te = worldIn.getTileEntity(pos); Item playerItem = player.getHeldItemMainhand() .getItem(); if (te instanceof CelestialPowerPedestalTileEntity) { if (((CelestialPowerPedestalTileEntity) te).isFillable() && playerItem == ModItems.CELESTIAL_POWER_EYE.get()) { ItemStack stack = player.getHeldItemMainhand(); ((CelestialPowerPedestalTileEntity) te).inv.insertItem(0, stack, false); player.getHeldItemMainhand().shrink(1); return ActionResultType.SUCCESS; } if (!((CelestialPowerPedestalTileEntity) te).isFillable()) { player.addItemStackToInventory(((CelestialPowerPedestalTileEntity) te).inv.getStackInSlot(0)); ((CelestialPowerPedestalTileEntity) te).inv.extractItem(0, 1, false); return ActionResultType.SUCCESS; } } } return ActionResultType.CONSUME; }
-
I implemented IItemHandler as a capability, but i don't know why it is still not working, the setting part still seems to cause issues. here is the updated code: private static Capability <IItemHandler> capability = CapabilityItemHandler.ITEM_HANDLER_CAPABILITY; public IItemHandler inv = capability.getDefaultInstance(); private final LazyOptional <IItemHandler> capabilityLazyOptional = LazyOptional.of(() -> inv); @Override protected NonNullList <ItemStack> getItems() { NonNullList<ItemStack> items = NonNullList.withSize(slots, ItemStack.EMPTY); for (int i = 0; i < inv.getSlots(); i++) { items.set(i, inv.getStackInSlot(i)); } return items; } @Override protected void setItems( NonNullList <ItemStack> itemsIn) { for (int i = 0; i < itemsIn.size(); i++) { inv.insertItem(i, itemsIn.get(i), false); } } public Item getItem() { return this.inv.getStackInSlot(0) .getItem(); } @Override public int getSizeInventory() { return slots; } public boolean isFillable() { return inv.getStackInSlot(0).getItem() != ModItems.CELESTIAL_POWER_EYE.get(); } @Nonnull @Override public <T> LazyOptional <T> getCapability( Capability <T> cap, Direction side) { if (cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) { return capabilityLazyOptional.cast(); } return super.getCapability(cap, side); } @Override protected void invalidateCaps() { super.invalidateCaps(); capabilityLazyOptional.invalidate(); } @Override public ActionResultType onBlockActivated( BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { if (worldIn != null && !worldIn.isRemote()) { TileEntity te = worldIn.getTileEntity(pos); Item playerItem = player.getHeldItemMainhand() .getItem(); if (te instanceof CelestialPowerPedestalTileEntity) { if (((CelestialPowerPedestalTileEntity) te).isFillable() && playerItem == ModItems.CELESTIAL_POWER_EYE.get()) { ItemStack stack = player.getHeldItemMainhand(); ((CelestialPowerPedestalTileEntity) te).inv.insertItem(0, stack, false); player.getHeldItemMainhand().shrink(1); return ActionResultType.SUCCESS; } if (!((CelestialPowerPedestalTileEntity) te).isFillable()) { player.addItemStackToInventory(((CelestialPowerPedestalTileEntity) te).inv.getStackInSlot(0)); ((CelestialPowerPedestalTileEntity) te).inv.extractItem(0, 1, false); return ActionResultType.SUCCESS; } } } return ActionResultType.CONSUME; } I didn't do that but I saw that the problem was coming from the setting part, since everything works perfectly but this.