Jump to content

[1.8 and 1.9] Having a few issues on 1.9 and 1.8


NovaViper

Recommended Posts

Don't call

ModelBakery.registerItemVariants

for the override models, they will automatically be loaded.

 

This error looks like it's caused by Forge trying to load

tetracraft:item/ballisticBow_pulling_1

, which is trying to load the parent model

tetracraft:item/ballisticBow

, which is trying to load the override model

tetracraft:item/ballisticBow_pulling_1

. If you allow the override models to be loaded automatically, you won't run into any circular reference errors.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

  • Replies 83
  • Created
  • Last Reply

Top Posters In This Topic

Don't call

ModelBakery.registerItemVariants

for the override models, they will automatically be loaded.

 

This error looks like it's caused by Forge trying to load

tetracraft:item/ballisticBow_pulling_1

, which is trying to load the parent model

tetracraft:item/ballisticBow

, which is trying to load the override model

tetracraft:item/ballisticBow_pulling_1

. If you allow the override models to be loaded automatically, you won't run into any circular reference errors.

 

That did the trick, thanks! Also, I'll make a note of that.

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Link to comment
Share on other sites

Hey Choonster, I got another question, what in the world is Loot Tables? I want to make my entity drop something, but it wants a Loot Table

 

See the wiki page. They're basically a more flexible replacement for

ChestGenHooks

/

WeightedRandomChestContent

that are also used for entity drops.

 

Forge hasn't added any hooks for loot tables yet, but you can still register your own using the vanilla classes. You can see my loot table registration class here and a loot table here.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Hey Choonster, I got another question, what in the world is Loot Tables? I want to make my entity drop something, but it wants a Loot Table

 

See the wiki page. They're basically a more flexible replacement for

ChestGenHooks

/

WeightedRandomChestContent

that are also used for entity drops.

 

Forge hasn't added any hooks for loot tables yet, but you can still register your own using the vanilla classes. You can see my loot table registration class here and a loot table here.

 

Thanks! How would this work if I want to add a custom condition, like if the player has tamed the entity and it died?

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Link to comment
Share on other sites

Thanks! How would this work if I want to add a custom condition, like if the player has tamed the entity and it died?

 

It looks like you'll need to create an

EntityProperty

to test whether the entity has been tamed. You'll also need to create its

EntityProperty.Serializer

and register an instance of it with

EntityPropertyManager.registerProperty

.

 

In your loot table, use the

entity_properties

condition with your property.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Thanks! How would this work if I want to add a custom condition, like if the player has tamed the entity and it died?

 

It looks like you'll need to create an

EntityProperty

to test whether the entity has been tamed. You'll also need to create its

EntityProperty.Serializer

and register an instance of it with

EntityPropertyManager.registerProperty

.

 

In your loot table, use the

entity_properties

condition with your property.

 

How do I make Custom Entity Properties? I never made those before, mostly did datawatchers for certain properties like gender and evo stages.

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Link to comment
Share on other sites

How do I make Custom Entity Properties? I never made those before, mostly did datawatchers for certain properties like gender and evo stages.

 

You need to implement

EntityProperty

, look at

EntityOnFire

for an example.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Ok so I made the entity property class but I'm not sure on how to acutally register it for the entity to use (And test to see if it works)

 

Did you create and register the

Serializer

?

 

Look at the pig loot table to see how it uses the

on_fire

property to determine whether the meat should be cooked.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Hm, I having a bit of an issue with my loot table, the item I made isn't dropping. Also the contionus bow I made, not all of the textures is being shown, it just shows the first two but not the last one.

 

The Source for this issue is in this commit

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Link to comment
Share on other sites

EntityTamed

is actually testing whether the entity is burning rather than whether it's tamed. You need to check whether the entity is tameable (

entity instanceof EntityTameable

) and whether it's tamed (

((EntityTameable) entity).isTamed()

) and then compare that to the expected result.

 

Your

ballisticBow

model is using

pull

instead of

tetracraft:pull

for the

ballisticBow_pulling_2

override model's condition.

 

You seem to have two copies of your main class and registration/initialisation classes, one in the

novaviper.tetracraft.main

package and one in the

novaviper.tetracraft.common.inti

package (should that be

init

rather than

inti

?). Delete the outdated copy.

 

I'm not too sure why it's not dropping your item.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Oh yeah, sorry about leaving that main package there, and I fixed that typo in the bow json and package. I did the EntityTamed like this

 

package novaviper.tetracraft.common.entity.properties;

import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonElement;
import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSerializationContext;
import net.minecraft.entity.Entity;
import net.minecraft.entity.passive.EntityTameable;
import net.minecraft.util.JsonUtils;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.storage.loot.conditions.EntityHasScore;
import net.minecraft.world.storage.loot.properties.EntityProperty;
import novaviper.tetracraft.common.entity.EntityModTameable;

import java.util.Random;

/**
* Created by NovaViper on 4/11/2016.
* Class Purpose: Declares Entity Property for Tamed Mod Entities
*/
public class EntityTamed implements EntityProperty
{
private final boolean isTamed;

public EntityTamed(boolean isTamedIn)
{
	this.isTamed = isTamedIn;
}

public boolean testProperty(Random random, Entity entityIn)
{
	if(entityIn instanceof EntityTameable){
		EntityTameable entityTameable = (EntityTameable)entityIn;
		if(entityTameable.isTamed()){
			return this.isTamed == true;
		}else{
			return this.isTamed == false;
		}
	}else{
		return this.isTamed == false;
	}
}

public static Serializer getSerializer(){
	return new Serializer();
}

public static class Serializer extends EntityProperty.Serializer<EntityTamed>
{
	protected Serializer()
	{
		super(new ResourceLocation("is_tamed"), EntityTamed.class);
	}

	public JsonElement serialize(EntityTamed property, JsonSerializationContext serializationContext)
	{
		return new JsonPrimitive(Boolean.valueOf(property.isTamed));
	}

	public EntityTamed deserialize(JsonElement element, JsonDeserializationContext deserializationContext)
	{
		return new EntityTamed(JsonUtils.getBoolean(element, "is_tamed"));
	}
}
}

 

How do I acutally register this?

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Link to comment
Share on other sites

You should include your mod ID in your property name

ResourceLocation

to avoid conflicts with other mods defining similar properties.

 

I already explained how to register your property:

You'll also need to create its

EntityProperty.Serializer

and register an instance of it with

EntityPropertyManager.registerProperty

.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Caused by: java.lang.IllegalArgumentException: Can't re-register entity property name minecraft:is_tamed

at net.minecraft.world.storage.loot.properties.EntityPropertyManager.registerProperty(EntityPropertyManager.java:19) ~[EntityPropertyManager.class:?]

at novaviper.tetracraft.common.entity.EntityTerrakon.<init>(EntityTerrakon.java:43) ~[EntityTerrakon.class:?]

 

The property should be registered once in preInit, not every time the

EntityTerrakon

constructor is called.

 

As I said before, you should include your mod ID in your property name

ResourceLocation

to avoid conflicts with other mods defining similar properties.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Sorry for not responding in a while and I did get that error fixed, I have another question relating with commands. Is it possible to make sub-commands like

/tetracraft admin tame

and

/tetracraft help

? And for the admin commands, only restrict them to the owner/admin while leaving the other ones like

/tetracraft help

to be used by everyone?

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Link to comment
Share on other sites

The existing command system has no concept of sub-commands, but you should be able to create an

ICommand

that implements

ICommandManager

by wrapping your own implementation of

CommandHandler

. This should allow you to register sub-commands and re-use the existing permissions system.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

It's probably easiest to extend

CommandHandler

and implement

ICommand

, since

CommandHandler

provides a lot more functionality for you than

CommandBase

does (most of the useful methods from

CommandBase

are static, so you can use them from any implementation of

ICommand

).

 

Register this class like a normal command, then register your sub-commands with this class.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Should I make the class abstract? Also.. Should I override the

exeuteCommand

methods in

CommandHandler

and place the mod id here:

        if (rawCommand.startsWith("/")) <<<<<
        {
            rawCommand = rawCommand.substring(1);
        }

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Link to comment
Share on other sites

You need to create an instance of this class to register it as a command, so don't make it abstract.

 

You don't need to override

CommandHandler#executeCommand

, it should only ever be called from within the same class.

 

Implement

ICommand#execute

to join the arguments array into a single string and call

executeCommand

with it.

 

/tetracraft foo bar

will execute the

/tetracraft

command, which will pass

foo bar

to

executeCommand

. This will execute the

foo

sub-command with

bar

as its argument.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

I've actually implemented this myself now, I did it slightly differently than I originally suggested (which was mostly off the top of my head).

 

The command itself extends

CommandBase

and has a field storing an instance of a nested class that extends

CommandHandler

to manage the sub-commands.

 

It overrides

ICommand#execute

to call

ICommandManager#executeCommand

and

ICommand#getTabCompletionOptions

to call

ICommandManager#getTabCompletionOptions

, both on the sub-command manager.

 

It overrides

ICommand#isUsernameIndex

to check if the index is greater than 0 and the first argument is a valid sub-command. It then creates a copy of the arguments array without the first argument and calls

ICommand#isUsernameIndex

on the sub-command with this new array and the index minus 1.

 

When the sub-command manager is created, it calls

ModCommands.registerSubCommands

to register the sub-commands. These are just regular commands that return usage text starting with

/testmod3 command

instead of

/command

.

 

