Jump to content

Is it possible for an entity to emit a red stone signal?


tlr38usd
 Share

Recommended Posts

Computer craft turtles are entities only when moving.  When still they are a block + tile entity, which can emit signals.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Alright. Well currently the way I'm doing it is adding a transparent non-solid block to the world wherever I want the entity to emit a red stone signal. However it still has the black line around it when I hover my mouse over it and it still acts like a block. Is there a way to make it behave like air so players don't have to break it before placing another block and don't have to see the black border?

 

Also what would be the onupdate for blocks? I'd like it to disappear it to air after x amount of ticks.

 

edit: I got the border to disappear with.

public MovingObjectPosition collisionRayTrace(World par1World, int par2, int par3, int par4, Vec3 par5Vec3, Vec3 par6Vec3)
    {
        float f = 0.15F;

        this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F);

        return super.collisionRayTrace(par1World, par2, par3, par4, par5Vec3, par6Vec3);
    }

However I'm not sure this is the best way to do it because now there is no way to break it...

Link to comment
Share on other sites

Alright. Well currently the way I'm doing it is adding a transparent non-solid block to the world wherever I want the entity to emit a red stone signal. However it still has the black line around it when I hover my mouse over it and it still acts like a block. Is there a way to make it behave like air so players don't have to break it before placing another block and don't have to see the black border?

 

Also what would be the onupdate for blocks? I'd like it to disappear it to air after x amount of ticks.

 

Black line:

public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
    {
	return null;
    }

 

Block (re)placement:

public boolean isBlockReplaceable(World world, int x, int y, int z)
    {
        return true;
    }

 

On update (you could have found this one yourself by searching Block.java):

public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {}

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

I already had the first and the last one, thanks for the isBlockReplaceable though! =D

 

My problem with updateTick though is that it does not update as much as I'd like it, is there a way to speed it up? I have tried tick handlers but I'm not sure how to get the block's coordinates.

Link to comment
Share on other sites

I already had the first and the last one, thanks for the isBlockReplaceable though! =D

 

My problem with updateTick though is that it does not update as much as I'd like it, is there a way to speed it up? I have tried tick handlers but I'm not sure how to get the block's coordinates.

 

Don't use random ticks

 

onBlockAdded(...) {
    world.scheduleBlockUpdate(x,y,z,how_many_ticks);
}

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Like this?

public void onBlockAdded(World par1World, int par2, int par3, int par4)
    {
	par1World.scheduleBlockUpdate(par2, par3, par4, 5, 5);
    }

 

There was an extra parameter I needed to add and I wasn't sure what it did. I set it really small so I could see it happening but it doesn't disappear.

Link to comment
Share on other sites

Like this?

public void onBlockAdded(World par1World, int par2, int par3, int par4)
    {
	par1World.scheduleBlockUpdate(par2, par3, par4, 5, 5);
    }

 

There was an extra parameter I needed to add and I wasn't sure what it did. I set it really small so I could see it happening but it doesn't disappear.

 

The extra param is the one after par4, its the block ID of the block making the update call (you can set it to this.blockID).

 

