
Pokecube Integration.
Thutmose opened this issue ยท 5 comments
Issue Description:
I generally try to get Pokecube compatible with as many mods as I can, and I would like to get it working with this one as well.
Questions:
Is there any way for me to tell when a mob is made from the powered spawner? to get it working for pokemobs, I need to call my init method after spawning (used to set initial exp, heatlth, stats, initiate moveset, etc), to ensure that it is properly randomized on spawn. this also applies to the soul viles made in the creative tab, though when capturing it works fine (i assume it reads the entity from nbt before/while spawning it)
Also on the soul viles, I would like to ensure that they cannot be used to pickup tame pokemobs, or at least somehow restrict it, as presently you can pick up pokemobs owned by other players fairly easily, and even those owned by trainers, which allows players to get pokemobs they shouldn't (ie take arceus from notch player, and put it in spawner, thereby spawn arceuses)
I would also like to get the farmer block working with berries, which are plantable, and some grow to trees, which then have pickable berries on them, and others grow a berry above themselves.
I would be willing to add all of this via my own compatiblity mod, but I need to what would be the appropriate way to go about doing the above.
I you want to double check your entities: EntityJoinWorldEvent
To set your entity's initial data: net.minecraft.entity.EntityLiving.onInitialSpawn(DifficultyInstance, IEntityLivingData)
(Note: This may be missing when spawning from a creative vial, ping if if it is, because that'd be a bug.) And yes, picked up entities are serialized to/from nbt.
To blacklist an entity, you can send an IMC "soulVial:blacklist:add" with the entity id to Ender IO. (see API or crazypants.enderio.EnderIO.processImc() for details) and there also is an IMC for blacklisting an entity for the Powered Spawner. There's nothing in place to stop tamed entity from being picked up, I'll look into this. It does make sense to limit pickup for vanilla tamed animals to their owner (and exposing an API in the process).
For the Farming Station: I'd recommend you implement one of the vanilla/Forge interfaces on your plants. The they'll work with all mods' farming machines. It should be no problem if the block that actually is changed is the fruit block above the stem block. See https://github.com/SleepyTrousers/EnderIO/tree/1.10/src/main/java/crazypants/enderio/machine/farm/farmers for a list of existing farmers. If that doesn't work for you, the PickableFarmer should do the trick, in which case I'd only need block and item IDs from you.
I'm ok with getting a specialized Farmer as a PR and actually prefer that. Less chance of breakage on our side.
Ahha, the code we used for initial setting was rather old, and didn't use onInitialSpawn, I will see about moving my stuff over to that, and it should solve the spawner issue.
On the soul vials for tame stuff, I use an IEntityOwnable (same interface the wolfs use), so checking if getOwnerId() is not null will say if it is tamed, and will work for any vanilla tame entity as well.
I didn't get around to actually testing my crops, they very well might work due to extending BlockCrops for the bottom part, I will look into it, the pickable farmer very well might work fine, since my berries are picked via left or right click.
I will see about getting a PR for the specialised farmer if necessary.
if (entity instanceof IEntityOwnable && ((IEntityOwnable) entity).getOwnerId() != null && !player.equals(((IEntityOwnable) entity).getOwner())
&& !PermissionAPI.hasPermission(player.getGameProfile(), permissionPickupOwned, new PlayerContext(player))) {
player.addChatMessage(new TextComponentString(EnderIO.lang.localize("soulvial.denied")));
return false;
}
So this should work for you?
that should work for mine, it also looks like it will work with my permissions mod too :D