Jump to content

Xeraster

Members
  • Posts

    21
  • Joined

  • Last visited

Converted

  • URL
    lolyoujellybro.com

Recent Profile Visitors

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

Xeraster's Achievements

Tree Puncher

Tree Puncher (2/8)

2

Reputation

  1. I have updated the mod to version 1.0.1. Here is what is improved: Added 6 new TNTs: Arrow TNT, Airborne TNT, Teleportation TNT, Warp TNT, Fact TNT and Jail TNT. Modified the Mine TNT so that when it encounters ores, it will mine them and then drop the ore on the ground rather than delete it entirely causing any resources caught in the blast to be lost. Now, you can use the Mine TNT and be able to pick up ores that it Mined. Added a splash logo for the mcmodinfo screen. Added Spanish localization leftover from the 1.7.2 version
  2. The Super TNT Mod for Minecraft 1.12.2 Adds 56 new TNTs to Minecraft Updated 7/9/18 (latest release is version 1.0.1) Download link below Here is a remake of my Super TNT mod for 1.7.2. It currently has 56 TNTs. Below is a list of all 56 of them and a description of what they all do. For a more detailed description including recipes and screenshots, go here. Here are some videos I made about it. Quick trailer made before the mod was ready for download: 18 minute video demonstrating many of the different TNTs and what they do: Requirements: To play this mod, you need to be using Minecraft 1.12.2. Forge also has to be installed. In order to prevent your game from crashing and for maximum smoothness, you should probably use -Xmx3G for your launch arguments but I recommend -Xmx8G if you have the ram for it. This mod does take less ram than the 1.7.2 version and lags less but it still helps to have a good computer and have java properly set up. Download: HERE is the link to the download page! The latest version is for 1.12.2 and the mod version is 1.0.1. Have fun!
  3. The one called "RECORDSONG". It's a custom added record, not a base game one. It gets inserted when I execute jukebox1.setrecord.(recordWhatever.copy()). I can observe that the record does in fact insert because after the jukebox spawns, I can right-click on it or destroy it and the record pops out.
  4. I have what appears to be a simple question but it turns out to be way not simple if actually attempted. I am trying to spawn a jukebox, with a record in it and get the jukebox to play that record. So far I can spawn the actual jukebox. That's simple. I can assign it to a TileEntityJukebox variable and get it to put a record in it but I can't get it to actually play the stupid record for anything. I've lost track of all the different things I've tried but here's what I have right now: this.world.setBlockState(new BlockPos(this.posX - 1, this.posY, this.posZ), Blocks.JUKEBOX.getDefaultState()); //spawn the jukebox block TileEntityJukebox jukebox1 = (TileEntityJukebox)this.world.getTileEntity(new BlockPos(this.posX - 1, this.posY, this.posZ));//assign it to a TileEntityJukebox ItemStack recordWhatever = new ItemStack(com.xeraster.supertnt.init.Items.RECORDSONG, 1);//create the item stack with the record to go into the jukebox jukebox1.setRecord(recordWhatever.copy());//Put the record in the jukebox. Doesn't matter if I do it with or without that ".copy()" part at the end. It won't play the record either way. this.world.setBlockState(new BlockPos(this.posX - 1, this.posY, this.posZ), Blocks.JUKEBOX.getDefaultState().withProperty(PropertyBool.create("has_record"), Boolean.valueOf(true)));//I saw this in the BlockJukebox class so I tried slapping it in but lo and behold it still doesn't work. Shocker. /s this.world.playRecord(new BlockPos(this.posX - 1, this.posY, this.posZ), SoundHandler.RECORDSONG);//tried this too because I saw it on line 86 of BlockJukebox. Doesn't work either. Yeah yeah yeah ik it was in the "dropRecord" function but I'm out of things to try at this point It must be noted that my custom record DOES work when I insert it manually. If I right-click on the spawned jukebox, it spits out the record that it's not playing and if I manually put it back in, it will play. So what am I missing? How to I spawn a Jukebox with a record in it and make it play it?
  5. Well I made this mod a long time ago in 1.7.2 back when the structure of Minecraft made more sense and wasn't nearly as cryptic and convoluted, and the stuff that was that bad had much better documentation. Even software development for the friggin Super Nintendo is more straightforward and less cryptic than this, which I know from experience. I've written lots of other software in lots of languages including Java, so say whatever you want. The difficulty I have been having comes from how they've just reinvented the wheel on a number of things having to do with Minecraft's code and adequate documentation for a lot of it just isn't there. Yes I did look it up. Multiple times. And with slightly different search terms each time. And even went back several pages on Google search, still not finding what I needed.. I couldn't find anything giving me actually helpful or complete enough information so I had to resort to figuring it out myself through trial and error until I came up with a temporary way to get it working myself which just happened to not be the official way that works the best. This is the first time I have even seen anything close to what you've pasted here and I look forward using this and seeing if I can get it to work like that. Thank you for posting that.
  6. Sorry to double post but I finally did get it working!! Here is what I did: 1. Go to my RenderLargeTNTPrimed class file. On line 86, comment out the line: doRender(entity, x, y, z, entityYaw, partialTicks); 2. In my main classes init() function, put: RenderingRegistry.registerEntityRenderingHandler(LARGE_TNT_ENTITY.getEntityClass(), new RenderTNTLargePrimed(Minecraft.getMinecraft().getRenderManager())); 3. In my client proxy function which has "RegistryEvent.Register<EntityEntry> event", make sure it contains the following code in this particular and very specific order: LARGE_TNT_ENTITY.setRegistryName(SuperTNTMod.MODID, "large_tnt_1"); event.getRegistry().register(LARGE_TNT_ENTITY); EntityRegistry.registerModEntity(LARGE_TNT_ENTITY.getRegistryName(), LARGE_TNT_ENTITY.getEntityClass(), LARGE_TNT_ENTITY.getName(), 0, SuperTNTMod.MODID, 128, 1, false); 4. Make sure this is at the top of whatever class I have the above code in: public static final EntityEntry LARGE_TNT_ENTITY = new EntityEntry(EntityTNTLargePrimed.class, SuperTNTMod.MODID + ":large_tnt_primed"); So there. Now as soon as I figure out how to use this EntityEntryBuilder system that diesieben07 is talking about, it will probably be more efficient but I'm just happy it's working now finally.
  7. I'm really struggling to grasp an understanding of this EntityEntryBuilder idea here. The best documentation I can find is here: http://maven.thiakil.com/forge-1.12-javadoc/net/minecraftforge/fml/common/registry/EntityEntryBuilder.html but it's still pretty vague and not very helpful at least to me. Is EntityEntryBuilder a type of variable? Is it a function? You said EntityRegistry as I'm currently using it doesn't fully do the job. So I've been trying stuff like: EntityRegistration fff = new EntityRegistry.EntityRegistration(SuperTNTMod.ModContainer, LARGE_TNT_ENTITY.getRegistryName(), LARGE_TNT_ENTITY.getEntityClass(), LARGE_TNT_ENTITY.getName(), 0, 128, 1, false); EntityEntryBuilder.create(fff); which might work if mod container was a variable I knew how to reproduce. Is this how that is supposed to work? If so, how do I satisfy the mod container variable? Where do I get ModContainer from?
  8. With all due respect, I don't agree with the statement that you told me how to do this above. I guess I'm just still missing something somewhere. After Googleing, I think I'm supposed to establish a variable entity at the top so it looks like: public static final EntityEntry LARGE_TNT_ENTITY = new EntityEntry(EntityTNTLargePrimed.class, SuperTNTMod.MODID + ":large_tnt_primed") at the top where all my blocks get their variables set? So I know I'm supposed to have a RegistryEvent function. I didn't have this before. I made that just now. It looks like this: @SubscribeEvent public static void registerStuff(RegistryEvent.Register<EntityEntry> event) { //event.getRegistry().register([EntityEntry]); System.out.println("registerStuff got executed"); LARGE_TNT_ENTITY.setRegistryName(SuperTNTMod.MODID, "large_tnt_1"); event.getRegistry().register(LARGE_TNT_ENTITY); EntityRegistry.registerModEntity(new ResourceLocation(SuperTNTMod.MODID, "largetnt_1"), EntityTNTLargePrimed.class, "largetnt_1", 0, SuperTNTMod.MODID, 128, 1, false); } I was previously putting the EntityRegistry line in my init. Doing this makes it execute and I get the white cube too though. What I can't find really find from Google is where and what I'm supposed to do with a EntityEntryBuilder statement and how to make one. I do observe that at no point in my current code are EntityLargeTNTPrimed and RenderLargeTNTPrimed linked to each-other in any way and according to common sense, this has to be done. The fact that none of my console comments in the RenderTNTLargePrimed never get executed supports this theory. Perhaps if I knew the correct syntax and intended use of EntityEntryBuilder, I could do this? You told me to register my renderer and put it in my preinit. Is this what EntityEntryBuilder does? Hey but thank you so much for helping so far. I hope I get this working soon.
  9. OK I'm getting warmer but still no cigar. In my RenderTNTLargePrimed class file, I replaced: protected ResourceLocation getEntityTexture(EntityTNTLargePrimed entity) { return TextureMap.LOCATION_BLOCKS_TEXTURE; } with: @Override protected ResourceLocation getEntityTexture(Entity entity) { return TextureMap.LOCATION_BLOCKS_TEXTURE; } which Draco18s expertly pointed out was causing a problem. Now, I can put the line: EntityRegistry.registerModEntity(new ResourceLocation(SuperTNTMod.MODID, "largetnt"), EntityTNTLargePrimed.class, "EntityTNTLargePrimed", 0, SuperTNTMod.MODID, 128, 1, false); in my init function. Putting it anywhere else makes it crash on startup. Doing this makes it damn-near almost work. When I ignite the tnt, it shows up as a white, textureless cube along with the fuse burning particles. Interestingly enough, the console doesn't actually output any errors like it does if I use anything other than "largetnt" for the ResourceLocation part after my ModId. Here is my console log: Here is a screenshot of what it looks like when I do this: https://imgur.com/a/0tDKg Adding in the deprecated ""RenderingRegistry.registerEntityRenderingHandler(blah blah blah)" as previously pointed out to not use, causes the white textureless box to not show at all, but will show the fuse burning particles and shadow. I makes no difference if I put it before or after the EntityRegistry line. The console log is completely the same whether I put that line in there, whether its before EntityRegistry or after EntityRegistry. I think maybe it has to do with the resource location part in my render class. Changing it to return something like "new ResourceLocation(SuperTNTMod.MODID, "largetnt")" or "new ResourceLocation(SuperTNTMod.MODID, "textures/blocks/largetnt_side")" doesn't actually seem to do anything. Am I correct to guess that this is where the last problem is or am I barking up the wrong tree? Also, I have changed my RenderTNTLargePrimed file. Here is what it looks like right now. package com.xeraster.supertnt.renders; import com.xeraster.supertnt.SuperTNTMod; import com.xeraster.supertnt.primedtnt.EntityTNTLargePrimed; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.BlockRendererDispatcher; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityTNTPrimed; import net.minecraft.init.Blocks; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.MathHelper; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class RenderTNTLargePrimed extends Render<EntityTNTLargePrimed> { public RenderTNTLargePrimed(RenderManager renderManagerIn) { super(renderManagerIn); this.shadowSize = 0.5F; } /** * Renders the desired {@code T} type Entity. */ public void doRender(EntityTNTLargePrimed entity, double x, double y, double z, float entityYaw, float partialTicks) { BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher(); GlStateManager.pushMatrix(); GlStateManager.translate((float)x, (float)y + 0.5F, (float)z); if ((float)entity.getFuse() - partialTicks + 1.0F < 10.0F) { float f = 1.0F - ((float)entity.getFuse() - partialTicks + 1.0F) / 10.0F; f = MathHelper.clamp(f, 0.0F, 1.0F); f = f * f; f = f * f; float f1 = 1.0F + f * 0.3F; GlStateManager.scale(f1, f1, f1); } float f2 = (1.0F - ((float)entity.getFuse() - partialTicks + 1.0F) / 100.0F) * 0.8F; //bindEntityTexture(entity); bindEntityTexture(entity); GlStateManager.rotate(-90.0F, 0.0F, 1.0F, 0.0F); GlStateManager.translate(-0.5F, -0.5F, 0.5F); blockrendererdispatcher.renderBlockBrightness(SuperTNTMod.LARGE_TNT.getDefaultState(), entity.getBrightness()); GlStateManager.translate(0.0F, 0.0F, 1.0F); if (this.renderOutlines) { GlStateManager.enableColorMaterial(); GlStateManager.enableOutlineMode(this.getTeamColor(entity)); blockrendererdispatcher.renderBlockBrightness(SuperTNTMod.LARGE_TNT.getDefaultState(), 1.0F); GlStateManager.disableOutlineMode(); GlStateManager.disableColorMaterial(); } else if (entity.getFuse() / 5 % 2 == 0) { GlStateManager.disableTexture2D(); GlStateManager.disableLighting(); GlStateManager.enableBlend(); GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.DST_ALPHA); GlStateManager.color(1.0F, 1.0F, 1.0F, f2); GlStateManager.doPolygonOffset(-3.0F, -3.0F); GlStateManager.enablePolygonOffset(); blockrendererdispatcher.renderBlockBrightness(SuperTNTMod.LARGE_TNT.getDefaultState(), 1.0F); GlStateManager.doPolygonOffset(0.0F, 0.0F); GlStateManager.disablePolygonOffset(); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.disableBlend(); GlStateManager.enableLighting(); GlStateManager.enableTexture2D(); } GlStateManager.popMatrix(); doRender(entity, x, y, z, entityYaw, partialTicks); } /** * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. */ @Override protected ResourceLocation getEntityTexture(EntityTNTLargePrimed entity) { return TextureMap.LOCATION_BLOCKS_TEXTURE; } } Edit: Well if I put any console output commands into my render's doRender function, it doesn't get executed. This means that there's still a problem with my registering. This is really frustrating though because if I change ANYTHING having to do with registering renders, it either functions even worse or crashes. I'm amazed at the convoluted complexity of this. Another edit: @diesieben07 I would love to try your suggestion of using EntityEntryBuilder except that I can't find documentation on how to use it, a working example of how to use it or how to do it myself through trial and error. Could you point me to a source of documentation or shed more light on this? Typing "EntityEntryBuilder.BuiltEntityEntry()" won't give me that one tooltip with what arguments the function accepts.
  10. What do I put for the first argument of the EntityRegistry.registerModEntity function? RenderTNTLargePrimed is what would make sense but that gives me an error. What ResouceLocation variable can I put in there that will not only keep the game from crashing, but cause my render to actually work? Putting null crashes it. Entering a new ResourceLocation(SuperTNTMod.MODID, "RenderTNTLargePrimed") crashes it. I have only been able to crash it or get errors by using that line. What do I do for the ResourceLocation variable? Update: I changed that one line to EntityRegistry.registerModEntity(new ResourceLocation(SuperTNTMod.MODID + ":textures/blocks/largetnt_side.png"), EntityTNTLargePrimed.class, "EntityTNTLargePrimed", 0, SuperTNTMod.MODID, 128, 1, false); Now, it waits until I ignite the TNT to crash. So.. close... Also, here is my crash log:
  11. Ok well omitting the EntityRegistry.registerGlobalEntityID(blah blah blah) and EntityRegistry.registerModEntity(blah blah blah) lines causes the render animation to not show (not that it was showing before). Perhaps I need the EntityRegistry.registerModEntity line since it doesn't have "global id" in it as pointed out. I am taking a stab in the dark here, but as far as converting the 1.7.2 code into something that will actually compile, I came up with: @SideOnly(Side.CLIENT) @SubscribeEvent public static void onRegisterModels(ModelRegistryEvent event) { EntityRegistry.registerModEntity(new ResourceLocation("EntityTNTLargePrimed"), EntityTNTLargePrimed.class, "entitytntlargeprimed", 64, SuperTNTMod.SUPER_TNT, 256, 1, false); RenderingRegistry.registerEntityRenderingHandler(EntityTNTLargePrimed.class, new RenderTNTLargePrimed(Minecraft.getMinecraft().getRenderManager())); } Now it just crashes on start up. What can I do now?
  12. OK but what do I replace it with in order to make that function actually execute? Do you mean to just not use registerGlobalEntityID at all? If that is what you mean, that solves half my problem but I still can't find a way to make it accept the "EntityRegistry.registerModEntity(EntityTNTLargePrimed.class, "entitytntlarge", 64, this, 256, 1, false);" line Note that simply putting the line "RenderingRegistry.registerEntityRenderingHandler(EntityTNTLargePrimed.class, new RenderTNTLargePrimed(Minecraft.getMinecraft().getRenderManager()));" in client proxy doesn't fix it and renders still don't work like that.
  13. I'm having a lot of trouble getting renders to work, specifically with custom TNT. In it's current state, when I ignite a custom TNT block, creating an "EntityTNTLargePrimed", it becomes invisible. Here is how I am registering my render in my preInit(): RenderingRegistry.registerEntityRenderingHandler(EntityTNTLargePrimed.class, new RenderTNTLargePrimed(Minecraft.getMinecraft().getRenderManager())); System.out.println("Registered RenderTNTLargePrimed from preint function"); I don't get any render related errors in the console and that system print statement correctly outputs to the console. In my "RenderTNTLargePrimed" class, it's basically a copy and paste of "RenderTNTPrimed" from the base game. package com.xeraster.supertnt.renders; import com.xeraster.supertnt.SuperTNTMod; import com.xeraster.supertnt.primedtnt.EntityTNTLargePrimed; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.BlockRendererDispatcher; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.item.EntityTNTPrimed; import net.minecraft.init.Blocks; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.MathHelper; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class RenderTNTLargePrimed extends Render<EntityTNTLargePrimed> { public RenderTNTLargePrimed(RenderManager renderManagerIn) { super(renderManagerIn); this.shadowSize = 0.5F; } /** * Renders the desired {@code T} type Entity. */ public void doRender(EntityTNTLargePrimed entity, double x, double y, double z, float entityYaw, float partialTicks) { BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher(); GlStateManager.pushMatrix(); GlStateManager.translate((float)x, (float)y + 0.5F, (float)z); if ((float)entity.getFuse() - partialTicks + 1.0F < 10.0F) { float f = 1.0F - ((float)entity.getFuse() - partialTicks + 1.0F) / 10.0F; f = MathHelper.clamp(f, 0.0F, 1.0F); f = f * f; f = f * f; float f1 = 1.0F + f * 0.3F; GlStateManager.scale(f1, f1, f1); } float f2 = (1.0F - ((float)entity.getFuse() - partialTicks + 1.0F) / 100.0F) * 0.8F; bindEntityTexture(entity); GlStateManager.rotate(-90.0F, 0.0F, 1.0F, 0.0F); GlStateManager.translate(-0.5F, -0.5F, 0.5F); blockrendererdispatcher.renderBlockBrightness(SuperTNTMod.LARGE_TNT.getDefaultState(), entity.getBrightness()); GlStateManager.translate(0.0F, 0.0F, 1.0F); if (this.renderOutlines) { GlStateManager.enableColorMaterial(); GlStateManager.enableOutlineMode(this.getTeamColor(entity)); blockrendererdispatcher.renderBlockBrightness(SuperTNTMod.LARGE_TNT.getDefaultState(), 1.0F); GlStateManager.disableOutlineMode(); GlStateManager.disableColorMaterial(); } else if (entity.getFuse() / 5 % 2 == 0) { GlStateManager.disableTexture2D(); GlStateManager.disableLighting(); GlStateManager.enableBlend(); GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.DST_ALPHA); GlStateManager.color(1.0F, 1.0F, 1.0F, f2); GlStateManager.doPolygonOffset(-3.0F, -3.0F); GlStateManager.enablePolygonOffset(); blockrendererdispatcher.renderBlockBrightness(SuperTNTMod.LARGE_TNT.getDefaultState(), 1.0F); GlStateManager.doPolygonOffset(0.0F, 0.0F); GlStateManager.disablePolygonOffset(); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.disableBlend(); GlStateManager.enableLighting(); GlStateManager.enableTexture2D(); } GlStateManager.popMatrix(); doRender(entity, x, y, z, entityYaw, partialTicks); } /** * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. */ protected ResourceLocation getEntityTexture(EntityTNTLargePrimed entity) { return TextureMap.LOCATION_BLOCKS_TEXTURE; } } I can't find any information on the internet about stuff that's relevant for fixing this. I did look in a really really old 1.7.2 mod that I made were entity renders for TNT work. The code appears to be: EntityRegistry.registerGlobalEntityID(EntityTNTLargePrimed.class, "entitytntlarge", EntityRegistry.findGlobalUniqueEntityId()); EntityRegistry.registerModEntity(EntityTNTLargePrimed.class, "entitytntlarge", 64, this, 256, 1, false); RenderingRegistry.registerEntityRenderingHandler(EntityTNTLargePrimed.class, new RenderTNTLargePrimed(Minecraft.getMinecraft().getRenderManager())); where my rendering registry is but the problem is that in 1.12.2 that doesn't work. I get errors in the registerGlobalEntityID and registerModEntity lines. On the registerGlobalEntityID, it doesn't like the ".findGlobalUniqueEntityId" part. The error just says "The method findGlobalUniqueEntityId() is undefined for the type EntityRegistry". If I backspace and then make a period, I don't see any functions even remotely close to findGlobalUniqueEntityId and when I just backspace it, it doesn't work either. On the next line, the problem is with the registerModEntity function and the fact that I have (class extends Entity, String, int, Object, int, int, boolean) where it's expecting (ResourceLocation, class extends Entity, String, Object, int, int, boolean). Does anybody know of either a workaround, another way to do this, or something I'm doing wrong that would otherwise allow this to work without those two lines of 1.7.2 code I can't hack into working? I'm thoroughly stumped with this.
  14. You are right. It was a typo and I needed to change my item registration to: ModelLoader.setCustomModelResourceLocation(STARWARSRECORD, 0, new ModelResourceLocation("supertnt:record.starrecord", "inventory")); rather than ModelLoader.setCustomModelResourceLocation(STARWARSRECORD, 0, new ModelResourceLocation("record.starrecord", "inventory")); And thanks for pointing out the stuff about @SideOnly and @SidedProxy. I'll look into changing that when I get a chance to.
  15. I am wanting to make a custom fluid in forge 1.12.2. I did it in a 1.7.2 mod and I think I remember it being substantially difficult but I did figure it out. I think my biggest problem was with textures. That is not the case now. After looking at the minecraft files for 1.12.2, they seem to have made it so much more complicated that I don't even know where or how to start making a custom one. I've made a few attempts extending base classes but in the end haven't been able to get anywhere because of the way they register their liquids in net.minecraft.init.Blocks and how that applies to or works with net.minecraftforge.fluids. The biggest barrier that makes it not possible to extend existing classes and mess with it until it works is in net.minecraft.init.Blocks where they have: public static final BlockDynamicLiquid FLOWING_WATER; public static final BlockStaticLiquid WATER; followed by: @Nullable private static Block getRegisteredBlock(String blockName) { Block block = Block.REGISTRY.getObject(new ResourceLocation(blockName)); if (!CACHE.add(block)) { throw new IllegalStateException("Invalid Block requested: " + blockName); } else { return block; } } static { if (!Bootstrap.isRegistered()) { throw new RuntimeException("Accessed Blocks before Bootstrap!"); } else { FLOWING_WATER = (BlockDynamicLiquid)getRegisteredBlock("flowing_water"); WATER = (BlockStaticLiquid)getRegisteredBlock("water"); } } I expected there to be something along the lines of: public static final BlockDynamicLiquid FLOWING_WATER = new BlockDynamicLiquid().getRegisteredBlock("flowing_water") public static final BlockStaticLiquid WATER = new BlockStaticLiquid().getRegisteredBlock("water") Now after doing what I believe is a good job of duplicating or extending base class files or making new ones, the above won't work, nor will: public static final BlockDynamicLiquid FLOWING_WATER = new BlockDynamicLiquid("flowing_water"); public static final BlockStaticLiquid WATER = new BlockStaticLiquid("water"); or any other variation after much messing around with it. The idea was to get that to work and then in my block registry, just register it like any regular block like: @Mod.EventBusSubscriber(modid = SuperTNTMod.MODID) public static class RegistrationHandler { public static final Set<ItemBlock> ITEM_BLOCKS = new HashSet<>(); @SubscribeEvent public static void registerBlocks(final RegistryEvent.Register<Block> event) { final IForgeRegistry<Block> registry = event.getRegistry(); System.out.println("register blocks event executed"); final Block[] blocks = {FLOWING_WATER, WATER}; registry.registerAll(blocks); System.out.println("register all function executed"); } @SubscribeEvent public static void registerItemBlocks(final RegistryEvent.Register<Item> event) { final ItemBlock[] items = {new ItemBlock(WATER), new ItemBlock(FLOWING_WATER) }; I just can't even do a good enough job of this to even get it to compile. I have also tried blatantly copy and pasting class files from TestMod3 to get a liquid working using that code. Seems like a reasonable idea if you're desperate enough but it just kept going down a never-ending rabbit hole and I had to keep creating more and more and more TestMod3 dependent classes. I gave up halfway through the multiplayer server crap which doesn't have anything to do with liquid but in TestMod3 I guess it does. So is 1.12.2 liquid really this elusively difficult? What am I missing? I'm an experienced programmer but I'm dumbfounded from the unnecessary complexity of this liquid system. I don't even have any code to post because I can't really get anything close to what might work or something I think should work that could compile. Is there an "idiots guide" for 1.12.2 liquid?
×
×
  • Create New...

Important Information

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