Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.16.1] Tree Generation


Willzigos
 Share

Recommended Posts

public static final ConfiguredFeature<?,?> MAPLE =
            new MapleTreeFeature( BaseTreeFeatureConfig.field_236676_a_)
                    .withConfiguration(
                    new BaseTreeFeatureConfig.Builder(
                            new SimpleBlockStateProvider(MapleLog.INSTANCE.getDefaultState()),
                            new SimpleBlockStateProvider(MapleLeaves.INSTANCE.getDefaultState()),
                            new BlobFoliagePlacer(2,0,0,0,3),
                            new StraightTrunkPlacer(4,2,0),
                            new TwoLayerFeature(1,0,1))
                            .func_236700_a_().func_236703_a_(ImmutableList.of(new BeehiveTreeDecorator(0.002F))).build()
            ).withPlacement(Placement.COUNT_EXTRA_HEIGHTMAP.configure(new AtSurfaceWithExtraConfig(2,0.1F,1)));

This is my tree config code. I'm getting the following error:

net.minecraft.world.gen.feature.DecoratedFeatureConfig cannot be cast to net.minecraft.world.gen.feature.BaseTreeFeatureConfig

Link to comment
Share on other sites

[15Sep2021 18:45:47.320] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--gameDir, ., --launchTarget, fmluserdevclient, --fml.mcpVersion, 20200625.160719, --fml.mcVersion, 1.16.1, --fml.forgeGroup, net.minecraftforge, --fml.forgeVersion, 32.0.108, --version, MOD_DEV, --assetIndex, 1.16, --assetsDir, C:\Users\wsode\.gradle\caches\forge_gradle\assets, --username, Dev, --accessToken, ????????, --userProperties, {}]
[15Sep2021 18:45:47.335] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 6.1.3+75+master.851120a starting: java version 1.8.0_302 by Temurin
[15Sep2021 18:45:47.617] [main/INFO] [net.minecraftforge.fml.loading.FixSSL/CORE]: Added Lets Encrypt root certificates as additional trust
[15Sep2021 18:45:47.648] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8 Source=file:/C:/Users/wsode/.gradle/caches/modules-2/files-2.1/org.spongepowered/mixin/0.8/dbe9e5db694a7c3cd644d5bb98f8a21295c75048/mixin-0.8.jar Service=ModLauncher Env=CLIENT
[15Sep2021 18:45:48.756] [main/INFO] [cpw.mods.modlauncher.LaunchServiceHandler/MODLAUNCHER]: Launching target 'fmluserdevclient' with arguments [--version, MOD_DEV, --gameDir, ., --assetsDir, C:\Users\wsode\.gradle\caches\forge_gradle\assets, --assetIndex, 1.16, --username, Dev, --accessToken, ????????, --userProperties, {}]
[15Sep2021 18:45:59.119] [Render thread/INFO] [com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService/]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', name='PROD'
[15Sep2021 18:45:59.139] [Render thread/INFO] [net.minecraft.client.Minecraft/]: Setting user: Dev
[15Sep2021 18:45:59.432] [Render thread/INFO] [net.minecraft.client.Minecraft/]: Backend library: LWJGL version 3.2.2 build 10
[15Sep2021 18:46:00.478] [modloading-worker-1/INFO] [net.minecraftforge.common.ForgeMod/FORGEMOD]: Forge mod loading, version 32.0.108, for MC 1.16.1 with MCP 20200625.160719
[15Sep2021 18:46:00.478] [modloading-worker-1/INFO] [net.minecraftforge.common.MinecraftForge/FORGE]: MinecraftForge v32.0.108 Initialized
[15Sep2021 18:46:00.870] [Render thread/INFO] [geodemod/]: Registering Blocks
[15Sep2021 18:46:00.980] [Render thread/INFO] [geodemod/]: Registering Items
[15Sep2021 18:46:01.003] [Render thread/ERROR] [net.minecraft.util.Util/]: No data fixer registered for red_mushroom_chicken
[15Sep2021 18:46:01.012] [Render thread/ERROR] [net.minecraft.util.Util/]: No data fixer registered for red_creeper
[15Sep2021 18:46:01.015] [Render thread/INFO] [geodemod/]: Registering Biomes
[15Sep2021 18:46:01.074] [Render thread/INFO] [geodemod/]: Registering Entities
[15Sep2021 18:46:03.793] [Render thread/INFO] [com.mojang.text2speech.NarratorWindows/]: Narrator library for x64 successfully loaded
[15Sep2021 18:46:03.870] [Render thread/INFO] [net.minecraft.resources.SimpleReloadableResourceManager/]: Reloading ResourceManager: Default, Mod Resources
[15Sep2021 18:46:03.892] [modloading-worker-4/INFO] [geodemod/]: Mod Setup Step
[15Sep2021 18:46:03.926] [modloading-worker-4/INFO] [geodemod/]: Client Setup Step
[15Sep2021 18:46:03.937] [Forge Version Check/INFO] [net.minecraftforge.fml.VersionChecker/]: [forge] Starting version check at https://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
[15Sep2021 18:46:04.809] [Forge Version Check/INFO] [net.minecraftforge.fml.VersionChecker/]: [forge] Found status: BETA Current: 32.0.108 Target: 32.0.108
[15Sep2021 18:46:08.028] [Render thread/INFO] [net.minecraft.client.audio.SoundSystem/]: OpenAL initialized.
[15Sep2021 18:46:08.029] [Render thread/INFO] [net.minecraft.client.audio.SoundEngine/SOUNDS]: Sound engine started
[15Sep2021 18:46:08.198] [Render thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 1024x512x4 minecraft:textures/atlas/blocks.png-atlas
[15Sep2021 18:46:08.222] [Render thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 256x128x4 minecraft:textures/atlas/signs.png-atlas
[15Sep2021 18:46:08.222] [Render thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 512x512x4 minecraft:textures/atlas/banner_patterns.png-atlas
[15Sep2021 18:46:08.222] [Render thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 512x512x4 minecraft:textures/atlas/shield_patterns.png-atlas
[15Sep2021 18:46:08.223] [Render thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 256x256x4 minecraft:textures/atlas/chest.png-atlas
[15Sep2021 18:46:08.223] [Render thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 512x256x4 minecraft:textures/atlas/beds.png-atlas
[15Sep2021 18:46:08.223] [Render thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 512x256x4 minecraft:textures/atlas/shulker_boxes.png-atlas
[15Sep2021 18:46:08.647] [Render thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 256x256x0 minecraft:textures/atlas/particles.png-atlas
[15Sep2021 18:46:08.648] [Render thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 256x256x0 minecraft:textures/atlas/paintings.png-atlas
[15Sep2021 18:46:08.648] [Render thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 128x128x0 minecraft:textures/atlas/mob_effects.png-atlas
[15Sep2021 18:46:09.055] [Realms Notification Availability checker #1/INFO] [com.mojang.realmsclient.client.RealmsClient/]: Could not authorize you against Realms server: Invalid session id
[15Sep2021 18:46:19.715] [Render thread/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, destination] and [teleport, targets] with inputs: [Player, 0123, @e, dd12be42-52a9-4a91-a8a1-11c01849e498]
[15Sep2021 18:46:19.716] [Render thread/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, location] and [teleport, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[15Sep2021 18:46:19.716] [Render thread/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, location] and [teleport, targets] with inputs: [0.1 -0.5 .9, 0 0 0]
[15Sep2021 18:46:19.717] [Render thread/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, targets] and [teleport, destination] with inputs: [Player, 0123, dd12be42-52a9-4a91-a8a1-11c01849e498]
[15Sep2021 18:46:19.717] [Render thread/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, targets, location] and [teleport, targets, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[15Sep2021 18:46:19.721] [Render thread/INFO] [net.minecraft.resources.SimpleReloadableResourceManager/]: Reloading ResourceManager: Default, forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar, main
[15Sep2021 18:46:21.581] [Render thread/INFO] [net.minecraft.item.crafting.RecipeManager/]: Loaded 7 recipes
[15Sep2021 18:46:22.982] [Render thread/INFO] [net.minecraft.advancements.AdvancementList/]: Loaded 927 advancements
[15Sep2021 18:46:23.135] [Render thread/INFO] [net.minecraftforge.registries.GameData/REGISTRIES]: Injecting existing registry data into this CLIENT instance
[15Sep2021 18:46:23.446] [Render thread/INFO] [com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService/]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', name='PROD'
[15Sep2021 18:46:23.522] [Server thread/INFO] [net.minecraft.server.integrated.IntegratedServer/]: Starting integrated minecraft server version 1.16.1
[15Sep2021 18:46:23.523] [Server thread/INFO] [net.minecraft.server.integrated.IntegratedServer/]: Generating keypair
[15Sep2021 18:46:24.126] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Preparing start region for dimension minecraft:overworld
[15Sep2021 18:46:24.426] [Render thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 0%
[15Sep2021 18:46:24.594] [Render thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Time elapsed: 468 ms
[15Sep2021 18:46:24.735] [Server thread/INFO] [net.minecraft.server.integrated.IntegratedServer/]: Changing view distance to 11, from 10
[15Sep2021 18:46:25.841] [Netty Local Client IO #0/INFO] [net.minecraftforge.fml.network.NetworkHooks/]: Connected to a modded server.
[15Sep2021 18:46:25.886] [Server thread/INFO] [net.minecraftforge.common.AdvancementLoadFix/]: Using new advancement loading for net.minecraft.advancements.PlayerAdvancements@5ffb5413
[15Sep2021 18:46:25.899] [Server thread/INFO] [net.minecraft.server.management.PlayerList/]: Dev[local:E:7dcf0608] logged in with entity id 83 at (-11.662333709986715, 4.0, 24.741047174960396)
[15Sep2021 18:46:25.915] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Dev joined the game
[15Sep2021 18:46:26.750] [Server thread/INFO] [net.minecraft.server.integrated.IntegratedServer/]: Saving and pausing game...
[15Sep2021 18:46:26.760] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[Sapling Experiments]'/minecraft:overworld
[15Sep2021 18:46:26.858] [Render thread/INFO] [net.minecraft.advancements.AdvancementList/]: Loaded 3 advancements
[15Sep2021 18:46:26.860] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[Sapling Experiments]'/minecraft:the_nether
[15Sep2021 18:46:26.862] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[Sapling Experiments]'/minecraft:the_end
[15Sep2021 18:46:36.594] [Server thread/FATAL] [net.minecraft.util.concurrent.ThreadTaskExecutor/]: Error executing task on Server
java.lang.ClassCastException: net.minecraft.world.gen.feature.DecoratedFeatureConfig cannot be cast to net.minecraft.world.gen.feature.BaseTreeFeatureConfig
	at net.minecraft.block.trees.Tree.func_230339_a_(Tree.java:28) ~[?:?]
	at net.minecraft.block.SaplingBlock.func_226942_a_(SaplingBlock.java:46) ~[?:?]
	at net.minecraft.block.SaplingBlock.grow(SaplingBlock.java:63) ~[?:?]
	at net.minecraft.item.BoneMealItem.applyBonemeal(BoneMealItem.java:70) ~[?:?]
	at net.minecraft.item.BoneMealItem.onItemUse(BoneMealItem.java:33) ~[?:?]
	at net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(ForgeHooks.java:601) ~[?:?]
	at net.minecraft.item.ItemStack.onItemUse(ItemStack.java:190) ~[?:?]
	at net.minecraft.server.management.PlayerInteractionManager.func_219441_a(PlayerInteractionManager.java:359) ~[?:?]
	at net.minecraft.network.play.ServerPlayNetHandler.processTryUseItemOnBlock(ServerPlayNetHandler.java:923) ~[?:?]
	at net.minecraft.network.play.client.CPlayerTryUseItemOnBlockPacket.processPacket(CPlayerTryUseItemOnBlockPacket.java:45) ~[?:?]
	at net.minecraft.network.play.client.CPlayerTryUseItemOnBlockPacket.processPacket(CPlayerTryUseItemOnBlockPacket.java:12) ~[?:?]
	at net.minecraft.network.PacketThreadUtil.lambda$checkThreadAndEnqueue$0(PacketThreadUtil.java:19) ~[?:?]
	at net.minecraft.util.concurrent.TickDelayedTask.run(TickDelayedTask.java:20) ~[?:?]
	at net.minecraft.util.concurrent.ThreadTaskExecutor.run(ThreadTaskExecutor.java:139) ~[?:?]
	at net.minecraft.util.concurrent.RecursiveEventLoop.run(RecursiveEventLoop.java:22) ~[?:?]
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:760) ~[?:?]
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:157) ~[?:?]
	at net.minecraft.util.concurrent.ThreadTaskExecutor.driveOne(ThreadTaskExecutor.java:109) ~[?:?]
	at net.minecraft.server.MinecraftServer.driveOneInternal(MinecraftServer.java:743) ~[?:?]
	at net.minecraft.server.MinecraftServer.driveOne(MinecraftServer.java:737) ~[?:?]
	at net.minecraft.util.concurrent.ThreadTaskExecutor.driveUntil(ThreadTaskExecutor.java:122) ~[?:?]
	at net.minecraft.server.MinecraftServer.runScheduledTasks(MinecraftServer.java:723) ~[?:?]
	at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:669) ~[?:?]
	at net.minecraft.server.MinecraftServer.lambda$func_240784_a_$0(MinecraftServer.java:231) ~[?:?]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_302]
[15Sep2021 18:46:38.387] [Server thread/INFO] [net.minecraft.server.integrated.IntegratedServer/]: Saving and pausing game...
[15Sep2021 18:46:38.393] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[Sapling Experiments]'/minecraft:overworld
[15Sep2021 18:46:38.445] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[Sapling Experiments]'/minecraft:the_nether
[15Sep2021 18:46:38.446] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[Sapling Experiments]'/minecraft:the_end
[15Sep2021 18:58:08.844] [Server thread/INFO] [net.minecraft.network.play.ServerPlayNetHandler/]: Dev lost connection: Disconnected
[15Sep2021 18:58:08.845] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Dev left the game
[15Sep2021 18:58:08.850] [Server thread/INFO] [net.minecraft.network.play.ServerPlayNetHandler/]: Stopping singleplayer server as player logged out
[15Sep2021 18:58:08.887] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Stopping server
[15Sep2021 18:58:08.887] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving players
[15Sep2021 18:58:08.887] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving worlds
[15Sep2021 18:58:08.887] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[Sapling Experiments]'/minecraft:overworld
[15Sep2021 18:58:09.024] [Server thread/INFO] [net.minecraft.world.server.ChunkManager/]: ThreadedAnvilChunkStorage (Sapling Experiments): All chunks are saved
[15Sep2021 18:58:09.024] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[Sapling Experiments]'/minecraft:the_nether
[15Sep2021 18:58:09.025] [Server thread/INFO] [net.minecraft.world.server.ChunkManager/]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved
[15Sep2021 18:58:09.025] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[Sapling Experiments]'/minecraft:the_end
[15Sep2021 18:58:09.025] [Server thread/INFO] [net.minecraft.world.server.ChunkManager/]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved
[15Sep2021 18:58:09.039] [Server thread/INFO] [net.minecraft.world.server.ChunkManager/]: ThreadedAnvilChunkStorage (Sapling Experiments): All chunks are saved
[15Sep2021 18:58:09.050] [Server thread/INFO] [net.minecraft.world.server.ChunkManager/]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved
[15Sep2021 18:58:09.051] [Server thread/INFO] [net.minecraft.world.server.ChunkManager/]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved
[15Sep2021 18:58:09.743] [Render thread/INFO] [net.minecraft.client.Minecraft/]: Stopping!

Here is the full log

Link to comment
Share on other sites

I have:

public class MapleTreeFeature extends TreeFeature {
    public MapleTreeFeature(Codec<BaseTreeFeatureConfig> p_i231999_1_) {
        super(p_i231999_1_);
    }
}

and:

public class MapleTree extends Tree {

    @Nullable
    @Override
    protected ConfiguredFeature<BaseTreeFeatureConfig, ?> getTreeFeature(Random randomIn, boolean p_225546_2_) {
        return  TreeGenerator.MAPLE;
    }
}

It's possible that the problem could be something related to the version since I based this code off of something from 16.5

Edited by Willzigos
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • These are my particle effect classes, they are all copied from a tutorial.   public class Juan1ParticalType extends ParticleType { public Juan1ParticalType() { super(false, Juan1ParticalData.DESERIALIZER); } @Override public Codec<Juan1ParticalData> func_230522_e_() { return Codec.unit(new Juan1ParticalData(new Vector3d(0, 0, 0), new Color(0xF63900), 0)); } }   public class Juan1ParticalData implements IParticleData { private final Vector3d speed; private final Color color; private final float diameter; public static final IDeserializer<Juan1ParticalData> DESERIALIZER = new IDeserializer<Juan1ParticalData>() { @Override public Juan1ParticalData deserialize(ParticleType<Juan1ParticalData> particleTypeIn, StringReader reader) throws CommandSyntaxException { final int MIN_COLOUR = 0; final int MAX_COLOUR = 255;reader.expect(' '); double speedX = reader.readDouble(); reader.expect(' '); double speedY = reader.readDouble(); reader.expect(' '); double speedZ = reader.readDouble(); reader.expect(' '); int red = MathHelper.clamp(reader.readInt(), MIN_COLOUR, MAX_COLOUR); reader.expect(' '); int green = MathHelper.clamp(reader.readInt(), MIN_COLOUR, MAX_COLOUR); reader.expect(' '); int blue = MathHelper.clamp(reader.readInt(), MIN_COLOUR, MAX_COLOUR);reader.expect(' ');  int alpha = MathHelper.clamp(reader.readInt(), 1, MAX_COLOUR);reader.expect(' '); float diameter = reader.readFloat();  return new Juan1ParticalData(new Vector3d(speedX, speedY, speedZ), new Color(red, green, blue, alpha), diameter); } @Override public Juan1ParticalData read(ParticleType<Juan1ParticalData> particleTypeIn, PacketBuffer buffer) { final int MIN_COLOUR = 0; final int MAX_COLOUR = 255; double speedX = buffer.readDouble(); double speedY = buffer.readDouble(); double speedZ = buffer.readDouble(); int red = MathHelper.clamp(buffer.readInt(), MIN_COLOUR, MAX_COLOUR); int green = MathHelper.clamp(buffer.readInt(), MIN_COLOUR, MAX_COLOUR); int blue = MathHelper.clamp(buffer.readInt(), MIN_COLOUR, MAX_COLOUR); int alpha = MathHelper.clamp(buffer.readInt(), 1, MAX_COLOUR); float diameter = buffer.readFloat(); return new Juan1ParticalData(new Vector3d(speedX, speedY, speedZ), new Color(red, green, blue, alpha), diameter); } }; public Juan1ParticalData(Vector3d speed, Color color, float diameter) { this.speed = speed; this.color = color; this.diameter = diameter; } @Override public ParticleType<?> getType() { return Utils.ParticleRegistry.JUAN_1_PARTICLE.get(); } @Override public void write(PacketBuffer buffer) { buffer.writeDouble(this.speed.x); buffer.writeDouble(this.speed.y); buffer.writeDouble(this.speed.z); buffer.writeInt(this.color.getRed()); buffer.writeInt(this.color.getGreen()); buffer.writeInt(this.color.getBlue()); buffer.writeInt(this.color.getAlpha()); buffer.writeFloat(this.diameter); } @Override public String getParameters() { return String.format(Locale.ROOT, "%s %.2f %i %i %i %i %.2d %.2d %.2d", this.getType().getRegistryName(), diameter, color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha(), speed.getX(), speed.getY(), speed.getZ()); } public Vector3d getSpeed() { return speed; } public Color getColor() { return color; } public float getDiameter() { return diameter; } }   public class Juan1Particle extends SpriteTexturedParticle { public Juan1Particle(ClientWorld world, double x, double y, double z, Vector3d speed, Color color, float diameter) { super(world, x, y, z, speed.x, speed.y, speed.z); maxAge = 100; setColor(color.getRed() / 255F,color.getGreen() / 255F,color.getBlue() / 255); this.setAlphaF(color.getAlpha()); final float PARTICLE_SCALE_FOR_ONE_METER = 0.1F; particleScale = PARTICLE_SCALE_FOR_ONE_METER * diameter; this.canCollide = true; } @Override public IParticleRenderType getRenderType(){ return IParticleRenderType.PARTICLE_SHEET_TRANSLUCENT; } }   public class Juan1ParticleFactory implements IParticleFactory<Juan1ParticalData> { private final IAnimatedSprite sprites; public Juan1ParticleFactory(IAnimatedSprite sprite) { this.sprites = sprite; } @Override public Particle makeParticle(Juan1ParticalData typeIn, ClientWorld worldIn, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) { Juan1Particle particle = new Juan1Particle(worldIn, x, y, z, typeIn.getSpeed(), typeIn.getColor(), typeIn.getDiameter()); particle.selectSpriteWithAge(sprites); return particle; } }
    • This is where I want to call the addParticle() method, it is in the livingTick() in an entity. But it shows no particle effect. @Override public void livingTick() { double x = rand.nextGaussian() * 0.02D; double y = rand.nextGaussian() * 0.02D; double z = rand.nextGaussian() * 0.02D; double px = this.getPosX() + 4.0D * rand.nextDouble() - 2.0D; double py = this.getPosY() + rand.nextDouble() - 0.5D; double pz = this.getPosZ() + 4.0D * rand.nextDouble() - 2.0D; world.addParticle(new Juan1ParticalData(new Vector3d(x, y, z), new Color(0xae6be2), 0), px, py, pz, x, y, z);  } When I change "new Juan1ParticalData(new Vector3d(x, y, z), new Color(0xae6be2), 0)" to "ParticleTypes.DRAGON_BREATH" , the particle effects appeared.
    • can you get any useful info from your crash reports?
    • I made a particle effect of my own, and I can only display the particle effect in the game through the command : /particle mymod:juan1particle 0 0 0 0 0 255 100 3.   When I want add the particle through World.addParticle(IParticleData particleData, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed), it does not show at all.   But when I change the particleData Parameter from my particledata's instance to those in the ParticleTypes in the vanilla, It works without problem. So it seems that only my particle effect can't be added into the game, but those in the vanilla can be added.
    • Ok, so, that's really helpful. I guess i need to learn how to make a custom sound instance for my sound.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.