Jump to content

Recommended Posts

Posted

Since the Moderator Diesieben gave me a warning:

  On 10/2/2016 at 4:52 PM, diesieben07 said:

Stop hijacking this thread. Make your own thread if you have a problem. This is a warning.

I think that's a bit rude because i didn't wanted to make a double thread.

There are forums that give you a warning for that!

So i started my own thread even when it's the same problem!

 

So to start:

 

I have everything set up fine for an item but when i start the game my item has no texture.

The console doesn't show any error.

 

I figured already out that there is something wrong with my proxy.

Somehow the method in the proxy is not being called even when i do call it.

 

Client proxy:

public class ClientProxy implements CommonProxy{

@Override
public void init() {

	ModItems.registerRenders();
	System.out.println("renders have been registered");

}	

}

 

my main class:

 

  Reveal hidden contents

 

Posted

Well then i apologize for being rude and hijacking, wich was not my intention after all.

Still i think you could have said/asked this nice without giving a warning.

I'm trying to be nice to other people and i expect the same from others too.

But i apologized now, let's get over this now and stick to the real problem.

 

 

the ModItems class:

 

public class ModItems {

public static Item cheese;

public static void init(){

	cheese = new ItemCheese();

}

public static void register(){
	GameRegistry.register(cheese);

}

public static void registerRenders(){
	registerRender(cheese);

}

private static void registerRender(Item item){
	ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(),"inventory"));
	//Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(item.getRegistryName(),"inventory"));
}

}

 

By testing i mean this:

 

public class ClientProxy implements CommonProxy{

@Override
public void init() {

	ModItems.registerRenders();
	System.out.println("renders have been registered");

}	

}

i don't see that message so i guess the method init is not working/ being called!

But and just for testing purpose, i moved

ModItems.registerRenders();

over to the main class in the preInit to see if the problem is something else.

This however does work like it should. So that means something is not right with the proxies, at least i think that is.

 

I did a tutorial from MrCrayFish on youtube, because he explains all the things too  so people understands it and it isn't just copy paste.

I did exactly what he did (i think) and it works for him but not for me. I did a small change with the ModelLoader,but even when i use the old way it doesn't work.

I watched the tutorial over and over again to see what i missed or did wrong, but i can't see the problem.

Here is the tutorial if you want to see for yourself:

Posted

alright here is the reference class:

 

public class References {
public static final String MOD_ID = "tem";
public static final String NAME = "Tim's Expansion Mod";
public static final String VERSION = "1.0.0";
public static final String ACCEPTED_VERSIONS = "[1.10]";

public static final String CLIENT_PROXY_CLASS = "winnetrie.tem.proxy.ClientProxy";
public static final String SERVER_PROXY_CLASS = "winnetrie.tem.proxy.ServerProxy";

public static enum temItems {
	CHEESE("cheese", "cheese");

	private String unlocalizedName;
	private String registryName;

	temItems(String unlocalizedName, String registryName){
		this.unlocalizedName = unlocalizedName;
		this.registryName = registryName;

	}
	public String getUnlocalizedName(){
		return unlocalizedName;
	}
	public String getRegistryName(){
		return registryName;
	}
}

}

Posted

Sorry if I'm treading on toes here... but if you're using ModelLoader shouldn't it be called in the preInit?

 

My CommonProxy setups like so:

public class CommonProxy {

    public void preInit(FMLPreInitializationEvent e) {
        BlockReg.load();
        ItemReg.load();
    }

    public void init(FMLInitializationEvent e) {

    }

    public void postInit(FMLPostInitializationEvent e) {

    }
}

And my ClientProxy like so:

public class ClientProxy extends CommonProxy {
    @Override
    public void preInit(FMLPreInitializationEvent e) {
        super.preInit(e);
        BlockRender.regRender();
        ItemRender.regRender();
    }

    @Override
    public void init(FMLInitializationEvent e) {
        super.init(e);
    }

    @Override
    public void postInit(FMLPostInitializationEvent e) {
        super.postInit(e);
    }
}

With the main mod section like so:

