Everything posted by herbix
-
[1.8] Disable natural healing
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.
-
[Solved] Cannot build
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.
-
[1.7.10][SOLVED] Insert method call beteween multiple } (}}(here)}})
Yes, you are right. I know it now. Thank you.
-
[1.7.10][SOLVED] Insert method call beteween multiple } (}}(here)}})
I don't mean to directly modify vanilla classes. I mean I would replace it by a coremod.
-
[Forge 1.8] Help Understanding Minecraft's Noise Generation
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.
-
[1.7.10][SOLVED] Insert method call beteween multiple } (}}(here)}})
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?
-
[Forge 1.8] Help Understanding Minecraft's Noise Generation
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.
-
A mob that acts as a collective consciousness?
Pigmen would call for help when attacked. Is this collective consciousness?
-
[1.7.10][SOLVED] Insert method call beteween multiple } (}}(here)}})
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"
-
[Forge 1.8] Help Understanding Minecraft's Noise Generation
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.
-
[Solved] Cannot build
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.
-
[1.8][SOLVED] Issues with Custom Fire Texturing
Registering a block with a null ItemBlock class makes it has no corresponding item.
-
[1.8] Registering block models with metadata
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.
-
Arrow Rendering
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.
-
Arrow Rendering
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; }
-
Testing with external mods
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.
-
[1.8]ItemBlock crash
ItemBlock needs an ItemBlock(Block) constructor. Modify your ItemBlockCoalGun class and add an ItemBlockCoalGun(Block) constructor.
-
[1.8]Annormal status , How to stun a mob ??
Why not add a high level SLOW potion effect to the mob?
-
Here is a tool to render entity or block model in parallel projection.
I made one by myself. See http://github.com/herbix/renderTo.
-
[1.8][SOLVED] Has Anyone fixed their portals for their custom dimensions?
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.
-
[1.7.10] How to tell if a player has an achievement
Achievement is a stat actually. If one's achievement stat > 1, it's taken.
-
[1.8] How to render items in the left hand in third person view?
I don't know how to do it in 1.8. Is there any possible way except replacing RenderPlayer? Any clue would help. Thanks.
-
[1.8] [SOLVED] Get TileEntity from IBlockState in ISmartBlockModel
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; }
-
[1.8][SOLVED] Has Anyone fixed their portals for their custom dimensions?
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) { ...
-
[1.8][SOLVED] Has Anyone fixed their portals for their custom dimensions?
Put your codes.
IPS spam blocked by CleanTalk.