Skip to content

Instantly share code, notes, and snippets.

@JamiesWhiteShirt
Last active November 11, 2016 22:17
Show Gist options
  • Save JamiesWhiteShirt/9336cc873022f6bc5a87d9e3888a9144 to your computer and use it in GitHub Desktop.
Save JamiesWhiteShirt/9336cc873022f6bc5a87d9e3888a9144 to your computer and use it in GitHub Desktop.
Midas trait
package slimeknights.tconstruct.tools.modifiers;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import slimeknights.tconstruct.library.modifiers.ModifierTrait;
public class ModMidas extends ModifierTrait {
public ModMidas() {
super("midas", 0xffffff);
}
@Override
public EnumActionResult onToolUse(ItemStack tool, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
world.setBlockState(pos, Blocks.GOLD_BLOCK.getDefaultState());
return EnumActionResult.SUCCESS;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment