Jump to content

Lycanite

Members
  • Posts

    35
  • Joined

  • Last visited

  • Days Won

    1

Lycanite last won the day on January 25 2020

Lycanite had the most liked content!

1 Follower

Converted

  • Gender
    Undisclosed
  • Personal Text
    Developer of Lycanites Mobs

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Lycanite's Achievements

Tree Puncher

Tree Puncher (2/8)

10

Reputation

  1. Hot Swapping in IntelliJ Idea with Forge 1.15.2 does not work, it takes forever to reload, the game freezes for several seconds and then the hot swap fails. In 1.12.2 I can hot swap with no issue and very quickly, I've also had success with hot swapping in 1.14.4 but I haven't touched 1.14.4 for a long time now. (I'm actively maintaining my mod across both 1.15.2 and 1.12.2 atm). I setup OpenJDK8 DCEVM which does work and allows for greater changes such as function changes, etc but this is still incredibly slow compared to hot swapping with or without DCEVM in 1.12.2 which makes modding in 1.15.2 very tedious. I don't use Eclipse so cannot test with that and my gradle config is mostly unchanged from 1.14.4 though I did recreate it from the 1.15.2 MDK download just to make sure with no difference. I've seen similar posts with no solution but people have mentioned running without gradle, if this is possible how would I set this up in Idea? Mod source: https://gitlab.com/Lycanite/LycanitesMobs
  2. Must have been a server side issue as I tried today and now it's working.
  3. I'm trying to update my mod from 1.51.1 to 1.15.2 but I'm getting this error: Could not find net.minecraftforge:forge:1.15.2-31.0.1_mapped_snapshot_20200125-1.15.1. Searched in the following locations: - file:/C:/Gradle/caches/forge_gradle/bundeled_repo/net/minecraftforge/forge/1.15.2-31.0.1_mapped_snapshot_20200125-1.15.1/forge-1.15.2-31.0.1_mapped_snapshot_20200125-1.15.1.pom - file:/C:/Gradle/caches/forge_gradle/bundeled_repo/net/minecraftforge/forge/1.15.2-31.0.1_mapped_snapshot_20200125-1.15.1/forge-1.15.2-31.0.1_mapped_snapshot_20200125-1.15.1.jar - https://files.minecraftforge.net/maven/net/minecraftforge/forge/1.15.2-31.0.1_mapped_snapshot_20200125-1.15.1/forge-1.15.2-31.0.1_mapped_snapshot_20200125-1.15.1.pom - https://files.minecraftforge.net/maven/net/minecraftforge/forge/1.15.2-31.0.1_mapped_snapshot_20200125-1.15.1/forge-1.15.2-31.0.1_mapped_snapshot_20200125-1.15.1.jar - https://libraries.minecraft.net/net/minecraftforge/forge/1.15.2-31.0.1_mapped_snapshot_20200125-1.15.1/forge-1.15.2-31.0.1_mapped_snapshot_20200125-1.15.1.jar - https://repo.maven.apache.org/maven2/net/minecraftforge/forge/1.15.2-31.0.1_mapped_snapshot_20200125-1.15.1/forge-1.15.2-31.0.1_mapped_snapshot_20200125-1.15.1.pom - https://repo.maven.apache.org/maven2/net/minecraftforge/forge/1.15.2-31.0.1_mapped_snapshot_20200125-1.15.1/forge-1.15.2-31.0.1_mapped_snapshot_20200125-1.15.1.jar Possible solution: - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html I've tried several mappings including: 20190719-1.14.3 which is included in the mdk download. I've also tried a fresh project from the mdk download and I get the same error (only with the 20190719-1.14.3 mappings of course). Dropping it back to 1.15.1 (1.15.1-30.0.51) works again and I can change mappings, etc so my gradle setup is working otherwise, just not for 1.15.2 versions (the 1.14.4 version of my mod is also working fine with gradle).
  4. I figured I'd post here after our PMs for other people who find this. There is a lot of custom code and renderers involved but my source is openly available here: https://gitlab.com/Lycanite/LycanitesMobs
  5. I haven't found a solution yet, it's still in my todo list!
  6. I have a custom mob spawner that locates structures to spawn mobs around, if a world has no structures spawning or nearby (can happen in the Nether when there are no Nether Fortresses nearby), calling world.findNearestStructure just hangs infinitely. To further test this, I created a new world with structures disabled and used the /locate command for a village, this also caused the game to hang.
  7. So I've attempted to add new Stat Types in 1.14.3, this is through total guess work though as I can't seem to find anything about them or if they're even doable yet. I've created a new StatType like so: Registry<ResourceLocation> statRegistry = new SimpleRegistry<>(); StatType<ResourceLocation> statType = new StatType<>(statRegistry); statType.setRegistryName(modid, "stat_type_name"); And then registered it like so: @SubscribeEvent public void registerStats(RegistryEvent.Register<StatType<?>> event) { event.getRegistry().register(statType); } Finally I add the stat to the player like this: player.addStat(statType.get(new ResourceLocation(modid, "stat_name"), IStatFormatter.DEFAULT), 1); This seems to register fine (confirmed that the registry event is fired, etc) but i get this exception on trying to add the stat to the player: java.lang.NullPointerException: Unexpected error at net.minecraft.stats.Stat.locationToKey(SourceFile:29) ~[forge-1.14.3-27.0.22_mapped_snapshot_20190625-1.14.3.jar:?] {} at net.minecraft.stats.Stat.buildName(SourceFile:23) ~[forge-1.14.3-27.0.22_mapped_snapshot_20190625-1.14.3.jar:?] {} at net.minecraft.stats.Stat.<init>(SourceFile:16) ~[forge-1.14.3-27.0.22_mapped_snapshot_20190625-1.14.3.jar:?] {} at net.minecraft.stats.StatType.lambda$get$0(StatType.java:25) ~[forge-1.14.3-27.0.22_mapped_snapshot_20190625-1.14.3.jar:?] {} at java.util.Map.computeIfAbsent(Map.java:957) ~[?:1.8.0_162] {} at net.minecraft.stats.StatType.get(StatType.java:24) ~[forge-1.14.3-27.0.22_mapped_snapshot_20190625-1.14.3.jar:?] {} I have no idea if this is even remotely correct but it was what I figured out from look at the vanilla classes and comparing things to other registries. Looking at StatType it looks like it uses an empty SimpleRegistry in it's constructor and adds any stats dynamically to it via get() but this is just my guess.
  8. I'm having exactly the same problem now. My Mobs are showing up great but my projectiles do not show up on the client at all, anything spawned via SSpawnMobPacket is great but SSpawnObjectPacket is not showing. I use an EntityFactory object rather than the entity constructors and that also isn't being called by SSpawnObjectPacket on the client.
  9. Ahah! That was it! My stupidity using the wrong event bus! I'll look into reorganizing how registries are handled, thanks a bunch for the help!
  10. Ah I see, I've moved my event registration into the main mod class' constructor, but the same issue is happening. Before moving them I was still getting log output from my event listeners though. I've also tested with using @Mod.EventBusSubscriber directly on the class that registers entities with the same issue also.
  11. I've updated the post and Gitlab with the Runtime exceptions added and constructors stored to help performance. I've also tested without using the custom Entity Factory with the same results.
  12. Ohh I see what you mean sorry, I've added a RuntimeException to make it crash if that does happen.
  13. It's currently done via reflection because each entity is defined via a JSON file which provides the class as a string, this is just temporary though, as I later plan on changing this so that I just have one generic entity class instead that is based on the json, but it's going to take a while for me to create AI goals, control behavior, etc all from JSON definitions but it's my end goal there. I've fixed the factory, when first updating from 1.12.2 I thought the factory had to spawn and forgot to remove that, so that is corrected now. For the exception, this is just temporary and will go away once I finish the generic entity class in the future, for now I'm just trying to get entities showing up in the world, I can return a fallback entity instead of null, but getConstructor requires a try catch, what I'll do instead is pre load the constructor instance when the json is being parsed at startup, that should solve performance and eliminates the try catch. Either way, all entity classes involved always have that constructor available so that exception will never show up and shouldn't relate to the problem, but thanks for the feedback.
  14. I understand Forge for 1.14 is still beta but I've searched around a lot and can't find how far along it is for modded entities so figured I'd ask about this problem I'm having here, if anyone has modded entities going in 1.14.2 perhaps you can show me where I'm going wrong, etc. If it is just a Forge beta thing then that's all good, I know I can just chill for a bit until things are ready. So I register my Entity Types like this: Gitlab Link @SubscribeEvent public void registerEntities(RegistryEvent.Register<EntityType<?>> event) { LycanitesMobs.logDebug("Creature", "Forge registering all " + this.creatures.size() + " creatures..."); for(CreatureInfo creatureInfo : this.creatures.values()) { event.getRegistry().register(creatureInfo.getEntityType()); } } I build them like this: Gitlab Link public EntityType getEntityType() { if(this.entityType == null) { EntityType.Builder entityTypeBuilder = EntityType.Builder.create(EntityFactory.getInstance(), this.peaceful ? EntityClassification.CREATURE : EntityClassification.MONSTER); //entityTypeBuilder.setCustomClientFactory(EntityFactory.getInstance().createOnClientFunction); Client Factory never called. entityTypeBuilder.setTrackingRange(this.isBoss() ? 32 : 10); entityTypeBuilder.setUpdateInterval(3); entityTypeBuilder.setShouldReceiveVelocityUpdates(false); entityTypeBuilder.size((float)this.width, (float)this.height); entityTypeBuilder.disableSerialization(); this.entityType = entityTypeBuilder.build(this.getName()); this.entityType.setRegistryName(this.modInfo.modid, this.getName()); EntityFactory.getInstance().addEntityType(this.entityType, this.entityClass); } return this.entityType; } My factory's create function is this: Gitlab Link @Override public Entity create(EntityType entityType, World world) { LycanitesMobs.logDebug("", "Spawning entity: " + this.entityTypeConstrcutorMap.get(entityType).toString() + " Type: " + entityType.getName() + " Classification: " + entityType.getClassification()); // Name always shows pig! Class<? extends Entity> entityConstrcutor = this.entityTypeConstrcutorMap.get(entityType); try { Entity entity = entityConstrcutor.newInstance(entityType, world); world.addEntity(entity); return entity; } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e); } return null; } The problem I'm having is that on the client they always spawn as EntityPigs and immediately trigger a crash because the entity Data Manager is casting a Byte to a Bool, I'm assuming this is because on the server side the correct entity has spawned with a different set of Data manager keys: java.lang.ClassCastException: java.lang.Byte cannot be cast to java.lang.Boolean at net.minecraft.entity.AgeableEntity.getGrowingAge(AgeableEntity.java:71) ~[forge-1.14.2-26.0.33_mapped_snapshot_20190618-1.14.2-recomp.jar:?] {} at net.minecraft.entity.passive.AnimalEntity.livingTick(AnimalEntity.java:49) ~[forge-1.14.2-26.0.33_mapped_snapshot_20190618-1.14.2-recomp.jar:?] {} at net.minecraft.entity.LivingEntity.tick(LivingEntity.java:2178) ~[forge-1.14.2-26.0.33_mapped_snapshot_20190618-1.14.2-recomp.jar:?] {} at net.minecraft.entity.MobEntity.tick(MobEntity.java:308) ~[forge-1.14.2-26.0.33_mapped_snapshot_20190618-1.14.2-recomp.jar:?] {pl:accesstransformer:B} at net.minecraft.client.world.ClientWorld.func_217418_a(ClientWorld.java:167) ~[forge-1.14.2-26.0.33_mapped_snapshot_20190618-1.14.2-recomp.jar:?] {pl:accesstransformer:B,pl:runtimedistcleaner:A} Looking further into this, on both the client and server, when logging what's being registered, if I call getName or TranslationKey on the EntityType I always get back entity.minecraft.pig. Here's an example that is logged from here (which is called from getEntityType() posed above): [13:14:06.710] [modloading-worker-9/DEBUG] [co.ly.LycanitesMobs/]: [LycanitesMobs] [Debug] [] Adding entity: class com.lycanitesmobs.core.entity.creature.EntityArisaur Type: TranslatableComponent{key='entity.minecraft.pig', args=[], siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}} Classification: MONSTER Here the entity class being registered is correct and each EntityType for each entity I'm registering is definitely unique, but they call still translate as a pig. I can also confirm that my Entity Factory is working correctly server side but it is never called client side, I've also tried using the Custom Client Factory, but it is never called by the client as it seems the client is always treating the EntityType as the default vanilla PIG EntityType instance. Also here is an example of one of my DataManager entries: protected static final DataParameter<Byte> TARGET = EntityDataManager.createKey(EntityCreatureBase.class, DataSerializers.BYTE); I've made sure that I always provide the correct entity class when creating a key and I'm also assuming that this is the byte sent from the server that the client is trying to cast into a boolean as it is the first DataParameter I register for all entities in my mod. The entire mod is available on Gitlab if anyone wants to look further into things.
×
×
  • Create New...

Important Information

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