@Mod.EventHandler
    public void preInit(FMLPreInitializationEvent e) {
        this.proxy.preInit(e);

        MinecraftForge.EVENT_BUS.register(this);
        FMLCommonHandler.instance().bus().register(this);

        path = e.getModConfigurationDirectory().getAbsolutePath() + File.separator + "NihilEnim" + File.separator;
        config = new Configuration(new File(path + "NihilEnim.cfg"));

        NihilEnimWorld.configure(config);

        if(config.hasChanged()) config.save();
    }

    @Mod.EventHandler
    public void init(FMLInitializationEvent e) {
        this.proxy.init(e);
    }

    @Mod.EventHandler
    public void postInit(FMLPostInitializationEvent e) {
        this.proxy.postInit(e);
    }

    @SubscribeEvent
    public void onWorldLoad(WorldEvent.Load e) {
        if(!e.getWorld().isRemote && e.getWorld() instanceof WorldServer) {
            NihilEnimWorld.load(e.getWorld());
        }
    }

Another thing to bare in mind is if your items aren't set to a Creative Tab, you won't find them anywhere. They need a Registry name as well, a json file to determine textures and scale, and only then can you say for certain that you're not getting errors.

Posted

I doesn't matter how you call your methods, just give it logical names or whatever you like.

Also you don't need to this

public void preInit(FMLPreInitializationEvent e) 

again in your proxies.

That's already done in your main file.

Yes i haven't made a creative tab, but that has nothing to do with it.

I use the command to get the item, it only has no texture.

If i render it directly in the main file, wich should never be done ofc i know, it works.

So i'm wondering why it has no texture when i call the proxy?

 

EDITOmg .....i just found the problem......this is such a stupid mistake...really

The problem is at this line:

 

@SidedProxy(serverSide = References.CLIENT_PROXY_CLASS, clientSide = References.SERVER_PROXY_CLASS)
public static CommonProxy proxy;

I'm searching the problem the whole day....

Posted
  On 10/2/2016 at 9:11 PM, diesieben07 said:

You should investigate why your proxy method does not seem to be called. I suspected it might be a mistake in the constants in your

References

class, which is not the case. I recommend you use the debugger to find out why it is not calling the method.

 

No i found the problem i edited my previous post

Posted

Yeah mostly it is just a small thing. A typo!

 

my clientproxy looks now like this:

public class ClientProxy implements CommonProxy{

@Override
public void ItemRenderRegistry() {

	registerRender(ModItems.cheese);
	//ModItems.registerRenders();
	System.out.println("renders have been registered");
}	


private static void registerRender(Item item){
	ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(),"inventory"));
	//Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(item.getRegistryName(),"inventory"));
}

}

 

@swordkorn

I wouldn't know why implementing it is wrong for you?

 

extends is for extending a class

implements is for implementing an interface

 

As far as i know you can only extend 1 class but you can implement as many interfaces you want.

Implementing interfaces can be very usefull.

Is it needed for what the use i have? No absolutely not, extending would be sufficient.

Perhaps for more advanced modding you would probebly need to implement multiple interfaces.

Posted

Well the CommonProxy handles all the main behaviours for both Server and Client side.

 

Therefore making the Client and Server Proxies extend it will call on that specific side.

 

At least... that's how I've always seen it anyway. Feel free to correct me if I'm wrong, but you are correct. Implementing a class is generally used for interfaces.

 

