Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

FuzzyAcornIndustries

Members
  • Posts

    46
  • Joined

  • Last visited

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)

0

Reputation

  1. 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.
  2. Oooh, thanks for clearing that up. Thanks, I definitely understand that is not something to try and do.
  3. 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?
  4. 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.
  5. 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.
  6. 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.
  7. Thank you! I knew it was something absolutely simple. I just didn't think to check the horse constructor.
  8. 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.
  9. 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.
  10. 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.
  11. 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!
  12. I encountered a strange issue where 1 of 7 similarly programed custom Tamable mobs in my modification has none of its sounds play when on a Server. Instead you get the default mob sounds. When played on single player, the mob sounds play as expected. I checked the server and client logs when it starts up and I don’t see any messages indicating the files are not loading. Instead, I notice a strange null pointer exception message to sections of code I do not recognize. They appear any time I suspect the mob’s sound is supposed to play, seen below (Client log): [23:47:45] [main/FATAL] [net.minecraft.client.Minecraft]: Error executing task java.util.concurrent.ExecutionException: java.lang.NullPointerException at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_51] at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_51] at net.minecraft.util.Util.func_181617_a(SourceFile:47) [h.class:?] at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1087) [bib.class:?] at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:397) [bib.class:?] at net.minecraft.client.main.Main.main(SourceFile:123) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51] at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] Caused by: java.lang.NullPointerException at net.minecraft.client.audio.PositionedSoundRecord.<init>(SourceFile:34) ~[cgp.class:?] at net.minecraft.client.audio.PositionedSoundRecord.<init>(SourceFile:30) ~[cgp.class:?] at net.minecraft.client.multiplayer.WorldClient.func_184134_a(WorldClient.java:468) ~[bsb.class:?] at net.minecraft.client.multiplayer.WorldClient.func_184148_a(WorldClient.java:456) ~[bsb.class:?] at net.minecraft.client.network.NetHandlerPlayClient.func_184327_a(NetHandlerPlayClient.java:1674) ~[brz.class:?] at net.minecraft.network.play.server.SPacketSoundEffect.func_148833_a(SourceFile:89) ~[kq.class:?] at net.minecraft.network.play.server.SPacketSoundEffect.func_148833_a(SourceFile:11) ~[kq.class:?] at net.minecraft.network.PacketThreadUtil$1.run(SourceFile:13) ~[hv$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_51] at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_51] at net.minecraft.util.Util.func_181617_a(SourceFile:46) ~[h.class:?] ... 9 more Does anyone know what might be happening here in this null pointer exception?
  13. I want to add items with a feature where they regenerate durability over time and I am trying to find the most effective or least complicated way to do it. Do either of the following sound ideal: Option 1: Item’s onUpdate() I feel the easiest way would be to add to an Item’s onUpdate() function something like: if(worldTimeTick % 200 == 0) { if(stack.getDamage() > 0) stack.setItemDamage(stack.getDamage() – 1); } If this is even practical, how could I find the “worldTimeTick” and apply it in the Item class? I see Minecraft Clocks use new ResourceLocation("time") Can this be used at all for this and if so, how? Option 2: Capabilities I saw on another post that it you want to track something like time on an Item, you have to do it via Capabilities on its ItemStack. How do/would you even track time with such an option? (I have very primitive understanding of Capabilities)
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.