Jump to content

How do i test run my new mod?


Drachenbauer

Recommended Posts

Hello

 

I have two mods open in my eclipse workspace.

Now i noticed, no matter, what i try to setup a test run for my new flat-tiles-mod, it tries to run the old Angry-Birds-mod.

How do i tell eclipse, that it should run the new mod now?

Edit:

Now it does not more load the old mod, but it also does not load the new mod into the test-client.

 

Edited by Drachenbauer
Link to comment
Share on other sites

Now i get other errors:

Quote

[m[1;31m[16:03:19] [Render thread/ERROR] [ne.mi.fm.ja.FMLModContainer/]: Exception caught during firing event: Can't use a null-name for the registry, object Block{null}.
    Index: 1
    Listeners:
        0: NORMAL
        1: ASM: class drachenbauer32.flattilesmod.FlatTiles$RegistryEvents registerBlocks(Lnet/minecraftforge/event/RegistryEvent$Register;)V
java.lang.NullPointerException: Can't use a null-name for the registry, object Block{null}.
    at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:864)
    at net.minecraftforge.registries.ForgeRegistry.add(ForgeRegistry.java:314)
    at net.minecraftforge.registries.ForgeRegistry.add(ForgeRegistry.java:308)
    at net.minecraftforge.registries.ForgeRegistry.register(ForgeRegistry.java:133)
    at net.minecraftforge.registries.ForgeRegistry.registerAll(ForgeRegistry.java:180)
    at drachenbauer32.flattilesmod.FlatTiles$RegistryEvents.registerBlocks(FlatTiles.java:78)
    at net.minecraftforge.eventbus.ASMEventHandler_0_RegistryEvents_registerBlocks_Register.invoke(.dynamic)
    at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:80)
    at net.minecraftforge.eventbus.EventBus.post(EventBus.java:258)
    at net.minecraftforge.fml.javafmlmod.FMLModContainer.fireEvent(FMLModContainer.java:106)
    at java.util.function.Consumer.lambda$andThen$0(Unknown Source)
    at java.util.function.Consumer.lambda$andThen$0(Unknown Source)
    at net.minecraftforge.fml.ModContainer.transitionState(ModContainer.java:112)
    at net.minecraftforge.fml.ModList.lambda$dispatchSynchronousEvent$5(ModList.java:125)
    at java.util.ArrayList.forEach(Unknown Source)
    at net.minecraftforge.fml.ModList.dispatchSynchronousEvent(ModList.java:125)
    at net.minecraftforge.fml.ModList.lambda$static$1(ModList.java:96)
    at net.minecraftforge.fml.LifecycleEventProvider.dispatch(LifecycleEventProvider.java:71)
    at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:197)
    at net.minecraftforge.fml.ModLoader.lambda$gatherAndInitializeMods$24(ModLoader.java:189)
    at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:964)
    at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:189)
    at net.minecraftforge.fml.client.ClientModLoader.lambda$begin$2(ClientModLoader.java:97)
    at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:113)
    at net.minecraftforge.fml.client.ClientModLoader.begin(ClientModLoader.java:97)
    at net.minecraft.client.Minecraft.<init>(Minecraft.java:393)
    at net.minecraft.client.main.Main.main(SourceFile:164)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55)
    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:81)
    at cpw.mods.modlauncher.Launcher.main(Launcher.java:65)
    at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:101)

But i don´t know, where it means "null-name" My blocks have names: black_concrete_tile_block, blue_concrete_tile_block, and so on.

For the block java file, i use the setup from the carpet-block.

 

Now i noticed, this setup gives o registra name.

How do i add a registry name to this:

    public static void registerBlocks(final RegistryEvent.Register<Block> event)
        {
            event.getRegistry().registerAll(FlatTilesBlocks.black_concrete_tile_block = new ConcreteTileBlock(DyeColor.BLACK,
                                            Block.Properties.create(Material.ROCK, MaterialColor.BLACK).sound(SoundType.STONE).
                                            lightValue(0).hardnessAndResistance(1.8f, 9f).variableOpacity()),
                                            FlatTilesBlocks.blue_concrete_tile_block = new ConcreteTileBlock(DyeColor.BLUE,
                                            Block.Properties.create(Material.ROCK, MaterialColor.BLUE).sound(SoundType.STONE).
                                            lightValue(0).hardnessAndResistance(1.8f, 9f).variableOpacity()),
                                            FlatTilesBlocks.brown_concrete_tile_block = new ConcreteTileBlock(DyeColor.BROWN,
                                            Block.Properties.create(Material.ROCK, MaterialColor.BROWN).sound(SoundType.STONE).
                                            lightValue(0).hardnessAndResistance(1.8f, 9f).variableOpacity()));
        }

