Jump to content

FuzzyAcornIndustries

Members
  • Posts

    49
  • Joined

  • Last visited

  • Days Won

    1

FuzzyAcornIndustries last won the day on April 13 2024

FuzzyAcornIndustries had the most liked content!

Converted

  • Gender
    Undisclosed
  • Personal Text
    Faaantastic!

Recent Profile Visitors

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

FuzzyAcornIndustries's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. Thank you so much for replying to this. I tried out your recommendation in place of what I had and it fixed my problem! It helped me better understand streams/lambda and see what I had done wrong.
  2. Should I just try to change my Creative Tab item listing to suppress listing the Crop Block and just go with it generating an item block for it?
  3. Hello, thank you for reading! I am working with a custom crop that functions similar to potatoes in terms of drops. With what I have right now, when I run DataGen I get an error that says: java.lang.IllegalStateException: Created block loot tables for non-blocks: [pokemonmd:blocks/oranian_berry_crop] This seems to be a related to how I register my crop block here https://github.com/SpikybumJolteon/PokemonMD-1.20.1/blob/master/src/main/java/net/spikybumjolteon/pokemonmd/common/core/ModBlocks.java private static <T extends Block> RegistryObject<T> registerNoItem(String name, Supplier<? extends T> sup) { return BLOCKS.register(name, sup); } public static final RegistryObject<Block> ORANIAN_BERRY_CROP = registerNoItem("oranian_berry_crop", () -> new OranianBerryCropBlock(BlockBehaviour.Properties.copy(Blocks.POTATOES).noOcclusion().noCollission())); When I switch registration to this function, DataGen works just fine but it creates the block in Creative Mode Tab: private static <T extends Block> RegistryObject<T> register(String name, Supplier<? extends T> sup) { return register(name, sup, ModBlocks::itemDefault); } private static <T extends Block> RegistryObject<T> register(String name, Supplier<? extends T> sup, Function<RegistryObject<T>, Supplier<? extends Item>> itemCreator) { RegistryObject<T> ret = registerNoItem(name, sup); ITEMS.register(name, itemCreator.apply(ret)); return ret; } Here is the Loot Table DataGen I have https://github.com/SpikybumJolteon/PokemonMD-1.20.1/blob/master/src/main/java/net/spikybumjolteon/pokemonmd/datagen/ModLootTableProvider.java LootItemCondition.Builder lootitemcondition$builder = LootItemBlockStatePropertyCondition .hasBlockStateProperties(ModBlocks.ORANIAN_BERRY_CROP.get()) .setProperties(StatePropertiesPredicate.Builder.properties().hasProperty(OranianBerryCropBlock.AGE, OranianBerryCropBlock.MAX_AGE)); this.add(ModBlocks.ORANIAN_BERRY_CROP.get(), this.applyExplosionDecay(ModBlocks.ORANIAN_BERRY_CROP.get(), LootTable.lootTable().withPool(LootPool.lootPool() .add(LootItem.lootTableItem(ModItems.ORANIAN_BERRY.get()))) .withPool(LootPool.lootPool().when(lootitemcondition$builder) .add(LootItem.lootTableItem(ModItems.ORANIAN_BERRY.get()) .apply(ApplyBonusCount.addBonusBinomialDistributionCount(Enchantments.BLOCK_FORTUNE, 0.5714286F, 3)))) .withPool(LootPool.lootPool().when(lootitemcondition$builder).add(LootItem.lootTableItem(ModItems.REVIVE_SEED.get()) .when(LootItemRandomChanceCondition.randomChance(0.9F)))))); What is the proper way to register the Crop Block so the DataGen Loot Table will run while still omitting the block from Creative Tab? Apologies in advance if I am doing something wrong with this post or with Github, as I am very new to Github and only just returned to programming after 2 years since 1.15.
  4. I’m still trying to finalize my modification’s update from 1.12 to 1.15 so then I can finally update to the most current version; Apologies in advance for asking this of such an old version. I’m trying to find the proper way to do mob spawns via the biome dictionary in 1.15. What I have so far works with overworld spawns but it doesn’t work with Nether or with other biome mods like Biomes’o’plenty. Can I be given a proper direction to look at over how to do it correctly? What I have now was built from 1.12 era logic so probably not even worth showing.
  5. Oooh, thanks for clearing that up. Thanks, I definitely understand that is not something to try and do.
  6. What do you mean by "coremods"? Or are you referring to JEI as such?
  7. I created a furnace like TileEntity that performs its own unique processes with its unique recipes. It performs exactly as intended with item processing and GUI display. At this point I want to add this Custom Furnace and its recipes to be viewed like a Furnace in the Recipe Book. What can I look at to figure out how to do this?
  8. Oh thanks! This is very helpful and I played around with all of these and have a good idea of how the three events work. Now how do you actually store information to be used on a different event? I think my needs changed a little bit. One of my users recommends that I only have specific items come back with the player rather than the whole inventory. So how could I do this: First event: Find a specific item in inventory on death Second event: Delete that specific item from drop collection Third event: Place that specific item in player inventory As far as I could tell from testing, in the Clone event, the getOriginal() does not have a record of the player inventory.
  9. I am looking to create an item where if it is in the player's main inventory, when the player dies, they do not drop their items upon death. What would I look into to create this effect? Item being consumed on use could be useful but not required.
  10. I want to figure out how potions in crafting recipes are handled. I see a TippedArrowRecipe class for I assume doing this with Tipped Arrows. If this is what needs to be used, how do I deploy this in my mod? (such as registering it and making the Json recipe files) I would not mind referral to another mod that has done this so I could reference for doing/learning this.
  11. Thank you! I knew it was something absolutely simple. I just didn't think to check the horse constructor.
  12. I'm working on a custom mount. Right now, I have it mimic most everything a horse can but I cannot figure out how to get the mount to travel up one block inclines like a horse can. I cannot find anything in the related Horse, EntityLiving, or PlayerEntity classes. Where is this feature located? Or what might it be called in code so I could run a search for it.
  13. Ah, I did not know EntityDataManager applied to both Client and Server. It works beautifully now, thanks! I may look to see if that can affect my action animation code as that logic was originally written before EntityDataManager was an established thing. Thank you for that little bit about Packets as that helped me better realize what those various functions on SimpleNetworkWrapper are intended to do.
  14. I am working with Packets to assign a value to an Entity's Client Side version to pass animation information to its Model class. This particular value tells the client side entity that the mob has a current target (aggro). Most all of the code I have checked seems to run/fire correctly but the key value I need assigned/changed doesn't change on the client side entity. With this set up, when I run print statements I see the Server side Entity will say true for isAggroed but false for Client side. Here is what I have right now: Entity Class (EntityImmortalArcanine): public boolean isAggroed = false; ....... @Override public void onUpdate() { super.onUpdate(); ..... if(!this.world.isRemote) { System.out.println( "Server isAggroed " + isAggroed ); checkAggro(); } else { System.out.println( "Client isAggroed " + isAggroed ); calculateAggroValue(); } .... } public void checkAggro() { if(this.getAttackTarget() != null) { if(!this.isAggroed) { this.isAggroed = true; KindredLegacyMain.sendMobAggroPacket(this, true); } } else { if(this.isAggroed) { this.isAggroed = false; KindredLegacyMain.sendMobAggroPacket(this, false); } } } @Override public void setAggro(boolean isAggroed) { this.isAggroed = isAggroed; } Main Mod Class (KindredLegacyMain): @EventHandler public void init(FMLInitializationEvent event) { network = NetworkRegistry.INSTANCE.newSimpleChannel(ModInfo.CHANNEL); int packetID = 0; network.registerMessage(PacketAnimation.Handler.class, PacketAnimation.class, packetID, Side.CLIENT); packetID++; network.registerMessage(PacketMobTargeting.Handler.class, PacketMobTargeting.class, packetID, Side.CLIENT); ..... } ....... public static boolean isEffectiveClient() { return FMLCommonHandler.instance().getEffectiveSide().isClient(); } public static void sendMobAggroPacket(IAdvAnimatedEntity entity, boolean isAggroed) { if(isEffectiveClient()) return; entity.setAggro(isAggroed); network.sendToAll(new PacketMobTargeting((boolean)isAggroed, ((Entity)entity).getEntityId())); } Packet Class (PacketMobTargeting): public class PacketMobTargeting implements IMessage { private boolean isTargeting; private int entityID; public PacketMobTargeting() {} public PacketMobTargeting(boolean isTargetingBoolean, int entity) { isTargeting = isTargetingBoolean; entityID = entity; } @Override public void toBytes(ByteBuf buffer) { buffer.writeBoolean(isTargeting); buffer.writeInt(entityID); } @Override public void fromBytes(ByteBuf buffer) { isTargeting = buffer.readBoolean(); entityID = buffer.readInt(); } public static class Handler implements IMessageHandler<PacketMobTargeting, IMessage> { @Override public IMessage onMessage(PacketMobTargeting packet, MessageContext ctx) { World world = KindredLegacyMain.proxy.getWorldClient(); IAdvAnimatedEntity entity = (IAdvAnimatedEntity)world.getEntityByID(packet.entityID); if(entity != null) { entity.setAggro(packet.isTargeting); } return null; } } } Associated Interface (IAdvAnimatedEntity): public interface IAdvAnimatedEntity { void setAggro(boolean isAggro); float getAggroValue(); } This set up is almost identical to an action animation set up I have and that does work correctly.
  15. Thanks! That gave me the direction I needed. And as I started copying over the code to share, I happened to find the issue. The SoundEvent variables for the mob sounds accidentally got replaced from the SoundEvent registry handler Set when I added a new mob to the modification. I did not realize that missing something like that there would not cause a complete failure of the sound playing. Again, thank you!
×
×
  • Create New...

Important Information

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