This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
thomas15v's profile picture

Changing something in computercraft 1.5?

Started by thomas15v, 02 April 2014 - 09:21 AM
thomas15v #1
Posted 02 April 2014 - 11:21 AM
Hello i am thomas15v and have some problem with the older version of computercraft (what is used in tekkit lite).

I am running a griefing server and have the problem that turtles grief bases. Well i really love turtles so i don't want to disable them. Well i am not asking for a patch or whatever. I mostly patch the mods on my own. But this mod is euh. Really hard to decompile –> recompile. I can't find most lua libs that are used causing me to stuck at 462 decompile errors where the missing LuaLibery class occurs the most.

The only thing i would like to change is this in dan200.turtle.shared.TurtleTool methode canBreakBlock.

protected boolean canBreakBlock(World world, int x, int y, int z) {
		int bid = world.getBlockId(x, y, z);
		Block block = Block.blocksList[bid];
		if (bid != 0 && (bid != Block.bedrock.blockID /*start new code*/ || bid != 231 || bid != 230 /*end new code*/ && block.getBlockHardness(world, x, y, z) > -1.0f) return true;
		return false;
	}

(Look for the comment anotation)

If somebody could help me out i would appreciate that :)/>

(If this is a reason to ban me just ignore this post than :(/> )
Cranium #2
Posted 02 April 2014 - 02:06 PM
Well, it is against the mod license to modify and redistribute modified code for ComputerCraft. If you're looking to make turtles safer, you're better off disabling them altogether. You can do this by simply removing ccTurtle from the mod zip itself.
CometWolf #3
Posted 02 April 2014 - 02:56 PM
I don't have much experience modding mc, but if you could make a protection mod that basically alters the blocks hardness to something harder than whatever "-1.0f" is, it would essentially prevent the turtle from breaking it, no? Just seems like a more doable solution :P/>
theoriginalbit #4
Posted 02 April 2014 - 02:58 PM
I don't have much experience modding mc, but if you could make a protection mod that basically alters the blocks hardness to something harder than whatever "-1.0f" is, it would essentially prevent the turtle from breaking it, no? Just seems like a more doable solution :P/>
Setting to something of hardness -1.0f means it is unbreakable, this is for the players as well.
thomas15v #5
Posted 02 April 2014 - 06:12 PM
Well, it is against the mod license to modify and redistribute modified code for ComputerCraft. If you're looking to make turtles safer, you're better off disabling them altogether. You can do this by simply removing ccTurtle from the mod zip itself.
I wasn't planning to redistribute or release computercraft again. Its for fixing an annoying bug on my server that good protected bases keep getting raided. Its for personally use.
I just need to know a way to compile/change it back.