Extending a class means it will inherit all the behaviours of that class. Implementing an Interface allows access to the methods and will call an individual instance of your class type with those methods implemented.

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

    • New users at Temu receive a $100 discount on orders over $100 Use the code [aci789589] during checkout to get Temu Coupon Code $100 off For New Users. Yes, Temu offers $100 off coupon code “aci789589” for first-time users. Temu 100% Off coupon code "aci789589" will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. Yes, Temu offers $100 off coupon code “aci789589” for first-time users. You can get a$100 bonus plus 30% off any purchase at Temu with the$100 Coupon Bundle at Temu if you sign up with the referral code [aci789589] and make a first purchase of$50 or more. The Temu $100 Off coupon code (aci789589) will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. Yes Temu offers $100 Off Coupon Code “aci789589” for First Time Users. Yes, Temu offers $100 off coupon code {aci789589} for first-time users. You can get a $100 bonus plus 100% off any purchase at Temu with the $100 Coupon Bundle if you sign up with the referral code [aci789589] and make a first purchase of $100 or more. If you are who wish to join Temu, then you should use this exclusive Temu coupon code $100 off (aci789589) and get $100 off on your purchase with Temu. You can get a $100 discount with Temu coupon code {aci789589}. This exclusive offer is for existing customers and can be used for a $100 reduction on your total purchase. Enter coupon code {aci789589} at checkout to avail of the discount. You can use the code {aci789589} to get a $100 off Temu coupon as a new customer. Apply this Temu coupon code $100 off (aci789589) to get a $100 discount on your shopping with Temu. If you’re a first-time user and looking for a Temu coupon code $100 first time user(aci789589) then using this code will give you a flat $100 Off and a 90% discount on your Temu shopping. Temu $100% Off Coupon Code "aci789589" will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. Temu coupon code$100off-{aci789589} Temu coupon code -{aci789589} Temu coupon code$50 off-{aci789589} Temu Coupon code [aci789589] for existing users can get up to 50% discount on product during checkout. Temu Coupon Codes for Existing Customers-aci789589 Temu values its loyal customers and offers various promo codes, including the Legit Temu Coupon Code (aci789589]) or (aci789589), which existing users can use. This ensures that repeat shoppers can also benefit from significant discounts on their purchases. Keep an eye out for special promotions and offers that are periodically available to enhance your shopping experience.
    • New users at Temu receive a $100 discount on orders over $100 Use the code [aci789589] during checkout to get Temu Coupon Code $100 off For New Users. Yes, Temu offers $100 off coupon code “aci789589” for first-time users. Temu 100% Off coupon code "aci789589" will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. Yes, Temu offers $100 off coupon code “aci789589” for first-time users. You can get a$100 bonus plus 30% off any purchase at Temu with the$100 Coupon Bundle at Temu if you sign up with the referral code [aci789589] and make a first purchase of$50 or more. The Temu $100 Off coupon code (aci789589) will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. Yes Temu offers $100 Off Coupon Code “aci789589” for First Time Users. Yes, Temu offers $100 off coupon code {aci789589} for first-time users. You can get a $100 bonus plus 100% off any purchase at Temu with the $100 Coupon Bundle if you sign up with the referral code [aci789589] and make a first purchase of $100 or more. If you are who wish to join Temu, then you should use this exclusive Temu coupon code $100 off (aci789589) and get $100 off on your purchase with Temu. You can get a $100 discount with Temu coupon code {aci789589}. This exclusive offer is for existing customers and can be used for a $100 reduction on your total purchase. Enter coupon code {aci789589} at checkout to avail of the discount. You can use the code {aci789589} to get a $100 off Temu coupon as a new customer. Apply this Temu coupon code $100 off (aci789589) to get a $100 discount on your shopping with Temu. If you’re a first-time user and looking for a Temu coupon code $100 first time user(aci789589) then using this code will give you a flat $100 Off and a 90% discount on your Temu shopping. Temu $100% Off Coupon Code "aci789589" will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. Temu coupon code$100off-{aci789589} Temu coupon code -{aci789589} Temu coupon code$50 off-{aci789589} Temu Coupon code [aci789589] for existing users can get up to 50% discount on product during checkout. Temu Coupon Codes for Existing Customers-aci789589 Temu values its loyal customers and offers various promo codes, including the Legit Temu Coupon Code (aci789589]) or (aci789589), which existing users can use. This ensures that repeat shoppers can also benefit from significant discounts on their purchases. Keep an eye out for special promotions and offers that are periodically available to enhance your shopping experience.
    • Both Ars Nouveau and Chaos Awakens require a range of geckolib versions, and the build you sent is outside the range. Ars Nouveau has an update, but Chaos Awakens doesn't, which means I can't use the build you sent. Is there any other way to fix the crash?
    • New users at Temu receive a $100 discount on orders over $100 Use the code [aci789589] during checkout to get Temu Coupon Code $100 off For New Users. Yes, Temu offers $100 off coupon code “aci789589” for first-time users. Temu 100% Off coupon code "aci789589" will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. Yes, Temu offers $100 off coupon code “aci789589” for first-time users. You can get a$100 bonus plus 30% off any purchase at Temu with the$100 Coupon Bundle at Temu if you sign up with the referral code [aci789589] and make a first purchase of$50 or more. The Temu $100 Off coupon code (aci789589) will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. Yes Temu offers $100 Off Coupon Code “aci789589” for First Time Users. Yes, Temu offers $100 off coupon code {aci789589} for first-time users. You can get a $100 bonus plus 100% off any purchase at Temu with the $100 Coupon Bundle if you sign up with the referral code [aci789589] and make a first purchase of $100 or more. If you are who wish to join Temu, then you should use this exclusive Temu coupon code $100 off (aci789589) and get $100 off on your purchase with Temu. You can get a $100 discount with Temu coupon code {aci789589}. This exclusive offer is for existing customers and can be used for a $100 reduction on your total purchase. Enter coupon code {aci789589} at checkout to avail of the discount. You can use the code {aci789589} to get a $100 off Temu coupon as a new customer. Apply this Temu coupon code $100 off (aci789589) to get a $100 discount on your shopping with Temu. If you’re a first-time user and looking for a Temu coupon code $100 first time user(aci789589) then using this code will give you a flat $100 Off and a 90% discount on your Temu shopping. Temu $100% Off Coupon Code "aci789589" will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. Temu coupon code$100off-{aci789589} Temu coupon code -{aci789589} Temu coupon code$50 off-{aci789589} Temu Coupon code [aci789589] for existing users can get up to 50% discount on product during checkout. Temu Coupon Codes for Existing Customers-aci789589 Temu values its loyal customers and offers various promo codes, including the Legit Temu Coupon Code (aci789589]) or (aci789589), which existing users can use. This ensures that repeat shoppers can also benefit from significant discounts on their purchases. Keep an eye out for special promotions and offers that are periodically available to enhance your shopping experience.
    • New users at Temu receive a $100 discount on orders over $100 Use the code [aci789589] during checkout to get Temu Coupon Code $100 off For New Users. Yes, Temu offers $100 off coupon code “aci789589” for first-time users. Temu 100% Off coupon code "aci789589" will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. Yes, Temu offers $100 off coupon code “aci789589” for first-time users. You can get a$100 bonus plus 30% off any purchase at Temu with the$100 Coupon Bundle at Temu if you sign up with the referral code [aci789589] and make a first purchase of$50 or more. The Temu $100 Off coupon code (aci789589) will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. Yes Temu offers $100 Off Coupon Code “aci789589” for First Time Users. Yes, Temu offers $100 off coupon code {aci789589} for first-time users. You can get a $100 bonus plus 100% off any purchase at Temu with the $100 Coupon Bundle if you sign up with the referral code [aci789589] and make a first purchase of $100 or more. If you are who wish to join Temu, then you should use this exclusive Temu coupon code $100 off (aci789589) and get $100 off on your purchase with Temu. You can get a $100 discount with Temu coupon code {aci789589}. This exclusive offer is for existing customers and can be used for a $100 reduction on your total purchase. Enter coupon code {aci789589} at checkout to avail of the discount. You can use the code {aci789589} to get a $100 off Temu coupon as a new customer. Apply this Temu coupon code $100 off (aci789589) to get a $100 discount on your shopping with Temu. If you’re a first-time user and looking for a Temu coupon code $100 first time user(aci789589) then using this code will give you a flat $100 Off and a 90% discount on your Temu shopping. Temu $100% Off Coupon Code "aci789589" will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. Temu coupon code$100off-{aci789589} Temu coupon code -{aci789589} Temu coupon code$50 off-{aci789589} Temu Coupon code [aci789589] for existing users can get up to 50% discount on product during checkout. Temu Coupon Codes for Existing Customers-aci789589 Temu values its loyal customers and offers various promo codes, including the Legit Temu Coupon Code (aci789589]) or (aci789589), which existing users can use. This ensures that repeat shoppers can also benefit from significant discounts on their purchases. Keep an eye out for special promotions and offers that are periodically available to enhance your shopping experience.
  • Topics

×
×
  • Create New...

Important Information

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