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


Forge Modder
  • Content Count

  • Joined

  • Last visited

Everything posted by AnZaNaMa

  1. Not sure if this is the right thread, so move it if I'm in the wrong place. I'm working on updating an old mod to 1.15.2, which runs a RESTful HTTP server alongside the game server that allows outside services to query information. Originally, I had implemented this using Netty, because it is already included in any Minecraft game. However, I was unable to figure out how to get an HTTPS server running, and honestly Netty is too low-level for this project. It required like 10 different classes just to get a basic HTTP server running. I've been looking into di
  2. Oh wow I'm stupid. Yeah, originally I was just using the normal block class. Guess I forgot to change it after I made my custom block class. I've changed it to TradeTerminalBlock and that's solved my problems. However, I still have a couple of questions. First off, it seems like the game is somehow saving my blockstate's properties when I quit the world, but I haven't written anything to translate the blockstate into nbt or metadata or anything. How is this information saved, since getStateFromMeta and getMetaFromState no longer exist? If I were to create my own custom BlockState p
  3. I checked out the Loom, because it uses HorizontalBlock Loom BlockState: { "variants": { "facing=north": { "model": "block/loom" }, "facing=south": { "model": "block/loom", "y": 180 }, "facing=west": { "model": "block/loom", "y": 270 }, "facing=east": { "model": "block/loom", "y": 90 } } } Loom Model: { "parent": "block/orientable", "textures": { "top": "block/loom_top", "bottom": "block/loom_bottom", "front": "block/loom_front", "side": "block/loom_side" } } As you can
  4. Hello, I'm having some troubles getting simple BlockStates to work in 1.15.2 (forge 31.1.1). Currently, I'm trying to get a simple rotatable block. Originally, I tried using the official Forge ReadTheDocs, but I've noticed that the Forge documentation is SEVERAL MAJOR VERSIONS out of date. The readthedocs says that the documentation is for 1.15.x, but most of the information in there is clearly out of date. All of the references it makes use the old naming scheme, and it often tells you to use methods that no longer exist. I was following the instructions on the docs, but that tuto
  5. Hello! I've noticed that newer versions of Forge like to dump out the entire registry when the game loads, which makes it annoying to try and read through the console while testing mods in my development environment. Is there a way to disable this registry dump, while still keeping the log level at DEBUG?
  6. I managed to figure it out. I had my @EventBusSubscriber wrong (had to subscribe to the client-specific bus for the FMLCommonSetupEvent). Because of that, the event handler wasn't firing, so the instance of the capability was never being injected with a value, so it was still null when I tried to use it. @Draco18s also, you were right. I was just passing an instance of my ILifeForce, when I needed to pass it a supplier. I ended up using a lambda supplier: @SubscribeEvent public static void onCommonSetupEvent(FMLCommonSetupEvent event) { CapabilityManager.INSTANCE.register(I
  7. LIFE_FORCE_CAP is a Capability<ILifeForce>, so the call to LIFE_FORCE_CAP::getDefaultInstance will resolve to Capability::getDefaultInstance which does exist. I was under the impression that getDefultInstance would return the instance of LifeForce that I passed into CapabilityManager.INSTANCE.register()
  8. FIrst off, the file contents you gave for your model file for example_item.json look like a localization file. For regular rendering of an item, your src\main\resources\assets\fm\models\item\example_item.json would look something like this: { "parent": "item/generated", "textures": { "layer0": "modid:item/example_item" } } That "modid:item/example_item" is a resource location for the texture that will be used to draw layer0, which is the only layer in this case. Essentially, the "modid:item/example_item" refers to the texture for your item. With the way that reso
  9. Hello, I'm working on implementing a capability for living entities for a mod I'm working on and I've run into some trouble. I believe I've gotten most of it right, from what I've gathered from other threads here. The trouble I'm running into is when the AttachCapabilitiesEvent<Entity> I'm hooking into fires. When that event fires, I'm calling event.addCapability(), and the game crashes while it's attempting to create the new instance of my capability provider (ICapabilitySerializable), throwing a null pointer exception. Here, you can see my event listener for the
  10. Hello, I'm working on a mod that communicates information about the minecraft server to outside sources. One of the ways I'm trying to accomplish this is by hooking into certain events and sending out an HTTP post request with a json payload to a user-defined endpoint. I'm using Netty to accomplish this, since it's already used by minecraft. For some reason, though, my HttpClient won't send the messages through. I have print statements before and after message sending and it gets to the first message, but never gets to the second one. I realize this is more of a question about Netty than forge
  11. I discovered that either minecraft or forge is already keeping a record of tick times, so I'll just use this instead to avoid having a tick handler that bogs down the server. For anyone in the future, who's interested in this, look in net.minecraftforge.server.command.CommandTps to see how the forge TPS command calculates it.
  12. Hello, I'm attempting to monitor the average tick time of a forge server in my mod. Currently, I'm using an event handler that subscibes to TickEvent.ServerTickEvent to record System.currentTimeMillis each tick and then when someone asks for the TPS, I average out the differences between times in the array to find the mean tick time in milliseconds and divide 1000 by that to get the TPS. However, the numbers I come up with are always much larger than those produced by the 'forge tps' command (i.e. 0.3ms vs 10ms). I'm fairly certain my math is correct, which means there must be a pr
  13. I have a command that teleports a player to another player and in that, I make a check to see if the player is in the same dimension as the other one, and if not, I call EntityPlayer::changeDimension(); This seems to teleport the player fine, but it causes a weird desync with the client. The mod is server side only, as it's only a commands mod and I don't want to make my players have to download anything additional. The client acts like it doesn't know it moved to a new dimension. It sees everything in the new dimension fine, but other players can't see the one who teleported and the clie
  14. Thank you. Sorry, I haven't worked with entities so I didn't have any experience with methods involving them or I would have just looked there.
  15. Is there a similar registry for entities? doesn't look like Entity class has an Entity.REGISTRY
  16. Hi, I'm not extremely familiar with the new registry system that has been introduced in 1.12. I'm attempting to figure out how I can get an instance of an Item from its registry name (i.e. "minecraft:torch") It looks like in 1.7.10, you could call GameData.findItem(modid, name) however, I haven't been able to find anything from newer versions. I would think it's a part of the registry system, but I'm not sure how it would be done.
  17. Yeah I understand this, but I was just wondering if it was possible cause I've seen plugins claiming they do it - I've already got it working fine on the main thread, but I'm just thinking if it's possible it'd be nice in the case that there are a LOT of entities I need to clear. However, from what I've found in testing it doesn't seem like the amount of time it takes to run is really going to matter. Seems to run just fine.
  18. Hi all, I'm working on a little mod akin to the ClearLagg plugin that will automatically clear out entities from time to time. I have seen a couple plugins boasting that they do this on a separate thread to reduce lag, but I'm wondering how this would be possible. It seems like it'd be subject to some hella race conditions.
  19. So I've been looking through resource packs a lot recently and I've come across an idea. I think it would be really cool to allow people to make a resource pack that makes use of the OreDictionary - for example, you define a model for oreCopper and every block that is registered as oreCopper uses that model.
  20. Hello, I'm working on porting a mod and I've noticed that MinecraftServer.getServer().getConfigurationManager() no longer exists. I have found looking around that I can use FMLCommonHandler.instance().getServer() will give an instance of MinecraftServer, but the server doesn't have a getConfigurationManager(). In 1.7.10, this could be used via ConfigurationManager#func_152596_g() to check if a player is operator. How can I accomplish this in 1.10.2?
  21. Thanks for your help! I was doing some more research and found another topic here where you linked a topic related to IBakedModels, but it seems the link doesn't work anymore. Don't suppose you know how I can find it?
  22. Actually, I think I may have managed to figure it out. Here's what I'm doing in getQuads() to access the TileEntity: @Override public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand) { if(side != null) { return Collections.EMPTY_LIST; } IExtendedBlockState extState = (IExtendedBlockState)state; TileEntityBase tile = (TileEntityBase)extState.getValue(UnlistedProperty.BLOCK_ACCESS).getTileEntity(extState.getValue(UnlistedProperty.POS)); } Are you using the UnlistedPropertyGeneric.
  • Create New...

Important Information

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