Jump to content

Recommended Posts

Posted

So I made a config file using a few tutorials, but it doesn't seem to work. It appears and everything, but when I change the numbers, nothing changes.

 

Here are the two files:

 

mod_Goblins (Only the important part shown):

 

 static
   {
   GOBLINmodHelper.initProps();
}

  //Blocks---------------------------------------------------------------------------------------------------------------------------------
   //public static final Block fireplace = new GOBLINBlockFireplace(200, 0).setHardness(1F).setResistance(1F).setBlockName("fireplace");
   public static final Block MobGSpawner = new GOBLINBlockMobGSpawner(GOBLINmodHelper.MobGSpawnerBlockID, 0, GOBLINmodHelper.SpawnerRandSpawnrate1).setHardness(4F).setResistance(1F).setBlockName("BlockMobGSpawner");
   public static final Block MobGRSpawner = new GOBLINBlockMobGRSpawner(GOBLINmodHelper.MobGRSpawnerBlockID, 0,GOBLINmodHelper.SpawnerRandSpawnrate2).setHardness(4F).setResistance(1F).setBlockName("BlockMobGRSpawner");
   public static final Block MobGMSpawner = new GOBLINBlockMobGMSpawner(GOBLINmodHelper.MobGMSpawnerBlockID, 0, GOBLINmodHelper.SpawnerRandSpawnrate3).setHardness(4F).setResistance(1F).setBlockName("BlockMobGMSpawner");      
   public static final Block VillageSpawn = new GOBLINBlockVillageSpawn (GOBLINmodHelper.VillageSpawnBlockID,1).setHardness(0.1F).setResistance(1F).setBlockName("VillageSpawn").setLightValue(0.65F);
   public static final Block ETNT = new GOBLINBlockETNT (GOBLINmodHelper.ETNTBlockID,2).setHardness(0.0F).setBlockName("ETNT").setLightValue(0.65F);
   public static final Block MTNT = new GOBLINBlockMTNT (GOBLINmodHelper.MTNTBlockID,5).setHardness(0.0F).setBlockName("MTNT").setLightValue(0.8F);
   public static final Block totemR = new GOBLINBlockTotemR (GOBLINmodHelper.totemRBlockID,.setHardness(3.5F).setResistance(20F).setBlockName("totemR").setLightValue(0.65F);
   public static final Block totemB = new GOBLINBlockTotemB (GOBLINmodHelper.totemBBlockID,10).setHardness(3.5F).setResistance(20F).setBlockName("totemB").setLightValue(0.5F);
   public static final Block totemG = new GOBLINBlockTotemG (GOBLINmodHelper.totemGBlockID,12).setHardness(3.5F).setResistance(20F).setBlockName("totemG").setLightValue(0.5F);
   public static final Block totemY = new GOBLINBlockTotemY (GOBLINmodHelper.totemYBlockID,14).setHardness(3.5F).setResistance(20F).setBlockName("totemY").setLightValue(0.65F);
   public static final Block gobDrum = new GOBLINBlockGobDrum (GOBLINmodHelper.gobDrumBlockID).setHardness(0.8F).setBlockName("gobDrum").setRequiresSelfNotify();
   public static final Block gobStone = new GOBLINBlockGobStone(GOBLINmodHelper.gobStoneBlockID,16).setHardness(1.5F).setResistance(10F).setBlockName("gobStone");
   //public static final Block gobSlabStone = new BlockGobSlabStone(213, 0).setHardness(2.0F).setResistance(10F).setBlockName("gobSlabStone");
   public static final Block gobSlabWood = new GOBLINBlockGobSlabWood(GOBLINmodHelper.gobSlabWoodBlockID, 17).setHardness(2.0F).setResistance(10F).setBlockName("gobSlabWood");
    

 

And GOBLINmodHelper:

 

package net.minecraft.src;
import java.io.File;
import java.io.IOException;

import net.minecraft.client.Minecraft;
import net.minecraft.src.forge.Configuration;

public class GOBLINmodHelper {

    public static void initProps()
    {

        File file = new File(Minecraft.getMinecraftDir() + "/config/GoblinsConfig");
        file.mkdir();
        File newFile = new File(Minecraft.getMinecraftDir() + "/config/GoblinsConfig/GoblinsConfig.cfg");

        try
        {
            newFile.createNewFile();
            System.out.println("Successfully created/read Integer.parseInt(configuration file");
        }
        catch (IOException e)
        {
            System.out.println("Could not create Integer.parseInt(configuration file for mod_HelloWorld. Reason:");
            System.out.println(e);
        }

        Configuration configuration = new Configuration(newFile);

       configuration.load();
   
                MobGSpawnerBlockID = Integer.parseInt(configuration.getOrCreateIntProperty("Goblin Spawner 1 ID ", Configuration.CATEGORY_BLOCK, 201).value );
			MobGRSpawnerBlockID = Integer.parseInt(configuration.getOrCreateIntProperty("Goblin Spawner 2 ID ",Configuration.CATEGORY_BLOCK, 202).value );
			MobGMSpawnerBlockID = Integer.parseInt(configuration.getOrCreateIntProperty("Goblin Spawner 3 ID ",Configuration.CATEGORY_BLOCK, 203).value );
			VillageSpawnBlockID = Integer.parseInt(configuration.getOrCreateIntProperty("Village Spawner ID ",Configuration.CATEGORY_BLOCK, 204).value );
			ETNTBlockID = Integer.parseInt(configuration.getOrCreateIntProperty("Enchanted TNT ID ",Configuration.CATEGORY_BLOCK, 205).value );
			MTNTBlockID = Integer.parseInt(configuration.getOrCreateIntProperty("Arcane TNT ID ",Configuration.CATEGORY_BLOCK, 206).value );
			totemRBlockID = Integer.parseInt(configuration.getOrCreateIntProperty("Red Totem ID ",Configuration.CATEGORY_BLOCK, 207).value );
			totemBBlockID = Integer.parseInt(configuration.getOrCreateIntProperty("Blue Totem ID ",Configuration.CATEGORY_BLOCK, 208).value );
			totemGBlockID = Integer.parseInt(configuration.getOrCreateIntProperty("Green Totem ID ",Configuration.CATEGORY_BLOCK, 209).value );
			totemYBlockID = Integer.parseInt(configuration.getOrCreateIntProperty("Yellow Totem ID ",Configuration.CATEGORY_BLOCK, 210).value );
			gobDrumBlockID = Integer.parseInt(configuration.getOrCreateIntProperty("Goblin Drum ID ",Configuration.CATEGORY_BLOCK, 211).value );
			gobStoneBlockID = Integer.parseInt(configuration.getOrCreateIntProperty("Goblin Stone ID ",Configuration.CATEGORY_BLOCK, 212).value );
			gobSlabWoodBlockID = Integer.parseInt(configuration.getOrCreateIntProperty("Goblin Wood Slab ID ",Configuration.CATEGORY_BLOCK, 213).value );

                swordFireShiftedIndex = Integer.parseInt(configuration.getOrCreateIntProperty("Flame Blade ID ", Configuration.CATEGORY_ITEM, 348).value );
			GoblinFleshShiftedIndex = Integer.parseInt(configuration.getOrCreateIntProperty("Goblin Flesh ID ", Configuration.CATEGORY_ITEM, 349).value );
			bombShiftedIndex = Integer.parseInt(configuration.getOrCreateIntProperty("Bomb ID ", Configuration.CATEGORY_ITEM, 350).value );
			staffBlueShiftedIndex = Integer.parseInt(configuration.getOrCreateIntProperty("Arcane Staff ID ", Configuration.CATEGORY_ITEM, 351).value );
			staffNatureShiftedIndex = Integer.parseInt(configuration.getOrCreateIntProperty("Scepter of Life ID ", Configuration.CATEGORY_ITEM, 352).value );
			ShurikenShiftedIndex = Integer.parseInt(configuration.getOrCreateIntProperty("Shuriken ID ", Configuration.CATEGORY_ITEM, 353).value );
			arrowGShiftedIndex = Integer.parseInt(configuration.getOrCreateIntProperty("Nature Arrow ID ", Configuration.CATEGORY_ITEM, 354).value );
			arrowRShiftedIndex = Integer.parseInt(configuration.getOrCreateIntProperty("Explosive Arrow ID ", Configuration.CATEGORY_ITEM, 355).value );
			arrowYShiftedIndex = Integer.parseInt(configuration.getOrCreateIntProperty("Lighting Arrow ID ", Configuration.CATEGORY_ITEM, 356).value );
			crystalBShiftedIndex = Integer.parseInt(configuration.getOrCreateIntProperty("Blue Crystal ID ", Configuration.CATEGORY_ITEM, 357).value );
			crystalRShiftedIndex = Integer.parseInt(configuration.getOrCreateIntProperty("Red Crystal ID ", Configuration.CATEGORY_ITEM, 358).value );
			crystalGShiftedIndex = Integer.parseInt(configuration.getOrCreateIntProperty("Green Crystal ID ", Configuration.CATEGORY_ITEM, 359).value );
			crystalYShiftedIndex = Integer.parseInt(configuration.getOrCreateIntProperty("Yellow Crystal ID ", Configuration.CATEGORY_ITEM, 360).value );
			powderRShiftedIndex = Integer.parseInt(configuration.getOrCreateIntProperty("Red Powder ID ", Configuration.CATEGORY_ITEM, 361).value );
			powderBShiftedIndex = Integer.parseInt(configuration.getOrCreateIntProperty("Blue Powder ID ", Configuration.CATEGORY_ITEM, 362).value );
			powderYShiftedIndex = Integer.parseInt(configuration.getOrCreateIntProperty("Yellow Powder ID ", Configuration.CATEGORY_ITEM, 363).value );
			powderGShiftedIndex = Integer.parseInt(configuration.getOrCreateIntProperty("Green Powder ID ", Configuration.CATEGORY_ITEM, 364).value );
			katanaSwordShiftedIndex = Integer.parseInt(configuration.getOrCreateIntProperty("Katana ID ", Configuration.CATEGORY_ITEM, 365).value );
			staffTeleportShiftedIndex = Integer.parseInt(configuration.getOrCreateIntProperty("Teleportation Staff ID ", Configuration.CATEGORY_ITEM, 366).value );
			staffLightningShiftedIndex = Integer.parseInt(configuration.getOrCreateIntProperty("Lightning Staff ID ", Configuration.CATEGORY_ITEM, 367).value );
			ectoplasmShiftedIndex = Integer.parseInt(configuration.getOrCreateIntProperty("Ectoplasm ID ", Configuration.CATEGORY_ITEM, 368).value );
			GoblinBowShiftedIndex = Integer.parseInt(configuration.getOrCreateIntProperty("Goblin Bow ID ", Configuration.CATEGORY_ITEM, 369).value );

			GoblinRandSpawnrate1 = Integer.parseInt(configuration.getOrCreateIntProperty("Goblin Spawnrate How often should goblins spawn in the wild ", Configuration.CATEGORY_GENERAL, 1).value );
			GoblinRandSpawnrate2 = Integer.parseInt(configuration.getOrCreateIntProperty("Goblin Spawnrate min goblins in group but is often much less foor some reason ", Configuration.CATEGORY_GENERAL, 10).value );
			GoblinRandSpawnrate3 = Integer.parseInt(configuration.getOrCreateIntProperty("Goblin Spawnrate max goblins in group but is often much less foor some reason ", Configuration.CATEGORY_GENERAL, 25).value );

			SpawnerRandSpawnrate1 = Integer.parseInt(configuration.getOrCreateIntProperty("Goblin Spawner Delay ", Configuration.CATEGORY_GENERAL, 280).value );
			SpawnerRandSpawnrate2 = Integer.parseInt(configuration.getOrCreateIntProperty("Goblin Rider and Direwolf Spawner Delay ", Configuration.CATEGORY_GENERAL, 230).value );
			SpawnerRandSpawnrate3 = Integer.parseInt(configuration.getOrCreateIntProperty("Goblin Miner Spawner Delay ", Configuration.CATEGORY_GENERAL, 180).value );

                VillageSpawnrate = Integer.parseInt(configuration.getOrCreateIntProperty("Village Spawnrate ", Configuration.CATEGORY_GENERAL, 36).value );				

        configuration.save();
    }


    
    static int MobGSpawnerBlockID;
    static int MobGRSpawnerBlockID;
    static int MobGMSpawnerBlockID;
    static int VillageSpawnBlockID; 
    static int ETNTBlockID; 
    static int MTNTBlockID; 
    static int totemRBlockID; 
    static int totemBBlockID; 
    static int totemGBlockID; 
    static int totemYBlockID ;
static int gobDrumBlockID ;
static int gobStoneBlockID ;
static int gobSlabWoodBlockID ;

    static int swordFireShiftedIndex;
static int GoblinFleshShiftedIndex;
    static int bombShiftedIndex;
static int staffBlueShiftedIndex;
static int staffNatureShiftedIndex;
static int ShurikenShiftedIndex;
static int arrowGShiftedIndex;
static int arrowRShiftedIndex;
static int arrowYShiftedIndex;
static int crystalBShiftedIndex;
static int crystalRShiftedIndex;
static int crystalGShiftedIndex;
static int crystalYShiftedIndex;
static int powderRShiftedIndex;
static int powderBShiftedIndex;
static int powderYShiftedIndex;
static int powderGShiftedIndex;
static int katanaSwordShiftedIndex;
static int staffTeleportShiftedIndex;
static int staffLightningShiftedIndex;
static int ectoplasmShiftedIndex;
static int GoblinBowShiftedIndex;
   
    static int GoblinRandSpawnrate1;
static int GoblinRandSpawnrate2;
static int GoblinRandSpawnrate3;

    static int SpawnerRandSpawnrate1;
static int SpawnerRandSpawnrate2;
static int SpawnerRandSpawnrate3;

    static int VillageSpawnrate;
} 

Posted

Not only is your variable naming horrible, your code placement is horrible.

Anyways Why are you initalizing everything in the static initalizer?

Move it to load or modsloaded like a good boy.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

You didn't have to reply. You could ignore my post and someone else would solve my problem. Instead, you chose not to solve my problem, but to write un-constructive critiscism about my code. And to top that off, you didn't solve the problem either. When I posted my problem on the minecraft forum, I got an immediate fix (I asked here first, because I thought people who go on this forum all use and know how to use Forge). I assume you just wanted to offend me for no reason.

 

I don't understand what inclined you to post this. Is it that I put my question in a wrong section, and you wanted to insult me because of that? Or are you a dick to everyone who has a problem? Now, if you wrote some constructive critiscism ("like, your variable naming is bad because x", instead of "it sucks because I said so"), I wouldn't care that much, because I would learn something new.

 

Also, why did you write : "Move it to load or modsloaded like a good boy." Just because you wrote some API, doesn't mean you are better than the people who have problems here.

 

Don't get me wrong, I don't want to start a flame war (I'm deleting my account after this, because I sure I won't get any support here). I just want you to realize that you are a dick.

Posted
  On 5/6/2012 at 1:34 PM, sartharis said:

You didn't have to reply. You could ignore my post and someone else would solve my problem. Instead, you chose not to solve my problem, but to write un-constructive critiscism about my code. And to top that off, you didn't solve the problem either. When I posted my problem on the minecraft forum, I got an immediate fix (I asked here first, because I thought people who go on this forum all use and know how to use Forge). I assume you just wanted to offend me for no reason.

 

I don't understand what inclined you to post this. Is it that I put my question in a wrong section, and you wanted to insult me because of that? Or are you a dick to everyone who has a problem? Now, if you wrote some constructive critiscism ("like, your variable naming is bad because x", instead of "it sucks because I said so"), I wouldn't care that much, because I would learn something new.

 

Also, why did you write : "Move it to load or modsloaded like a good boy." Just because you wrote some API, doesn't mean you are better than the people who have problems here.

 

Don't get me wrong, I don't want to start a flame war (I'm deleting my account after this, because I sure I won't get any support here). I just want you to realize that you are a dick.

 

Someone doesn't have a thick skin.

 

His reply did tell you EXACTLY how to fix it - you were initialising the blocks before the ID's had even had chance to be read. He did solve your problem, you just chose to ignore that part just because you felt his tongue in cheek reply was insulting you.

Posted

And this ladies and gentlemen is how you get banned!

Quit being a insufferable twat, as they said I DID help you and give you the answer.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Yes that’s the full log, I managed to get it working last night, the anvil fix mod is what was causing it to crash
    • Hey guys, i'm currently developping a mod with forge 1.12.2 2860 and i'm using optifine and gradle 4.9. The thing is i'm trying to figure out how to show the player's body in first person. So far everything's going well since i've try to use a shader. The player's body started to blink dark when using a shader. I've try a lot of shader like chocapic, zeus etc etc but still the same issue. So my question is : How should i apply the current shader to the body ? At the same time i'm also drawing a HUD so maybe it could be the problem?   Here is the issue :    And here is the code where i'm trying to display the body :    private static void renderFirstPersonBody(EntityPlayerSP player, float partialTicks) { Minecraft mc = Minecraft.getMinecraft(); GlStateManager.pushMatrix(); GlStateManager.pushAttrib(); try { // Préparation OpenGL GlStateManager.enableDepth(); GlStateManager.depthMask(true); GlStateManager.enableAlpha(); GlStateManager.alphaFunc(GL11.GL_GREATER, 0.1F); GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); // Éclairage correct pour shaders GlStateManager.enableLighting(); RenderHelper.enableStandardItemLighting(); GlStateManager.enableRescaleNormal(); // Active la lightmap pour les shaders mc.entityRenderer.enableLightmap(); // Position de rendu interpolée double px = player.lastTickPosX + (player.posX - player.lastTickPosX) * partialTicks; double py = player.lastTickPosY + (player.posY - player.lastTickPosY) * partialTicks; double pz = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * partialTicks; GlStateManager.translate( px - mc.getRenderManager().viewerPosX, py - mc.getRenderManager().viewerPosY, pz - mc.getRenderManager().viewerPosZ ); // Rendu du joueur sans la tête Render<?> render = mc.getRenderManager().getEntityRenderObject(player); if (render instanceof RenderPlayer) { RenderPlayer renderPlayer = (RenderPlayer) render; boolean oldHeadHidden = renderPlayer.getMainModel().bipedHead.isHidden; boolean oldHeadwearHidden = renderPlayer.getMainModel().bipedHeadwear.isHidden; renderPlayer.getMainModel().bipedHead.isHidden = true; renderPlayer.getMainModel().bipedHeadwear.isHidden = true; setArmorHeadVisibility(renderPlayer, false); renderPlayer.doRender(player, 0, 0, 0, player.rotationYaw, partialTicks); renderPlayer.getMainModel().bipedHead.isHidden = oldHeadHidden; renderPlayer.getMainModel().bipedHeadwear.isHidden = oldHeadwearHidden; setArmorHeadVisibility(renderPlayer, !oldHeadwearHidden); } // Nettoyage post rendu mc.entityRenderer.disableLightmap(); GlStateManager.disableRescaleNormal(); } catch (Exception e) { // silent fail } finally { GlStateManager.popAttrib(); GlStateManager.popMatrix(); } }   Ty for your help. 
    • Item successfully registered, but there was a problem with the texture of the item, it did not insert and has just the wrong texture.     
    • Keep on using the original Launcher Run Vanilla 1.12.2 once and close the game Download Optifine and run optifine as installer (click on the optifine jar) Start the launcher and make sure the Optifine profile is selected - then test it again  
    • Hi everyone, I’m hoping to revisit an old version of Minecraft — specifically around Beta 1.7.3 — for nostalgia’s sake. I’ve heard you can do this through the official Minecraft Launcher, but I’m unsure how to do it safely without affecting my current installation or save files. Are there any compatibility issues I should watch out for when switching between versions? Would really appreciate any tips or advice from anyone who’s done this before! – Adam
  • Topics

×
×
  • Create New...

Important Information

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