Jump to content

Terrails

Members
  • Posts

    186
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Terrails

  1. Changing dimensions is done with PlayerList#transferPlayerToDimension, which you get from WorldServer and it requires a Teleporter as a parameter. Make a class which extends Teleporter and then do something like this WorldServer world = (WorldServer) player.getEntityWorld(); PlayerList playerList = world.getMinecraftServer().getPlayerList(); playerList.transferPlayerToDimension(player, <dimensionID>, new CustomTeleporter(params....));
  2. I'm trying to change my config directory (annotation config)... since the old way allows you to change the location of the file but this one doesn't. Should I request this on github or should I just switch to the old way? EDIT: Figured it out.... had to use the "name" parameter and just make it look like this @Config(modid = "example", name = "example" + "/" + "configFileName")
  3. This is a new thread, I opened the old one in bug reports so I wanted to move it here since its modder support question now. I just tried to fix the crash and it still happens after I moved it to the client proxy. The only way to fix it is to remove the @SideOnly from class annotations. I even tried removing everything connected to the ICustomModel interface and only leaving it in the package but it still crashed with the same error. ModelRegistryEvent EVENT_BUS#register ICustomModel (I currently removed the annotation from the class annotations cause it causes the crash)
  4. I'm not really sure if this had to go into Modder Support cause I've never seen this crash and I'm pretty sure its caused by forge and not my mod. I got this crash report on my issue tracker and from what I'm seeing its forge's fault: Caused by: net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerException: Exception in class transformer net.minecraftforge.fml.common.asm.transformers.SideTransformer@58d63b16 from coremod FMLCorePlugin at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:262) at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279) at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176) ... 19 more Caused by: java.lang.RuntimeException: Attempted to load class terrails/terracore/registry/client/ICustomModel for invalid side SERVER at net.minecraftforge.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:62) at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:258) ... 21 more By the looks of it its trying to load ICustomModel interface in my library mod on server side (the interface is annotated with Side.CLIENT), I'm using that interface only in ModelRegistryEvent to register models for blocks/items
  5. Caused by: net.minecraftforge.fml.common.LoaderException: java.lang.ClassNotFoundException: com.br4yd3n.dimensionalstartinglocation.proxy.ClientProxy and the package name is..... dimensionalstarteringlocation .. Didn't notice to it was solved... sorry!
  6. I'm trying to add all my 'args' into runClient in build.gradle but for some reason they don't want to load until I use '/gradlew runClient", I'm using IntelliJ. Is there a way to do this? Since I sometimes find it annoying to every time I make a new project I need to add the arguments I want... its the same for 'jvmArgs' too. runClient { args = ['--username', 'name'] } I've also tried connecting them into one string... removing the equals sign.... but none helped, IntelliJ just wasn't detecting it.
  7. I'm trying to add compatibility with my mod and JAOPCA. The problem is to JAOPCA requires you to register your ore dictionary before FMLInitializationEvent, I did it in my RegistryEvent but the problem is to I switched to GameRegistry.ObjectHolder in my items/blocks class (Which prints that exception how the item/block doesn't exist) instead of assigning the variables in 'initItems' method, I even tried getting the item directly from the registry but that didn't help since it still wasn't in the registry. What would be the best way to do this now?
  8. bump EDIT: Figured it out, I didn't think to I needed to register my entity in the RegistryEvent, but looks like I needed to.
  9. I'm working on a icicle block which drops icicles one by one, since I'm using blockstates to store the number of icicles in the block I needed to create a custom EntityFallingBlock since the default one deletes the Block which is falling and spawns a entity. I don't want it to delete the block but only decrease the icicle number, I'm doing this already and then spawning the entity. The problem is for some reason the Entity doesn't render even though I have RenderingRegistry#registerEntityRenderingHandler (I know it runs since I debugged it) in my ClientProxy#preInit. I know it gets spawned since the icicle block gets dropped in item form after the entity touches the ground (but I can't see the entity since its not rendering). Code (most of the entity code is just copied since I just wanted to test it if it works)
  10. I'm not sure too. It looks like it doesn't care if the data is received on client when lamda is used and it tries to launch the code on server when registering even though its a client side packet.
  11. Had this issue too. I fixed it by adding a method to my proxy called getPlayer() with which I return null in server proxy and Minecraft.getMinecraft.player in client proxy. After that do something like this: FMLCommonHandler.instance().getWorldThread(ctx.netHandler).addScheduledTask(() -> { EntityPlayer player = MainClass.proxy.getPlayer(); if (player != null) { World world = player.getEntityWorld(); } });
  12. I'm trying to animate an TESR. Well I already did it but I did it wrong (by increasing the counter in the rendering itself instead of update() in the tile class), I'm trying to move it to update() but the problem starts here... the rendering isn't smooth. I read to I need to use partialTicks for this kind of stuff but I don't understand how? I'm translating, scaling and rotating in my TESR. Any help would be greatly appreciated.
  13. Its the player capability (stores the death counter in seconds and a tick counter with which I decrease the counter) EDIT: Also just tested it with a logger at the start which displays the side, phase and type [09:11:41] [Server thread/INFO] []: Side: SERVER, Phase: START, Type: PLAYER [09:11:41] [Server thread/INFO] []: Side: SERVER, Phase: START, Type: PLAYER [09:11:41] [Server thread/INFO] []: Side: SERVER, Phase: END, Type: PLAYER [09:11:41] [Server thread/INFO] []: Side: SERVER, Phase: END, Type: PLAYER [09:11:41] [main/INFO] []: Side: CLIENT, Phase: START, Type: PLAYER [09:11:41] [main/INFO] []: Side: CLIENT, Phase: START, Type: PLAYER [09:11:41] [main/INFO] []: Side: CLIENT, Phase: END, Type: PLAYER [09:11:41] [main/INFO] []: Side: CLIENT, Phase: END, Type: PLAYER Looks like its launching twice on each phase, and also I moved the displayTitle inside the packet which I send to client so I don't need to sync the capability data. updated code EDIT-2: I realized what I messed up. I registered the event bus twice for the same class so the event was launching twice
  14. I'm trying to make a player die after a countdown if the players position is over the specified Y level in the nether. Everything works but there's one problem, the timer is going too fast (2 seconds per second instead of 1). Syncing with client for the title works, together with everything other except that timer. I store the timer in a capability together with a tick counter which I use to decrease the timer. the code I also noticed this weird thing when printing to the console, its launching twice and sometimes even four times on one side. The only thing I think is wrong to I'm not checking something else too but I don't know what that would be.
  15. Ah, never mind. I forgot to remove the itemblock registration.
  16. I'm trying to add an feature which disables vanilla end portal and uses my instead, I got everything working by overriding onEntityCollidedWithBlock() of the end portal class and then I just registered the block (it registered since it printed out the "Potentially Dangerous alternative prefix" message), but the issue starts here, for some reason it started to throw the model loading exception, and yes I made sure to my ModelRegistryEvent doesn't set the model resource location for the end portal
  17. I maybe found something, instead of using that syncConfig() method in onConfigChanged event try using ConfigManager.sync(<modid>, Config.Type.INSTANCE);
  18. Did you try replacing the default values with true/false since thats the only thing that I find weird in syncConfig(), since the default is a variable (lets say its false) what if the config value changes to true? The default changes together with it cause its using the same variable to set value to and get default from. I never tried this annotation system but thats the only thing I find weird in that code.
  19. I made a fluid tank which changes its material into water if it has more than 2 buckets of water in it, I noticed this behaviour after placing lava next to it. The block turns flowing lava into cobblestone, sources into obsidian and when lava flows over it, the tank turns into smooth stone. I'm not sure how I could disable that behaviour since its in the BlockLiquid class, I need the water material so it hydrates the farmland around it, and farmland also has hardcoded Material.WATER in its hasWater method. I'm starting to think the only way to do this would be ASM and I don't know a lot about it so don't want to mess with it.
  20. I now tried something simple like this, but it still doesn't work @Override public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) { ItemStack stack = new ItemStack(this); IFluidHandler fluidHandler = getFluidHandler(world, pos); // Gets the tile at pos and FLUID_HANDLER_CAPABILITY from it IFluidHandlerItem fluidHandlerItem = FluidUtil.getFluidHandler(stack); if (fluidHandler != null && fluidHandlerItem != null) { fluidHandlerItem.fill(fluidHandler.drain(Integer.MAX_VALUE, false), true); return fluidHandlerItem.getContainer(); // Tried without this but it makes no difference } return stack; } I just fill the item fluid handler with drained fluid stack from the tile, the doDrain in drain method is false because I don't want it to drain the tile entity. also this is how I display the fluid amount in the ItemBlock class @Override public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> tooltip, ITooltipFlag flagIn) { IFluidHandler fluidHandler = FluidUtil.getFluidHandler(stack); if (fluidHandler == null) return; for (IFluidTankProperties properties : fluidHandler.getTankProperties()) { FluidStack fluidStack = properties.getContents(); if (fluidStack == null) return; tooltip.add(fluidStack.amount + "/" + properties.getCapacity()); } } I know it didn't fill it because fluidStack is null EDIT: Looks like I fixed it, in initCapabilities of my itemblock I used my own handler, now tried FluidHandlerItemStack and it works
  21. I'm creating a variable so I can return an empty item if IFluidHandler is null, but when IFluidHandler isn't null I try to fill a new instance and if its filled I set the variable to that new instance. Yes it needs to access the TileEntity, it checks if block at pos has tileentity and if it has it, then checks if it has fluid handler capability and returns the IFluidHandler if it has the capability, if not it returns null. FluidUtil is a class in minecraftforge itself. But like I said on server it only launches with WorldClient and if I check if world isn't remote it doesn't even run
  22. I have an fluid tank which has fluid handler item capability and fluid handler capability. I tried using getPickBlock so players in creative can get the filled tank in their inventory but for some reason its working only on an integrated server, when I try it on a dedicated server for some reason its only called client side, I tried using !world.isRemote but then the code doesn't run at all. This is the code I'm using: @Override public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) { ItemStack stack = new ItemStack(this); IFluidHandler fluidHandler = FluidUtil.getFluidHandler(world, pos, null); if (fluidHandler != null) { FluidActionResult fluidActionResult = FluidUtil.tryFillContainer(new ItemStack(this), fluidHandler, Integer.MAX_VALUE, null, false); if (fluidActionResult.isSuccess()) { stack = fluidActionResult.getResult(); } } return stack; }
×
×
  • Create New...

Important Information

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