You can see my implementation here.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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

    • S1288POKER Rasakan sensasi bertaruh Mix Parlay yang tak terlupakan dengan bonus fantastis di situs judi terpercaya kami! Kami menawarkan bonus Mix Parlay terbesar di Asia dengan berbagai pilihan taruhan dan minimal deposit rendah. Dapatkan bonus hingga jutaan rupiah untuk taruhan Mix Parlay Anda dan nikmati keuntungan berlipat ganda.
    • Situs Akun Pro Peru adalah pilihan terbaik bagi Anda yang mencari situs terpercaya untuk bermain slot dan taruhan bola. Berikut adalah beberapa alasan mengapa Anda harus memilih Situs Akun Pro Peru: Slot Populer Kami menyajikan koleksi slot yang populer dan menarik dengan berbagai tema yang beragam. Dari slot klasik hingga slot video modern, setiap pemain dapat menemukan permainan favorit mereka dengan mudah. Taruhan Bola Terpercaya Selain slot, kami juga menyediakan taruhan bola dengan pasaran terlengkap dan odds yang kompetitif. Dengan berbagai pertandingan dan liga yang tersedia, Anda dapat menikmati pengalaman taruhan bola yang seru dan menguntungkan. Transaksi Mudah dengan Bank BTN Kami menyediakan layanan transaksi yang mudah dan aman melalui Bank BTN. Dengan dukungan dari sistem pembayaran yang terpercaya, Anda dapat melakukan deposit dan penarikan dana dengan cepat dan tanpa hambatan.  
    • Ngamenslot adalah pilihan terbaik bagi Anda yang mencari situs terpercaya untuk bermain slot dan taruhan bola. Berikut adalah beberapa alasan mengapa Anda harus memilih Ngamenslot: Kombinasi Slot & Bola Kami menyajikan kombinasi terbaik antara permainan slot yang seru dan taruhan bola yang menegangkan. Dengan pilihan permainan yang beragam, setiap pemain dapat menikmati pengalaman bermain yang unik dan menyenangkan. Transaksi Mudah melalui Bank Ekonomi Kami menyediakan layanan transaksi yang mudah dan aman melalui Bank Ekonomi. Dengan dukungan dari sistem pembayaran yang terpercaya, Anda dapat melakukan deposit dan penarikan dana dengan cepat dan tanpa hambatan. Terpercaya dan Terjamin Ngamenslot telah terbukti sebagai situs terpercaya dengan ribuan pemain yang puas. Kami mengutamakan keamanan dan kenyamanan para pemain, sehingga Anda dapat bermain dengan tenang dan fokus pada permainan.  
    • Tambang88 adalah pilihan terbaik bagi Anda yang mencari pengalaman bermain slot gacor dengan transaksi mudah menggunakan Bank Sinarmas. Berikut adalah beberapa alasan mengapa Anda harus memilih Tambang88: Raja Slot Gacor Kami merupakan raja slot gacor dengan koleksi permainan terbaik yang menawarkan kesenangan bermain dan peluang kemenangan besar. Dengan fitur-fitur unggulan dan tema-tema menarik, setiap putaran permainan akan memberikan Anda pengalaman yang tak terlupakan. Transaksi Mudah dengan Bank Sinarmas Kami menyediakan layanan transaksi mudah melalui Bank Sinarmas untuk kenyamanan dan keamanan Anda. Dengan proses yang cepat dan efisien, Anda dapat melakukan deposit dan penarikan dana dengan lancar dan tanpa hambatan. Profesional dan Menguntungkan Tambang88 mengutamakan profesionalitas dalam memberikan layanan kepada para pemainnya. Kami juga menawarkan kesempatan untuk meraih keuntungan yang besar dengan jackpot dan hadiah-hadiah menarik lainnya.    
    • TRIK POLA SL0T GAC0R MAHJONG WAYS 1 DAN 2 HARI INI Sekarang Anda dapat meningkatkan peluang Bermain dengan langsung menggunakan situs resmi dari permainan Mahjong (PG SOFT). Cukup daftar dan siapkan hanya mulai dari 50K hingga 200K, Anda sudah memiliki peluang untuk memenangkan hadiah besar. Jika tidak memiliki dana sebanyak itu, Anda dapat mencoba dengan dana 50K dan memanfaatkan bonus member baru untuk menambah modal. Berikut adalah Situs Resmi Mahjong yang dapat Anda kunjungi: >> SITUS RESMI MAHJONG YANG TERBUKTI << >> SITUS RESMI MAHJONG YANG TERBUKTI << Setelah mendaftar, Anda dapat menggunakan pola yang sering saya gunakan: 🔥 25 Manual TURBO OFF 🔥 15 Manual TURBO ON 🔥 30 Auto TURBO OFF 🔥 10 Manual TURBO ON Pola ini biasanya memberikan hasil yang konsisten.
  • Topics

×
×
  • Create New...

Important Information

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