Jump to content

DavidM

Members
  • Posts

    1830
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by DavidM

  1. Yes. After canceling the event, you can render the player yourself with whatever effect you want.
  2. 1. Even if he did, you should not directly post the code that he is supposed to write. 2. Your example is bad both style-wise and performance-wise. This will set a poor example for others.
  3. Fixed. Override Block#neighborChanged. Thanks!
  4. An equivalent for Block#updatePostPlacement (only exists in 1.13.2), but in 1.12.2. I am trying to implement this to detect redstone signal.
  5. That seems to be the problem. I forgot to change it in my 1.12.2 branch. Thanks.
  6. 1. Use the correct syntax highlight when posting code. 2. Post code with correct Java syntax or specify that it is pseudocode. 3. Don't just post solutions like that. Others can copy/paste without learning.
  7. Subscribe to the RenderPlayerEvent.Pre, cancel the event, and render your model and items in hand.
  8. Those are irrelevant. Add the counter in your ITickable#update. My previous post explained how to implement this.
  9. 1. Your switch statement for sword tier is messy. Utilize string concatenation. 2. Stop using BlockBase and ItemBase (or in your case, BlockBasic and MItem). 3. You are trying to get the player's view from the server side, which will immediately cause a crash due to the usage of Minecraft#getMinecraft. Use packets.
  10. 1.7.10 is no longer supported on this forum. You are unlikely to find a developer here for 1.7.10
  11. How does one detect block update in 1.12.2?
  12. Make a counter that increments every tick. If the counter hits 5, reset it to 0 and do whatever you want.
  13. I am using reflection to get the EntityLiving#getLootTable (SRG name: "func_184647_J") method of an EntityLiving. However, this sometimes (rather rare) fails to work with modded mobs, which, although inherits from the EntityLiving class, does not seems to have the method with SRG name "func_184647_J". The crash report below is an example of EntityGaiaMinotaur from Grimoire of Gaia, which, according to the source code, does inherit from EntityLiving, but does not have the method "func_184647_J". Note that the EntityLiving#getLootTable (SRG name: "func_184647_J") fetching works with most modded mobs, but not with some specific ones. ---- Minecraft Crash Report ---- // Ooh. Shiny. Time: 2019-02-23 08:02:36 EST Description: Error executing task java.util.concurrent.ExecutionException: net.minecraftforge.fml.relauncher.ReflectionHelper$UnableToFindMethodException: java.lang.NoSuchMethodException: gaia.entity.monster.EntityGaiaMinotaur.func_184647_J() at java.util.concurrent.FutureTask.report(Unknown Source) at java.util.concurrent.FutureTask.get(Unknown Source) at net.minecraft.util.Util.runTask(SourceFile:531) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:723) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:668) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:185) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526) at java.lang.Thread.run(Unknown Source) Caused by: net.minecraftforge.fml.relauncher.ReflectionHelper$UnableToFindMethodException: java.lang.NoSuchMethodException: gaia.entity.monster.EntityGaiaMinotaur.func_184647_J() at net.minecraftforge.fml.relauncher.ReflectionHelper.findMethod(ReflectionHelper.java:303) at cn.davidma.tinymobfarm.util.LootTableHelper.getLootTableLocation(LootTableHelper.java:27) at cn.davidma.tinymobfarm.item.Lasso.interactEntity(Lasso.java:66) at cn.davidma.tinymobfarm.item.template.InteractiveMobTool.itemInteractionForEntity(InteractiveMobTool.java:61) at net.minecraft.item.ItemStack.interactWithEntity(ItemStack.java:391) at net.minecraft.entity.player.EntityPlayer.interactOn(EntityPlayer.java:1220) at com.tmtravlr.potioncore.network.PacketHandlerServer.useEntity(PacketHandlerServer.java:96) at com.tmtravlr.potioncore.network.PacketHandlerServer.lambda$onMessage$1(PacketHandlerServer.java:66) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at net.minecraft.util.Util.runTask(SourceFile:529) ... 5 more Caused by: java.lang.NoSuchMethodException: gaia.entity.monster.EntityGaiaMinotaur.func_184647_J() at java.lang.Class.getDeclaredMethod(Unknown Source) at net.minecraftforge.fml.relauncher.ReflectionHelper.findMethod(ReflectionHelper.java:297) ... 15 more
  14. A few days ago I ported one of my mods to 1.13.2, which used the 1.13.2 method of opening GUI (via NetworkHooks). GUI setup (with container): https://github.com/davidmaamoaix/TinyMobFarm/tree/1.13.2/src/main/java/cn/davidma/tinymobfarm/client/gui Opening (Block#onBlockActivated): here. Registering: here.
  15. 1. git remote add origin https://github.com/Drachenbauer/AngryBirdsMod.git 2. Read: https://product.hubspot.com/blog/git-and-github-tutorial-for-beginners
  16. The authors of some of the mods did not include some translation files, as well as some signatures. You don't have to worry about those. They won't affect your server.
  17. 1. PlayerInteractEvent can be triggered from the server side, in which case the currentScreen is null, as the server side does not have a currently opened GUI. The currentScreen is only client side. 2. Please elucidate what you are trying to do, and we can perhaps figure out an alternative solution. We need some context of your problem.
  18. That is his debug message. He knows what he is doing. He is asking why Minecraft.getMinecraft().currentScreen is null.
  19. No, you cannot, as ResourceLocation cannot access files on the internet.
  20. 1. Stop watching HarryTalk's tutorials. His videos are out dated and have very bad coding conventions. I've pointed out some of the problematic code, both style-wise and code-wise, in the comment section of his video (the custom furnace series), and hopefully he will update his videos in the future. 2. In java, a division where both sides are ints will return an int. Thus, you need to cast one value to double before performing division in your getCookProgressScaled.
  21. Right. According to your code on GitHub, you didn't add ANY code that does anything in terms of rendering a beam. Therefore, of course there is no beam, as code won't work if you don't actually write them down.
  22. The definition of "String" is char[]; It does not means code. I would suggest you to change the habit of referring to code as String, as this might cause confusion in the future. Apart from your render issue, some suggestions for your code: 1. "tools" and "util" are essentially the same thing, thus there is no need to create 2 separate packages. 2. You have 2 item packages. You only need one. Merge them. 3. Stop using ItemBase. 4. Stop using BlockBase. 5. Do not use static initializers. Cadiboo made a post previously explaining the reasons: http://www.minecraftforge.net/forum/topic/68881-onblockactivated-not-being-called/?tab=comments#comment-332831
  23. Define "Render beam". public class RenderTestingBlock extends TileEntitySpecialRenderer<TileEntityTestingBlock> { public static final ResourceLocation TEXTURE_BEACON_BEAM = new ResourceLocation("textures/entity/beacon_beam.png"); public void render(TileEntityTestingBlock te, double x, double y, double z, float partialTicks, int destroyStage, float alpha) { this.renderBeam(x, y, z, partialTicks, destroyStage, te.getBeamSegments(), alpha); } public void renderBeam(double x, double y, double z, double partialTicks, double textureScale, List<TileEntityTestingBlock.BeamSegment> beamSegments, double totalWorldTime) { this.bindTexture(TEXTURE_BEACON_BEAM); } } As far as I can tell from your code, you are not doing anything to tell minecraft to render the beam. All you are doing is binding the textures. You need to draw the beam yourself. An easy way to do it would be to draw a "rectangular" beam with 4 faces. If you do not know how to start, you might want to look at how minecraft renders lightning. What? Please elucidate. What do you mean by the "String"?
  24. From your crash log, it seems like the Cape mod is causing the crash. Remove it and try again. You are using a different version of the mod. This is probably due to the misleading file name a site like 9minecraft creates. Please download all your mods from the correct place.
  25. Don't. He thinks he can get away with copyright infringement. He deserves to be called . In addition, mods created with mcreator are known to cause a lot of problems. Please make sure you are getting all your mods from https://minecraft.curseforge.com or https://www.curseforge.com/minecraft/mc-mods. Mods from any other places can contain malware and cause other problems.
×
×
  • Create New...

Important Information

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