theese are three blocks so far.

Link to comment
Share on other sites

This is thr block-registry now:

    public static void registerBlocks(final RegistryEvent.Register<Block> event)
        {
            event.getRegistry().registerAll(FlatTilesBlocks.black_concrete_tile_block = new ConcreteTileBlock("black_concrete_tile_block", DyeColor.BLACK,
                                            Block.Properties.create(Material.ROCK, MaterialColor.BLACK).sound(SoundType.STONE).
                                            lightValue(0).hardnessAndResistance(1.8f, 9f).variableOpacity()),
                                            FlatTilesBlocks.blue_concrete_tile_block = new ConcreteTileBlock("blue_concrete_tile_block", DyeColor.BLUE,
                                            Block.Properties.create(Material.ROCK, MaterialColor.BLUE).sound(SoundType.STONE).
                                            lightValue(0).hardnessAndResistance(1.8f, 9f).variableOpacity()),
                                            FlatTilesBlocks.brown_concrete_tile_block = new ConcreteTileBlock("brown_concrete_tile_block", DyeColor.BROWN,
                                            Block.Properties.create(Material.ROCK, MaterialColor.BROWN).sound(SoundType.STONE).
                                            lightValue(0).hardnessAndResistance(1.8f, 9f).variableOpacity()));
        }

 

The item-registry:

    public static void registerItems(final RegistryEvent.Register<Item> event)
        {
            
            event.getRegistry().registerAll(FlatTilesItems.black_concrete_tile_block = new BlockItem(FlatTilesBlocks.black_concrete_tile_block,
                                            new Item.Properties().defaultMaxDamage(0).group(FLAT_TILES).maxStackSize(64).rarity(Rarity.COMMON).
                                            setNoRepair()).setRegistryName(FlatTilesBlocks.black_concrete_tile_block.getRegistryName()),
                                            FlatTilesItems.blue_concrete_tile_block = new BlockItem(FlatTilesBlocks.blue_concrete_tile_block,
                                            new Item.Properties().defaultMaxDamage(0).group(FLAT_TILES).maxStackSize(64).rarity(Rarity.COMMON).
                                            setNoRepair()).setRegistryName(FlatTilesBlocks.blue_concrete_tile_block.getRegistryName()),
                                            FlatTilesItems.brown_concrete_tile_block = new BlockItem(FlatTilesBlocks.brown_concrete_tile_block,
                                            new Item.Properties().defaultMaxDamage(0).group(FLAT_TILES).maxStackSize(64).rarity(Rarity.COMMON).
                                            setNoRepair()).setRegistryName(FlatTilesBlocks.brown_concrete_tile_block.getRegistryName()));
        }

In the official minecraft files i found no hint, that the carpet uses a special blockitem-class, so i use  instances from the commen blockitem-class for the blockitems of the tiles.

 

and this is the block java:

package drachenbauer32.flattilesmod.blocks;

import drachenbauer32.flattilesmod.util.Reference;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.item.DyeColor;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.IWorld;
import net.minecraft.world.IWorldReader;

public class ConcreteTileBlock extends Block {
   protected static final VoxelShape SHAPE = Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 1.0D, 16.0D);
   private final DyeColor color;

   public ConcreteTileBlock(String name, DyeColor p_i48290_1_, Block.Properties properties) {
      super(properties);
      setRegistryName(Reference.MOD_ID, name);
      this.color = p_i48290_1_;
   }

   public DyeColor getColor() {
      return this.color;
   }

   public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
      return SHAPE;
   }

   /**
    * Update the provided state given the provided neighbor facing and neighbor state, returning a new state.
    * For example, fences make their connections to the passed in state if possible, and wet concrete powder immediately
    * returns its solidified counterpart.
    * Note that this method should ideally consider only the specific face passed in.
    */
   public BlockState updatePostPlacement(BlockState stateIn, Direction facing, BlockState facingState, IWorld worldIn, BlockPos currentPos, BlockPos facingPos) {
      return !stateIn.isValidPosition(worldIn, currentPos) ? Blocks.AIR.getDefaultState() : super.updatePostPlacement(stateIn, facing, facingState, worldIn, currentPos, facingPos);
   }

   public boolean isValidPosition(BlockState state, IWorldReader worldIn, BlockPos pos) {
      return !worldIn.isAirBlock(pos.down());
   }
}

 

I get no more error messages, but the items for the blocks don´t appear in the Creative inventory tab, that i made for them...

 

