• 0

    posted a message on trying to find an even that fires on after messing with a placed blocks inventory

    Try PlayerContainerEvent.Close for chests (and other containers), and PlayerInteractEvent.EntityInteractSpecific for armor stands and item frames.

    Posted in: Modification Development
  • 0

    posted a message on Crashing at forth stage of loading no errors in mod code.
    net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Crafters Dream (craftersdrm)
    Caused by: java.lang.NullPointerException
        at net.minecraftforge.registries.IForgeRegistryEntry$Impl.setRegistryName(IForgeRegistryEntry.java:79)
        at net.minecraftforge.fml.common.registry.GameRegistry.addShapedRecipe(GameRegistry.java:203)
        at com.Proninja342.CraftersDream.CraftersDream.init(CraftersDream.java:54)

    There is some problem with the recipe.

    Posted in: Modification Development
  • 0

    posted a message on No Endermen in the End

    do /gamerule doMobSpawning false. It doesn't affect mob spawners.

    Posted in: Requests / Ideas For Mods
  • 1

    posted a message on Getting items present in chest

    Try using PlayerContainerEvent.Open. I suspect that GuiOpenEvent fires (on the client side, ofc) before a packet is sent with the information of what is contained in the chest to the client (from the wording in the javadoc, this appears to be the case).

    Posted in: Modification Development
  • 0

    posted a message on Need Help with Chest Placement Rotation

    You need to check which direction the block is facing using getBlockMetadata in TileEntity, and then rotate it based on the metadata.

    From TileEntityChestRenderer:


    public void render(TileEntityChest te, double x, double y, double z, float partialTicks, int destroyStage, float alpha)
    {
    ...
    i = te.getBlockMetadata();
    ...
    if (i == 2)
    {
       j = 180;
    }
    if (i == 3)
    {
       j = 0;
    }//and so on
    ...
    GlStateManager.rotate((float)j, 0.0F, 1.0F, 0.0F);
    ...
    }


    Posted in: Modification Development
  • 0

    posted a message on SOLVED - Ore generation troubles

    No, if you want it to generate in veins of size one, you have to do something different, such as how emerald generates.

    Posted in: Modification Development
  • 0

    posted a message on SOLVED - Ore generation troubles

    Sorry, forgot to mention that. The stated vein size is not quite what actually generates. From this post:


    Quote from TheMasterCaver»
    ...
    Spawn size = 1: No ore generated
    Spawn size = 2: No ore generated
    Spawn size = 3: 241 ore, 0.455 ore/vein, 15% (smallest practical vein size)
    Spawn size = 4: 1047 ore, 1.98 ore/vein, 49.5%
    Spawn size = 5: 1702 ore, 3.22 ore/vein, 64.4%
    Spawn size = 6: 2138 ore, 4.04 ore/vein, 67.3% (default lapis size pre-1.8)
    Spawn size = 7: 2597 ore, 4.91 ore/vein, 70.1% (default diamond/redstone size pre-1.8, default lapis size in 1.8)
    Spawn size = 8: 2998 ore, 5.67 ore/vein, 70.9% (default diamond/redstone size in 1.8, default size of iron/gold pre-1.8)
    Spawn size = 9: 3606 ore, 6.82 ore/vein, 75.78% (default size of iron/gold in 1.8)
    Spawn size = 16: 10239 ore, 19.36 ore/vein, 121% (default size of coal pre-1.8)
    Spawn size = 17: 11655 ore, 22.03 ore/vein, 130% (default size of coal in 1.8)
    Spawn size = 32: 54666 ore, 103.3 ore/vein, 323% (default size of dirt/gravel pre-1.8)
    Spawn size = 33: 58997 ore, 111.5 ore/vein, 338% (default size of dirt/gravel/stones in 1.8)
    Spawn size = 50: 178330 ore, 337.1 ore/vein, 674% (maximum vein size allowed)
    ...

    afaik, spawn size 3 generates 0-3 ore per vein

    Posted in: Modification Development
  • 0

    posted a message on SOLVED - Ore generation troubles

    There is a way to make in generate only in veins of 1 (similar to emerald).

    This is the code that generates emeralds in 1.12.2 (which probably looks quite different in 1.7.10):


    private static class EmeraldGenerator extends WorldGenerator
        {
            @Override
            public boolean generate(World worldIn, Random rand, BlockPos pos)
            {
                int count = 3 + rand.nextInt(6);//the number of veins to generate
                for (int i = 0; i < count; i++)
                {
                    int offset = net.minecraftforge.common.ForgeModContainer.fixVanillaCascading ? 8 : 0; // MC-114332 (offsets by 8 blocks south and east to prevent cascading worldgen) (more of an issue with larger generated things)
                    BlockPos blockpos = pos.add(rand.nextInt(16) + offset, rand.nextInt(28) + 4, rand.nextInt(16) + offset);//chooses position to generate the block
    
                    net.minecraft.block.state.IBlockState state = worldIn.getBlockState(blockpos);//blockstates don't exist in 1.7.10 afaik
                    if (state.getBlock().isReplaceableOreGen(state, worldIn, blockpos, net.minecraft.block.state.pattern.BlockMatcher.forBlock(Blocks.STONE)))//checks if the chosen block is stone
                    {
                        worldIn.setBlockState(blockpos, Blocks.EMERALD_ORE.getDefaultState(), 16 | 2);
                    }
                }
                return true;
            }
        }


    This is in the class BiomeHills (which generates extreme hills).

    Posted in: Modification Development
  • 0

    posted a message on SOLVED - Ore generation troubles

    I don't know why your ore generation class is causing it to crash. The crash report says that there is a NullPointerException thrown here:

    at fr.minecraftforgefrance.client.custommenu.GuiCustomMainMenu.<init>(GuiCustomMainMenu.java:110)

    I am guessing that GuiCustomMainMenu and ModCustomMenu are both classes in your mod. It looks like there is a problem in the method onTick in ModCustomMenu which results in a problem initializing GuiCustomMainMenu, or there is just a problem with initializing GuiCustomMainMenu.

    Posted in: Modification Development
  • 0

    posted a message on SOLVED - Ore generation troubles
    Quote from iRoad»

    Hey, thanks! I got EXP working after tweaking your code a bit and Googling some things.
    However, I changed 'return 1' to 'return rand.nextInt(fortune+1) + 1' for the item drop and it still only drops one.


    There is probably a different method that is used to determine how much to drop for fortune. In 1.12.2, it is called quantityDroppedWithBonus. If you are using eclipse, you can do control+space to see a list of methods in superclasses that you can override.

    Posted in: Modification Development
  • 0

    posted a message on SOLVED - Ore generation troubles

    It looks like it is crashing for some reason other than the ore generation; I have no idea why commenting out that line would affect it. I'm guessing these are classes in your mod:

        at fr.minecraftforgefrance.client.custommenu.GuiCustomMainMenu.<init>(GuiCustomMainMenu.java:110)
        at fr.minecraftforgefrance.client.custommenu.ModCustomMenu.onTick(ModCustomMenu.java:35)

    Quote from iRoad»

    Crash log:

    https://pastebin.com/gWWTDERH

    For the EXP, how exactly would I add this to the block?
    For the fortune, can I change the number '1' to n(n+1)/(2n+4)? I don't know if N is a placeholder you want me to change or if I leave it as it is.


    For xp, you need to add the method getExpDrop (or whatever it is called in 1.7.10) and return an int between the max and minimum xp values you want.

    For example, this would make an ore drop between 3 and 7 (inclusive) xp. However, this code is for 1.12.2 and won't work in 1.7.10 afaik:


    public int getExpDrop(IBlockState state, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) 
    { 
        Random rand = world instanceof World ? ((World)world).rand : new Random(); 
        return rand.nextInt(5)+3; 
    }

    You need to do a similar thing to make it affected by fortune. This bit of code, in the quantityDropped method, would make it drop 1.5x the amount for fortune 1, and 2x and 2.5x for fortune 2 and 3 (on average), slightly more than for the normal ores:


    return rand.nextInt(fortune+1) + 1;

    Posted in: Modification Development
  • 0

    posted a message on SOLVED - Ore generation troubles

    Just a disclaimer: I have not done much modding in 1.7.10, and all the modding that I did for that version was years ago.


    1 & 2 are as there is no code for it to drop xp or for fortune to work on it.

    I do not know what the method for getting the xp drop in 1.7.10 is called, but in 1.12.2, it is called getExpDrop. I would recommend poking around on BlockOre or Block to find it.

    For getting fortune to work, you need to change the method quantityDropped (I think; it is different in 1.12.2) from always returning 1 to returning a random number that uses the fortune value. For reference, ores except for redstone and lapis add 0-fortune level drops on, with 0 being weighted twice that of every other number, resulting in 1/3 more drops with fortune 1, 3/4 more drops with fortune 2, and 6/5 more drops with fortune 3 (general formula: (n(n+1)/(2n+4) more drops for fortune n).


    For 3, could you post the crash report?

    Posted in: Modification Development
  • 1

    posted a message on 1.12.2 [WIP - Early Alpha] Ruins of Humanity
    Quote from kimngan1003»

    Superb mod, thks u
    Btw, is Minecraft11.com good website? I've downloaded many nice mods in that.




    I would say no. It looks like a mod repost site, though it is not on the list. It has been mentioned on the issue tracker (for the list).

    Here is a brief summary of some problems with these sites (from this post):


    Quote from CoolSquid»
    ...

    Why is mod theft a problem?


    The feeling of finding your work on those websites.
    Just the feeling of finding your mods on those websites is extremely
    discouraging for many people. Lets say that you wrote a book. The day
    after, you see the book in a shop, with a big "9books" logo on the front
    page. You haven't even been notified. How would you feel? You then read
    the books ToS, and see that "9books" is claiming to own your book! This
    is extremely discouraging.

    Outdated versions. When users find a bug,
    they then go to the mod author to report it. The problem is, that the
    bug was fixed 2 months ago! This is very annoying for both the author
    and the user.

    Wrong Minecraft versions. Those websites
    are marking the mods as working with wrong Minecraft version. They do
    this to get more downloads. The user will then go to the mod author and
    complain.

    Possible malware. Mods from those sites are untrustable, and may contain malware.

    Making money of other peoples work. Those
    sites are placing other peoples mods behind AdFly links, and other ads,
    and are directly earning money on other peoples work!

    Stealing money. When many people download
    from those sites instead of the official sites, the author loses
    revenue. Modders don't earn much from their mods, but small amounts of
    money can be a big motivation.

    Stealing downloads. Maybe one of the most
    encouraging things about making mods, is seeing your mods getting lots
    of downloads. When many users download from those sites instead of the
    official sites, the author loses many of downloads from his/her server.
    This is extremely discouraging for the modder.



    Posted in: WIP Mods
  • 0

    posted a message on 1.12.2 [WIP - Early Alpha] Ruins of Humanity
    Quote from BrixAlive»

    This mod is amazing but a lot of the ores are kinda useless.


    Thanks for the feedback. I understand that this is kind of a big problem with the mod. I am working on making some of the more useless materials more useful. For instance, nickel will be used to make invar, which will be used to make some machines. But others, such as uranium, thorium, and bismuth, will remain relatively useless for longer, as the plans that I have require other things to be added to the mod.

    Posted in: WIP Mods
  • 0

    posted a message on 1.12.2 [WIP - Early Alpha] Ruins of Humanity

    Version 0.0.1.2493 is now available for download here.

    Posted in: WIP Mods
  • To post a comment, please or register a new account.