Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

herbix

Forge Modder
  • Joined

  • Last visited

Everything posted by herbix

  1. One tricky way to find the healing source is using java call stack, which can be obtained by a try catch statement. try { throw new Exception(); } catch(Exception e) { StackTraceElement[] elems = e.getStackTrace(); // Do something with "elems" } But it's really the last way I would use. It makes me uncomfortable.
  2. I have updated them to 1.8. But my server is still on 1.7.2. That's the only reason I coding on 1.7.2 and I would update my server then. Thanks for your suggestion after all.
  3. Yes, you are right. I know it now. Thank you.
  4. I don't mean to directly modify vanilla classes. I mean I would replace it by a coremod.
  5. More: There're particulars about implementation. 1. Not all density values of points in world are generate from noise generator. In vanilla minecraft, density values of points in a 4x8x4 zone are interpolated from those of its 8 vertices. 2. Density value resolution can be increased by using multiple noise generator. For example: density = (1 - d0) * d1 + d0 * d2, where d0, d1, d2 can only be 0, 0.33, 0.67, 1. The density can have 10 different values.
  6. Sorry about that. I know this would cause compatibility issues. But... I don't know the purpose of a coremod even I have wrote some. Is it bad to replace a method or a class?
  7. Sorry about my misunderstanding. I read about terrain generation code in vanilla minecraft, and those variable names confused me, but I still find something useful. Noise generators in minecraft are 3-dimension perlin noise generators, which makes a density value for points in 3d space (for example, from 0 to 1). One simple thought is that if it is less than 0.5, it's stone block, otherwise air block. But this will make a nether-like terrain. Each biome has highest and lowest surface levels. The chunk provider will add a value to the raw density. This value depends on y position. If y < lowest, the output density < 0.5, vise versa. A floating island is a coincidence of raw density and y position. That's what I know about terrain generation. May it help you.
  8. Pigmen would call for help when attacked. Is this collective consciousness?
  9. Actually, the easiest way of making a coremod is to replace the whole class or the whole method. This would save time since you don't need to work to find out where the byte code insert. Of course, this reduces compatibility. Edit: It's "replace" not "place"
  10. Generating islands in the ocean doesn't use noise generators. It uses biome generator, which is implemented as GenLayer class. After biomes generated, chunk provider uses the information and several noise generators to make terrains.
  11. Today, I can't build with "gradlew build". Here's the console output: D:\minecraft\forge-1.7.2-10.12.2.1121-src>gradlew build --stacktrace FAILURE: Build failed with an exception. * Where: Build file 'D:\minecraft\forge-1.7.2-10.12.2.1121-src\build.gradle' line: 18 * What went wrong: A problem occurred evaluating root project 'forge-1.7.2-10.12.2.1121-src'. > java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 * Try: Run with --info or --debug option to get more log output. * Exception is: org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'forge-1.7.2-10.12.2.1121-src'. at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptR unnerImpl.run(DefaultScriptRunnerFactory.java:54) at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl. apply(DefaultScriptPluginFactory.java:152) at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildSc riptProcessor.java:40) at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildSc riptProcessor.java:26) at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.eva luate(ConfigureActionsProjectEvaluator.java:34) at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(L ifecycleProjectEvaluator.java:55) at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProj ect.java:493) at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProj ect.java:80) at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuil dConfigurer.java:31) at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(Default GradleLauncher.java:142) at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradle Launcher.java:113) at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLaun cher.java:81) at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildCon troller.run(InProcessBuildActionExecuter.java:64) at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.jav a:33) at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.jav a:24) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce ssBuildActionExecuter.java:35) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce ssBuildActionExecuter.java:26) at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50) at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.jav a:171) at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction. execute(CommandLineActionFactory.java:201) at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction. execute(CommandLineActionFactory.java:174) at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute( CommandLineActionFactory.java:170) at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute( CommandLineActionFactory.java:139) at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionRep ortingAction.java:33) at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionRep ortingAction.java:22) at org.gradle.launcher.Main.doAction(Main.java:46) at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45) at org.gradle.launcher.Main.main(Main.java:37) at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBoots trap.java:50) at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.j ava:32) at org.gradle.launcher.GradleMain.main(GradleMain.java:23) at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.ja va:30) at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127) at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:55) Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 at com.google.gson.Gson.fromJson(Gson.java:815) at com.google.gson.Gson.fromJson(Gson.java:768) at com.google.gson.Gson.fromJson(Gson.java:717) at net.minecraftforge.gradle.common.BasePlugin.setVersionInfoJson(BasePl ugin.java:170) at net.minecraftforge.gradle.common.BasePlugin.apply(BasePlugin.java:112 ) at net.minecraftforge.gradle.common.BasePlugin.apply(BasePlugin.java:49) at org.gradle.api.internal.plugins.DefaultPluginContainer.providePlugin( DefaultPluginContainer.java:104) at org.gradle.api.internal.plugins.DefaultPluginContainer.addPluginInter nal(DefaultPluginContainer.java:68) at org.gradle.api.internal.plugins.DefaultPluginContainer.apply(DefaultP luginContainer.java:34) at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.appl yPlugin(DefaultObjectConfigurationAction.java:116) at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.acce ss$200(DefaultObjectConfigurationAction.java:36) at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.ru n(DefaultObjectConfigurationAction.java:85) at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.exec ute(DefaultObjectConfigurationAction.java:129) at org.gradle.api.internal.project.AbstractPluginAware.apply(AbstractPlu ginAware.java:41) at org.gradle.api.Project$apply.call(Unknown Source) at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.gro ovy:34) at org.gradle.api.Script$apply.callCurrent(Unknown Source) at build_3jp9jdnktsp47fkn257mc3k0gq.run(D:\minecraft\forge-1.7.2-10.12.2 .1121-src\build.gradle:18) at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptR unnerImpl.run(DefaultScriptRunnerFactory.java:52) ... 33 more Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:374) at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapT ypeAdapterFactory.java:183) at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapT ypeAdapterFactory.java:145) at com.google.gson.Gson.fromJson(Gson.java:803) ... 51 more BUILD FAILED Total time: 4.493 secs And here's my build.gradle: buildscript { repositories { mavenCentral() maven { name = "forge" url = "http://files.minecraftforge.net/maven" } maven { name = "sonatype" url = "https://oss.sonatype.org/content/repositories/snapshots/" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' } } apply plugin: 'forge' version = "For-1.7.2" group= "org.ssast.minecraft" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "ssastServerMod" minecraft { version = "1.7.2-10.12.2.1121" assetDir = "eclipse/assets" } dependencies { // you may put jars on which you depend on in ./libs // or you may define them like so.. //compile "some.group:artifact:version:classifier" //compile "some.group:artifact:version" // real examples //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env // for more info... // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/dependency_management.html } processResources { // this will ensure that this task is redone when the versions change. inputs.property "version", project.version inputs.property "mcversion", project.minecraft.version // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' // replace version and mcversion expand 'version':project.version, 'mcversion':project.minecraft.version } // copy everything else, thats not the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } } Line 18: apply plugin: 'forge' Edit: Well, it works now.
  12. Registering a block with a null ItemBlock class makes it has no corresponding item.
  13. You wouldn't. Actually, these technical blocks shall not even have an corresponding ItemBlock, which makes it impossible to get this block by /give command.
  14. I don't know whether it's a bug or intentional. I used to meet this problem, and read the codes, trying to find out why this happens. Finally I found it. In a words, an entity except EntityArrow doesn't transfer its moving information to client in its first tick. So if it moves, entity in client is always behind that in server, which causes a wrong position.
  15. Try add these code at the begin of your onUpdate() method. That means, Do not move your arrow entity at the first tick it spawns. if(this.ticksExisted == 1) { if(!worldObj.isRemote) { this.throwerLastX = thrower.posX; this.throwerLastY = thrower.posY; this.throwerLastZ = thrower.posZ; } return; }
  16. Trying to add a released mod into a developing minecraft may cause crash. That's because a released mod is reobfuscated, which cannot run in deobfuscated environment. If the mod is open-sourced, you could simply copy these source to your src folder and add them to your source directories in IDE. I have no idea about those not open-sourced.
  17. ItemBlock needs an ItemBlock(Block) constructor. Modify your ItemBlockCoalGun class and add an ItemBlockCoalGun(Block) constructor.
  18. Why not add a high level SLOW potion effect to the mob?
  19. I made one by myself. See http://github.com/herbix/renderTo.
  20. There's no much difference between non-player entities and players. They DO have timeUntilPortal field. Do the same thing as players to non-players and It would be solved. By the way, you need to understand how these codes work, not just copy them and ask "why these bugs come out" even when they is solved in other cases.
  21. Achievement is a stat actually. If one's achievement stat > 1, it's taken.
  22. I don't know how to do it in 1.8. Is there any possible way except replacing RenderPlayer? Any clue would help. Thanks.
  23. You could store ANYTHING in IExtendedBlockState, in case the property is unlisted. For example: public static final IUnlistedProperty<TileEntity> TILE_ENTITY = new IUnlistedProperty<TileEntity>() { @Override public String getName() { return "tileEntity"; } @Override public boolean isValid(TileEntity value) { return true; } @Override public Class<TileEntity> getType() { return TileEntity.class; } @Override public String valueToString(TileEntity value) { return value.toString(); } }; ... @Override public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos) { if(state instanceof IExtendedBlockState) { TileEntity te = ... // Get your tile entity here return ((IExtendedBlockState)state).withProperty(TILE_ENTITY, te); } return state; }
  24. What's the difference between new TeleporterNillax(server.worldServerForDimension(0), false) and new TeleporterNillax(server.worldServerForDimension(0)) ? And, hmm... how about removing "&& entityIn.timeUntilPortal <= 0" in this if statement? ... public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { if (entityIn.ridingEntity == null && entityIn.riddenByEntity == null && entityIn.timeUntilPortal <= 0) { ...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.