In the official minecraft files

 

What is not correct now?

Edited by Drachenbauer
Link to comment
Share on other sites

My creativetab is another class, that i just didn´t post here, because in the other mod it worked so far.

 

I took all about it from the other mod.

So i think, the problem is not about the creative tab itself.

 

maybe something about the json's:

base for the flat tiles:

{   "parent": "block/thin_block",
    "elements": [
        {   "from": [ 0, 0, 0 ],
            "to": [ 16, 1, 16 ],
            "faces": {
                "down":  { "uv": [ 0,  0, 16, 16 ], "texture": "#material", "cullface": "down" },
                "up":    { "uv": [ 0,  0, 16, 16 ], "texture": "#material" },
                "north": { "uv": [ 0, 15, 16, 16 ], "texture": "#material", "cullface": "north" },
                "south": { "uv": [ 0, 15, 16, 16 ], "texture": "#material", "cullface": "south" },
                "west":  { "uv": [ 0, 15, 16, 16 ], "texture": "#material", "cullface": "west" },
                "east":  { "uv": [ 0, 15, 16, 16 ], "texture": "#material", "cullface": "east" }
            }
        }
    ]
}

 

one specific block:

{
    "parent": "flattilesmod:block/tile",
    "textures": {
        "particle": "block/blue_concrete",
        "material": "block/blue_concrete"
    }
}

 

Blockstates for this block:

{
    "variants": {
        "": { "model": "flattilesmod:block/blue_concrete_tile" }
    }
}

 

Blockitem:

{
    "parent": "flattilesmod:block/blue_concrete_tile"
}

 

Is there some issue?

Edited by Drachenbauer
Link to comment
Share on other sites

Well, given the information I have, I would have to say there's something wrong with it if it's not working.

Just for grins, if you change FLAT_TILES to ItemGroup.MISC does it add your items to the Miscellaneous tab? If that works, then your custom tab is broken.

Link to comment
Share on other sites

Just out of curiosity, what happens if you change the icon in your FlatTilesItemGroup to a vanilla item, instead of one of your modded items? I'm just curious if the issue is arising because your item is not registered yet, therefore does not exist, so your tab isn't getting setup?

Check out https://mcforge.readthedocs.io/en/1.14.x/concepts/registries/#injecting-registry-values-into-fields for info on ObjectHolders.

 

Also. . . . .

15 hours ago, Ugdhar said:

I guess post logs?

 

Link to comment
Share on other sites

If my item is not registered, i wonder, why...

In 1.14.3 this way to register items worked...

 

Edit:

i noticed, that i forgot a "@SubscribeEvent" above the item registry event.

Now my item appears on the tab from my item-group, but not in it´s inventory-slots.

 

Now i try the item sorter again.

 

I noticed, that I forgot "super.fill(itemStacks);" in the fill-method of my item-group.

 

Now it works.

 

And placing the flat blocks on the ground works too.

 

Now i just have to add blocks of all the materials, i want to have in this mod

and add english and german language naming.

Edited by Drachenbauer
Link to comment
Share on other sites

  • 4 weeks later...

If i test run the flat tiles mod, at first it opens a window to choose a main-class, and then a window, to choose the run-type (client, server, ...) and after this, a minecraft test-window opens, where i can play around with the new content of my mod.

 

But if i now test run the new tulips mod, the seccond window does not appear and i get this error instead:

Quote

2020-02-12 19:36:21,395 main WARN Advanced terminal features are not available in this environment
Exception in thread "main" java.lang.IllegalArgumentException: Environment variable target must be set.
    at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:51)

I choosed the same option in the first window, as in the other mod.

 

to set up this mod, i copyed the flat tiles mod and renamed it (all folders, wich have the name of the mod, and all appearences of the name and id in files like ".project" and "build.gradle")

and i used the commands "gradlew eclipse" and "gradlew genEclipseRuns".

 

Should i use "gradlew clean" and then the other two again?

 

Edit:

after doing this and a refresh in eclipse, it shown the same behavior as the other one.

Now i can test my new tulip.