You still need an updateTick(...) function to deal with it.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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

    • Try removing the Curios mod and any mods that depend on it. Add them back in one at a time, test launching each time.
    • I am new in modding. I have a registry class for all minecraft items. How I add information an Item without opening new class?
    • Seriously, is this gonna plague future versions of Forge? Because how the hell am I supposed to load mods correctly like I did before if this keeps going on? (Here's the error.) [07Feb2023 12:06:56.387] [Render thread/WARN] [mixin/]: Error loading class: com/mojang/math/Quaternion (java.lang.ClassNotFoundException: com.mojang.math.Quaternion) [07Feb2023 12:06:56.390] [Render thread/FATAL] [mixin/]: Mixin apply failed flywheel.mixins.json:matrix.PoseStackMixin -> com.mojang.blaze3d.vertex.PoseStack: org.spongepowered.asm.mixin.transformer.throwables.InvalidMixinException Unexpecteded ClassMetadataNotFoundException whilst transforming the mixin class: [MAIN Applicator Phase -> flywheel.mixins.json:matrix.PoseStackMixin -> Apply Methods -> (Lcom/mojang/math/Quaternion;)Lcom/jozufozu/flywheel/util/transform/TransformStack;:multiply -> Transform LVT -> var=quaternion -> desc=Lcom/mojang/math/Quaternion;] org.spongepowered.asm.mixin.transformer.throwables.InvalidMixinException: Unexpecteded ClassMetadataNotFoundException whilst transforming the mixin class: [MAIN Applicator Phase -> flywheel.mixins.json:matrix.PoseStackMixin -> Apply Methods -> (Lcom/mojang/math/Quaternion;)Lcom/jozufozu/flywheel/util/transform/TransformStack;:multiply -> Transform LVT -> var=quaternion -> desc=Lcom/mojang/math/Quaternion;]     at org.spongepowered.asm.mixin.transformer.MixinTargetContext.transformMethod(MixinTargetContext.java:491) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]     at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.applyNormalMethod(MixinApplicatorStandard.java:532) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]     at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.applyMethods(MixinApplicatorStandard.java:518) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]     at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.applyMixin(MixinApplicatorStandard.java:386) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]     at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.apply(MixinApplicatorStandard.java:325) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]     at org.spongepowered.asm.mixin.transformer.TargetClassContext.apply(TargetClassContext.java:383) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]     at org.spongepowered.asm.mixin.transformer.TargetClassContext.applyMixins(TargetClassContext.java:365) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]     at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:363) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]     at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:250) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]     at org.spongepowered.asm.service.modlauncher.MixinTransformationHandler.processClass(MixinTransformationHandler.java:131) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]     at org.spongepowered.asm.launch.MixinLaunchPluginLegacy.processClass(MixinLaunchPluginLegacy.java:131) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]     at cpw.mods.modlauncher.serviceapi.ILaunchPluginService.processClassWithFlags(ILaunchPluginService.java:156) ~[modlauncher-10.0.8.jar:10.0.8+10.0.8+main.0ef7e830]     at cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:88) ~[modlauncher-10.0.8.jar:?]     at cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:120) ~[modlauncher-10.0.8.jar:?]     at cpw.mods.modlauncher.TransformingClassLoader.maybeTransformClassBytes(TransformingClassLoader.java:50) ~[modlauncher-10.0.8.jar:?]     at cpw.mods.cl.ModuleClassLoader.readerToClass(ModuleClassLoader.java:113) ~[securejarhandler-2.1.6.jar:?]     at cpw.mods.cl.ModuleClassLoader.lambda$findClass$15(ModuleClassLoader.java:219) ~[securejarhandler-2.1.6.jar:?]     at cpw.mods.cl.ModuleClassLoader.loadFromModule(ModuleClassLoader.java:229) ~[securejarhandler-2.1.6.jar:?]     at cpw.mods.cl.ModuleClassLoader.findClass(ModuleClassLoader.java:219) ~[securejarhandler-2.1.6.jar:?]     at cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:135) ~[securejarhandler-2.1.6.jar:?]     at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]     at com.mojang.blaze3d.systems.RenderSystem.<clinit>(RenderSystem.java:83) ~[1.19.3-forge-44.1.16.jar:?]     at net.minecraft.client.main.Main.m_239872_(Main.java:174) ~[1.19.3-forge-44.1.16.jar:?]     at net.minecraft.client.main.Main.main(Main.java:51) ~[1.19.3-forge-44.1.16.jar:?]     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]     at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]     at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]     at net.minecraftforge.fml.loading.targets.CommonClientLaunchHandler.lambda$launchService$0(CommonClientLaunchHandler.java:27) ~[fmlloader-1.19.3-44.1.16.jar:?]     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30) ~[modlauncher-10.0.8.jar:?]     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) ~[modlauncher-10.0.8.jar:?]     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) ~[modlauncher-10.0.8.jar:?]     at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) ~[modlauncher-10.0.8.jar:?]     at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) ~[modlauncher-10.0.8.jar:?]     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) ~[modlauncher-10.0.8.jar:?]     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) ~[modlauncher-10.0.8.jar:?]     at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) ~[bootstraplauncher-1.1.2.jar:?] Caused by: org.spongepowered.asm.mixin.throwables.ClassMetadataNotFoundException: com.mojang.math.Quaternion     at org.spongepowered.asm.mixin.transformer.MixinTargetContext.transformSingleDescriptor(MixinTargetContext.java:983) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]     at org.spongepowered.asm.mixin.transformer.MixinTargetContext.transformSingleDescriptor(MixinTargetContext.java:943) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]     at org.spongepowered.asm.mixin.transformer.MixinTargetContext.transformLVT(MixinTargetContext.java:544) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]     at org.spongepowered.asm.mixin.transformer.MixinTargetContext.transformMethod(MixinTargetContext.java:450) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] This has been going on since 44.1.8 and how on Earth is this not even fixed yet?
    • Error downloading asset (try 2) : minecraft/sounds/block/fence_gate/close2.ogg java.io.IOException: Server returned HTTP response code: 400 for URL: http://resources.download.minecraft.net/58/58d63232621aaa03e4d09598700561214e7c2477     at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1902)     at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1500)     at java.net.URL.openStream(URL.java:1093)     at net.minecraftforge.gradle.tasks.DownloadAssetsTask$GetAssetTask.call(DownloadAssetsTask.java:189)     at net.minecraftforge.gradle.tasks.DownloadAssetsTask$GetAssetTask.call(DownloadAssetsTask.java:150)     at java.util.concurrent.FutureTask.run(FutureTask.java:266)     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)     at java.lang.Thread.run(Thread.java:750) This and countless other assets failing to download. This is my school laptop, Programs such as Fortiguard are installed, Could this possibly be interfering? 
    • you do realize we have no idea what you wrote and where? also, even if you did it right, maybe a code from one of the goals is changing y-rotation after your code. read through all the goals that are active. delete all goals unless they meet two requirements: 1) you want the goal to execute, and 2) you 100% understand everything it does.
  • Topics

×
×
  • Create New...

Important Information

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