
PixelsNeverDie
Members-
Posts
25 -
Joined
-
Last visited
Everything posted by PixelsNeverDie
-
Render Model from JSON anywhere in the World
PixelsNeverDie replied to PixelsNeverDie's topic in Modder Support
I want to render a model between two blocks, in an animation. -
Is there a way for me to render JSON Models anywhere in the world from an IBakedModel using a method similar to the renderAll method the BaseModel class offers? I'd like to render the IBakedModel wherever I wish, independent of World and a BlockPos.
-
Load and register B3D Model from File
PixelsNeverDie replied to PixelsNeverDie's topic in Modder Support
are there any negative side effects of using ATs? -
Load and register B3D Model from File
PixelsNeverDie replied to PixelsNeverDie's topic in Modder Support
Ugh. I can't even. Seriously - what's so bad about them? We also use Sponge Mixins instead of direct ASM transformers, are we the devil himself now? -
Load and register B3D Model from File
PixelsNeverDie replied to PixelsNeverDie's topic in Modder Support
I have changed my plans to support .obj and .tcn files using the old AdvancedModelLoader. No clue how to render .b3d either. -
Load and register B3D Model from File
PixelsNeverDie replied to PixelsNeverDie's topic in Modder Support
Still working on the Replay Mod. -
Load and register B3D Model from File
PixelsNeverDie replied to PixelsNeverDie's topic in Modder Support
Please no! Kill it with fire! Rest assured that I have an accessTransformers.cfg file which is over 100 lines long for the Replay Mod. -
Load and register B3D Model from File
PixelsNeverDie replied to PixelsNeverDie's topic in Modder Support
Thanks for the response. I'll use Access Transformers, but I got the idea. Cheers! -
Load and register B3D Model from File
PixelsNeverDie replied to PixelsNeverDie's topic in Modder Support
Do you need any more information to help me? Basically I just need to know how to make a ResourceLocation to point to an actual File on the User's File System. -
Hello, is it possible to render a 3D Object in the World which is loaded from a .b3d File which is not in the Mod's Assets, but dynamically loaded from the User's Hard Drive? The B3DLoader class takes a ResourceLocation in its loadModel Method, how can I either create a ResourceLocation which points to a File or avoid using a ResourceLocation there? Thanks in advance, CrushedPixel
-
Storing and loading FMLProxyPackets
PixelsNeverDie replied to PixelsNeverDie's topic in Modder Support
Do you know the Replay Mod? https://replaymod.com We're trying to expand it to support Mod's Packets as well. -
Hello fellow Modders, for my current Project I need to store all IMessages the Client sends to the Server (and the other way around) in a File and load them later. Therefore, I'm hooking into the FML Channel using the following code: NetworkManager nm = event.manager; Channel channel = nm.channel(); for(String channelName : NetworkRegistry.INSTANCE.channelNamesFor(Side.CLIENT)) { FMLEmbeddedChannel embeddedChannel = NetworkRegistry.INSTANCE.getChannel(channelName, Side.CLIENT); embeddedChannel.pipeline().addFirst(new IMessageInboundListener()); } for(String channelName : NetworkRegistry.INSTANCE.channelNamesFor(Side.SERVER)) { FMLEmbeddedChannel embeddedChannel = NetworkRegistry.INSTANCE.getChannel(channelName, Side.SERVER); embeddedChannel.pipeline().addFirst(new IMessageOutboundListener()); } The IMessageInboundListener looks the following way: public class IMessageInboundListener extends ChannelInboundHandlerAdapter { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { int somehting = 0; if(msg instanceof FMLProxyPacket) { FMLProxyPacket proxyPacket = (FMLProxyPacket)msg; String channelName = proxyPacket.channel(); Side target = proxyPacket.getTarget(); ByteBuf buf = proxyPacket.payload(); byte[] bytes = new byte[buf.readableBytes()]; buf.readBytes(bytes); buf.readerIndex(0); //some code to store the Packet is here } super.channelRead(ctx, msg); } } Now, my question is - how do I re-send these Packets to the Server? How can I reconstruct the Packet from the byte array, channel name and target Side and where do I need to inject it? Thanks in advance, Pixel
-
Forge Version: 11.14.3.1487 Basic Setup: I've created a Helper Interface for Gui Elements called GuiElement, so my custom Gui Elements provide some basic methods like isHovering(), mouseClick() or setEnabled(). In my case I created a GuiAdvancedTextField, which extends GuiTextField and implements GuiElement. To satisfy the interface, I override void setEnabled(boolean enabled); When calling this Method while in the Development Environment, everything works fine, but after compiling the following error occurs: java.lang.AbstractMethodError: somepackets.GuiAdvancedTextField.setEnabled(Z)V As far as I understand, this is caused by setEnabled both overriding GuiTextField's setEnabled method with the same signature and implementing GuiElement's setEnabled method where GuiTextField doesn't implement GuiElement. Renaming the interface's setEnabled method to setElementEnabled was a functioning workaround. Thanks in advance for the fix, Pixel
-
Hello dear Modders, I've recently needed to create a multiline GuiTextField to allow users to input a File Description. However, I am quite confused with Overriding the drawTextBox() method, as it's not very simple to properly set the cursor positions etc. Has anyone here ever created a simple Multiline TextField Gui Element? This is basically holding me back of creating a pretty huge mod. Thanks in advance, Pixel
-
[1.8] Dynamically update .lang files
PixelsNeverDie replied to PixelsNeverDie's topic in Modder Support
I've got everything to work. Thank you so much! -
[1.8] Dynamically update .lang files
PixelsNeverDie replied to PixelsNeverDie's topic in Modder Support
Should I have any physical Resource Pack on the Hard Drive? Or is everything just emulated by the mod itself? I think I need a code example for the getInputStream Method to get started. -
[1.8] Dynamically update .lang files
PixelsNeverDie replied to PixelsNeverDie's topic in Modder Support
Thanks for your reply, I'll have a look into it. -
For my current Project, I've allowed translators to change the localization for their main language on a nice website. I've provided an API call to generate a .lang file from the strings in the database. I now want to automatically update the .lang files for the requested language whenever the language is changed or the mod is restarted. Therefore, I've registered the following IResourceManagerReloadListener: ((SimpleReloadableResourceManager)mc.getResourceManager()).registerReloadListener(new IResourceManagerReloadListener() { @Override public void onResourceManagerReload(IResourceManager resourceManager) { SimpleReloadableResourceManager rm = (SimpleReloadableResourceManager) resourceManager; Language current = mc.getLanguageManager().getCurrentLanguage(); String languageCode = current.getLanguageCode(); try { File file = new File("./" + languageCode + ".lang"); file.createNewFile(); apiClient.downloadTranslation(languageCode, file); ArrayList arraylist = Lists.newArrayList(new String[]{"en_US"}); if(!"en_US".equals(languageCode)) { arraylist.add(languageCode); } Properties prop = new Properties(); prop.load(new FileInputStream(file)); HashMap<String, String> lang_prop = StringTranslate.parseLangFile(new FileInputStream(file)); net.minecraftforge.fml.common.registry.LanguageRegistry.instance().mergeLanguageTable(lang_prop, languageCode); for(Map.Entry e : lang_prop.entrySet()) { System.out.println(e.getKey() + " => " + e.getValue()); } StringTranslate.replaceWith(lang_prop); System.out.println("Written to " + file.getAbsolutePath()); } catch(Exception e) { e.printStackTrace(); } } }); The mappings in the lang_prop Map are correct (thus the debug output), but it doesn't translate the localized Strings from the mod. And yes, my localization is properly implemented using I18n.format(); Any suggestions? Thanks in advance, CrushedPixel
-
Hello, I am depending on a local .jar file in my mod, and the mod only works if this jar is also in the Mods folder. What do I need to append to the build.gradle to remove the need of multiple downloads (for my users)? I've tried jar { from configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } but it lets the Build fail.
-
Hello, does anyone here have a clue how to advance the net.minecraft.util.Timer that is used for Rendering and Game Ticking by a certain amount of time? I manually stopped it from calling the updateTimer() method (by setting timerSpeed to 0). However, I'm creating a mod which needs to be frame perfect, so I'd like to advance the timer (and it's elapsedPartialTicks, elapsedTicks and elapsedRenderTicks fields) by 1/FPS seconds. Thanks in advance for any suggestions, Pixel