Edited by Drachenbauer
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Slot deposit 3000 adalah situs slot deposit 3000 via dana yang super gacor dimana para pemain dijamin garansi wd hari ini juga hanya dengan modal receh berupa deposit sebesar 3000 baik via dana, ovo, gopay maupun linkaja untuk para pemain pengguna e-wallet di seluruh Indonesia.   DAFTAR & LOGIN AKUN PRO SLOT DEPOSIT 3000 ⭐⭐⭐ KLIK DISINI ⭐⭐⭐  
    • OLXTOTO: Menikmati Sensasi Bermain Togel dan Slot dengan Aman dan Mengasyikkan Dunia perjudian daring terus berkembang dengan cepat, dan salah satu situs yang telah menonjol dalam pasar adalah OLXTOTO. Sebagai platform resmi untuk permainan togel dan slot, OLXTOTO telah memenangkan kepercayaan banyak pemain dengan menyediakan pengalaman bermain yang aman, adil, dan mengasyikkan. DAFTAR OLXTOTO DISINI <a href="https://imgbb.com/"><img src="https://i.ibb.co/GnjSVpx/daftar1-480x480.webp" alt="daftar1-480x480" border="0" /></a> Keamanan Sebagai Prioritas Utama Salah satu aspek utama yang membuat OLXTOTO begitu menonjol adalah komitmennya terhadap keamanan pemain. Dengan menggunakan teknologi enkripsi terkini, situs ini memastikan bahwa semua informasi pribadi dan keuangan para pemain tetap aman dan terlindungi dari akses yang tidak sah. Beragam Permainan yang Menarik Di OLXTOTO, pemain dapat menemukan beragam permainan yang menarik untuk dinikmati. Mulai dari permainan klasik seperti togel hingga slot modern dengan fitur-fitur inovatif, ada sesuatu untuk setiap selera dan preferensi. Grafik yang memukau dan efek suara yang mengagumkan menambah keseruan setiap putaran. Peluang Menang yang Tinggi Salah satu hal yang paling menarik bagi para pemain adalah peluang menang yang tinggi yang ditawarkan oleh OLXTOTO. Dengan pembayaran yang adil dan peluang yang setara bagi semua pemain, setiap taruhan memberikan kesempatan nyata untuk memenangkan hadiah besar. Layanan Pelanggan yang Responsif Tim layanan pelanggan OLXTOTO siap membantu para pemain dengan setiap pertanyaan atau masalah yang mereka hadapi. Dengan layanan yang ramah dan responsif, pemain dapat yakin bahwa mereka akan mendapatkan bantuan yang mereka butuhkan dengan cepat dan efisien. Kesimpulan OLXTOTO telah membuktikan dirinya sebagai salah satu situs terbaik untuk penggemar togel dan slot online. Dengan fokus pada keamanan, beragam permainan yang menarik, peluang menang yang tinggi, dan layanan pelanggan yang luar biasa, tidak mengherankan bahwa situs ini telah menjadi pilihan utama bagi banyak pemain. Jadi, jika Anda mencari pengalaman bermain yang aman, adil, dan mengasyikkan, jangan ragu untuk bergabung dengan OLXTOTO hari ini dan rasakan sensasi kemenangan!
    • Slot deposit dana adalah situs slot deposit dana yang juga menerima dari e-wallet lain seperti deposit via dana, ovo, gopay & linkaja terlengkap saat ini, sehingga para pemain yang tidak memiliki rekening bank lokal bisa tetap bermain slot dan terbantu dengan adanya fitur tersebut.   DAFTAR & LOGIN AKUN PRO SLOT DEPOSIT DANA ⭐⭐⭐ KLIK DISINI ⭐⭐⭐  
    • Slot deposit dana adalah situs slot deposit dana minimal 5000 yang dijamin garansi super gacor dan gampang menang, dimana para pemain yang tidak memiliki rekening bank lokal tetap dalam bermain slot dengan melakukan deposit dana serta e-wallet lainnya seperti ovo, gopay maupun linkaja lengkap. Agar para pecinta slot di seluruh Indonesia tetap dapat menikmati permainan tanpa halangan apapun khususnya metode deposit, dimana ketersediaan cara deposit saat ini yang lebih beragam tentunya sangat membantu para pecinta slot.   DAFTAR & LOGIN AKUN PRO SLOT DEPOSIT DANA ⭐⭐⭐ KLIK DISINI ⭐⭐⭐  
    • Slot deposit pulsa adalah situs slot deposit pulsa tanpa potongan apapun yang dijamin garansi terpercaya, dimana kamu bisa bermain slot dengan melakukan deposit pulsa dan tanpa dikenakan potongan apapun sehingga dana yang masuk ke dalam akun akan 100% utuh. Proses penarikan dana juga dijamin gampang dan tidak sulit sehingga kamu tidak perlu khawatir akan kemenangan yang akan kamu peroleh dengan sangat mudah jika bermain disini.   DAFTAR & LOGIN AKUN PRO SLOT DEPOSIT PULSA TANPA POTONGAN ⭐⭐⭐ KLIK DISINI ⭐⭐⭐  
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.